Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
ZLMediaKit
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
张翔宇
ZLMediaKit
Commits
25b2208f
Unverified
Commit
25b2208f
authored
Jun 20, 2021
by
Xiaofeng Wang
Committed by
GitHub
Jun 20, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #921 from johzzy/johnny/dev
parents
e3708e74
89d8f005
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
33 行增加
和
33 行删除
+33
-33
webrtc/RtpExt.cpp
+1
-1
webrtc/readme.md
+1
-1
www/webrtc/ZLMRTCClient.js
+15
-15
www/webrtc/ZLMRTCClient.js.map
+0
-0
www/webrtc/index.html
+16
-16
没有找到文件。
webrtc/RtpExt.cpp
查看文件 @
25b2208f
...
...
@@ -390,7 +390,7 @@ string RtpExt::getSdesMid() const {
//https://tools.ietf.org/html/draft-ietf-avtext-rid-06
//用于simul
e
cast
//用于simulcast
//3.1. RTCP 'RtpStreamId' SDES Extension
//
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
...
...
webrtc/readme.md
查看文件 @
25b2208f
...
...
@@ -31,7 +31,7 @@ ZLMediaKit的WebRTC相关功能目前仅供测试与开发,现在还不成熟
-
1、完善webrtc rtcp相关功能,包括丢包重传、带宽检测等功能。
-
2、实现rtp重传等相关功能。
-
3、实现simul
e
cast相关功能。
-
3、实现simulcast相关功能。
-
4、fec、rtp扩展等其他功能。
-
5、如果精力允许,逐步替换MediaSoup相关代码,改用自有版权代码。
www/webrtc/ZLMRTCClient.js
查看文件 @
25b2208f
...
...
@@ -4,7 +4,7 @@ var ZLMRTCClient = (function (exports) {
const
Events$1
=
{
WEBRTC_NOT_SUPPORT
:
'WEBRTC_NOT_SUPPORT'
,
WEBRTC_ICE_CANDIDATE_ERROR
:
'WEBRTC_ICE_CANDIDATE_ERROR'
,
WEBRTC_OFFER_AN
WSER_EXCHANGE_FAILED
:
'WEBRTC_OFFER_ANWS
ER_EXCHANGE_FAILED'
,
WEBRTC_OFFER_AN
SWER_EXCHANGE_FAILED
:
'WEBRTC_OFFER_ANSW
ER_EXCHANGE_FAILED'
,
WEBRTC_ON_REMOTE_STREAMS
:
'WEBRTC_ON_REMOTE_STREAMS'
,
WEBRTC_ON_LOCAL_STREAM
:
'WEBRTC_ON_LOCAL_STREAM'
,
CAPTURE_STREAM_FAILED
:
'CAPTURE_STREAM_FAILED'
...
...
@@ -7285,7 +7285,7 @@ var ZLMRTCClient = (function (exports) {
debug
:
false
,
// if output debug log
zlmsdpUrl
:
''
,
simul
e
cast
:
false
,
simulcast
:
false
,
useCamera
:
true
,
audioEnable
:
true
,
videoEnable
:
true
,
...
...
@@ -7342,16 +7342,16 @@ var ZLMRTCClient = (function (exports) {
let
ret
=
response
.
data
;
//JSON.parse(response.data);
if
(
ret
.
code
!=
0
)
{
// mean failed for offer/an
ws
er exchange
this
.
dispatch
(
Events$1
.
WEBRTC_OFFER_AN
WS
ER_EXCHANGE_FAILED
,
ret
);
// mean failed for offer/an
sw
er exchange
this
.
dispatch
(
Events$1
.
WEBRTC_OFFER_AN
SW
ER_EXCHANGE_FAILED
,
ret
);
return
;
}
let
an
ws
er
=
{};
an
ws
er
.
sdp
=
ret
.
sdp
;
an
ws
er
.
type
=
'answer'
;
let
an
sw
er
=
{};
an
sw
er
.
sdp
=
ret
.
sdp
;
an
sw
er
.
type
=
'answer'
;
log
(
this
.
TAG
,
'answer:'
,
ret
.
sdp
);
this
.
pc
.
setRemoteDescription
(
an
ws
er
).
then
(()
=>
{
this
.
pc
.
setRemoteDescription
(
an
sw
er
).
then
(()
=>
{
log
(
this
.
TAG
,
'set remote sucess'
);
}).
catch
(
e
=>
{
error
(
this
.
TAG
,
e
);
...
...
@@ -7398,7 +7398,7 @@ var ZLMRTCClient = (function (exports) {
sendEncodings
:
[]
};
if
(
this
.
options
.
simul
e
cast
&&
stream
.
getVideoTracks
().
length
>
0
)
{
if
(
this
.
options
.
simulcast
&&
stream
.
getVideoTracks
().
length
>
0
)
{
VideoTransceiverInit
.
sendEncodings
=
[{
rid
:
'q'
,
active
:
true
,
...
...
@@ -7449,16 +7449,16 @@ var ZLMRTCClient = (function (exports) {
let
ret
=
response
.
data
;
//JSON.parse(response.data);
if
(
ret
.
code
!=
0
)
{
// mean failed for offer/an
ws
er exchange
this
.
dispatch
(
Events$1
.
WEBRTC_OFFER_AN
WS
ER_EXCHANGE_FAILED
,
ret
);
// mean failed for offer/an
sw
er exchange
this
.
dispatch
(
Events$1
.
WEBRTC_OFFER_AN
SW
ER_EXCHANGE_FAILED
,
ret
);
return
;
}
let
an
ws
er
=
{};
an
ws
er
.
sdp
=
ret
.
sdp
;
an
ws
er
.
type
=
'answer'
;
let
an
sw
er
=
{};
an
sw
er
.
sdp
=
ret
.
sdp
;
an
sw
er
.
type
=
'answer'
;
log
(
this
.
TAG
,
'answer:'
,
ret
.
sdp
);
this
.
pc
.
setRemoteDescription
(
an
ws
er
).
then
(()
=>
{
this
.
pc
.
setRemoteDescription
(
an
sw
er
).
then
(()
=>
{
log
(
this
.
TAG
,
'set remote sucess'
);
}).
catch
(
e
=>
{
error
(
this
.
TAG
,
e
);
...
...
www/webrtc/ZLMRTCClient.js.map
查看文件 @
25b2208f
This source diff could not be displayed because it is too large. You can
view the blob
instead.
www/webrtc/index.html
查看文件 @
25b2208f
...
...
@@ -26,8 +26,8 @@
</p>
<p>
<label
for=
"simul
ecast"
>
simule
cast:
</label>
<input
type=
"checkbox"
id=
'simul
e
cast'
checked=
"checked"
>
<label
for=
"simul
cast"
>
simul
cast:
</label>
<input
type=
"checkbox"
id=
'simulcast'
checked=
"checked"
>
</p>
<p>
<label
for=
"useCamera"
>
useCamera:
</label>
...
...
@@ -46,14 +46,14 @@
</p>
<p>
<label
for=
"metho
nd"
>
methon
d(play or push):
</label>
<input
type=
"radio"
name=
"metho
n
d"
value=
"push"
>
push
<input
type=
"radio"
name=
"metho
n
d"
value=
"play"
checked =
true
>
play
<label
for=
"metho
d"
>
metho
d(play or push):
</label>
<input
type=
"radio"
name=
"method"
value=
"push"
>
push
<input
type=
"radio"
name=
"method"
value=
"play"
checked =
true
>
play
</p>
<p>
<label
for=
"res
i
lution"
>
resolution:
</label>
<select
id=
"res
i
lution"
>
<label
for=
"res
o
lution"
>
resolution:
</label>
<select
id=
"res
o
lution"
>
</select>
</p>
...
...
@@ -69,7 +69,7 @@
var
recvOnly
=
true
var
resArr
=
[]
document
.
getElementsByName
(
"metho
n
d"
).
forEach
((
el
,
idx
)
=>
{
document
.
getElementsByName
(
"method"
).
forEach
((
el
,
idx
)
=>
{
el
.
onclick
=
function
(
e
){
if
(
el
.
value
==
"play"
)
{
...
...
@@ -91,14 +91,14 @@
opt
=
document
.
createElement
(
'option'
);
opt
.
text
=
r
.
label
+
"("
+
r
.
width
+
"x"
+
r
.
height
+
")"
;
opt
.
value
=
r
;
document
.
getElementById
(
"res
i
lution"
).
add
(
opt
,
null
)
document
.
getElementById
(
"res
o
lution"
).
add
(
opt
,
null
)
//console.log(opt.text.match(/\d+/g))
})
function
start_play
(){
let
elr
=
document
.
getElementById
(
"res
i
lution"
);
let
elr
=
document
.
getElementById
(
"res
o
lution"
);
let
res
=
elr
.
options
[
elr
.
selectedIndex
].
text
.
match
(
/
\d
+/g
);
let
h
=
parseInt
(
res
.
pop
());
let
w
=
parseInt
(
res
.
pop
());
...
...
@@ -108,7 +108,7 @@
element
:
document
.
getElementById
(
'video'
),
// video 标签
debug
:
true
,
// 是否打印日志
zlmsdpUrl
:
document
.
getElementById
(
'streamUrl'
).
value
,
//流地址
simul
ecast
:
false
,
//document.getElementById('simule
cast').checked,
simul
cast
:
false
,
//document.getElementById('simul
cast').checked,
useCamera
:
document
.
getElementById
(
'useCamera'
).
checked
,
audioEnable
:
document
.
getElementById
(
'audioEnable'
).
checked
,
videoEnable
:
document
.
getElementById
(
'videoEnable'
).
checked
,
...
...
@@ -127,9 +127,9 @@
console
.
log
(
'播放成功'
,
e
.
streams
)
});
player
.
on
(
ZLMRTCClient
.
Events
.
WEBRTC_OFFER_AN
WS
ER_EXCHANGE_FAILED
,
function
(
e
)
{
// offer an
ws
er 交换失败
console
.
log
(
'offer an
ws
er 交换失败'
,
e
)
player
.
on
(
ZLMRTCClient
.
Events
.
WEBRTC_OFFER_AN
SW
ER_EXCHANGE_FAILED
,
function
(
e
)
{
// offer an
sw
er 交换失败
console
.
log
(
'offer an
sw
er 交换失败'
,
e
)
stop
();
});
...
...
@@ -139,7 +139,7 @@
document
.
getElementById
(
'selfVideo'
).
srcObject
=
s
;
document
.
getElementById
(
'selfVideo'
).
muted
=
true
;
//console.log('offer an
ws
er 交换失败',e)
//console.log('offer an
sw
er 交换失败',e)
});
player
.
on
(
ZLMRTCClient
.
Events
.
CAPTURE_STREAM_FAILED
,
function
(
s
)
...
...
@@ -152,7 +152,7 @@
function
start
()
{
stop
();
let
elr
=
document
.
getElementById
(
"res
i
lution"
);
let
elr
=
document
.
getElementById
(
"res
o
lution"
);
let
res
=
elr
.
options
[
elr
.
selectedIndex
].
text
.
match
(
/
\d
+/g
);
let
h
=
parseInt
(
res
.
pop
());
let
w
=
parseInt
(
res
.
pop
());
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论