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

fix the bug of publish, server close the connection when timeout.

This commit is contained in:
winlin 2013-12-25 14:39:54 +08:00
parent ffda615124
commit 836bc413f9
7 changed files with 35 additions and 15 deletions

23
trunk/research/players/js/srs.publisher.js Normal file → Executable file
View file

@ -35,9 +35,12 @@ function SrsPublisher(container, width, height, private_object) {
// error code defines.
this.errors = {
"100": "无法获取指定的摄像头", //error_camera_get
"101": "无法获取指定的麦克风", //error_microphone_get
"102": "摄像头为禁用状态推流时请允许flash访问摄像头" //error_camera_muted
"100": "无法获取指定的摄像头。", //error_camera_get
"101": "无法获取指定的麦克风。", //error_microphone_get
"102": "摄像头为禁用状态推流时请允许flash访问摄像头。", //error_camera_muted
"103": "服务器关闭了连接。", //error_connection_closed
"104": "服务器连接失败。", //error_connection_failed
"199": "未知错误。"
};
}
/**
@ -84,11 +87,17 @@ SrsPublisher.prototype.start = function() {
* @param acodec an object contains the audio codec info.
*/
SrsPublisher.prototype.publish = function(url, vcodec, acodec) {
this.url = url;
this.vcodec = vcodec;
this.acodec = acodec;
if (url) {
this.url = url;
}
if (vcodec) {
this.vcodec = vcodec;
}
if (acodec) {
this.acodec = acodec;
}
this.callbackObj.ref.__publish(url, this.width, this.height, vcodec, acodec);
this.callbackObj.ref.__publish(this.url, this.width, this.height, this.vcodec, this.acodec);
}
SrsPublisher.prototype.stop = function() {
this.callbackObj.ref.__stop();