Huge amount of work to (mostly) allow .ogg (and maybe other) formats to skip transcode

- Update get_display_media in several ways:
   - now uses the media type's own declaration of the order of things
   - returns both the media_size and the media_path, as per the docstring
   - implicitly uses self.media_files as opposed to forcing you to pass it in
 - update videos to use get_display_media
 - update images to declare media_fetch_order in the media manager (videos also)
 - update stl to use media.media_files['original'] instead of weird
   use of get_display_media
 - update sidebar to only conditionally show webm_640

TODO still: identify video type information *during* processing, show
that in the <video><source /></video> element.

This commit sponsored by Nathan Yergler.  Thanks, nyergler!
This commit is contained in:
Christopher Allan Webber
2013-03-02 19:06:31 -06:00
parent fd693e368b
commit ddbf6af1e2
7 changed files with 32 additions and 17 deletions

View File

@@ -25,4 +25,8 @@ MEDIA_MANAGER = {
"sniff_handler": sniff_handler,
"display_template": "mediagoblin/media_displays/image.html",
"default_thumb": "images/media_thumbs/image.png",
"accepted_extensions": ["jpg", "jpeg", "png", "gif", "tiff"]}
"accepted_extensions": ["jpg", "jpeg", "png", "gif", "tiff"],
# Used by the media_entry.get_display_media method
"media_fetch_order": [u'medium', u'original', u'thumb'],
}

View File

@@ -26,4 +26,8 @@ MEDIA_MANAGER = {
"display_template": "mediagoblin/media_displays/video.html",
"default_thumb": "images/media_thumbs/video.jpg",
"accepted_extensions": [
"mp4", "mov", "webm", "avi", "3gp", "3gpp", "mkv", "ogv", "m4v"]}
"mp4", "mov", "webm", "avi", "3gp", "3gpp", "mkv", "ogv", "m4v"],
# Used by the media_entry.get_display_media method
"media_fetch_order": [u'webm_640', u'original'],
}