Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
ae05a19e
提交
ae05a19e
authored
11月 18, 2015
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-8401 refactor the sinkid function into verto lib
上级
fb8d4a2b
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
53 行增加
和
51 行删除
+53
-51
jquery.verto.js
html5/verto/js/src/jquery.verto.js
+49
-4
attachSinkId.js
html5/verto/verto_communicator/js/3rd-party/attachSinkId.js
+0
-18
index.html
html5/verto/verto_communicator/src/index.html
+0
-1
MainController.js
...icator/src/vertoControllers/controllers/MainController.js
+4
-1
verto-min.js
html5/verto/video_demo/js/verto-min.js
+0
-0
verto.js
html5/verto/video_demo/verto.js
+0
-27
没有找到文件。
html5/verto/js/src/jquery.verto.js
浏览文件 @
ae05a19e
...
...
@@ -2043,6 +2043,53 @@
return
false
;
}
// Attach audio output device to video element using device/sink ID.
function
find_name
(
id
)
{
for
(
var
i
in
$
.
verto
.
audioOutDevices
)
{
var
source
=
$
.
verto
.
audioOutDevices
[
i
];
if
(
source
.
id
===
id
)
{
return
(
source
.
label
);
}
}
return
id
;
}
$
.
verto
.
dialog
.
prototype
.
setAudioPlaybackDevice
=
function
(
sinkId
,
callback
,
arg
)
{
var
dialog
=
this
;
var
element
=
dialog
.
audioStream
;
if
(
typeof
element
.
sinkId
!==
'undefined'
)
{
var
devname
=
find_name
(
sinkId
);
console
.
info
(
"Dialog: "
+
dialog
.
callID
+
" Setting speaker:"
,
element
,
devname
);
element
.
setSinkId
(
sinkId
)
.
then
(
function
()
{
console
.
log
(
"Dialog: "
+
dialog
.
callID
+
' Success, audio output device attached: '
+
sinkId
);
if
(
callback
)
{
callback
(
true
,
devname
,
arg
);
}
})
.
catch
(
function
(
error
)
{
var
errorMessage
=
error
;
if
(
error
.
name
===
'SecurityError'
)
{
errorMessage
=
"Dialog: "
+
dialog
.
callID
+
' You need to use HTTPS for selecting audio output '
+
'device: '
+
error
;
}
if
(
callback
)
{
callback
(
false
,
null
,
arg
);
}
console
.
error
(
errorMessage
);
});
}
else
{
console
.
warn
(
"Dialog: "
+
dialog
.
callID
+
' Browser does not support output device selection.'
);
if
(
callback
)
{
callback
(
false
,
null
,
arg
);
}
}
}
$
.
verto
.
dialog
.
prototype
.
setState
=
function
(
state
)
{
var
dialog
=
this
;
...
...
@@ -2082,11 +2129,9 @@
console
.
info
(
"Using Speaker: "
,
speaker
);
if
(
speaker
&&
speaker
!==
"any"
)
{
var
videoElement
=
dialog
.
audioStream
;
setTimeout
(
function
()
{
console
.
info
(
"Setting speaker:"
,
videoElement
,
speaker
);
attachSinkId
(
videoElement
,
speaker
);
},
500
);
dialog
.
setAudioPlaybackDevice
(
speaker
);
},
500
);
}
break
;
...
...
html5/verto/verto_communicator/js/3rd-party/attachSinkId.js
deleted
100644 → 0
浏览文件 @
fb8d4a2b
function
attachSinkId
(
element
,
sinkId
)
{
if
(
typeof
element
.
sinkId
!==
'undefined'
)
{
element
.
setSinkId
(
sinkId
)
.
then
(
function
()
{
console
.
log
(
'Success, audio output device attached:'
,
sinkId
);
})
.
catch
(
function
(
error
)
{
var
errorMessage
=
error
;
if
(
error
.
name
===
'SecurityError'
)
{
errorMessage
=
'You need to use HTTPS for selecting audio output '
+
'device: '
+
error
;
}
console
.
error
(
errorMessage
);
});
}
else
{
console
.
warn
(
'Browser does not support output device selection.'
);
}
}
html5/verto/verto_communicator/src/index.html
浏览文件 @
ae05a19e
...
...
@@ -96,7 +96,6 @@
<script
type=
"text/javascript"
src=
"js/3rd-party/getScreenId.js"
></script>
<script
type=
"text/javascript"
src=
"js/3rd-party/md5.min.js"
></script>
<script
type=
"text/javascript"
src=
"js/3rd-party/volume-meter.js"
></script>
<script
type=
"text/javascript"
src=
"js/3rd-party/attachSinkId.js"
></script>
<script
type=
"text/javascript"
src=
"src/vertoApp/vertoApp.module.js"
></script>
...
...
html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js
浏览文件 @
ae05a19e
...
...
@@ -36,7 +36,10 @@
});
$rootScope
.
$on
(
'changedSpeaker'
,
function
(
event
,
speakerId
)
{
attachSinkId
(
myVideo
,
speakerId
);
// This should provide feedback
//setAudioPlaybackDevice(<id>[,<callback>[,<callback arg>]]);
// if callback is set it will be called as callback(<bool success/fail>, <device name>, <arg if you supplied it>)
verto
.
data
.
call
.
setAudioPlaybackDevice
(
speakerId
);
});
/**
...
...
html5/verto/video_demo/js/verto-min.js
浏览文件 @
ae05a19e
This diff was suppressed by a .gitattributes entry.
html5/verto/video_demo/verto.js
浏览文件 @
ae05a19e
...
...
@@ -234,33 +234,6 @@ function do_speed_test(fn)
});
}
// Attach audio output device to video element using device/sink ID.
function
attachSinkId
(
element
,
sinkId
)
{
if
(
typeof
element
.
sinkId
!==
'undefined'
)
{
element
.
setSinkId
(
sinkId
)
.
then
(
function
()
{
console
.
log
(
'Success, audio output device attached: '
+
sinkId
);
})
.
catch
(
function
(
error
)
{
var
errorMessage
=
error
;
if
(
error
.
name
===
'SecurityError'
)
{
errorMessage
=
'You need to use HTTPS for selecting audio output '
+
'device: '
+
error
;
}
console
.
error
(
errorMessage
);
// Jump back to first output device in the list as it's the default.
//audioOutputSelect.selectedIndex = 0;
});
}
else
{
console
.
warn
(
'Browser does not support output device selection.'
);
}
}
function
messageTextToJQ
(
body
)
{
// Builds a jQuery collection from body text, linkifies http/https links, imageifies http/https links to images, and doesn't allow script injection
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论