isherwood
isherwood

Reputation: 61114

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.

Upvotes: 0

Views: 1789

Answers (2)

Rohit Sharma
Rohit Sharma

Reputation: 379

You need to put this in a script tag:

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

Upvotes: 2

Nikhil Baliga
Nikhil Baliga

Reputation: 1341

Why don't you simply put a div overlay on top of the player with z-index, say 10000. That way, even if some double-clicks, they are clicking on the DIV and nothing happens. Continue with the CSS button hiding.

Upvotes: -1

Related Questions