Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
liveAssistant_web_demo
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
胡斌
2017-05-12 12:28:52 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1ed31a4c4d04ad9d04c7c6964981b04becb398c2
1ed31a4c
1 parent
fcd87d1f
parse the result of rtmp status notifation
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
19 行增加
和
22 行删除
demo.html
demo.html
查看文件 @
1ed31a4
...
...
@@ -278,7 +278,11 @@ a:active {
"SET_MIC_VOL_SUC"
,
"SET_MIC_VOL_FAIL"
,
"GET_MIC_VOL_SUC"
,
"GET_MIC_VOL_FAIL"
];
"GET_MIC_VOL_FAIL"
,
"RTMP_CONNECTING"
,
"RTMP_CONNECT_SUC"
,
"RTMP_CONNECT_FAIL"
,
"RTMP_CONNECT_CLOSED"
];
function
onMessage
(
evt
)
{
...
...
@@ -331,6 +335,9 @@ a:active {
else
if
(
55
==
result
){
//ds_start success
playRTMPStream
(
"rtmp://127.0.0.1:"
+
rtmp_port
+
"/live/ds"
);
}
else
if
(
59
==
result
){
//as start success
playRTMPStream
(
"rtmp://127.0.0.1:"
+
rtmp_port
+
"/live/as"
);
}
else
if
(
result
==
83
){
//get camera sucess
if
(
data_len
>
4
){
var
cam_num
=
dv
.
getUint32
(
8
,
true
);
...
...
@@ -402,11 +409,16 @@ a:active {
input
.
value
=
data_sting
;
writeToScreen
(
'<span style="color: blue;">get_rtmp_port result: '
+
data_sting
+
' </span>'
);
}
else
if
(
111
<=
result
&&
114
>=
result
){
var
data
=
new
Uint8Array
(
evt
.
target
.
result
,
8
,
evt
.
target
.
result
.
byteLength
-
8
);
var
url
=
utf8to16
(
data
);
writeToScreen
(
'<span style="color: blue;">url: '
+
url
+
' </span>'
);
}
else
{
var
data
=
new
Uint8Array
(
evt
.
target
.
result
,
8
,
evt
.
target
.
result
.
byteLength
-
8
);
//var data_sting = new TextDecoder("utf-8").decode(data);
var
data_sting
=
utf8to16
(
data
);
writeToScreen
(
'<span style="color: blue;">
RESPONSE
: '
+
data_sting
+
' </span>'
);
writeToScreen
(
'<span style="color: blue;">
url
: '
+
data_sting
+
' </span>'
);
}
}
}
...
...
@@ -702,6 +714,9 @@ function getExplorerTitle() {
var
default_ss_start_pos
=
"0,0,"
+
window
.
screen
.
width
+
","
+
window
.
screen
.
height
;
document
.
getElementById
(
'ds_start_coord'
).
value
=
default_ss_start_pos
;
//video=scr,doc,mov,non ; audio=mic,mov,non
document
.
getElementById
(
'start_push_input'
).
value
=
"0 video=scr audio=mic rtmp://127.0.0.1/live/1"
;
document
.
getElementById
(
'start_record_input'
).
value
=
"0 video=scr audio=mic"
;
}
function
onJavaScriptBridgeCreated
(
id
){
...
...
@@ -805,31 +820,13 @@ function getExplorerTitle() {
initialize
();
}
function
checkbox
(
type
)
{
if
(
type
==
"vod"
)
{
if
(
document
.
getElementById
(
'liveCheckbox'
).
checked
==
true
)
{
document
.
getElementById
(
'liveCheckbox'
).
checked
=
false
;
}
}
if
(
type
==
"live"
)
{
if
(
document
.
getElementById
(
'vodCheckbox'
).
checked
==
true
)
{
document
.
getElementById
(
'vodCheckbox'
).
checked
=
false
;
}
}
}
function
connectLiveServ
()
{
var
url
=
document
.
getElementById
(
'websocketURL'
).
value
;
if
(
wsState
==
"idle"
){
wsState
=
"connecting"
;
writeToScreen
(
"connecting "
+
url
);
wsState
=
"connecting"
;
writeToScreen
(
"connecting "
+
url
);
websocket
=
new
WebSocket
(
url
);
websocket
.
onopen
=
function
(
evt
)
{
onOpen
(
evt
)
};
websocket
.
onclose
=
function
(
evt
)
{
onClose
(
evt
)
};
...
...
请
注册
或
登录
后发表评论