Skip to content

Commit

Permalink
Fix: Added loadedmetadata and durationchange events to Flash MP3.
Browse files Browse the repository at this point in the history
  • Loading branch information
thepag committed Dec 15, 2013
1 parent 36a80ff commit b767e26
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
10 changes: 8 additions & 2 deletions actionscript/Jplayer.as
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* http://opensource.org/licenses/MIT
*
* Author: Mark J Panaghiston
* Version: 2.5.0
* Date: 7th November 2013
* Version: 2.5.2
* Date: 15th December 2013
*
* FlashVars expected: (AS3 property of: loaderInfo.parameters)
* id: (URL Encoded: String) Id of jPlayer instance
Expand Down Expand Up @@ -279,6 +279,9 @@ package {

myMp3Player.addEventListener(JplayerEvent.JPLAYER_CANPLAY, jPlayerFlashEvent); // only MP3 atm
myMp3Player.addEventListener(JplayerEvent.JPLAYER_CANPLAYTHROUGH, jPlayerFlashEvent); // only MP3 atm

myMp3Player.addEventListener(JplayerEvent.JPLAYER_LOADEDMETADATA, jPlayerFlashEvent);
myMp3Player.addEventListener(JplayerEvent.JPLAYER_DURATIONCHANGE, jPlayerFlashEvent); // only MP3 atm
} else {
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_ERROR, jPlayerFlashEvent);
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_PROGRESS, jPlayerFlashEvent);
Expand All @@ -297,6 +300,9 @@ package {

myMp3Player.removeEventListener(JplayerEvent.JPLAYER_CANPLAY, jPlayerFlashEvent); // only MP3 atm
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_CANPLAYTHROUGH, jPlayerFlashEvent); // only MP3 atm

myMp3Player.removeEventListener(JplayerEvent.JPLAYER_LOADEDMETADATA, jPlayerFlashEvent);
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_DURATIONCHANGE, jPlayerFlashEvent); // only MP3 atm
}
}
private function listenToMp4(active:Boolean):void {
Expand Down
6 changes: 3 additions & 3 deletions actionscript/happyworm/jPlayer/JplayerEvent.as
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* http://opensource.org/licenses/MIT
*
* Author: Mark J Panaghiston
* Date: 20th May 2013
* Date: 15th December 2013
*/

package happyworm.jPlayer {
Expand All @@ -33,7 +33,7 @@ package happyworm.jPlayer {
public static const JPLAYER_STALLED:String = "jPlayer_stalled"; // Not implemented
public static const JPLAYER_PLAY:String = "jPlayer_play";
public static const JPLAYER_PAUSE:String = "jPlayer_pause";
public static const JPLAYER_LOADEDMETADATA:String = "jPlayer_loadedmetadata"; // MP3 has no equivilent
public static const JPLAYER_LOADEDMETADATA:String = "jPlayer_loadedmetadata";
public static const JPLAYER_LOADEDDATA:String = "jPlayer_loadeddata"; // Not implemented
public static const JPLAYER_WAITING:String = "jPlayer_waiting"; // Not implemented (Done in: MP3)
public static const JPLAYER_PLAYING:String = "jPlayer_playing"; // Not implemented (Done in: MP3)
Expand All @@ -44,7 +44,7 @@ package happyworm.jPlayer {
public static const JPLAYER_TIMEUPDATE:String = "jPlayer_timeupdate";
public static const JPLAYER_ENDED:String = "jPlayer_ended";
public static const JPLAYER_RATECHANGE:String = "jPlayer_ratechange"; // Not implemented
public static const JPLAYER_DURATIONCHANGE:String = "jPlayer_durationchange"; // Not implemented
public static const JPLAYER_DURATIONCHANGE:String = "jPlayer_durationchange"; // Not implemented (Done in: MP3)
public static const JPLAYER_VOLUMECHANGE:String = "jPlayer_volumechange"; // See JavaScript

// Events used internal to jPlayer's Flash.
Expand Down
4 changes: 3 additions & 1 deletion actionscript/happyworm/jPlayer/JplayerMp3.as
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* http://opensource.org/licenses/MIT
*
* Author: Mark J Panaghiston
* Date: 28th May 2013
* Date: 15th December 2013
*/

package happyworm.jPlayer {
Expand Down Expand Up @@ -100,6 +100,8 @@ package happyworm.jPlayer {
myStatus.loaded();
progressUpdates(false);
progressEvent();
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_LOADEDMETADATA, myStatus));
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_DURATIONCHANGE, myStatus));
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_CANPLAYTHROUGH, myStatus));
}
private function soundCompleteHandler(e:Event):void {
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 @@ -7,13 +7,13 @@
* http://opensource.org/licenses/MIT
*
* Author: Mark J Panaghiston
* Date: 7th November 2013
* Date: 15th Devember 2013
*/

package happyworm.jPlayer {
public class JplayerStatus {

public static const VERSION:String = "2.5.0"; // The version of the Flash jPlayer entity.
public static const VERSION:String = "2.5.2"; // 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.
8 changes: 4 additions & 4 deletions jquery.jplayer/jquery.jplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* http://opensource.org/licenses/MIT
*
* Author: Mark J Panaghiston
* Version: 2.5.1
* Date: 8th December 2013
* Version: 2.5.2
* Date: 15th December 2013
*/

/* Code verified using http://www.jshint.com/ */
Expand Down Expand Up @@ -470,8 +470,8 @@
$.jPlayer.prototype = {
count: 0, // Static Variable: Change it via prototype.
version: { // Static Object
script: "2.5.1",
needFlash: "2.5.0",
script: "2.5.2",
needFlash: "2.5.2",
flash: "unknown"
},
options: { // Instanced in $.jPlayer() constructor
Expand Down

0 comments on commit b767e26

Please sign in to comment.