aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/media_types
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2013-03-02 19:06:31 -0600
committerChristopher Allan Webber <cwebber@dustycloud.org>2013-03-02 19:06:31 -0600
commitddbf6af1e20222882a7ce559804ed48f4ad31a92 (patch)
treee53664048ed3f46d8c034eee64fff298b1f7ae13 /mediagoblin/media_types
parentfd693e368bf7d344c29ff99b77acbb92f4524b73 (diff)
downloadmediagoblin-ddbf6af1e20222882a7ce559804ed48f4ad31a92.tar.lz
mediagoblin-ddbf6af1e20222882a7ce559804ed48f4ad31a92.tar.xz
mediagoblin-ddbf6af1e20222882a7ce559804ed48f4ad31a92.zip
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!
Diffstat (limited to 'mediagoblin/media_types')
-rw-r--r--mediagoblin/media_types/image/__init__.py6
-rw-r--r--mediagoblin/media_types/video/__init__.py6
2 files changed, 10 insertions, 2 deletions
diff --git a/mediagoblin/media_types/image/__init__.py b/mediagoblin/media_types/image/__init__.py
index 36d7c201..3e167db1 100644
--- a/mediagoblin/media_types/image/__init__.py
+++ b/mediagoblin/media_types/image/__init__.py
@@ -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'],
+}
diff --git a/mediagoblin/media_types/video/__init__.py b/mediagoblin/media_types/video/__init__.py
index 3faa5b9f..fd364c02 100644
--- a/mediagoblin/media_types/video/__init__.py
+++ b/mediagoblin/media_types/video/__init__.py
@@ -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'],
+}