![](/img/trans.png)
[英]How to put a custom overlay on Clappr video player when I’m fullscreen?
[英]How can I modify the attributes on the VIDEO tag in Clappr
我正在嘗試通過自定義插件在Clappr(clappr.io)中實現IOS 10的新playsinline屬性。 目前,我有以下代碼:
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;
}
});
訣竅在於,我需要在觸發播放之前,但在視頻元素填充之后觸發代碼,但是我使用的每個鈎子似乎都出現在該行的一側或另一側。 有任何想法嗎? (使用此代碼,似乎在填充視頻元素之前會觸發)
您可以傳遞一個名為playInline
的配置來解決此問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.