mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine js, move the consts to the head of srs.js
This commit is contained in:
parent
46eb1ebd6b
commit
1783e1f764
1 changed files with 25 additions and 21 deletions
|
@ -1,3 +1,28 @@
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/**
|
||||||
|
* player specified size.
|
||||||
|
*/
|
||||||
|
function srs_get_player_modal() { return 740; }
|
||||||
|
function srs_get_player_width() { return srs_get_player_modal() - 30; }
|
||||||
|
function srs_get_player_height() { return srs_get_player_width() * 9 / 19; }
|
||||||
|
|
||||||
|
// to query the swf anti cache.
|
||||||
|
function srs_get_version_code() { return "1.9"; }
|
||||||
|
// get the default vhost for players.
|
||||||
|
function srs_get_player_vhost() { return "players"; }
|
||||||
|
// the api server port, for chat room.
|
||||||
|
function srs_get_api_server_port() { return 8085; }
|
||||||
|
// get the stream published to vhost,
|
||||||
|
// generally we need to transcode the stream to support HLS and filters.
|
||||||
|
// for example, src_vhost is "players", we transcode stream to vhost "players_pub".
|
||||||
|
// if not equals to the player vhost, return the orignal vhost.
|
||||||
|
function srs_get_player_publish_vhost(src_vhost) { return (src_vhost != srs_get_player_vhost())? src_vhost:(src_vhost + "_pub"); }
|
||||||
|
// for chat, use rtmp only vhost, low latecy, without gop cache.
|
||||||
|
function srs_get_player_chat_vhost(src_vhost) { return (src_vhost != srs_get_player_vhost())? src_vhost:(src_vhost + "_pub_rtmp"); }
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
//////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
//////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -193,27 +218,6 @@ function srs_parse_rtmp_url(rtmp_url) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* player specified size.
|
|
||||||
*/
|
|
||||||
function srs_get_player_modal() { return 740; }
|
|
||||||
function srs_get_player_width() { return srs_get_player_modal() - 30; }
|
|
||||||
function srs_get_player_height() { return srs_get_player_width() * 9 / 19; }
|
|
||||||
|
|
||||||
// to query the swf anti cache.
|
|
||||||
function srs_get_version_code() { return "1.7"; }
|
|
||||||
// get the default vhost for players.
|
|
||||||
function srs_get_player_vhost() { return "players"; }
|
|
||||||
// the api server port, for chat room.
|
|
||||||
function srs_get_api_server_port() { return 8085; }
|
|
||||||
// get the stream published to vhost,
|
|
||||||
// generally we need to transcode the stream to support HLS and filters.
|
|
||||||
// for example, src_vhost is "players", we transcode stream to vhost "players_pub".
|
|
||||||
// if not equals to the player vhost, return the orignal vhost.
|
|
||||||
function srs_get_player_publish_vhost(src_vhost) { return (src_vhost != srs_get_player_vhost())? src_vhost:(src_vhost + "_pub"); }
|
|
||||||
// for chat, use rtmp only vhost, low latecy, without gop cache.
|
|
||||||
function srs_get_player_chat_vhost(src_vhost) { return (src_vhost != srs_get_player_vhost())? src_vhost:(src_vhost + "_pub_rtmp"); }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initialize the page.
|
* initialize the page.
|
||||||
* @param rtmp_url the div id contains the rtmp stream url to play
|
* @param rtmp_url the div id contains the rtmp stream url to play
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue