Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
张桐
/
xdykt-build
转到一个项目
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-03-02 20:09:25 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f85c896a3abccc3ae27cfc8b86d5ac77c3fc9049
f85c896a
1 parent
9ec1399e
0302 同时开关视频OK
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
220 行增加
和
98 行删除
index.html
js/McuClient.js
src/main.js
src/videoWithFlash.js
index.html
查看文件 @
f85c896
...
...
@@ -16,8 +16,8 @@
<script
type=
"text/javascript"
src=
"js/xdyEvent.js"
></script>
<script
type=
"text/javascript"
src=
"js/drag.js"
></script>
<!--<script type="text/javascript" src="js/McuClient.js?v=1.0.228.14"></script>-->
<script
type=
"text/javascript"
src=
"http://192.168.1.140/McuClient/McuClient.js?7213236"
></script>
<script
type=
"text/javascript"
src=
"js/McuClient.js?v=1.0.0302.19"
></script>
<!--<script type="text/javascript" src="http://192.168.1.140/McuClient/McuClient.js?722990836"></script>-->
<script
type=
"text/javascript"
src=
"js/jquery-1.11.3.min.js"
></script>
<script
type=
"text/javascript"
src=
"src/main.js"
></script>
...
...
@@ -590,7 +590,7 @@
<div
class=
"fourParamsOut"
>
<ul
class=
"fourParams clear"
>
<li><span>
classId:
</span><input
class=
"classId"
type=
"text"
value=
"1
154006572
"
></li>
<li><span>
classId:
</span><input
class=
"classId"
type=
"text"
value=
"1
215295269
"
></li>
<!--<li><span>userRole:</span><input class="userRole" type="text" value=""></li>-->
<!--<li><span>portal:</span><input class="portal" type="text" value=""></li>-->
<li><span>
userId:
</span><input
class=
"userId"
type=
"text"
value=
""
></li>
...
...
js/McuClient.js
查看文件 @
f85c896
此 diff 太大无法显示。
src/main.js
查看文件 @
f85c896
...
...
@@ -374,12 +374,21 @@ function showInter(_data,isPage){
$
(
"#totalPageNum"
).
html
(
pageNum
);
console
.
log
(
"curPageNum"
,
curPageNum
);
for
(
var
i
=
0
;
i
<
docfullPath
.
length
;
i
++
){
var
docfullSingle
=
docfullPath
[
curPageNum
-
1
];
var
docfullSingle
=
docfullPath
[
curPageNum
-
1
];
if
(
docfullSingle
){
$
(
"#docImage"
).
attr
(
"src"
,
docfullSingle
);
}
else
{
}
/* for (var i=0;i<docfullPath.length;i++){
var docfullSingle=docfullPath[curPageNum-1];
$("#docImage").attr("src",docfullSingle);
}*/
...
...
@@ -925,11 +934,10 @@ function layoutView( ) {
if
(
curPageNum
!==
pageNum
){
console
.
log
(
curPageNum
);
for
(
var
i
=
0
;
i
<
docfullPath
.
length
;
i
++
){
var
docfullSingle
=
docfullPath
[
curPageNum
-
1
];
console
.
log
(
"curPageNum,docfullSingle"
,
curPageNum
,
docfullSingle
);
$
(
"#docImage"
).
attr
(
"src"
,
docfullSingle
);
}
// curPageNum++;
}
...
...
@@ -941,11 +949,11 @@ function layoutView( ) {
$
(
".spinner1"
).
css
(
"display"
,
"block"
);
if
(
curPageNum
>
1
){
console
.
log
(
"curPageNum"
,
curPageNum
);
for
(
var
i
=
0
;
i
<
docfullPath
.
length
;
i
++
){
var
docfullSingle
=
docfullPath
[
curPageNum
-
1
];
console
.
log
(
"curPageNum,docfullSingle"
,
curPageNum
,
docfullSingle
);
$
(
"#docImage"
).
attr
(
"src"
,
docfullSingle
);
}
}
console
.
log
(
curPageNum
);
var
paramInfo
=
{
...
...
src/videoWithFlash.js
查看文件 @
f85c896
...
...
@@ -14,7 +14,9 @@ var videoWithFlash={};
var
pushTeaResult
;
//推老师音视频结果
var
pushTeaAudioResult
;
//推老师音频结果
var
pubStuResult
;
//推学生音视频结果
var
pubStuAudioResult
;
//推学生音频结果
window
.
videoWithFlash
=
videoWithFlash
;
...
...
@@ -40,11 +42,13 @@ $(function () {
//学生视频按钮点击
$
(
"#stuVideo-video"
).
click
(
function
(
e
)
{
console
.
log
(
"stuVideo-video点击"
);
$
(
".stuVideoBg"
).
css
(
"display"
,
"none"
);
$
(
".stuVideo-videoBg"
).
css
(
"display"
,
"block"
);
$
(
".stuVideo-video"
).
css
(
"display"
,
"none"
);
$
(
".studentVideo"
).
css
(
"background"
,
"#CCCCCC"
);
$
(
".stuVideo-voice"
).
css
(
"bottom"
,
"4px"
);
if
(
classAllInfo
.
userRole
==
"host"
){
$
(
".stuVideoBg"
).
css
(
"display"
,
"none"
);
$
(
".stuVideo-videoBg"
).
css
(
"display"
,
"block"
);
$
(
".stuVideo-video"
).
css
(
"display"
,
"none"
);
$
(
".stuVideo-voice"
).
css
(
"bottom"
,
"4px"
);
}
var
paramInfo
=
{
"actionType"
:
1
,
...
...
@@ -69,6 +73,10 @@ $(function () {
"data"
:
"0"
};
client
.
sendVideoBroadcastMsg
(
paramInfo
);
$
(
"#stuVideo-video"
).
css
(
"display"
,
"block"
);
$
(
"#stuVideo-videoBg"
).
css
(
"display"
,
"none"
);
...
...
@@ -79,14 +87,19 @@ $(function () {
$
(
"#stuVideo-voice"
).
click
(
function
(
e
)
{
console
.
log
(
"stuVideo-voice点击"
);
if
(
classAllInfo
.
userRole
==
"host"
){
$
(
".stuVideoBg"
).
css
(
"display"
,
"none"
);
$
(
".stuVideo-voiceBg"
).
css
(
"display"
,
"block"
);
$
(
".stuVideo-voice"
).
css
(
"display"
,
"none"
);
}
var
stuVideoDisplay
=
$
(
".stuVideo-videoBg"
).
css
(
"display"
);
if
(
stuVideoDisplay
==
"block"
){
$
(
"#stuVideo-videoBg"
).
trigger
(
"click"
);
}
$
(
"#stuVideo-voice"
).
css
(
"display"
,
"none"
);
$
(
"#stuVideo-voiceBg"
).
css
(
"display"
,
"block"
);
$
(
".stuPublish"
).
css
(
"display"
,
"none"
);
$
(
".studentVideoBg"
).
css
(
"display"
,
"none"
);
var
paramInfo
=
{
"actionType"
:
1
,
...
...
@@ -98,12 +111,14 @@ $(function () {
if
(
classAllInfo
.
userRole
==
"normal"
){
$
(
".stuVideo-voice"
).
css
(
"display"
,
"none"
);
$
(
".stuVideo-video"
).
css
(
"display"
,
"none"
);
$
(
"#stuVideo-voice"
).
css
(
"display"
,
"none"
);
$
(
"#stuVideo-voiceBg"
).
css
(
"display"
,
"block"
);
$
(
".stuPublish"
).
css
({
"width"
:
"240px"
,
"height"
:
"180px"
});
$
(
".studentVideoBg"
).
css
(
"display"
,
"none"
);
}
});
//学生音频关闭按钮点击
$
(
"#stuVideo-voiceBg"
).
click
(
function
(
e
){
var
paramInfo
=
{
...
...
@@ -139,13 +154,13 @@ $(function () {
$
(
".teacherVideo"
).
css
(
"background"
,
"#CCCCCC"
);
$
(
".teacherVideo-voice"
).
css
(
"bottom"
,
"4px"
);
$
(
".teacherVoicing"
).
css
(
"display"
,
"none"
);
}
//获取推流地址
achieveTeaVideoStream
();
});
//老师视频关闭按钮点击
$
(
"#teacherVideo-videoBg"
).
click
(
function
(
e
)
{
if
(
window
.
publishflash
)
{
...
...
@@ -177,7 +192,6 @@ $(function () {
});
//老师音频按钮点击
$
(
"#teacherVideo-voice"
).
click
(
function
(
e
)
{
console
.
log
(
"teacherVideo-voice点击"
);
...
...
@@ -198,7 +212,6 @@ $(function () {
achieveTeaAudioStream
();
});
//老师音频关闭按钮点击
$
(
"#teacherVideo-voiceBg"
).
click
(
function
(
e
)
{
...
...
@@ -229,35 +242,53 @@ $(function () {
});
//监听学生视频更新
function
stuBroadcast
(
callbackDate
){
if
(
callbackDate
.
fromNodeId
===
classAllInfo
.
nodeId
)
return
;
if
(
callbackDate
.
actionType
==
1
){
$
(
".stuVideoBg"
).
css
(
"display"
,
"none"
);
if
(
classAllInfo
.
userRole
==
"normal"
){
$
(
".stuPublish"
).
css
({
"width"
:
"240px"
,
"height"
:
"180px"
});
$
(
".stuPlay"
).
css
({
"width"
:
"1px"
,
"height"
:
"1px"
});
$
(
".stuVideoBg"
).
css
(
"display"
,
"none"
);
//获取推流地址
achieveStuPushStream
();
}
if
(
classAllInfo
.
userRole
==
"host"
){
$
(
".stuVideoBg"
).
css
(
"display"
,
"none"
);
}
}
if
(
callbackDate
.
actionType
==
2
){
else
if
(
callbackDate
.
actionType
==
2
){
if
(
classAllInfo
.
userRole
==
"normal"
){
var
paramInfo
=
{
"nodeId"
:
Number
(
classAllInfo
.
nodeId
)
//用户的nodeId
};
console
.
log
(
"stopPublishVideo==========>"
,
paramInfo
);
client
.
stopPublishVideo
(
paramInfo
);
$
(
".stuPublish"
).
css
({
"width"
:
"1px"
,
"height"
:
"1px"
});
$
(
".stuPlay"
).
css
({
"width"
:
"1px"
,
"height"
:
"1px"
});
$
(
".stuVideo-video"
).
css
(
"display"
,
"none"
);
$
(
".stuVideoBg"
).
css
(
"display"
,
"block"
);
}
else
if
(
classAllInfo
.
userRole
==
"host"
){
// $(".stuPublish").css({"width":"1px","height":"1px"});
// $(".stuPlay").css({"width":"1px","height":"1px"});
// $(".studentVideo").css("background", "#f5f9fb");
// $("#stuVideo-voice").css("display","block");
// $("#stuVideo-voiceBg").css("display","none");
// $(".stuVideoBg").css("display","block");
}
if
(
window
.
publishStuflash
)
{
const
stopStuInfo
=
JSON
.
stringify
({
type
:
5
,
videoId
:
publishflashStuVideoId
,
});
console
.
log
(
publishStuflash
.
_js2native
(
stopStuInfo
));
}
var
paramInfo
=
{
"nodeId"
:
Number
(
stuNodeId
)
//用户的nodeId
};
client
.
stopPublishVideo
(
paramInfo
);
$
(
".stuPlay"
).
css
(
"display"
,
"none"
);
$
(
".stuPublish"
).
css
(
"display"
,
"none"
);
$
(
".studentVideo"
).
css
(
"background"
,
"#f5f9fb"
);
$
(
".stuVideoBg"
).
css
(
"display"
,
"block"
);
$
(
"#stuVideo-voice"
).
css
(
"display"
,
"block"
);
$
(
"#stuVideo-voiceBg"
).
css
(
"display"
,
"none"
);
if
(
classAllInfo
.
userRole
==
"normal"
){
$
(
".stuVideo-video"
).
css
(
"display"
,
"none"
);
console
.
log
(
publishStuflash
.
_js2native
(
stopStuInfo
));
}
}
...
...
@@ -267,9 +298,10 @@ function stuBroadcast(callbackDate){
//监听学生音频更新
function
stuAudioBroadcast
(
callbackDate
){
if
(
callbackDate
.
fromNodeId
===
classAllInfo
.
nodeId
)
return
;
if
(
callbackDate
.
actionType
==
1
){
$
(
".stuVideoBg"
).
css
(
"display"
,
"none"
);
$
(
".stuPlay"
).
css
(
"display"
,
"none"
);
$
(
".stuPlay"
).
css
(
{
"width"
:
"1px"
,
"height"
:
"1px"
}
);
if
(
classAllInfo
.
userRole
==
"normal"
){
//获取学生只推音频地址
achieveStuVoice
();
...
...
@@ -289,8 +321,8 @@ function stuAudioBroadcast(callbackDate){
};
client
.
stopPublishAudio
(
paramInfo
);
$
(
".stuPlay"
).
css
(
"display"
,
"none"
);
$
(
".stuPublish"
).
css
(
"display"
,
"none"
);
$
(
".stuPlay"
).
css
({
"width"
:
"1px"
,
"height"
:
"1px"
});
$
(
".stuPublish"
).
css
({
"width"
:
"1px"
,
"height"
:
"1px"
});
$
(
".studentVideo"
).
css
(
"background"
,
"#f5f9fb"
);
$
(
".stuVideoBg"
).
css
(
"display"
,
"block"
);
$
(
"#stuVideo-video"
).
css
(
"display"
,
"block"
);
...
...
@@ -299,6 +331,7 @@ function stuAudioBroadcast(callbackDate){
if
(
classAllInfo
.
userRole
==
"normal"
){
$
(
".stuVideo-voice"
).
css
(
"display"
,
"none"
);
$
(
".stuVideo-video"
).
css
(
"display"
,
"none"
);
$
(
".stuPublish"
).
css
({
"width"
:
"240px"
,
"height"
:
"180px"
});
}
}
}
...
...
@@ -320,75 +353,84 @@ function userListUpdate(callbackData) {
// 监听当前是否有视频流更新
function
_videoUpdate
(
callbackDate
){
console
.
log
(
"videoUpdate==============>"
,
callbackDate
);
if
(
callbackDate
.
fromNodeId
==
classAllInfo
.
nodeId
)
return
;
// alert((classAllInfo.userRole=="host")&&(callbackDate.status==1)&&(callbackDate.fromNodeId==stuNodeId));
if
((
classAllInfo
.
userRole
==
"host"
)
&&
(
callbackDate
.
status
==
1
)
&&
(
callbackDate
.
fromNodeId
==
stuNodeId
)){
//获取学生播流地址
achieveStuPlayStream
(
callbackDate
);
$
(
".teacherVideo"
).
css
(
"background"
,
"#f5f9fb"
);
$
(
".teacherVideoBg"
).
css
(
"display"
,
"block"
);
}
if
((
classAllInfo
.
userRole
==
"normal"
)
&&
(
callbackDate
.
status
==
1
)
&&
(
callbackDate
.
fromNodeId
==
stuNodeId
)){
if
((
classAllInfo
.
userRole
==
"normal"
)
&&
(
callbackDate
.
status
==
1
)
&&
(
callbackDate
.
channelId
!==
''
)
&&
(
callbackDate
.
fromNodeId
==
stuNodeId
)){
//获取老师播流地址
achievePlayStream
(
callbackDate
);
}
//流的状态为0
if
((
classAllInfo
.
userRole
==
"host"
)
&&
(
callbackDate
.
status
==
0
)
&&
(
callbackDate
.
fromNodeId
==
stuNodeId
)){
//学生的流关闭
if
(
window
.
playflashStu
)
{
const
stopStuInfo
=
JSON
.
stringify
({
type
:
5
,
videoId
:
playflashStuVideoId
,
});
console
.
log
(
playflashStu
.
_js2native
(
stopStuInfo
));
}
$
(
".stuPublish"
).
css
({
"width"
:
"1px"
,
"height"
:
"1px"
});
$
(
".stuPlay"
).
css
({
"width"
:
"1px"
,
"height"
:
"1px"
});
$
(
".studentVideo"
).
css
(
"background"
,
"#f5f9fb"
);
$
(
"#stuVideo-voice"
).
css
(
"display"
,
"block"
);
$
(
"#stuVideo-voiceBg"
).
css
(
"display"
,
"none"
);
$
(
".stuVideoBg"
).
css
(
"display"
,
"block"
);
}
if
((
classAllInfo
.
userRole
==
"normal"
)
&&
(
callbackDate
.
status
==
0
)
&&
(
callbackDate
.
fromNodeId
==
stuNodeId
)){
//老师的流关闭
if
(
window
.
playflash
){
const
stopPlayInfo
=
JSON
.
stringify
({
type
:
5
,
videoId
:
playflashVideoId
});
console
.
log
(
playflash
.
_js2native
(
stopPlayInfo
));
}
$
(
".play"
).
css
({
"width"
:
"1px"
,
"height"
:
"1px"
});
$
(
".stuVideo-voice"
).
css
(
"display"
,
"none"
);
$
(
".teacherVideoBg"
).
css
(
"display"
,
"block"
);
$
(
".teacherVideo"
).
css
(
"background"
,
"#f5f9fb"
);
if
(
callbackDate
.
status
==
0
){
console
.
log
(
"callbackDate.fromNodeId,stuNodeId"
);
console
.
log
(
callbackDate
.
fromNodeId
,
stuNodeId
);
if
(
callbackDate
.
fromNodeId
==
stuNodeId
){
if
(
classAllInfo
.
userRole
==
"normal"
){
$
(
".play"
).
css
({
"width"
:
"1px"
,
"height"
:
"1px"
});
}
// $(".play").css("display","none");
$
(
".teacherVideoBg"
).
css
(
"display"
,
"block"
);
$
(
".teacherVideo"
).
css
(
"background"
,
"#f5f9fb"
);
if
(
window
.
playflash
){
console
.
log
(
"playflashVideoId"
,
playflashVideoId
);
const
stopPlayInfo
=
JSON
.
stringify
({
type
:
5
,
videoId
:
playflashVideoId
});
console
.
log
(
playflash
.
_js2native
(
stopPlayInfo
));
}
}
}
}
// 监听当前是否有音频流更新
function
_audioUpdate
(
callbackDate
){
if
(
callbackDate
.
fromNodeId
==
classAllInfo
.
nodeId
)
return
;
if
((
classAllInfo
.
userRole
==
"host"
)
&&
(
callbackDate
.
status
==
1
)
&&
(
callbackDate
.
fromNodeId
==
stuNodeId
)){
//获取学生播流地址
achieveStuPlayStream
(
callbackDate
);
$
(
".stuPlay"
).
css
(
"display"
,
"block"
);
//获取学生播放音频地址
achieveStuPlayAudioStream
(
callbackDate
);
$
(
".stuPlay"
).
css
({
"width"
:
"240px"
,
"height"
:
"180px"
});
$
(
".teacherVideo"
).
css
(
"background"
,
"#f5f9fb"
);
$
(
".teacherVideoBg"
).
css
(
"display"
,
"block"
);
}
if
((
classAllInfo
.
userRole
==
"normal"
)
&&
(
callbackDate
.
status
==
1
)
&&
(
callbackDate
.
channelId
!==
''
)
&&
(
callbackDate
.
fromNodeId
==
stuNodeId
)){
if
((
classAllInfo
.
userRole
==
"normal"
)
&&
(
callbackDate
.
status
==
1
)
&&
(
callbackDate
.
fromNodeId
==
stuNodeId
)){
achievePlayAudioStream
(
callbackDate
);
}
if
(
callbackDate
.
status
==
0
){
$
(
".teacherVideoBg"
).
css
(
"display"
,
"block"
);
$
(
".teacherVideo"
).
css
(
"background"
,
"#f5f9fb"
);
if
(
window
.
playflashAudio
)
{
console
.
log
(
"playflashVoiceId"
,
playflashAudioId
);
...
...
@@ -404,20 +446,30 @@ function _audioUpdate(callbackDate){
console
.
log
(
playflashAudio
.
_js2native
(
stopPlayInfo
));
}
}
if
(
window
.
playflashStuAudio
)
{
const
stopStuInfo
=
JSON
.
stringify
({
type
:
5
,
videoId
:
playflashStuAudioId
,
});
console
.
log
(
playflashStuAudio
.
_js2native
(
stopStuInfo
));
}
}
}
// //获取学生推流地址
// //获取学生推
音视频
流地址
function
achieveStuPushStream
()
{
$
(
".stuPublish"
).
css
(
"display"
,
"block"
);
$
(
".stuPlay"
).
css
(
"display"
,
"none"
);
var
paramInfo
=
{
"type"
:
"flash"
};
var
pubStuResult
=
client
.
getVideoPublishPath
(
paramInfo
);
pubStuResult
=
client
.
getVideoPublishPath
(
paramInfo
);
console
.
log
(
"执行getPublishVideoPath,返回的结果"
,
pubStuResult
);
...
...
@@ -432,6 +484,7 @@ function achieveStuPushStream() {
if
(
error
)
{
return
console
.
error
(
error
);
}
window
.
publishStuflash
=
publishflash
;
window
.
publishflashStuVideoId
=
teaTimeStamp
();
...
...
@@ -442,7 +495,7 @@ function achieveStuPushStream() {
console
.
log
(
' [stuPublish] native 2 js'
,
msg
);
var
_msg
=
JSON
.
parse
(
msg
);
console
.
log
(
"_msg===========>"
,
_msg
);
if
(
_msg
.
data
.
result
==
0
){
if
(
(
_msg
.
data
.
result
==
0
)
&&
(
_msg
.
data
.
type
==
10
)
){
//将之前底层取的推流结果传递给底层
var
_successErrorResult
=
client
.
publishVideo
(
pubStuResult
);
console
.
log
(
"_successErrorResult======>"
,
_successErrorResult
)
...
...
@@ -453,7 +506,13 @@ function achieveStuPushStream() {
console
.
log
(
"底层广播推流失败,关闭推流"
);
}
}
else
{
}
else
if
((
_msg
.
data
.
result
==
0
)
&&
(
_msg
.
data
.
type
==
5
)){
console
.
log
(
"5,flash把学生视频流关闭成功"
);
}
else
{
console
.
error
(
'stuPublish error'
);
}
}
...
...
@@ -495,10 +554,9 @@ function achieveStuPlayStream(_pubResultObj) {
};
var
streamInfo
=
client
.
getVideoPlayPath
(
_paramInfo
);
console
.
log
(
"result是=============>"
,
streamInfo
);
// $(".play").css("display","block");
$
(
".teacherVideoBg"
).
css
(
"display"
,
"none"
);
$
(
".teacherVideo"
).
css
(
"background"
,
"#CCCCCC"
);
$
(
".teacherVideo-voice"
).
css
(
"bottom"
,
"4px"
);
$
(
".stuPlay"
).
css
({
"width"
:
"240px"
,
"height"
:
"180px"
});
$
(
".teacherVideo"
).
css
(
"background"
,
"#f5f9fb"
);
// $(".teacherVideoBg").css("display","block");
if
(
!
window
.
playflashStu
)
{
flashvideo
(
...
...
@@ -516,6 +574,9 @@ function achieveStuPlayStream(_pubResultObj) {
},
function
(
msg
)
{
console
.
log
(
' [play] native 2 js'
,
msg
);
if
((
msg
.
data
.
result
==
0
)
&&
(
msg
.
data
.
type
==
5
)){
console
.
log
(
"5,flash把学生视频播放流关闭成功"
);
}
}
)
}
...
...
@@ -544,11 +605,11 @@ function achieveStuVoice() {
var
paramInfo
=
{
"type"
:
"flash"
};
var
pubResult
=
client
.
getAudioPublishPath
(
paramInfo
);
console
.
log
(
"执行getAudioPublishPath,返回的结果"
,
pubResult
);
pubStuAudioResult
=
client
.
getAudioPublishPath
(
paramInfo
);
console
.
log
(
"执行getAudioPublishPath,返回的结果"
,
pubStuAudioResult
);
//code为0,代表成功
if
(
pubResult
.
code
==
0
){
if
(
pub
StuAudio
Result
.
code
==
0
){
if
(
!
window
.
publishflashStuVoice
)
{
flashvideo
(
'stuPublish'
,
...
...
@@ -561,7 +622,7 @@ function achieveStuVoice() {
window
.
publishflashStuVoice
=
publishflash
;
window
.
publishflashStuVoiceId
=
teaTimeStamp
();
publishStuVoiceURL
(
pubResult
.
publishUrl
);
publishStuVoiceURL
(
pub
StuAudio
Result
.
publishUrl
);
},
function
(
msg
)
{
...
...
@@ -571,7 +632,7 @@ function achieveStuVoice() {
if
(
_msg
.
data
.
result
==
0
){
//将之前底层取的推流结果传递给底层
var
_successErrorResult
=
client
.
publishAudio
(
pubResult
);
var
_successErrorResult
=
client
.
publishAudio
(
pub
StuAudio
Result
);
console
.
log
(
"_successErrorResult======>"
,
_successErrorResult
)
if
(
_successErrorResult
.
code
==
0
){
console
.
log
(
"底层广播推流成功"
);
...
...
@@ -588,10 +649,10 @@ function achieveStuVoice() {
}
else
{
publishStuVoiceURL
(
pubResult
.
publishUrl
);
publishStuVoiceURL
(
pub
StuAudio
Result
.
publishUrl
);
}
}
else
if
(
pubResult
.
code
==
1
){
}
else
if
(
pub
StuAudio
Result
.
code
==
1
){
}
...
...
@@ -609,6 +670,62 @@ function publishStuVoiceURL(rtmpURL) {
console
.
log
(
publishflashStuVoice
.
_js2native
(
msg
));
}
//获取学生播音频地址
function
achieveStuPlayAudioStream
(
_pubResultObj
){
console
.
log
(
"_pubResultObj==========>"
,
_pubResultObj
)
var
_paramInfo
=
{
"type"
:
"rtmp"
,
"channelId"
:
_pubResultObj
.
channelId
,
//频道号
"classId"
:
_pubResultObj
.
classId
,
//课堂号
"siteId"
:
_pubResultObj
.
siteId
,
//站点号
"timestamp"
:
_pubResultObj
.
timestamp
,
//时间戳
"userId"
:
_pubResultObj
.
userId
,
//userId
};
var
streamInfo
=
client
.
getAudioPlayPath
(
_paramInfo
);
console
.
log
(
"result是=============>"
,
streamInfo
);
$
(
".stuPlay"
).
css
({
"width"
:
"240px"
,
"height"
:
"180px"
});
$
(
".teacherVideoBg"
).
css
(
"display"
,
"none"
);
$
(
".teacherVideo"
).
css
(
"background"
,
"#CCCCCC"
);
$
(
".teacherVideo-voice"
).
css
(
"bottom"
,
"4px"
);
if
(
!
window
.
playflashStuAudio
)
{
flashvideo
(
'stuPlay'
,
'100%'
,
'100%'
,
function
createPlayReady
(
error
,
playflash
)
{
if
(
error
)
{
return
console
.
error
(
error
);
}
window
.
playflashStuAudio
=
playflash
;
window
.
playflashStuAudioId
=
teaTimeStamp
();
stuPlayAudioURL
(
streamInfo
.
playUrl
);
},
function
(
msg
)
{
console
.
log
(
' [play] native 2 js'
,
msg
);
}
)
}
else
{
stuPlayAudioURL
(
streamInfo
.
playUrl
);
}
}
function
stuPlayAudioURL
(
rtmpURL
){
const
msg
=
JSON
.
stringify
({
type
:
2
,
videoId
:
playflashStuAudioId
,
data
:
{
url
:
rtmpURL
// url:'rtmp://123.56.205.116:1935/live/alexwang'
}
});
console
.
log
(
playflashStuAudio
.
_js2native
(
msg
));
}
//获取老师只推音频
...
...
@@ -682,12 +799,10 @@ function publishTeaAudioURL(rtmpURL) {
console
.
log
(
publishflashAudio
.
_js2native
(
msg
));
}
//获取老师推流音视频地址
function
achieveTeaVideoStream
(){
$
(
".publish"
).
css
({
"width"
:
"240px"
,
"height"
:
"180px"
});
$
(
".play"
).
css
(
"display"
,
"none"
);
$
(
".play"
).
css
(
{
"width"
:
"1px"
,
"height"
:
"1px"
}
);
var
paramInfo
=
{
"type"
:
"flash"
};
...
...
@@ -829,7 +944,6 @@ function playAudioURL(rtmpURL){
console
.
log
(
"result是=============>"
,
streamInfo
);
$
(
".play"
).
css
({
"width"
:
"240px"
,
"height"
:
"180px"
});
$
(
".teacherVideoBg"
).
css
(
"display"
,
"none"
);
$
(
".teacherVideo"
).
css
(
"background"
,
"#CCCCCC"
);
$
(
".teacherVideo-voice"
).
css
(
"bottom"
,
"4px"
);
if
(
!
window
.
playflash
)
{
...
...
请
注册
或
登录
后发表评论