Explorar el Código

Logiciel: Evolution #787: Lecture auto: soundcloud

Bastien Sevajol hace 11 años
padre
commit
672222c918

+ 4 - 5
src/Muzich/CoreBundle/Resources/public/js/player/SoundCloudPlayer.js Ver fichero

@@ -30,8 +30,7 @@ function SoundCloudPlayer(ref_id, object_for_player, finish_callback, autoplay)
30 30
     }
31 31
     else
32 32
     {
33
-      // On gère la lecture auto difframment: rappel: si on supprime une iframe l'api SC ne la trouve plus et bug
34
-      $('#autoplay').append('<iframe id="'+_iframe_id+'" src="http://w.soundcloud.com/player/?url='
33
+      $('#autoplay_player_soundcloud').append('<iframe id="'+_iframe_id+'" src="http://w.soundcloud.com/player/?url='
35 34
         +_ref_id+'&show_artwork=false&auto_play=true" width="100%" '
36 35
         +'height="350" scrolling="no" frameborder="no"></iframe>');
37 36
     }
@@ -93,13 +92,13 @@ function SoundCloudPlayer(ref_id, object_for_player, finish_callback, autoplay)
93 92
   
94 93
   this.destroy = function(force)
95 94
   {
96
-    if (_player)
95
+    if (_player && !_autoplay)
97 96
     {
98
-      _player.pause();
97
+      _object_for_player.html('');
99 98
     }
100 99
     if (_autoplay || force)
101 100
     {
102
-      $('#'+_iframe_id).hide();
101
+      $('#autoplay_player_soundcloud').html('');
103 102
     }
104 103
   }
105 104