aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2013-03-03 14:27:36 -0600
committerChristopher Allan Webber <cwebber@dustycloud.org>2013-03-03 14:27:36 -0600
commit9d4cebfd36b7bba3d8d4ad2cb97a85ec63068cb5 (patch)
tree3ab0a8a3b331e78089859e98d42ada6e8ac33129
parent787aafd64482de3a4d150c75ffec024e8e11f287 (diff)
downloadmediagoblin-9d4cebfd36b7bba3d8d4ad2cb97a85ec63068cb5.tar.lz
mediagoblin-9d4cebfd36b7bba3d8d4ad2cb97a85ec63068cb5.tar.xz
mediagoblin-9d4cebfd36b7bba3d8d4ad2cb97a85ec63068cb5.zip
Per Elrond's suggestions moving DEFAULT_WEBM_TYPE to media manager
The reason for this is to avoid defining this twice as we were previously (once in the template, once in video/models.py) This commit sponsored by Roland McIntosh. Thank you!
-rw-r--r--mediagoblin/media_types/video/__init__.py1
-rw-r--r--mediagoblin/media_types/video/models.py5
-rw-r--r--mediagoblin/templates/mediagoblin/media_displays/video.html2
3 files changed, 4 insertions, 4 deletions
diff --git a/mediagoblin/media_types/video/__init__.py b/mediagoblin/media_types/video/__init__.py
index fd364c02..fab601f6 100644
--- a/mediagoblin/media_types/video/__init__.py
+++ b/mediagoblin/media_types/video/__init__.py
@@ -30,4 +30,5 @@ MEDIA_MANAGER = {
# Used by the media_entry.get_display_media method
"media_fetch_order": [u'webm_640', u'original'],
+ "default_webm_type": 'video/webm; codecs="vp8, vorbis"',
}
diff --git a/mediagoblin/media_types/video/models.py b/mediagoblin/media_types/video/models.py
index 4639b8c8..970ceb75 100644
--- a/mediagoblin/media_types/video/models.py
+++ b/mediagoblin/media_types/video/models.py
@@ -21,13 +21,12 @@ from sqlalchemy import (
Column, Integer, SmallInteger, ForeignKey)
from sqlalchemy.orm import relationship, backref
from mediagoblin.db.extratypes import JSONEncoded
+from mediagoblin.media_types import video
BACKREF_NAME = "video__media_data"
-DEFAULT_WEBM_TYPE = 'video/webm; codecs="vp8, vorbis"'
-
class VideoData(Base):
"""
Attributes:
@@ -84,7 +83,7 @@ class VideoData(Base):
orig_metadata["tags"]["video-codec"].lower(),
orig_metadata["tags"]["audio-codec"].lower())
else:
- return DEFAULT_WEBM_TYPE
+ return video.MEDIA_MANAGER["default_webm_type"]
DATA_MODEL = VideoData
diff --git a/mediagoblin/templates/mediagoblin/media_displays/video.html b/mediagoblin/templates/mediagoblin/media_displays/video.html
index dc0c7b55..b0854c9f 100644
--- a/mediagoblin/templates/mediagoblin/media_displays/video.html
+++ b/mediagoblin/templates/mediagoblin/media_displays/video.html
@@ -38,7 +38,7 @@
{% if media.media_data %}
type="{{ media.media_data.source_type() }}"
{% else %}
- type="video/webm; codecs=&quot;vp8, vorbis&quot;"
+ type="{{ media.media_manager['default_webm_type'] }}"
{% endif %} />
<div class="no_html5">
{%- trans -%}Sorry, this video will not work because