File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11soundManager . flashVersion = 9 ;
22soundManager . debugMode = false ; // disable debug mode
33soundManager . defaultOptions . multiShot = false ;
4- soundManager . url = 'http://a1.soundcloud.com/swf/soundmanager2_flash9.swf ' ; // change to '.' to use local non-crossdomain soundmanager
4+ soundManager . url = '. ' ; // change to '.' to use local non-crossdomain soundmanager
55
66$ ( function ( ) {
77 $ ( "a.soundcloud-player#basic" ) . scPlayer ( ) ;
Original file line number Diff line number Diff line change 8787 progressBar . click ( function ( ev ) {
8888 var percent = ( ev . clientX - progressBar . offset ( ) . left ) / ( progressBar . width ( ) ) ;
8989 if ( sound . durationEstimate * percent < sound . duration ) {
90- sound . setPosition ( sound . durationEstimate * percent ) ;
9190 play ( ) ;
91+ sound . setPosition ( sound . durationEstimate * percent ) ;
9292 }
9393 } ) ;
9494
9595 var timer = setInterval ( function ( ) { // this is kind of ugly but don't know a better way of waiting for SoundManager 2 when multiple players are on the page
96- if ( window . soundManager . swfLoaded ) {
96+ if ( soundManager . swfLoaded ) {
9797 sound = soundManager . createSound ( {
9898 id : track . id ,
9999 url : track . stream_url ,
111111 } ,
112112 onload : function ( ) {
113113 loading . css ( 'width' , "100%" ) ;
114+ } ,
115+ onstop : function ( ) {
116+ stop ( ) ;
114117 }
115118 } ) ;
116-
119+
117120 if ( autoplay ) {
118121 play ( ) ;
119122 }
138141
139142 var play = function ( ) {
140143 if ( sound ) {
144+ soundManager . stopAll ( ) ;
141145 sound . paused ? sound . resume ( ) : sound . play ( ) ;
142146 $ ( ".delimiter" , dom ) . show ( ) ;
143147 dom . addClass ( "playing" ) ;
You can’t perform that action at this time.
0 commit comments