X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=mediagoblin%2Fmedia_types%2Fvideo%2F__init__.py;h=ea7bc0217675d1314a08f5f41d9bbfb41fdfb189;hb=ae7ebecdbba7c7ae66e547920502c77a65c4dc0f;hp=0b460d2929638db5c295fb543d1d311022a770e3;hpb=654d7cf94f41e6b6c01fe021a977d3898e6829a9;p=mediagoblin.git diff --git a/mediagoblin/media_types/video/__init__.py b/mediagoblin/media_types/video/__init__.py index 0b460d29..ea7bc021 100644 --- a/mediagoblin/media_types/video/__init__.py +++ b/mediagoblin/media_types/video/__init__.py @@ -14,6 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +from mediagoblin import mg_globals as mgg from mediagoblin.media_types import MediaManagerBase from mediagoblin.media_types.video.processing import (VideoProcessingManager, sniff_handler, sniffer) @@ -28,12 +29,20 @@ class VideoMediaManager(MediaManagerBase): human_readable = "Video" display_template = "mediagoblin/media_displays/video.html" default_thumb = "images/media_thumbs/video.jpg" - type_icon = "images/type_icons/video.jpg" + type_icon = "images/type_icons/video.png" # Used by the media_entry.get_display_media method - media_fetch_order = [u'webm_video', u'original'] default_webm_type = 'video/webm; codecs="vp8, vorbis"' + @property + def media_fetch_order(self): + video_config = mgg.global_config['plugins'][MEDIA_TYPE] + video_res = video_config['available_resolutions'] + video_res.remove(video_config['default_resolution']) + video_res.insert(0, video_config['default_resolution']) + video_res = map((lambda x: unicode('webm_' + str(x), 'utf-8')), video_res) + return ([u'webm_video'] + video_res + [u'original']) + def get_media_type_and_manager(ext): if ext in ACCEPTED_EXTENSIONS: