From d2a60ddea8d779e0f025f8fe965fa388c5a840b2 Mon Sep 17 00:00:00 2001 From: Nicolas Bornand Date: Sun, 11 May 2014 13:42:35 +0200 Subject: color changes --- app/css/lbarman.css | 7 ++++++- app/js/directives.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/css/lbarman.css b/app/css/lbarman.css index a688146..2a2a171 100644 --- a/app/css/lbarman.css +++ b/app/css/lbarman.css @@ -51,7 +51,8 @@ body .selected > .circle { - background-color: red; + background-color: rgba(7,140,255,.6); + border-color: black; } .point > .songLabel p{ position: relative; @@ -61,6 +62,10 @@ body display: none; font-size: 22px; } +.selected > .songLabel p{ + color:rgb(7,140,255); +} + .point:hover > .songLabel p{ display: block; } diff --git a/app/js/directives.js b/app/js/directives.js index a367920..2895592 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -70,7 +70,7 @@ app.directive('pgLine', function () { for (var i = 0; i < newPoints.length - 1; ++i) { if (newPoints[i].selected) { var line = paper.Path.Line(newPoints[i], newPoints[i+1]); - line.strokeColor = 'red'; + line.strokeColor = 'rgba(7,140,255,.6)'; line.strokeWidth = 2; } } -- cgit v1.2.3 From 68579f3a451b910ffa47ed9cc7414a5e0338105f Mon Sep 17 00:00:00 2001 From: Ludovic Barman Date: Sun, 11 May 2014 13:47:28 +0200 Subject: Working version YoutubePlayer --- app/index.html | 6 ++++++ app/js/yt_musicsearch.js | 18 ++++++++++++++---- videosearch_n_play.html | 13 ++++++++++++- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/app/index.html b/app/index.html index 8bb6176..905840a 100644 --- a/app/index.html +++ b/app/index.html @@ -45,6 +45,12 @@
  • {{song.label}}
  • + + + +
    diff --git a/app/js/yt_musicsearch.js b/app/js/yt_musicsearch.js index fcc52db..82ad741 100644 --- a/app/js/yt_musicsearch.js +++ b/app/js/yt_musicsearch.js @@ -18,12 +18,22 @@ function searchClicked() document.documentElement.firstChild.appendChild(script); } - - function newMusic(id) + + var musicTimer; + + function startSongWithDuration(id, duration) { $('#ytplayer').attr('src', 'https://www.youtube.com/embed/'+id+'?autoplay=1&modestbranding=1'); + console.log("Starting music "+id+", timer="+duration); + musicTimer = setInterval(changeSong, duration * 1000); } - + + function changeSong() + { + alert("Done"); + clearInterval(musicTimer); + } + function getAllMatchingIds(data) { var feed = data.feed; @@ -44,7 +54,7 @@ function searchClicked() for (var i = 0; i < results.length; i++) { //html.push('
  • ', '', results[i].title, '(', results[i].duration, ')', '
  • '); - html.push('
  • ', '', results[i].title, '', '
  • '); + html.push('
  • ', '', results[i].title, '', '
  • '); } html.push(''); document.getElementById('videoResultsDiv').innerHTML = html.join(''); 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(''); document.getElementById('videoResultsDiv').innerHTML = html.join(''); } + + -- cgit v1.2.3