General developer forum

VideoJS version? Need enterFullWindow() function

 
Picture of Tristan Roscoe
VideoJS version? Need enterFullWindow() function
 
Attempting to use the enterFullWindow() function instead of requestFullScreen as it can be carried between activities.

It's in the documention here:
http://docs.videojs.com/docs/api/player.html

I'm guessing Moodle does not have the latest version of VideoJS compiled but am surprised as there were some video updates added in 3.5.

If anyone is curious I'm autoplaying .mp4, listening for the end and automatically moving to the next video. Traditional full screen exits when the page reloads between activities but full window would work and allow the user to continue watching the videos in "full screen (window)".

Here's what I currently have at the end of my theme's columns2.mustache

{{#js}}
require(['theme_boost/loader']);
require(['theme_boost/drawer'], function(mod) {
    mod.init();
});
var videos = document.getElementsByTagName("video");
if (document.body.contains(videos[0])) {
    var player = videos[0];
    player.onended = function() {
        var l = document.getElementById('next-activity-link');
        l.click();
    };
    window.onload = function() {
      var promise = player.play();

      if (promise !== undefined) {
        promise.then(function() {
          // Autoplay started!
        }).catch(function(error) {
          // Autoplay was prevented.
          player.muted = true;
          player.play();
        });
      }
    }
}
{{/js}}
 
Average of ratings: -