video media_type now have their own config_spec.ini
authorRodney Ewing <ewing.rj@gmail.com>
Wed, 28 Aug 2013 15:10:47 +0000 (08:10 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Thu, 29 Aug 2013 15:22:16 +0000 (08:22 -0700)
mediagoblin/config_spec.ini
mediagoblin/media_types/video/config_spec.ini [new file with mode: 0644]
mediagoblin/media_types/video/processing.py
mediagoblin/media_types/video/util.py
mediagoblin/templates/mediagoblin/media_displays/video.html

index 790c31a5b6955c22365a9d00769a1269f53b3433..eb00b07c81e5e2c0c4d1f436e16d7eb44f8b4f5b 100644 (file)
@@ -104,27 +104,6 @@ max_height = integer(default=640)
 max_width = integer(default=180)
 max_height = integer(default=180)
 
-[media_type:mediagoblin.media_types.video]
-# Should we keep the original file?
-keep_original = boolean(default=False)
-
-# 0 means autodetect, autodetect means number_of_CPUs - 1
-vp8_threads = integer(default=0)
-# Range: 0..10
-vp8_quality = integer(default=8)
-# Range: -0.1..1
-vorbis_quality = float(default=0.3)
-
-# Autoplay the video when page is loaded?
-auto_play = boolean(default=False)
-
-[[skip_transcode]]
-mime_types = string_list(default=list("video/webm"))
-container_formats = string_list(default=list("Matroska"))
-video_codecs = string_list(default=list("VP8 video"))
-audio_codecs = string_list(default=list("Vorbis"))
-dimensions_match = boolean(default=True)
-
 [media_type:mediagoblin.media_types.audio]
 keep_original = boolean(default=True)
 # vorbisenc quality
diff --git a/mediagoblin/media_types/video/config_spec.ini b/mediagoblin/media_types/video/config_spec.ini
new file mode 100644 (file)
index 0000000..98714f5
--- /dev/null
@@ -0,0 +1,22 @@
+[plugin_spec]
+# Should we keep the original file?
+keep_original = boolean(default=False)
+
+# 0 means autodetect, autodetect means number_of_CPUs - 1
+vp8_threads = integer(default=0)
+# Range: 0..10
+vp8_quality = integer(default=8)
+# Range: -0.1..1
+vorbis_quality = float(default=0.3)
+
+# Autoplay the video when page is loaded?
+auto_play = boolean(default=False)
+
+[[skip_transcode]]
+mime_types = string_list(default=list("video/webm"))
+container_formats = string_list(default=list("Matroska"))
+video_codecs = string_list(default=list("VP8 video"))
+audio_codecs = string_list(default=list("Vorbis"))
+dimensions_match = boolean(default=True)
+
+
index 506c7501a3057a60dfd1c92f54ff26b3fb14cdda..4d1d5ea264b1baf6d35ea428db705f6cf66852b4 100644 (file)
@@ -126,7 +126,7 @@ class CommonVideoProcessor(MediaProcessor):
 
     def common_setup(self):
         self.video_config = mgg \
-            .global_config['media_type:mediagoblin.media_types.video']
+            .global_config['plugins'][MEDIA_TYPE]
 
         # Pull down and set up the processing file
         self.process_filename = get_process_filename(
index c33cce5addcce7c24806dedc1876b710debf47c2..beb1012924cc5e8f6f363e882134a8df5715b9f1 100644 (file)
@@ -27,7 +27,7 @@ def skip_transcode(metadata, size):
 
     Returns True if the video matches the requirements in the configuration.
     '''
-    config = mgg.global_config['media_type:mediagoblin.media_types.video']\
+    config = mgg.global_config['plugins']['mediagoblin.media_types.video']\
             ['skip_transcode']
 
     medium_config = mgg.global_config['media:medium']
index 5c52f9f0e5c211d14c717790f930924d6db74c8f..e35169bf2aa9de3bea79cdf1aa3b00332bce946f 100644 (file)
@@ -30,7 +30,7 @@
   {% set display_type, display_path = media.get_display_media() %}
 
   <video controls
-         {% if global_config['media_type:mediagoblin.media_types.video']['auto_play'] %}autoplay{% endif %}
+         {% if global_config['plugins']['mediagoblin.media_types.video']['auto_play'] %}autoplay{% endif %}
          preload="auto" class="video-js vjs-mg-skin"
          data-setup='{"height": {{ media.media_data.height }},
                       "width": {{ media.media_data.width }} }'>