aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/static/js/change-video-resolution.js
blob: 9fb6989e3475ba08635d1d898fb2971e2cca9d3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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());
    })
  })

  videojs.options.flash.swf = "https://ajax.cdnjs.com/ajax/libs/videojs-swf/5.4.0/video-js.swf"

});

/*

function myFunctionA() {
    glplayer.currentResolution('720p');
    console.log("clicked on A");
}

function myFunctionB() {
    glplayer.currentResolution('480p');
    console.log("clicked on A");
}

*/