简体   繁体   English

如何在Clappr中修改VIDEO标签上的属性

[英]How can I modify the attributes on the VIDEO tag in Clappr

I am trying to implement IOS 10's new playsinline attribute in Clappr (clappr.io), via a custom plugin. 我正在尝试通过自定义插件在Clappr(clappr.io)中实现IOS 10的新playsinline属性。 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) (使用此代码,似乎在填充视频元素之前会触发)

您可以传递一个名为playInline的配置来解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM