3

I am trying to implement IOS 10's new playsinline attribute in Clappr (clappr.io), via a custom plugin. Currently I have the following code:

var IOS_Fullscreen_Plugin = Clappr.UIContainerPlugin.extend({
  name: 'IOS_Fullscreen_Plugin',
  bindEvents: function() {
    this.on(Clappr.Events.PLAYBACK_READY, this.add_attributes);
  },
  add_attributes: function() {
    var $container = this.container.$el;
    var $video = $container.find('video');
    $video.attr('webkit-playsinline','').attr('playsinline','');
    return this;
  }
});

The trick is that I need the code to fire before playback is triggered, but after the video element is populated, but every hook I've used seems to come up on one side or the other of that line. Any ideas? (with this code, it appears to fire before the video element is populated)

Greg Schoppe
  • 576
  • 1
  • 7
  • 22

1 Answers1

-1

You can pass a config named playInline to solve this.

Leandro Moreira
  • 377
  • 3
  • 16
  • 1
    How to use it adding `playinline:true` doesnt really work and the link you sent doesnt make it much easier to understand – nikoss Nov 26 '19 at 09:45