Add change-video-resolution.js to start video-resolution-switcher plugin
authorvijeth-aradhya <vijthaaa@gmail.com>
Sun, 23 Jul 2017 04:40:06 +0000 (10:10 +0530)
committervijeth-aradhya <vijthaaa@gmail.com>
Sun, 23 Jul 2017 04:40:06 +0000 (10:10 +0530)
mediagoblin/static/js/change-video-resolution.js [new file with mode: 0644]

diff --git a/mediagoblin/static/js/change-video-resolution.js b/mediagoblin/static/js/change-video-resolution.js
new file mode 100644 (file)
index 0000000..0cae2b4
--- /dev/null
@@ -0,0 +1,27 @@
+var glplayer;
+
+$(document).ready(function()
+{
+  // fire up the plugin
+  glplayer = videojs('video_1', {
+    controls: true,
+    muted: true,
+    height: 400,
+    width: 700,
+    plugins: {
+      videoJsResolutionSwitcher: {
+        ui: true,
+        default: 'low', // Default resolution [{Number}, 'low', 'high'],
+        dynamicLabel: true // Display dynamic labels or gear symbol
+      }
+    }
+  }, function(){
+    var player = this;
+    window.player = player
+    player.on('resolutionchange', function(){
+      console.info('Source changed to %s', player.src());
+      console.log(player.currentTime());
+    })
+  })
+
+});
\ No newline at end of file