Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
98a0b499
提交
98a0b499
authored
5月 02, 2017
作者:
Anthony Minessale
提交者:
Mike Jerris
6月 01, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-10285: [verto.js] Device enumeration in Edge #resolve
上级
880b59e6
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
70 行增加
和
54 行删除
+70
-54
verto-min.js
html5/verto/demo/js/verto-min.js
+0
-0
jquery.FSRTC.js
html5/verto/js/src/jquery.FSRTC.js
+1
-0
jquery.verto.js
html5/verto/js/src/jquery.verto.js
+67
-54
verto-min.js
html5/verto/video_demo/js/verto-min.js
+0
-0
verto.js
html5/verto/video_demo/verto.js
+2
-0
没有找到文件。
html5/verto/demo/js/verto-min.js
浏览文件 @
98a0b499
This diff was suppressed by a .gitattributes entry.
html5/verto/js/src/jquery.FSRTC.js
浏览文件 @
98a0b499
...
...
@@ -1064,6 +1064,7 @@
video
:
check_video
,
},
onsuccess
:
function
(
e
)
{
e
.
getTracks
().
forEach
(
function
(
track
)
{
track
.
stop
();});
console
.
info
(
"media perm init complete"
);
...
...
html5/verto/js/src/jquery.verto.js
浏览文件 @
98a0b499
...
...
@@ -2665,70 +2665,83 @@
var
checkDevices
=
function
(
runtime
)
{
console
.
info
(
"enumerating devices"
);
var
aud_in
=
[],
aud_out
=
[],
vid
=
[];
var
has_video
=
0
,
has_audio
=
0
;
var
Xstream
;
function
gotDevices
(
deviceInfos
)
{
// Handles being called several times to update labels. Preserve values.
for
(
var
i
=
0
;
i
!==
deviceInfos
.
length
;
++
i
)
{
var
deviceInfo
=
deviceInfos
[
i
];
var
text
=
""
;
console
.
log
(
deviceInfo
);
console
.
log
(
deviceInfo
.
kind
+
": "
+
deviceInfo
.
label
+
" id = "
+
deviceInfo
.
deviceId
);
if
(
deviceInfo
.
kind
===
'audioinput'
)
{
text
=
deviceInfo
.
label
||
'microphone '
+
(
aud_in
.
length
+
1
);
aud_in
.
push
({
id
:
deviceInfo
.
deviceId
,
kind
:
"audio_in"
,
label
:
text
});
}
else
if
(
deviceInfo
.
kind
===
'audiooutput'
)
{
text
=
deviceInfo
.
label
||
'speaker '
+
(
aud_out
.
length
+
1
);
aud_out
.
push
({
id
:
deviceInfo
.
deviceId
,
kind
:
"audio_out"
,
label
:
text
});
}
else
if
(
deviceInfo
.
kind
===
'videoinput'
)
{
text
=
deviceInfo
.
label
||
'camera '
+
(
vid
.
length
+
1
);
vid
.
push
({
id
:
deviceInfo
.
deviceId
,
kind
:
"video"
,
label
:
text
});
}
else
{
console
.
log
(
'Some other kind of source/device: '
,
deviceInfo
);
}
}
if
((
!
navigator
.
mediaDevices
||
!
navigator
.
mediaDevices
.
enumerateDevices
)
&&
MediaStreamTrack
.
getSources
)
{
MediaStreamTrack
.
getSources
(
function
(
media_sources
)
{
for
(
var
i
=
0
;
i
<
media_sources
.
length
;
i
++
)
{
if
(
media_sources
[
i
].
kind
==
'video'
)
{
vid
.
push
(
media_sources
[
i
]);
}
else
{
aud_in
.
push
(
media_sources
[
i
]);
}
}
$
.
verto
.
videoDevices
=
vid
;
$
.
verto
.
audioInDevices
=
aud_in
;
console
.
info
(
"Audio Devices"
,
$
.
verto
.
audioInDevices
);
console
.
info
(
"Video Devices"
,
$
.
verto
.
videoDevices
);
runtime
(
true
);
});
}
else
{
/* of course it's a totally different API CALL with different element names for the same exact thing */
$
.
verto
.
videoDevices
=
vid
;
$
.
verto
.
audioInDevices
=
aud_in
;
$
.
verto
.
audioOutDevices
=
aud_out
;
if
(
!
navigator
.
mediaDevices
||
!
navigator
.
mediaDevices
.
enumerateDevices
)
{
console
.
log
(
"enumerateDevices() not supported."
);
return
;
console
.
info
(
"Audio IN Devices"
,
$
.
verto
.
audioInDevices
);
console
.
info
(
"Audio Out Devices"
,
$
.
verto
.
audioOutDevices
);
console
.
info
(
"Video Devices"
,
$
.
verto
.
videoDevices
);
if
(
Xstream
)
{
Xstream
.
getTracks
().
forEach
(
function
(
track
)
{
track
.
stop
();});
}
// List cameras and microphones.
if
(
runtime
)
{
runtime
(
true
);
}
}
navigator
.
mediaDevices
.
enumerateDevices
()
.
then
(
function
(
devices
)
{
devices
.
forEach
(
function
(
device
)
{
console
.
log
(
device
);
console
.
log
(
device
.
kind
+
": "
+
device
.
label
+
" id = "
+
device
.
deviceId
);
if
(
device
.
kind
===
"videoinput"
)
{
vid
.
push
({
id
:
device
.
deviceId
,
kind
:
"video"
,
label
:
device
.
label
});
}
else
if
(
device
.
kind
===
"audioinput"
)
{
aud_in
.
push
({
id
:
device
.
deviceId
,
kind
:
"audio_in"
,
label
:
device
.
label
});
}
else
if
(
device
.
kind
===
"audiooutput"
)
{
aud_out
.
push
({
id
:
device
.
deviceId
,
kind
:
"audio_out"
,
label
:
device
.
label
});
}
});
$
.
verto
.
videoDevices
=
vid
;
$
.
verto
.
audioInDevices
=
aud_in
;
$
.
verto
.
audioOutDevices
=
aud_out
;
console
.
info
(
"Audio IN Devices"
,
$
.
verto
.
audioInDevices
);
console
.
info
(
"Audio Out Devices"
,
$
.
verto
.
audioOutDevices
);
console
.
info
(
"Video Devices"
,
$
.
verto
.
videoDevices
);
runtime
(
true
);
})
.
catch
(
function
(
err
)
{
console
.
log
(
" Device Enumeration ERROR: "
+
err
.
name
+
": "
+
err
.
message
);
runtime
(
false
);
});
function
handleError
(
error
)
{
console
.
log
(
'device enumeration error: '
,
error
);
if
(
runtime
)
runtime
(
false
);
}
};
function
checkTypes
(
devs
)
{
for
(
var
i
=
0
;
i
!==
devs
.
length
;
++
i
)
{
if
(
devs
[
i
].
kind
===
'audioinput'
)
{
has_audio
++
;
}
else
if
(
devs
[
i
].
kind
===
'videoinput'
)
{
has_video
++
;
}
}
navigator
.
getUserMedia
({
audio
:
(
has_audio
>
0
?
true
:
false
),
video
:
(
has_video
>
0
?
true
:
false
)},
function
(
stream
)
{
Xstream
=
stream
;
navigator
.
mediaDevices
.
enumerateDevices
().
then
(
gotDevices
).
catch
(
handleError
);
},
function
(
err
)
{
console
.
log
(
"The following error occurred: "
+
err
.
name
);
}
);
}
navigator
.
mediaDevices
.
enumerateDevices
().
then
(
checkTypes
).
catch
(
handleError
);
};
$
.
verto
.
refreshDevices
=
function
(
runtime
)
{
checkDevices
(
runtime
);
...
...
html5/verto/video_demo/js/verto-min.js
浏览文件 @
98a0b499
This diff was suppressed by a .gitattributes entry.
html5/verto/video_demo/verto.js
浏览文件 @
98a0b499
...
...
@@ -1003,6 +1003,8 @@ function pop_select(id, cname, dft, onchange) {
function
refresh_devices
()
{
$
.
verto
.
refreshDevices
();
$
(
"#useshare"
).
selectmenu
({});
$
(
"#useshare"
).
selectmenu
({});
$
(
"#usemic"
).
selectmenu
({});
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论