Skip to content

Commit c6cef4d

Browse files
committed
Added videoWidth and videoHeight to status for HTML5 and Flash.
1 parent 4cb6b1c commit c6cef4d

6 files changed

Lines changed: 32 additions & 16 deletions

File tree

actionscript/Jplayer.as

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
* - http://www.gnu.org/copyleft/gpl.html
99
*
1010
* Author: Mark J Panaghiston
11-
* Version: 2.2.18
12-
* Date: 28th January 2013
11+
* Version: 2.2.19
12+
* Date: 29th January 2013
1313
*
1414
* FlashVars expected: (AS3 property of: loaderInfo.parameters)
1515
* id: (URL Encoded: String) Id of jPlayer instance
@@ -498,6 +498,8 @@ package {
498498
currentPercentAbsolute: data.currentPercentAbsolute,
499499
currentTime: data.currentTime / 1000, // JavaScript uses seconds
500500
duration: data.duration / 1000, // JavaScript uses seconds
501+
videoWidth: data.videoWidth,
502+
videoHeight: data.videoHeight,
501503
volume: commonStatus.volume,
502504
muted: commonStatus.muted
503505
};

actionscript/happyworm/jPlayer/JplayerMp4.as

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
22
* jPlayer Plugin for jQuery JavaScript Library
3-
* http://www.happyworm.com/jquery/jplayer
3+
* http://www.jplayer.org
44
*
5-
* Copyright (c) 2009 - 2011 Happyworm Ltd
5+
* Copyright (c) 2009 - 2013 Happyworm Ltd
66
* Dual licensed under the MIT and GPL licenses.
77
* - http://www.opensource.org/licenses/mit-license.php
88
* - http://www.gnu.org/copyleft/gpl.html
99
*
1010
* Author: Mark J Panaghiston
11-
* Date: 7th August 2011
11+
* Date: 29th January 2013
1212
*/
1313

1414
package happyworm.jPlayer {
@@ -388,10 +388,10 @@ package happyworm.jPlayer {
388388
myStatus.metaData = info;
389389
myStatus.duration = info.duration * 1000; // Only available via Meta Data.
390390
if(info.width != undefined) {
391-
myVideo.width = info.width;
391+
myVideo.width = myStatus.videoWidth = info.width;
392392
}
393393
if(info.height != undefined) {
394-
myVideo.height = info.height;
394+
myVideo.height = myStatus.videoHeight = info.height;
395395
}
396396

397397
if(myStatus.playOnLoad) {

actionscript/happyworm/jPlayer/JplayerRtmp.as

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* - http://www.gnu.org/copyleft/gpl.html
99
*
1010
* Author: Robert M. Hall
11-
* Date: 28th January 2013
11+
* Date: 29th January 2013
1212
* Based on JplayerMp4.as with modifications for rtmp
1313
*/
1414

@@ -950,11 +950,11 @@ package happyworm.jPlayer
950950
myStatus.duration = info.duration * 1000;// Only available via Meta Data.
951951
if (info.width != undefined)
952952
{
953-
myVideo.width = info.width;
953+
myVideo.width = myStatus.videoWidth = info.width;
954954
}
955955
if (info.height != undefined)
956956
{
957-
myVideo.height = info.height;
957+
myVideo.height = myStatus.videoHeight = info.height;
958958
}
959959

960960
if (myStatus.playOnLoad)

actionscript/happyworm/jPlayer/JplayerStatus.as

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
* - http://www.gnu.org/copyleft/gpl.html
99
*
1010
* Author: Mark J Panaghiston
11-
* Date: 28th January 2013
11+
* Date: 29th January 2013
1212
*/
1313

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

17-
public static const VERSION:String = "2.2.18"; // The version of the Flash jPlayer entity.
17+
public static const VERSION:String = "2.2.19"; // The version of the Flash jPlayer entity.
1818

1919
public var volume:Number = 0.5; // Not affected by reset()
2020
public var muted:Boolean = false; // Not affected by reset()
@@ -40,6 +40,9 @@ package happyworm.jPlayer {
4040
public var currentPercentRelative:Number;
4141
public var currentPercentAbsolute:Number;
4242
public var duration:Number;
43+
44+
public var videoWidth:Number;
45+
public var videoHeight:Number;
4346

4447
public var metaDataReady:Boolean;
4548
public var metaData:Object;
@@ -69,6 +72,9 @@ package happyworm.jPlayer {
6972
currentPercentRelative = 0;
7073
currentPercentAbsolute = 0;
7174
duration = 0;
75+
76+
videoWidth = 0;
77+
videoHeight = 0;
7278

7379
metaDataReady = false;
7480
metaData = {};

jquery.jplayer/Jplayer.swf

51 Bytes
Binary file not shown.

jquery.jplayer/jquery.jplayer.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
* - http://www.gnu.org/copyleft/gpl.html
99
*
1010
* Author: Mark J Panaghiston
11-
* Version: 2.2.18
12-
* Date: 28th January 2013
11+
* Version: 2.2.19
12+
* Date: 29th January 2013
1313
*/
1414

1515
/* Code verified using http://www.jshint.com/ */
@@ -454,8 +454,8 @@
454454
$.jPlayer.prototype = {
455455
count: 0, // Static Variable: Change it via prototype.
456456
version: { // Static Object
457-
script: "2.2.18",
458-
needFlash: "2.2.18",
457+
script: "2.2.19",
458+
needFlash: "2.2.19",
459459
flash: "unknown"
460460
},
461461
options: { // Instanced in $.jPlayer() constructor
@@ -631,6 +631,8 @@
631631
currentPercentAbsolute: 0,
632632
currentTime: 0,
633633
duration: 0,
634+
videoWidth: 0, // Intrinsic width of the video in pixels.
635+
videoHeight: 0, // Intrinsic height of the video in pixels.
634636
readyState: 0,
635637
networkState: 0,
636638
playbackRate: 1,
@@ -1333,6 +1335,9 @@
13331335
this.status.currentPercentAbsolute = cpa;
13341336
this.status.currentTime = ct;
13351337

1338+
this.status.videoWidth = media.videoWidth;
1339+
this.status.videoHeight = media.videoHeight;
1340+
13361341
this.status.readyState = media.readyState;
13371342
this.status.networkState = media.networkState;
13381343
this.status.playbackRate = media.playbackRate;
@@ -1479,6 +1484,9 @@
14791484
this.status.currentTime = status.currentTime;
14801485
this.status.duration = status.duration;
14811486

1487+
this.status.videoWidth = status.videoWidth;
1488+
this.status.videoHeight = status.videoHeight;
1489+
14821490
// The Flash does not generate this information in this release
14831491
this.status.readyState = 4; // status.readyState;
14841492
this.status.networkState = 0; // status.networkState;

0 commit comments

Comments
 (0)