1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

merge from srs2

This commit is contained in:
winlin 2015-09-17 18:06:03 +08:00
commit 5073a6fa08
2 changed files with 25 additions and 3 deletions

View file

@ -26,6 +26,7 @@ function SrsPlayer(container, width, height, private_object) {
this.max_buffer_time = this.buffer_time * 3; // default to 3 x bufferTime. this.max_buffer_time = this.buffer_time * 3; // default to 3 x bufferTime.
this.volume = 1.0; // default to 100% this.volume = 1.0; // default to 100%
this.callbackObj = null; this.callbackObj = null;
this.srs_player_url = "srs_player/release/srs_player.swf?_version="+srs_get_version_code();
// callback set the following values. // callback set the following values.
this.meatadata = {}; // for on_player_metadata this.meatadata = {}; // for on_player_metadata
@ -89,7 +90,7 @@ SrsPlayer.prototype.start = function(url) {
var self = this; var self = this;
swfobject.embedSWF( swfobject.embedSWF(
"srs_player/release/srs_player.swf?_version="+srs_get_version_code(), this.srs_player_url,
this.container, this.container,
this.width, this.height, this.width, this.height,
"11.1.0", "js/AdobeFlashPlayerInstall.swf", "11.1.0", "js/AdobeFlashPlayerInstall.swf",
@ -219,8 +220,27 @@ SrsPlayer.prototype.set_mbt = function(max_buffer_time) {
this.callbackObj.ref.__set_mbt(max_buffer_time); this.callbackObj.ref.__set_mbt(max_buffer_time);
} }
/** /**
* the callback when player is ready. * set the srs_player.swf url
* @param url, srs_player.swf's url.
* @param params, object.
*/ */
SrsPlayer.prototype.set_srs_player_url = function(url, params) {
var query_array = [],
query_string = "",
p;
params = params || {};
params._version = srs_get_version_code();
for (p in params) {
if (params.hasOwnProperty(p)) {
query_array.push(p + "=" + encodeURIComponent(params[p]));
}
}
query_string = query_array.join("&");
this.srs_player_url = url + "?" + query_string;
}
/**
* the callback when player is ready.
*/
SrsPlayer.prototype.on_player_ready = function() { SrsPlayer.prototype.on_player_ready = function() {
} }
/** /**

View file

@ -79,6 +79,8 @@ package
this.stage.addEventListener(FullScreenEvent.FULL_SCREEN, this.user_on_stage_fullscreen); this.stage.addEventListener(FullScreenEvent.FULL_SCREEN, this.user_on_stage_fullscreen);
Security.allowDomain("*");
this.addChild(this.control_fs_mask); this.addChild(this.control_fs_mask);
this.control_fs_mask.buttonMode = true; this.control_fs_mask.buttonMode = true;
this.control_fs_mask.addEventListener(MouseEvent.CLICK, user_on_click_video); this.control_fs_mask.addEventListener(MouseEvent.CLICK, user_on_click_video);