Skip to content

Commit

Permalink
Bug Fix: A broken link error with the MP3 player now stops timeupdate…
Browse files Browse the repository at this point in the history
… and progress events and resets the GUI state.
  • Loading branch information
thepag committed Sep 1, 2011
1 parent b06ce94 commit 08497b1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions actionscript/Jplayer.as
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* - http://www.gnu.org/copyleft/gpl.html
*
* Author: Mark J Panaghiston
* Version: 2.0.32
* Date: 9th August 2011
* Version: 2.1.0
* Date: 1st September 2011
*
* FlashVars expected: (AS3 property of: loaderInfo.parameters)
* id: (URL Encoded: String) Id of jPlayer instance
Expand Down
6 changes: 5 additions & 1 deletion actionscript/happyworm/jPlayer/JplayerMp3.as
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* - http://www.gnu.org/copyleft/gpl.html
*
* Author: Mark J Panaghiston
* Date: 7th August 2011
* Date: 1st September 2011
*/

package happyworm.jPlayer {
Expand Down Expand Up @@ -70,6 +70,10 @@ package happyworm.jPlayer {
myStatus.srcSet = false;
}
private function errorHandler(err:IOErrorEvent):void {
// MP3 player needs to stop progress and timeupdate events as they are started before the error occurs.
// NB: The MP4 player works differently and the error occurs before they are started.
progressUpdates(false);
timeUpdates(false);
myStatus.error(); // Resets status except the src, and it sets srcError property.
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_ERROR, myStatus));
}
Expand Down
4 changes: 2 additions & 2 deletions actionscript/happyworm/jPlayer/JplayerStatus.as
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
* - http://www.gnu.org/copyleft/gpl.html
*
* Author: Mark J Panaghiston
* Date: 9th August 2011
* Date: 1st September 2011
*/

package happyworm.jPlayer {
public class JplayerStatus {

public static const VERSION:String = "2.0.32"; // The version of the Flash jPlayer entity.
public static const VERSION:String = "2.1.0"; // The version of the Flash jPlayer entity.

public var volume:Number = 0.5; // Not affected by reset()
public var muted:Boolean = false; // Not affected by reset()
Expand Down
Binary file modified jquery.jplayer/Jplayer.swf
Binary file not shown.
11 changes: 6 additions & 5 deletions jquery.jplayer/jquery.jplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* - http://www.gnu.org/copyleft/gpl.html
*
* Author: Mark J Panaghiston
* Version: 2.0.36
* Date: 29th August 2011
* Version: 2.1.0
* Date: 1st September 2011
*/

/* Code verified using http://www.jshint.com/ */
Expand Down Expand Up @@ -237,8 +237,8 @@
$.jPlayer.prototype = {
count: 0, // Static Variable: Change it via prototype.
version: { // Static Object
script: "2.0.36",
needFlash: "2.0.32",
script: "2.1.0",
needFlash: "2.1.0",
flash: "unknown"
},
options: { // Instanced in $.jPlayer() constructor
Expand Down Expand Up @@ -1133,14 +1133,15 @@
if(this._validString(this.status.media.poster)) {
this.internal.poster.jq.show();
}
if(this.css.jq.videoPlay.length) {
if(this.css.jq.videoPlay.length && this.status.video) {
this.css.jq.videoPlay.show();
}
if(this.status.video) { // Set up for another try. Execute before error event.
this._flash_setVideo(this.status.media);
} else {
this._flash_setAudio(this.status.media);
}
this._updateButtons(false);
this._error( {
type: $.jPlayer.error.URL,
context:status.src,
Expand Down

0 comments on commit 08497b1

Please sign in to comment.