![](/img/trans.png)
[英]How to compile c++ to javascript using emscripten while including third party libraries?
[英]Javascript - how do i check if the movie is finished? while using jQuery and other third party libraries?
我現在有一些第三方庫和使用Javascript的jQuery,我需要檢測是否正在播放任何視頻並以事件偵聽器結尾。
我嘗試了以下操作,但不起作用:
$(document).ready(function() {
if(InitialiseDocReadyScripts()) {
console.log('Initialised Document Ready Scripts Successfully');
} else {
console.log('Failed to Initialise Document Ready Scripts');
}
var play_video = document.getElementById('mediaplayer');
play_video.onended = function(e) {
console.log('>>> Playing finished: ', e);
};
});
檢查當前播放時間是否==
視頻的長度==
。
play_video.onended = function(e) {
if(this.currentTime == this.duration) {
console.log('video end');
}
};
currentTime
和duration
是html5視頻的屬性: http : //www.w3schools.com/tags/ref_av_dom.asp
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.