]> git.parisson.com Git - mezzo.git/commitdiff
Cleaned js player
authorPhilippe Barbosa <contact@philippebarbosa.com>
Fri, 8 Apr 2016 12:47:35 +0000 (14:47 +0200)
committerPhilippe Barbosa <contact@philippebarbosa.com>
Fri, 8 Apr 2016 12:47:35 +0000 (14:47 +0200)
app/festival/static/js/index.js
app/festival/static/js/player.js [deleted file]

index f84546e9823a5eff2e1ec683076e880999a895e8..406cd946caf68188d89bac62ade22a97291dfe95 100644 (file)
@@ -138,9 +138,11 @@ $(function() {
 
      myTabs.init();
 
+     alert('go !');
+
      /**
-      * Audio player
-      */
+  * Audio player
+  */
 
     function init_player(){
         var audio;
@@ -183,4 +185,5 @@ $(function() {
 
     init_player();
 
+
 });
\ No newline at end of file
diff --git a/app/festival/static/js/player.js b/app/festival/static/js/player.js
deleted file mode 100644 (file)
index ea10e00..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
- /**
-  * Audio player
-  */
-
-function init_player(){
-    var audio;
-    var playlist;
-    var tracks;
-    var current;
-
-    current = 0;
-    audio = $('#audio');
-    playlist = $('#playlist');
-    tracks = playlist.find('li a');
-    len = tracks.length - 1;
-    audio[0].volume = .90;
-//    audio[0].play();
-    playlist.find('a').click(function(e){
-        e.preventDefault();
-        link = $(this);
-        current = link.parent().index();
-        run_player(link, audio[0]);
-    });
-    audio[0].addEventListener('ended',function(e){
-        current++;
-        if(current == len){
-            current = 0;
-            link = playlist.find('a')[0];
-        }else{
-            link = playlist.find('a')[current];
-        }
-        run_player($(link),audio[0]);
-    });
-}
-function run_player(link, player){
-    $(player).find('#primarysrc').attr('src', link.attr('href'));
-    $(player).find('#secondarysrc').attr('src', link.attr('data-altsrc'));
-    par = link.parent();
-    par.addClass('active').siblings().removeClass('active');
-    player.load();
-    player.play();
-}
-
-init_player();