Skip to content

Commit b767e26

Browse files
committed
Fix: Added loadedmetadata and durationchange events to Flash MP3.
1 parent 36a80ff commit b767e26

File tree

6 files changed

+20
-12
lines changed

6 files changed

+20
-12
lines changed

actionscript/Jplayer.as

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* http://opensource.org/licenses/MIT
88
*
99
* Author: Mark J Panaghiston
10-
* Version: 2.5.0
11-
* Date: 7th November 2013
10+
* Version: 2.5.2
11+
* Date: 15th December 2013
1212
*
1313
* FlashVars expected: (AS3 property of: loaderInfo.parameters)
1414
* id: (URL Encoded: String) Id of jPlayer instance
@@ -279,6 +279,9 @@ package {
279279

280280
myMp3Player.addEventListener(JplayerEvent.JPLAYER_CANPLAY, jPlayerFlashEvent); // only MP3 atm
281281
myMp3Player.addEventListener(JplayerEvent.JPLAYER_CANPLAYTHROUGH, jPlayerFlashEvent); // only MP3 atm
282+
283+
myMp3Player.addEventListener(JplayerEvent.JPLAYER_LOADEDMETADATA, jPlayerFlashEvent);
284+
myMp3Player.addEventListener(JplayerEvent.JPLAYER_DURATIONCHANGE, jPlayerFlashEvent); // only MP3 atm
282285
} else {
283286
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_ERROR, jPlayerFlashEvent);
284287
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_PROGRESS, jPlayerFlashEvent);
@@ -297,6 +300,9 @@ package {
297300

298301
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_CANPLAY, jPlayerFlashEvent); // only MP3 atm
299302
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_CANPLAYTHROUGH, jPlayerFlashEvent); // only MP3 atm
303+
304+
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_LOADEDMETADATA, jPlayerFlashEvent);
305+
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_DURATIONCHANGE, jPlayerFlashEvent); // only MP3 atm
300306
}
301307
}
302308
private function listenToMp4(active:Boolean):void {

actionscript/happyworm/jPlayer/JplayerEvent.as

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* http://opensource.org/licenses/MIT
88
*
99
* Author: Mark J Panaghiston
10-
* Date: 20th May 2013
10+
* Date: 15th December 2013
1111
*/
1212

1313
package happyworm.jPlayer {
@@ -33,7 +33,7 @@ package happyworm.jPlayer {
3333
public static const JPLAYER_STALLED:String = "jPlayer_stalled"; // Not implemented
3434
public static const JPLAYER_PLAY:String = "jPlayer_play";
3535
public static const JPLAYER_PAUSE:String = "jPlayer_pause";
36-
public static const JPLAYER_LOADEDMETADATA:String = "jPlayer_loadedmetadata"; // MP3 has no equivilent
36+
public static const JPLAYER_LOADEDMETADATA:String = "jPlayer_loadedmetadata";
3737
public static const JPLAYER_LOADEDDATA:String = "jPlayer_loadeddata"; // Not implemented
3838
public static const JPLAYER_WAITING:String = "jPlayer_waiting"; // Not implemented (Done in: MP3)
3939
public static const JPLAYER_PLAYING:String = "jPlayer_playing"; // Not implemented (Done in: MP3)
@@ -44,7 +44,7 @@ package happyworm.jPlayer {
4444
public static const JPLAYER_TIMEUPDATE:String = "jPlayer_timeupdate";
4545
public static const JPLAYER_ENDED:String = "jPlayer_ended";
4646
public static const JPLAYER_RATECHANGE:String = "jPlayer_ratechange"; // Not implemented
47-
public static const JPLAYER_DURATIONCHANGE:String = "jPlayer_durationchange"; // Not implemented
47+
public static const JPLAYER_DURATIONCHANGE:String = "jPlayer_durationchange"; // Not implemented (Done in: MP3)
4848
public static const JPLAYER_VOLUMECHANGE:String = "jPlayer_volumechange"; // See JavaScript
4949

5050
// Events used internal to jPlayer's Flash.

actionscript/happyworm/jPlayer/JplayerMp3.as

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* http://opensource.org/licenses/MIT
88
*
99
* Author: Mark J Panaghiston
10-
* Date: 28th May 2013
10+
* Date: 15th December 2013
1111
*/
1212

1313
package happyworm.jPlayer {
@@ -100,6 +100,8 @@ package happyworm.jPlayer {
100100
myStatus.loaded();
101101
progressUpdates(false);
102102
progressEvent();
103+
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_LOADEDMETADATA, myStatus));
104+
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_DURATIONCHANGE, myStatus));
103105
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_CANPLAYTHROUGH, myStatus));
104106
}
105107
private function soundCompleteHandler(e:Event):void {

actionscript/happyworm/jPlayer/JplayerStatus.as

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
* http://opensource.org/licenses/MIT
88
*
99
* Author: Mark J Panaghiston
10-
* Date: 7th November 2013
10+
* Date: 15th Devember 2013
1111
*/
1212

1313
package happyworm.jPlayer {
1414
public class JplayerStatus {
1515

16-
public static const VERSION:String = "2.5.0"; // The version of the Flash jPlayer entity.
16+
public static const VERSION:String = "2.5.2"; // The version of the Flash jPlayer entity.
1717

1818
public var volume:Number = 0.5; // Not affected by reset()
1919
public var muted:Boolean = false; // Not affected by reset()

jquery.jplayer/Jplayer.swf

14 Bytes
Binary file not shown.

jquery.jplayer/jquery.jplayer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* http://opensource.org/licenses/MIT
88
*
99
* Author: Mark J Panaghiston
10-
* Version: 2.5.1
11-
* Date: 8th December 2013
10+
* Version: 2.5.2
11+
* Date: 15th December 2013
1212
*/
1313

1414
/* Code verified using http://www.jshint.com/ */
@@ -470,8 +470,8 @@
470470
$.jPlayer.prototype = {
471471
count: 0, // Static Variable: Change it via prototype.
472472
version: { // Static Object
473-
script: "2.5.1",
474-
needFlash: "2.5.0",
473+
script: "2.5.2",
474+
needFlash: "2.5.2",
475475
flash: "unknown"
476476
},
477477
options: { // Instanced in $.jPlayer() constructor

0 commit comments

Comments
 (0)