Search code examples
javascriptjqueryhtml5-videokaltura

How can I disable fullscreen mode in Kaltura's HTML5 media player?


I'm loading Kaltura's video player in a learning management system (essentially a CMS for educators and their students), and it gets presented inside an iframe. With current browser security protocols as they are, full screen viewing is not possible. I need to disable the fullscreen capability for this use case. Here's an idea how we have the embed set up:

loadMovie: function(id) {
    var autoPlay = this._autoPlay;
    var allowFullScreen = this._allowFullScreen;

    kWidget.embed({
      'wid': '_' + this._partnerId,
      'targetId': this._playerTarget,
      'uiconf_id': this._playerId,
      'entry_id': id,
      'params': {
        'wmode': 'transparent',
        'allowFullScreen': allowFullScreen, // not working for html player
      },
      'captureClickEventForiOS': true,
      'readyCallback': function (playerId) { // autoPlay movies
        var kdp = document.getElementById(playerId);

        kdp.kBind('mediaReady', function() {
          kdp.sendNotification('doPlay');
        });
      }
    });
}

I've been able to hide the fullscreen button with CSS, but a user can still (intentionally or inadvertently) double-click the playback area to achieve fullscreen. Because of the iframe issue, the video essentially disappears, leaving the user confused and unable to easily close the player modal.

I'm passing a data attribute from the movie links to the player init function to indicate when fullscreen should be unavailable. I just need to find out how to actually do the disabling. Kaltura's documentation has not been helpful.

I've also fiddled with legacy Flash params, but they have no effect on the HTML 5 player. I'm using version 2.11. Thank you.


Solution

  • You need to put this in a script tag:

    mw.setConfig('EmbedPlayer.EnableFullscreen', false);