###前提・実現したいこと
howler.jsを使っているのですが、Sound.pause(id名)としても、効いていないようです。
###発生している問題・エラーメッセージ
動画と音声を分けていて、動画が4.8秒経ったら、Sound.pause()を実行するようにコードを書いたのですが、できていないようです。
###該当のソースコード
Javascript
1var Video = function(url) { 2 var thisObj = this; 3 this.url = url; 4 this.video = $('<video>').hide(); 5 this.video.attr('src',url); 6 }; 7 8 Video.prototype.loadVideo = function(){ 9 this.video.get(0).load(); 10 }; 11 Video.prototype.draw =function(){ 12 this.video.get(0).currentTime = Sound.pos(); 13 ctx.drawImage(this.video.get(0), 0, 0, 640, 360); 14 }; 15 16var playVideo3 = function(){ 17 video3.loadVideo(); 18 selectedVideo = video3; 19 Sound.play("left"); 20 console.log(video3.video.get(0).currentTime); 21 if(video3.video.get(0).currentTime >= 4.8){ 22 Sound.pause('left'); 23 }; 24 };
###補足情報(言語/FW/ツール等のバージョンなど)
Javascript, Atom
回答1件
あなたの回答
tips
プレビュー