diff options
author | Ludovic Barman <ludovic.barman@gmail.com> | 2014-05-11 13:47:28 +0200 |
---|---|---|
committer | Ludovic Barman <ludovic.barman@gmail.com> | 2014-05-11 13:47:28 +0200 |
commit | 68579f3a451b910ffa47ed9cc7414a5e0338105f (patch) | |
tree | 629481040c33d31e4031eeea048bc050b2013a9b /videosearch_n_play.html | |
parent | d2a60ddea8d779e0f025f8fe965fa388c5a840b2 (diff) | |
download | playGraph-68579f3a451b910ffa47ed9cc7414a5e0338105f.tar.gz playGraph-68579f3a451b910ffa47ed9cc7414a5e0338105f.tar.bz2 playGraph-68579f3a451b910ffa47ed9cc7414a5e0338105f.zip |
Working version YoutubePlayer
Diffstat (limited to 'videosearch_n_play.html')
-rw-r--r-- | videosearch_n_play.html | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/videosearch_n_play.html b/videosearch_n_play.html index 8a8f854..fb58843 100644 --- a/videosearch_n_play.html +++ b/videosearch_n_play.html @@ -31,9 +31,18 @@ } - function newMusic(id) + var songFinished; + function newMusic(id, duration) { $('#ytplayer').attr('src', 'https://www.youtube.com/embed/'+id+'?autoplay=1&modestbranding=1'); + songFinished = setTimer(nextSong, duration * 1000); + console.log("Setting timer for "+duration+" seconds"); + } + + function nextSong() + { + clearTimer(songFinished); + console.log("Bingo !"); } function getAllMatchingIds(data) @@ -60,6 +69,8 @@ html.push('</ul>'); document.getElementById('videoResultsDiv').innerHTML = html.join(''); } + + </script> |