From b57a682cd471d6830e63fffaa28ca00310019c7f Mon Sep 17 00:00:00 2001 From: vijeth-aradhya Date: Sun, 23 Jul 2017 10:10:06 +0530 Subject: [PATCH] Add change-video-resolution.js to start video-resolution-switcher plugin --- .../static/js/change-video-resolution.js | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 mediagoblin/static/js/change-video-resolution.js diff --git a/mediagoblin/static/js/change-video-resolution.js b/mediagoblin/static/js/change-video-resolution.js new file mode 100644 index 00000000..0cae2b46 --- /dev/null +++ b/mediagoblin/static/js/change-video-resolution.js @@ -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 -- 2.25.1