我有以下這是Vimeo視頻的自定義播放按鈕,它工作正常。點擊播放視頻淡出...Vimeo Native Play按鈕切換課程?
問題是,如果您在本機默認Vimeo控件上單擊播放,我的自定義播放圖標在播放時仍會保留在視頻上方。
無論如何通過點擊Vimeo play上的本地播放按鈕來切換課程?
因此,如果您單擊播放按鈕我的自定義一個被刪除?
if ($("#showreel")[0]) {
var iframe = document.getElementById('showreel');
if (typeof iframe !== 'undefined') {
// $f == Froogaloop
var player = $f(iframe);
// bind events
var playButton = document.getElementById("play-button");
playButton.addEventListener("click", function() {
$(playButton).toggleClass('video_playing');
player.api("play");
});
}
}
我猜你將不得不訂閱播放/暫停事件,以檢測那種狀態變化的 - 然後檢查它是否是由您自己的按鈕觸發,或以其他方式(那麼這將意味着默認控制,大概)。 – CBroe
我甚至不知道從哪裏開始你的建議,只是設法得到一個按鈕來播放視頻! – user4630