Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'mikedotalmond-master' into V2.97a.20130512+DEV

Conflicts:
	script/soundmanager2-jsmin.js
	script/soundmanager2-nodebug-jsmin.js
	script/soundmanager2.js
  • Loading branch information...
commit 5fc6faab562f24074a36d2150ab981d748e72a3e 2 parents 9e53683 + be5be28
@scottschiller authored
View
2  script/soundmanager2-jsmin.js
@@ -41,7 +41,7 @@ g?!0:d;b||(b={});a.url&&(a._iO.url=a.url);a._iO=B(a._iO,a.options);a._iO=B(b,a._
x)return x;b.url&&b.url!==a.url&&(!a.readyState&&!a.isHTML5&&8===n&&A?A=!1:a.load(a._iO));a.loaded?c._wD(e.substr(0,e.lastIndexOf(":"))):0===a.readyState?(c._wD(e+"Attempting to load"),!a.isHTML5&&!c.html5Only?(a._iO.autoPlay=!0,a.load(a._iO)):a.isHTML5?a.load(a._iO):(c._wD(e+"Unsupported type. Exiting."),x=a),a.instanceOptions=a._iO):2===a.readyState?(c._wD(e+"Could not load - exiting",2),x=a):c._wD(e+"Loading - attempting to play...");if(null!==x)return x;!a.isHTML5&&(9===n&&0<a.position&&a.position===
a.duration)&&(c._wD(e+"Sound at end, resetting to position:0"),b.position=0);if(a.paused&&0<=a.position&&(!a._iO.serverURL||0<a.position))c._wD(e+"Resuming from paused state",1),a.resume();else{a._iO=B(b,a._iO);if(null!==a._iO.from&&null!==a._iO.to&&0===a.instanceCount&&0===a.playState&&!a._iO.serverURL){f=function(){a._iO=B(b,a._iO);a.play(a._iO)};if(a.isHTML5&&!a._html5_canplay)c._wD(e+"Beginning load for from/to case"),a.load({_oncanplay:f}),x=!1;else if(!a.isHTML5&&!a.loaded&&(!a.readyState||
2!==a.readyState))c._wD(e+"Preloading for from/to case"),a.load({onload:f}),x=!1;if(null!==x)return x;a._iO=y()}(!a.instanceCount||a._iO.multiShotEvents||a.isHTML5&&a._iO.multiShot&&!E||!a.isHTML5&&8<n&&!a.getAutoPlay())&&a.instanceCount++;a._iO.onposition&&0===a.playState&&q(a);a.playState=1;a.paused=!1;a.position=a._iO.position!==g&&!isNaN(a._iO.position)?a._iO.position:0;a.isHTML5||(a._iO=oa(na(a._iO)));a._iO.onplay&&d&&(a._iO.onplay.apply(a),s=!0);a.setVolume(a._iO.volume,!0);a.setPan(a._iO.pan,
-!0);a.isHTML5?2>a.instanceCount?(m(),e=a._setup_html5(),a.setPosition(a._iO.position),e.play()):(c._wD(a.id+": Cloning Audio() for instance #"+a.instanceCount+"..."),k=new Audio(a._iO.url),z=function(){w.remove(k,"onended",z);a._onfinish(a);sa(k);k=null},h=function(){w.remove(k,"canplay",h);try{k.currentTime=a._iO.position/1E3}catch(c){J(a.id+": multiShot play() failed to apply position of "+a._iO.position/1E3)}k.play()},w.add(k,"ended",z),void 0!==a._iO.volume&&(k.volume=Math.max(0,Math.min(1,a._iO.volume/
+!0);a.isHTML5?2>a.instanceCount?(m(),e=a._setup_html5(),a.setPosition(a._iO.position),e.play()):(c._wD(a.id+": Cloning Audio() for instance #"+a.instanceCount+"..."),k=new Audio(a._iO.url),z=function(){w.remove(k,"ended",z);a._onfinish(a);sa(k);k=null},h=function(){w.remove(k,"canplay",h);try{k.currentTime=a._iO.position/1E3}catch(c){J(a.id+": multiShot play() failed to apply position of "+a._iO.position/1E3)}k.play()},w.add(k,"ended",z),void 0!==a._iO.volume&&(k.volume=Math.max(0,Math.min(1,a._iO.volume/
100))),a._iO.muted&&(k.muted=!0),a._iO.position?w.add(k,"canplay",h):k.play()):(x=l._start(a.id,a._iO.loops||1,9===n?a.position:a.position/1E3,a._iO.multiShot||!1),9===n&&!x&&(c._wD(e+"No sound hardware, or 32-sound ceiling hit",2),a._iO.onplayerror&&a._iO.onplayerror.apply(a)))}return a};this.stop=function(b){var d=a._iO;1===a.playState&&(c._wD(a.id+": stop()"),a._onbufferchange(0),a._resetOnPosition(0),a.paused=!1,a.isHTML5||(a.playState=0),Ua(),d.to&&a.clearOnPosition(d.to),a.isHTML5?a._a&&(b=
a.position,a.setPosition(0),a.position=b,a._a.pause(),a.playState=0,a._onTimer(),k()):(l._stop(a.id,b),d.serverURL&&a.unload()),a.instanceCount=0,a._iO={},d.onstop&&d.onstop.apply(a));return a};this.setAutoPlay=function(b){c._wD(a.id+": Autoplay turned "+(b?"on":"off"));a._iO.autoPlay=b;a.isHTML5||(l._setAutoPlay(a.id,b),b&&(!a.instanceCount&&1===a.readyState)&&(a.instanceCount++,c._wD(a.id+": Incremented instance count to "+a.instanceCount)))};this.getAutoPlay=function(){return a._iO.autoPlay};this.setPosition=
function(b){b===g&&(b=0);var d=a.isHTML5?Math.max(b,0):Math.min(a.duration||a._iO.duration,Math.max(b,0));a.position=d;b=a.position/1E3;a._resetOnPosition(a.position);a._iO.position=d;if(a.isHTML5){if(a._a){if(a._html5_canplay){if(a._a.currentTime!==b){c._wD(a.id+": setPosition("+b+")");try{a._a.currentTime=b,(0===a.playState||a.paused)&&a._a.pause()}catch(e){c._wD(a.id+": setPosition("+b+") failed: "+e.message,2)}}}else if(b)return c._wD(a.id+": setPosition("+b+"): Cannot seek yet, sound not ready",
View
2  script/soundmanager2-nodebug-jsmin.js
@@ -33,7 +33,7 @@ d.stream,d.autoPlay,d.usePolicyFile):k._load(a.id,d.url,!!d.stream,!!d.autoPlay,
b||c.destroySound(a.id,!0)};this.start=this.play=function(b,e){var d,f,g,K,A;f=!0;f=null;e=e===h?!0:e;b||(b={});a.url&&(a._iO.url=a.url);a._iO=w(a._iO,a.options);a._iO=w(b,a._iO);a._iO.url=fa(a._iO.url);a.instanceOptions=a._iO;if(!a.isHTML5&&a._iO.serverURL&&!a.connected)return a.getAutoPlay()||a.setAutoPlay(!0),a;ga(a._iO)&&(a._setup_html5(a._iO),l());1===a.playState&&!a.paused&&(d=a._iO.multiShot,d||(a.isHTML5&&a.setPosition(a._iO.position),f=a));if(null!==f)return f;b.url&&b.url!==a.url&&(!a.readyState&&
!a.isHTML5&&8===m&&x?x=!1:a.load(a._iO));a.loaded||(0===a.readyState?(!a.isHTML5&&!c.html5Only?(a._iO.autoPlay=!0,a.load(a._iO)):a.isHTML5?a.load(a._iO):f=a,a.instanceOptions=a._iO):2===a.readyState&&(f=a));if(null!==f)return f;!a.isHTML5&&(9===m&&0<a.position&&a.position===a.duration)&&(b.position=0);if(a.paused&&0<=a.position&&(!a._iO.serverURL||0<a.position))a.resume();else{a._iO=w(b,a._iO);if(null!==a._iO.from&&null!==a._iO.to&&0===a.instanceCount&&0===a.playState&&!a._iO.serverURL){d=function(){a._iO=
w(b,a._iO);a.play(a._iO)};if(a.isHTML5&&!a._html5_canplay)a.load({_oncanplay:d}),f=!1;else if(!a.isHTML5&&!a.loaded&&(!a.readyState||2!==a.readyState))a.load({onload:d}),f=!1;if(null!==f)return f;a._iO=y()}(!a.instanceCount||a._iO.multiShotEvents||a.isHTML5&&a._iO.multiShot&&!z||!a.isHTML5&&8<m&&!a.getAutoPlay())&&a.instanceCount++;a._iO.onposition&&0===a.playState&&n(a);a.playState=1;a.paused=!1;a.position=a._iO.position!==h&&!isNaN(a._iO.position)?a._iO.position:0;a.isHTML5||(a._iO=da(ca(a._iO)));
-a._iO.onplay&&e&&(a._iO.onplay.apply(a),r=!0);a.setVolume(a._iO.volume,!0);a.setPan(a._iO.pan,!0);a.isHTML5?2>a.instanceCount?(l(),f=a._setup_html5(),a.setPosition(a._iO.position),f.play()):(g=new Audio(a._iO.url),K=function(){t.remove(g,"onended",K);a._onfinish(a);ha(g);g=null},A=function(){t.remove(g,"canplay",A);try{g.currentTime=a._iO.position/1E3}catch(b){}g.play()},t.add(g,"ended",K),void 0!==a._iO.volume&&(g.volume=Math.max(0,Math.min(1,a._iO.volume/100))),a._iO.muted&&(g.muted=!0),a._iO.position?
+a._iO.onplay&&e&&(a._iO.onplay.apply(a),r=!0);a.setVolume(a._iO.volume,!0);a.setPan(a._iO.pan,!0);a.isHTML5?2>a.instanceCount?(l(),f=a._setup_html5(),a.setPosition(a._iO.position),f.play()):(g=new Audio(a._iO.url),K=function(){t.remove(g,"ended",K);a._onfinish(a);ha(g);g=null},A=function(){t.remove(g,"canplay",A);try{g.currentTime=a._iO.position/1E3}catch(b){}g.play()},t.add(g,"ended",K),void 0!==a._iO.volume&&(g.volume=Math.max(0,Math.min(1,a._iO.volume/100))),a._iO.muted&&(g.muted=!0),a._iO.position?
t.add(g,"canplay",A):g.play()):(f=k._start(a.id,a._iO.loops||1,9===m?a.position:a.position/1E3,a._iO.multiShot||!1),9===m&&!f&&a._iO.onplayerror&&a._iO.onplayerror.apply(a))}return a};this.stop=function(b){var c=a._iO;1===a.playState&&(a._onbufferchange(0),a._resetOnPosition(0),a.paused=!1,a.isHTML5||(a.playState=0),v(),c.to&&a.clearOnPosition(c.to),a.isHTML5?a._a&&(b=a.position,a.setPosition(0),a.position=b,a._a.pause(),a.playState=0,a._onTimer(),A()):(k._stop(a.id,b),c.serverURL&&a.unload()),a.instanceCount=
0,a._iO={},c.onstop&&c.onstop.apply(a));return a};this.setAutoPlay=function(b){a._iO.autoPlay=b;a.isHTML5||(k._setAutoPlay(a.id,b),b&&!a.instanceCount&&1===a.readyState&&a.instanceCount++)};this.getAutoPlay=function(){return a._iO.autoPlay};this.setPosition=function(b){b===h&&(b=0);var c=a.isHTML5?Math.max(b,0):Math.min(a.duration||a._iO.duration,Math.max(b,0));a.position=c;b=a.position/1E3;a._resetOnPosition(a.position);a._iO.position=c;if(a.isHTML5){if(a._a){if(a._html5_canplay){if(a._a.currentTime!==
b)try{a._a.currentTime=b,(0===a.playState||a.paused)&&a._a.pause()}catch(e){}}else if(b)return a;a.paused&&a._onTimer(!0)}}else b=9===m?a.position:b,a.readyState&&2!==a.readyState&&k._setPosition(a.id,b,a.paused||!a.playState,a._iO.multiShot);return a};this.pause=function(b){if(a.paused||0===a.playState&&1!==a.readyState)return a;a.paused=!0;a.isHTML5?(a._setup_html5().pause(),A()):(b||b===h)&&k._pause(a.id,a._iO.multiShot);a._iO.onpause&&a._iO.onpause.apply(a);return a};this.resume=function(){var b=
View
3  script/soundmanager2-nodebug.js
@@ -858,7 +858,7 @@ function SoundManager(smURL, smID) {
} else {
audioClone = new Audio(s._iO.url);
onended = function() {
- event.remove(audioClone, 'onended', onended);
+ event.remove(audioClone, 'ended', onended);
s._onfinish(s);
html5Unload(audioClone);
audioClone = null;
@@ -1128,6 +1128,7 @@ function SoundManager(smURL, smID) {
item.fired = true;
onPositionFired++;
item.method.apply(item.scope, [item.position]);
+ j = onPositionItems.length;
}
}
return true;
View
17 script/soundmanager2.js
@@ -2571,7 +2571,7 @@ function SoundManager(smURL, smID) {
this._processOnPosition = function() {
var i, item, j = onPositionItems.length;
-
+
if (!j || !s.playState || onPositionFired >= j) {
return false;
}
@@ -2582,9 +2582,10 @@ function SoundManager(smURL, smID) {
item.fired = true;
onPositionFired++;
item.method.apply(item.scope, [item.position]);
+ j = onPositionItems.length; // reset j -- onPositionItems.length can be changed in the item callback above... occasionally breaking the loop.
}
}
-
+
return true;
};
@@ -2674,7 +2675,7 @@ function SoundManager(smURL, smID) {
for (item in op) {
if (op.hasOwnProperty(item)) {
- s.onPosition(parseInt(item, 10), op[item]);
+ s.onPosition(parseInt(item, 10), op[item]);
}
}
@@ -3283,7 +3284,7 @@ function SoundManager(smURL, smID) {
/**
* internal: flash 9 + NetStream (MovieStar/RTMP-only) feature
- *
+ *
* @param {object} oData
*/
@@ -3302,7 +3303,7 @@ function SoundManager(smURL, smID) {
/**
* internal: flash 9 + NetStream (MovieStar/RTMP-only) feature
* RTMP may include song title, MovieStar content may include encoding info
- *
+ *
* @param {array} oMDProps (names)
* @param {array} oMDData (values)
*/
@@ -3327,7 +3328,7 @@ function SoundManager(smURL, smID) {
/**
* internal: flash 8 + flash 9 ID3 feature
* may include artist, song title etc.
- *
+ *
* @param {array} oID3Props (names)
* @param {array} oID3Data (values)
*/
@@ -4897,7 +4898,7 @@ function SoundManager(smURL, smID) {
if (h5IntervalTimer === null && h5TimerCount === 0) {
h5IntervalTimer = setInterval(timerExecute, sm2.html5PollingInterval);
-
+
}
h5TimerCount++;
@@ -5815,7 +5816,7 @@ function SoundManager(smURL, smID) {
var a = 'sm2-usehtml5audio=',
a2 = 'sm2-preferflash=',
- b = null,
+ b = null,
b2 = null,
l = wl.toLowerCase();
Please sign in to comment.
Something went wrong with that request. Please try again.