winlin

fix bug of player dar.

... ... @@ -78,6 +78,9 @@ SrsPlayer.prototype.start = function(url) {
* @param volume the volume, 0 is mute, 1 is 100%, 2 is 200%.
*/
SrsPlayer.prototype.play = function(url, volume) {
this.stop();
SrsPlayer.__players.push(this);
if (url) {
this.stream_url = url;
}
... ... @@ -118,8 +121,8 @@ SrsPlayer.prototype.resume = function() {
* use metadata width if 0.
* use user specified width if -1.
*/
SrsPlayer.prototype.dar = function(num, den) {
this.callbackObj.ref.__dar(num, den);
SrsPlayer.prototype.set_dar = function(num, den) {
this.callbackObj.ref.__set_dar(num, den);
}
/**
* set the fullscreen size data.
... ...
... ... @@ -78,8 +78,11 @@
realtime_player = new SrsPlayer("realtime_player", 430, 185);
realtime_player.on_player_ready = function() {
this.set_bt(0.5);
this.set_fs("screen", 100);
};
realtime_player.on_player_metadata = function(metadata) {
this.set_dar(0, 0);
this.set_fs("screen", 100);
}
realtime_player.start();
}
... ... @@ -230,8 +233,11 @@
var _player = new SrsPlayer("rp_raw_" + chat.id, 600, 300, chat);
_player.on_player_ready = function() {
this.set_bt(0.5);
this.set_fs("screen", 100);
};
_player.on_player_metadata = function(metadata) {
this.set_dar(0, 0);
this.set_fs("screen", 100);
}
_player.start(chat.url);
chat.player = _player;
... ...
... ... @@ -34,7 +34,7 @@
var __active_dar = null;
function select_dar(dar_id, num, den) {
srs_player.dar(num, den);
srs_player.set_dar(num, den);
if (__active_dar) {
__active_dar.removeClass("active");
... ...
... ... @@ -115,7 +115,7 @@ package
flash.external.ExternalInterface.addCallback("__stop", this.js_call_stop);
flash.external.ExternalInterface.addCallback("__pause", this.js_call_pause);
flash.external.ExternalInterface.addCallback("__resume", this.js_call_resume);
flash.external.ExternalInterface.addCallback("__dar", this.js_call_dar);
flash.external.ExternalInterface.addCallback("__set_dar", this.js_call_set_dar);
flash.external.ExternalInterface.addCallback("__set_fs", this.js_call_set_fs_size);
flash.external.ExternalInterface.addCallback("__set_bt", this.js_call_set_bt);
... ... @@ -229,7 +229,7 @@ package
* use metadata width if 0.
* use user specified width if -1.
*/
private function js_call_dar(num:int, den:int):void {
private function js_call_set_dar(num:int, den:int):void {
user_dar_num = num;
user_dar_den = den;
... ...
... ... @@ -80,16 +80,22 @@
remote_player = new SrsPlayer("remote_player", 430, 185);
remote_player.on_player_ready = function() {
this.set_bt(0.8);
this.set_fs("screen", 100);
};
remote_player.on_player_metadata = function(metadata) {
this.set_dar(0, 0);
this.set_fs("screen", 100);
}
remote_player.start();
// start the realtime player.
realtime_player = new SrsPlayer("realtime_player", 430, 185);
realtime_player.on_player_ready = function() {
this.set_bt(0.8);
this.set_fs("screen", 100);
};
realtime_player.on_player_metadata = function(metadata) {
this.set_dar(0, 0);
this.set_fs("screen", 100);
}
realtime_player.start();
}
});
... ...