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-06 17:22:58 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
79567bc999dc256430554d26c7e48668b9791fa3
79567bc9
1 parent
77c88e7a
1.增加开始上课,暂停上课,结束课堂功能
2.页码为1时,不能点击上一页按钮,页码为总页数时,不能点击下一页 3.音视频更新 进行修复
隐藏空白字符变更
内嵌
并排对比
正在显示
5 个修改的文件
包含
335 行增加
和
124 行删除
css/main.css
index.html
js/draw.js
src/main.js
src/videoWithFlash.js
css/main.css
查看文件 @
79567bc
...
...
@@ -264,7 +264,7 @@ height: 1080px;
margin-left
:
20px
;
color
:
#333
;
font-size
:
12px
;
width
:
4
0px
;
width
:
10
0px
;
height
:
20px
;
}
...
...
@@ -285,6 +285,16 @@ height: 1080px;
box-shadow
:
1px
;
border-radius
:
3px
;
}
.am-dropdown-content-li-pause
{
display
:
none
;
}
.am-dropdown-content-li-rest
{
display
:
none
;
}
.am-dropdown-content3
{
min-width
:
0
;
z-index
:
3000
;
...
...
@@ -783,6 +793,9 @@ height: 1080px;
float
:
right
;
}
.am-dropdownClass
{
float
:
left
;
}
.am-modal-bd-file
{
height
:
256px
;
width
:
398px
;
...
...
@@ -1057,8 +1070,15 @@ height: 1080px;
font-size
:
22px
;
cursor
:
pointer
;
}
.left
.control
.showBoardBtn
{
display
:
none
;
float
:
left
;
margin-left
:
15px
;
font-size
:
22px
;
cursor
:
pointer
;
}
.left
.control
.next-page
a
{
.left
.control
.next-page
.nextPage
{
float
:
right
;
margin
:
14px
20px
0
10px
;
width
:
20px
;
...
...
@@ -1066,7 +1086,14 @@ height: 1080px;
background
:
url("../images/right-normal.png")
no-repeat
;
}
.left
.control
.next-page
a
:active
{
.left
.control
.next-page
.nextPage
:active
{
background
:
url("../images/right-pre.png")
no-repeat
;
}
.nextPageNoClick
{
float
:
right
;
margin
:
14px
20px
0
10px
;
width
:
20px
;
height
:
20px
;
background
:
url("../images/right-pre.png")
no-repeat
;
}
...
...
@@ -1100,7 +1127,7 @@ height: 1080px;
}
.left
.control
.prev
a
{
.left
.control
.prev
.prevPage
{
float
:
right
;
margin-top
:
14px
;
width
:
20px
;
...
...
@@ -1108,7 +1135,7 @@ height: 1080px;
background
:
url("../images/left-normal.png")
no-repeat
;
cursor
:
pointer
;
}
.left
.control
.prev
a
:active
{
.left
.control
.prev
.prevPage
:active
{
background
:
url("../images/left-pre.png")
no-repeat
;
}
...
...
@@ -2643,7 +2670,7 @@ canvas {
width
:
18px
;
}
.left
.control
.next-page
a
{
.left
.control
.next-page
.nextPage
{
float
:
right
;
margin
:
5px
20px
0
10px
;
width
:
20px
;
...
...
@@ -2651,7 +2678,15 @@ canvas {
background
:
url("../images/right-normal.png")
no-repeat
;
}
.left
.control
.next-page
a
:active
{
.left
.control
.next-page
.nextPage
:active
{
background
:
url("../images/right-pre.png")
no-repeat
;
}
.nextPageNoClick
{
float
:
right
;
margin
:
5px
20px
0
10px
;
width
:
20px
;
height
:
20px
;
cursor
:
default
;
background
:
url("../images/right-pre.png")
no-repeat
;
}
...
...
@@ -2659,16 +2694,17 @@ canvas {
float
:
right
;
margin-left
:
5px
;
height
:
30px
;
line-height
:
30
px
;
line-height
:
26
px
;
}
.left
.control
.total-page
span
{
font-size
:
12px
;
}
.left
.control
.bias
{
float
:
right
;
margin-left
:
5px
;
height
:
30px
;
line-height
:
30
px
;
line-height
:
27
px
;
}
.left
.control
.cur-page
{
...
...
@@ -2688,7 +2724,7 @@ canvas {
}
.left
.control
.prev
a
{
.left
.control
.prev
.prevPage
{
float
:
right
;
margin-top
:
5px
;
width
:
20px
;
...
...
@@ -2696,10 +2732,98 @@ canvas {
background
:
url("../images/left-normal.png")
no-repeat
;
cursor
:
pointer
;
}
.left
.control
.prev
a
:active
{
.left
.control
.prev
.prevPage
:active
{
background
:
url("../images/left-pre.png")
no-repeat
;
}
.prevPageNoClick
{
float
:
right
;
margin-top
:
5px
;
width
:
20px
;
height
:
20px
;
cursor
:
default
;
background
:
url("../images/left-pre.png")
no-repeat
;
}
/*直播中*/
.live
{
position
:
absolute
;
width
:
26%
;
height
:
34%
;
bottom
:
20%
;
}
.live
i
{
width
:
4%
;
height
:
10%
;
position
:
absolute
;
bottom
:
0
;
background-color
:
red
;
}
.live
i
:nth-of-type
(
1
)
{
left
:
0
;
}
.live
i
:nth-of-type
(
2
)
{
left
:
6px
;
}
.live
i
:nth-of-type
(
3
)
{
left
:
12px
;
}
.live
i
:nth-of-type
(
4
)
{
left
:
18px
;
}
.live.active
i
:nth-of-type
(
1
)
{
-webkit-animation
:
wave
0.9s
linear
infinite
;
animation
:
wave
0.9s
linear
infinite
;
}
.live.active
i
:nth-of-type
(
2
)
{
-webkit-animation
:
wave
0.7s
linear
infinite
;
animation
:
wave
0.7s
linear
infinite
;
}
.live.active
i
:nth-of-type
(
3
)
{
-webkit-animation
:
wave
0.8s
linear
infinite
;
animation
:
wave
0.8s
linear
infinite
;
}
.live.active
i
:nth-of-type
(
4
)
{
-webkit-animation
:
wave
0.6s
linear
infinite
;
animation
:
wave
0.6s
linear
infinite
;
}
@-webkit-keyframes
wave
{
0
%
{
height
:
6px
}
50
%
{
height
:
20px
}
100
%
{
height
:
12px
}
}
@keyframes
wave
{
0
%
{
height
:
8px
}
50
%
{
height
:
20px
}
100
%
{
height
:
12px
}
}
/*进度条*/
.left
.control
.voice-progress
{
float
:
left
;
...
...
@@ -3610,9 +3734,8 @@ canvas {
position
:
absolute
;
width
:
26%
;
height
:
34%
;
margin-left
:
25%
;
bottom
:
30%
;
display
:
none
;
bottom
:
20%
;
}
.live
i
{
width
:
4%
;
...
...
index.html
查看文件 @
79567bc
...
...
@@ -71,41 +71,8 @@
<!--头部-->
<div
class=
"header clear"
>
<!--<li class="cur-status">-->
<!--<span id="no-start" class="no-start iconfont"></span>-->
<!--<div id='live' class="live active">-->
<!--<i></i>-->
<!--<i></i>-->
<!--<i></i>-->
<!--<i></i>-->
<!--</div>-->
<!--<a id="a-status" href="javascript: void(0)">未开始</a></li>-->
<!--右侧未开始-->
<div
class=
"am-dropdown"
data-am-dropdown
>
<button
type=
"button"
class=
"am-btn am-btn-primary am-dropdown-toggle "
data-am-dropdown-toggle
><span
id=
"span-iconfont"
class=
"span-classes iconfont"
>

</span><span
id=
"class-now"
>
未开始
</span>
</button>
<ul
class=
"am-dropdown-content"
>
<li><span
id=
"am-dropdown-content-span-1"
class=
"am-dropdown-content-span iconfont"
>

</span>
<button
id=
"classes-status-1"
type=
"button"
class=
"am-btn am-btn-primary am-dropdown-content-button"
href=
"#"
>
开始上课
</button>
</li>
<li><span
class=
"am-dropdown-content-span iconfont"
>

</span>
<button
id=
"classes-status-2"
type=
"button"
class=
"am-btn am-btn-primary am-dropdown-content-button"
data-am-modal=
"{target: '#end-classes', closeViaDimmer: 0, width: 340, height: 172}"
href=
"#"
>
结束课堂
</button>
</li>
</ul>
</div>
<li
class=
"classroom"
><a
id=
"classCurName"
href=
"javascript: void(0)"
></a></li>
<li
class=
"classCurId"
><a
id=
"classCurId"
href=
"javascript: void(0)"
></a></li>
<li
class=
"classroom"
>
课堂主题:
<a
id=
"classCurName"
href=
"javascript: void(0)"
></a></li>
<li
class=
"classCurId"
>
用户ID:
<a
id=
"classCurId"
href=
"javascript: void(0)"
></a></li>
<!--设置-->
<div
class=
"am-dropdown"
data-am-dropdown
>
...
...
@@ -181,36 +148,48 @@
<!--帮助-->
<div
class=
"am-dropdown"
data-am-dropdown
>
<div
class=
"am-dropdown
"
data-am-dropdown
>
<a
href=
"javascript: void(0)"
><button
class=
"am-btn am-btn-primary am-dropdown-toggle "
data-am-dropdown-toggle
><span
class=
"span-help iconfont"
>

</span>
帮助
</button></a>
</div>
<!--<!–右侧未开始–>-->
<!--<div class="am-dropdown" data-am-dropdown>-->
<!--<button type="button" class="am-btn am-btn-primary am-dropdown-toggle " data-am-dropdown-toggle><span-->
<!--id="span-iconfont" class="span-classes iconfont"></span><span id="class-now">未开始</span>-->
<!--</button>-->
<!--<ul class="am-dropdown-content">-->
<!--<li><span id="am-dropdown-content-span-1" class="am-dropdown-content-span iconfont"></span>-->
<!--<button id="classes-status-1" type="button"-->
<!--class="am-btn am-btn-primary am-dropdown-content-button"-->
<!--href="#">开始上课-->
<!--</button>-->
<!--</li>-->
<!--<li><span class="am-dropdown-content-span iconfont"></span>-->
<!--<button id="classes-status-2" type="button"-->
<!--class="am-btn am-btn-primary am-dropdown-content-button"-->
<!--data-am-modal="{target: '#end-classes', closeViaDimmer: 0, width: 340, height: 172}"-->
<!--href="#">结束课堂-->
<!--</button>-->
<!--</li>-->
<!--</ul>-->
<!--</div>-->
<!--右侧未开始-->
<div
class=
"am-dropdown classStatus"
data-am-dropdown
>
<button
type=
"button"
class=
"am-btn am-btn-primary am-dropdown-toggle "
data-am-dropdown-toggle
><span
id=
"span-iconfont"
class=
"span-classes iconfont"
>

</span><span
id=
"class-now"
>
未开始
</span>
</button>
<ul
class=
"am-dropdown-content"
>
<li
class=
"am-dropdown-content-li-begin"
><span
id=
"am-dropdown-content-span-1"
class=
"am-dropdown-content-span iconfont"
>

</span>
<button
id=
"classes-status-begin"
type=
"button"
class=
"am-btn am-btn-primary am-dropdown-content-button"
href=
"#"
>
开始上课
</button>
</li>
<li
class=
"am-dropdown-content-li-pause"
><span
id=
"am-dropdown-content-span-pause"
class=
"am-dropdown-content-span iconfont"
>

</span>
<button
id=
"classes-status-pause"
type=
"button"
class=
"am-btn am-btn-primary am-dropdown-content-button"
href=
"#"
>
暂停课堂
</button>
</li>
<li
class=
"am-dropdown-content-li-rest"
><span
id=
"am-dropdown-content-span-rest"
class=
"am-dropdown-content-span iconfont"
>

</span>
<button
id=
"classes-status-rest"
type=
"button"
class=
"am-btn am-btn-primary am-dropdown-content-button"
href=
"#"
>
继续上课
</button>
</li>
<li
class=
"am-dropdown-content-li-stop"
><span
class=
"am-dropdown-content-span iconfont"
>

</span>
<button
id=
"classes-status-2"
type=
"button"
class=
"am-btn am-btn-primary am-dropdown-content-button"
data-am-modal=
"{target: '#end-classes-1', closeViaDimmer: 0, width: 340, height: 172}"
href=
"#"
>
结束课堂
</button>
</li>
</ul>
</div>
<!--弹出层-结束课堂-->
...
...
@@ -349,12 +328,14 @@
<div
class=
"control"
>
<ul
class=
"clear"
>
<li
class=
"fileUpload iconfont"
data-am-modal=
"{target: '#doc-modal-1', closeViaDimmer: 0, width: 398, height: 288}"
>

</li>
<li
class=
"showBoardBtn iconfont"
>

</li>
<li
class=
"next-page "
><a
id=
"nextPage"
href=
"javascript:void(0)"
></a></li>
<li
class=
"next-page "
><a
id=
"nextPage"
class=
"nextPage"
href=
"javascript:void(0)"
></a></li>
<li
class=
"total-page"
><span
id=
"totalPageNum"
>
0
</span></li>
<li
class=
"bias"
>
/
</li>
<li
class=
"cur-page"
><span
id=
"curPageNum"
>
0
</span></li>
<li
class=
"prev"
><a
id=
"prevPage"
href=
"javascript:void(0)"
></a></li>
<li
class=
"prev"
><a
id=
"prevPage"
class=
"prevPage"
href=
"javascript:void(0)"
></a></li>
</ul>
...
...
js/draw.js
查看文件 @
79567bc
...
...
@@ -471,15 +471,6 @@ var color = '#b8242a';
}
}
function
trans
(
msg
)
{
CanvasConInfo
=
msg
;
}
// function transInfo(msg) {
// CanvasConInfoTran=msg;
//
// }
window
.
draw
=
{
initCanvas
:
initCanvas
,
...
...
@@ -488,7 +479,6 @@ window.draw={
recordPencilResult
:
recordPencilResult
,
drawCanvas
:
drawCanvas
,
clearCanvasCon
:
clearCanvasCon
,
trans
:
trans
,
clearContextCan
:
clearContextCan
,
clearDocCanvas
:
clearDocCanvas
...
...
src/main.js
查看文件 @
79567bc
...
...
@@ -18,6 +18,7 @@ var imgUrl;
var
curPageNum
;
var
pageNum
;
var
fileItemIdx
;
var
classErrorCode
;
//画布
...
...
@@ -46,7 +47,7 @@ function mainTimeStamp() {
$
(
function
()
{
initEngine
();
//加载MCUClientEngine;
listenClass
();
listenClass
();
//监听事件
loading
();
urlParamsJudge
();
//对地址栏参数的数据进行判断
});
...
...
@@ -530,7 +531,6 @@ function docDelete(callbackData){
$
(
".doc-headline-a"
).
trigger
(
"click"
);
if
(
fileFromArr
.
length
==
0
){
$
(
"#docImage"
).
attr
(
"src"
,
""
);
$
(
".next-page "
).
css
(
"display"
,
"none"
);
$
(
".total-page"
).
css
(
"display"
,
"none"
);
$
(
".bias"
).
css
(
"display"
,
"none"
);
...
...
@@ -565,11 +565,15 @@ function updateDocList(_data,isAdd) {
$
(
"#docImage"
).
attr
(
"src"
,
""
);
$
(
"#showImg"
).
attr
(
"src"
,
""
);
$
(
".canvas_container"
).
css
(
"overflow-y"
,
"hidden"
);
$
(
".canvas_container"
).
scrollTop
(
0
);
hideTurnPage
();
if
(
classAllInfo
.
userRole
==
"normal"
){
$
(
"#showImg"
).
css
(
"display"
,
"block"
);
$
(
"#docImage"
).
attr
(
"src"
,
""
);
$
(
"#showImg"
).
attr
(
"src"
,
""
);
$
(
".canvas_container"
).
scrollTop
(
0
);
$
(
".canvas_container"
).
css
(
"overflow-y"
,
"hidden"
);
}
fileFromArr
.
splice
(
i
,
1
);
...
...
@@ -605,8 +609,8 @@ function classFailed(callbackData) {
console
.
log
(
"classFailed---课堂失败"
);
console
.
log
(
callbackData
);
var
code
=
callbackData
.
code
;
switch
(
code
)
{
classErrorCode
=
callbackData
.
code
;
switch
(
classErrorCode
)
{
case
100
:
//当前没有 课堂号 用户角色 ip
if
((
classLoadInfo
.
classId
)
==
""
||
classLoadInfo
.
userRole
==
""
||
(
classLoadInfo
.
portal
)
==
":"
||
(
classLoadInfo
.
portalPort
)
==
""
||
(
classLoadInfo
.
portalIP
)
==
""
||
(
classLoadInfo
.
userName
)
==
""
){
...
...
@@ -693,6 +697,10 @@ function classFailed(callbackData) {
function
mcuErrorTip
(){
$
(
".passWordTip"
).
css
(
"margin-left"
,
"45px"
);
$
(
".passWordTip"
)[
0
].
innerHTML
=
"请稍后再试,正在重新连接"
;
if
(
classAllInfo
.
userRole
==
"normal"
){
$
(
".box"
).
css
(
"display"
,
"none"
);
}
}
...
...
@@ -784,7 +792,7 @@ function showLogin(isShow){
$
(
"#btnLogin"
).
click
(
function
(
e
)
{
console
.
log
(
"点击了登录按钮---------->"
);
var
userName
=
classLoadInfo
.
userNam
e
;
var
userName
=
$
(
".userNameInput"
)[
0
].
valu
e
;
var
pwd
=
$
(
".passWordInput"
)[
0
].
value
;
// var userName = $(".userNameInput").val();
...
...
@@ -844,8 +852,8 @@ function showLogin(isShow){
$
(
"#btnLogin"
).
click
(
function
(
e
)
{
console
.
log
(
"点击了登录按钮---------->"
);
var
userName
=
classLoadInfo
.
userName
;
console
.
log
(
userName
,
pwd
);
var
userName
=
$
(
".userNameInput"
)[
0
].
value
;
// console.log(userName,pwd);
// var userName = $(".userNameInput").val();
// var pwd = $(".passWordInput").val();
if
(
$
(
".userNameInput"
).
length
)
{
...
...
@@ -921,8 +929,16 @@ function showParmasInput(){
//加入课堂成功
function
classJoinSuccess
(
callbackData
){
classAllInfo
=
callbackData
;
console
.
log
(
"classJoinSuccess"
,
callbackData
);
console
.
log
(
callbackData
);
console
.
log
(
"classJoinSuccess====>"
,
callbackData
);
//去掉复制功能
document
.
body
.
onselectstart
=
document
.
body
.
oncontextmenu
=
function
(){
return
false
;}
...
...
@@ -931,7 +947,7 @@ function classJoinSuccess(callbackData){
$
(
".Color1"
).
trigger
(
"click"
);
$
(
".pencil"
).
trigger
(
"click"
);
//根据用户权限,隐藏不同界面,如果是学生,隐藏白板
if
(
callbackData
.
userRole
==
"normal"
){
if
(
callbackData
.
userRole
==
"normal"
){
$
(
"#tool"
).
css
(
"display"
,
"none"
);
$
(
".fileUpload"
).
css
(
"display"
,
"none"
);
...
...
@@ -944,7 +960,6 @@ if (callbackData.userRole=="normal"){
$
(
".stuVideo-videoNotClick"
).
css
(
"display"
,
"none"
);
$
(
".stuVideo-voiceNotClick"
).
css
(
"display"
,
"none"
);
}
//准备主页面
layoutView
();
}
...
...
@@ -981,8 +996,14 @@ function layoutView( ) {
//
// }
$
(
".showBoardBtn"
).
click
(
function
()
{
$
(
".docImage"
).
css
(
"display"
,
"none"
);
$
(
".showImg"
).
css
(
"display"
,
"none"
);
});
$
(
".fileUpload"
).
click
(
function
()
{
$
(
".docImage"
).
css
(
"display"
,
"block"
);
$
(
".showImg"
).
css
(
"display"
,
"block"
);
});
...
...
@@ -1000,47 +1021,66 @@ function layoutView( ) {
//点击下一页
$
(
"#nextPage"
).
on
(
"click"
,
function
(
e
)
{
$
(
"#prevPage"
).
removeClass
(
"prevPageNoClick"
);
$
(
"#prevPage"
).
addClass
(
"prevPage"
);
console
.
log
(
curPageNum
);
if
(
curPageNum
<
pageNum
){
$
(
"#nextPage"
).
removeClass
(
"nextPageNoClick"
);
$
(
"#nextPage"
).
addClass
(
"nextPage"
);
var
paramInfo
=
{
"itemIdx"
:
fileItemIdx
,
"curPageNo"
:
curPageNum
+
1
};
console
.
log
(
"paramInfo=======>"
,
paramInfo
)
client
.
sendDocumentSwitchPage
(
paramInfo
);
$
(
"#curPageNum"
).
html
(
curPageNum
);
if
(
curPageNum
!==
pageNum
){
console
.
log
(
curPageNum
);
var
docfullSingle
=
docfullPath
[
curPageNum
-
1
];
console
.
log
(
"curPageNum,docfullSingle"
,
curPageNum
,
docfullSingle
);
$
(
"#docImage"
).
attr
(
"src"
,
docfullSingle
);
// curPageNum++;
}
var
paramInfo
=
{
"itemIdx"
:
fileItemIdx
,
"curPageNo"
:
curPageNum
+
1
};
console
.
log
(
"paramInfo=======>"
,
paramInfo
)
client
.
sendDocumentSwitchPage
(
paramInfo
);
$
(
"#curPageNum"
).
html
(
curPageNum
);
}
if
(
curPageNum
==
(
pageNum
-
1
)){
$
(
"#nextPage"
).
removeClass
(
"nextPage"
);
$
(
"#nextPage"
).
addClass
(
"nextPageNoClick"
);
}
});
//点击上一页
$
(
"#prevPage"
).
on
(
"click"
,
function
(
e
)
{
if
(
curPageNum
>
1
){
$
(
"#nextPage"
).
removeClass
(
"nextPageNoClick"
);
$
(
"#nextPage"
).
addClass
(
"nextPage"
);
$
(
"#prevPage"
).
removeClass
(
"prevPageNoClick"
);
$
(
"#prevPage"
).
addClass
(
"prevPage"
);
console
.
log
(
"curPageNum"
,
curPageNum
);
var
docfullSingle
=
docfullPath
[
curPageNum
-
1
];
console
.
log
(
"curPageNum,docfullSingle"
,
curPageNum
,
docfullSingle
);
$
(
"#docImage"
).
attr
(
"src"
,
docfullSingle
);
console
.
log
(
curPageNum
);
var
paramInfo
=
{
"itemIdx"
:
fileItemIdx
,
"curPageNo"
:
curPageNum
-
1
};
console
.
log
(
"paramInfo=======>"
,
paramInfo
)
client
.
sendDocumentSwitchPage
(
paramInfo
);
$
(
"#curPageNum"
).
html
(
curPageNum
);
}
console
.
log
(
curPageNum
);
var
paramInfo
=
{
"itemIdx"
:
fileItemIdx
,
"curPageNo"
:
curPageNum
-
1
};
console
.
log
(
"paramInfo=======>"
,
paramInfo
)
client
.
sendDocumentSwitchPage
(
paramInfo
);
$
(
"#curPageNum"
).
html
(
curPageNum
);
if
(
curPageNum
==
2
){
$
(
"#prevPage"
).
removeClass
(
"prevPage"
);
$
(
"#prevPage"
).
addClass
(
"prevPageNoClick"
);
}
});
...
...
@@ -1077,7 +1117,72 @@ function whiteboardUpdate(callbackData) {
// }
//监听会议状态更新
function
classUpdateStatus
(
callbackData
)
{
console
.
log
(
callbackData
);
console
.
log
(
"监听会议状态更新======>"
,
callbackData
);
//当前课堂的状态0(未开始) 、1(已经开始) 2(暂停中)
if
(
callbackData
.
classStatus
==
0
){
//加入课堂成功后,点击开始上课
$
(
"#classes-status-begin"
).
click
(
function
()
{
$
(
".am-dropdown-content-li-begin"
).
css
(
"display"
,
"none"
);
$
(
".am-dropdown-content-li-pause"
).
css
(
"display"
,
"block"
);
$
(
".span-classes"
).
html
(
""
);
$
(
"#class-now"
).
html
(
"直播中"
);
client
.
sendStartClass
();
});
}
else
if
(
callbackData
.
classStatus
==
1
){
//暂停课堂
$
(
"#classes-status-pause"
).
click
(
function
()
{
$
(
".span-classes"
).
html
(
""
);
$
(
"#class-now"
).
html
(
"休息中"
);
$
(
".am-dropdown-content-li-pause"
).
css
(
"display"
,
"none"
);
$
(
".am-dropdown-content-li-rest"
).
css
(
"display"
,
"block"
);
client
.
sendPauseClass
();
});
//结束课堂,课堂的状态还原为未开始状态,所有人都要离开课堂。
$
(
"#end"
).
click
(
function
()
{
$
(
".box"
).
css
(
"display"
,
"none"
);
client
.
sendCloseClass
();
});
//退出,但不结束课堂,是当前这个人退出
$
(
"#end-no-exit"
).
click
(
function
()
{
client
.
leaveClass
();
$
(
".box"
).
css
(
"display"
,
"none"
);
});
}
else
if
(
callbackData
.
classStatus
==
2
){
//继续上课
$
(
"#classes-status-rest"
).
click
(
function
()
{
client
.
sendStartClass
();
$
(
".am-dropdown-content-li-rest"
).
css
(
"display"
,
"none"
);
$
(
".am-dropdown-content-li-pause"
).
css
(
"display"
,
"block"
);
$
(
".span-classes"
).
html
(
""
);
$
(
"#class-now"
).
html
(
"直播中"
);
});
//结束课堂,课堂的状态还原为未开始状态,所有人都要离开课堂。
$
(
"#end"
).
click
(
function
()
{
$
(
".box"
).
css
(
"display"
,
"none"
);
client
.
sendCloseClass
();
});
//退出,但不结束课堂,是当前这个人退出
$
(
"#end-no-exit"
).
click
(
function
()
{
client
.
leaveClass
();
$
(
".box"
).
css
(
"display"
,
"none"
);
});
}
else
{
}
}
//接收聊天消息
...
...
src/videoWithFlash.js
查看文件 @
79567bc
...
...
@@ -6,6 +6,7 @@
var
client
;
//客户端
var
teaNodeId
;
var
stuNodeId
;
var
videoWithFlash
=
{};
...
...
@@ -359,6 +360,17 @@ function userListUpdate(callbackData) {
$
(
".curStuUserName"
).
html
(
callbackData
.
nodeData
.
name
);
}
}
if
(
classAllInfo
.
userRole
==
"normal"
){
if
(
classAllInfo
.
nodeId
==
callbackData
.
nodeId
)
{
console
.
log
(
"callbackData.nodeId=====normal===========>"
,
callbackData
.
nodeId
);
stuNodeId
=
callbackData
.
nodeId
;
}
else
{
teaNodeId
=
callbackData
.
nodeId
;
console
.
log
(
"callbackData.nodeId=====teaNodeIdnormal===========>"
,
teaNodeId
,
callbackData
.
nodeId
)
}
}
}
//人员离开
...
...
@@ -375,7 +387,7 @@ function userListLeave(callbackData){
}
// 监听当前是否有视频流更新
function
_videoUpdate
(
callbackDate
){
console
.
log
(
"videoUpdate==============>"
,
callbackDate
);
console
.
log
(
"videoUpdate==============>"
,
callbackDate
,
callbackDate
.
fromNodeId
,
stuNodeId
);
if
(
callbackDate
.
fromNodeId
==
classAllInfo
.
nodeId
)
return
;
if
((
classAllInfo
.
userRole
==
"host"
)
&&
(
callbackDate
.
status
==
1
)
&&
(
callbackDate
.
fromNodeId
==
stuNodeId
)){
...
...
@@ -383,7 +395,7 @@ function _videoUpdate(callbackDate){
//获取学生播流地址
achieveStuPlayStream
(
callbackDate
);
}
if
((
classAllInfo
.
userRole
==
"normal"
)
&&
(
callbackDate
.
status
==
1
)
&&
(
callbackDate
.
fromNodeId
==
stu
NodeId
)){
if
((
classAllInfo
.
userRole
==
"normal"
)
&&
(
callbackDate
.
status
==
1
)
&&
(
callbackDate
.
fromNodeId
==
tea
NodeId
)){
//获取老师播流地址
achievePlayStream
(
callbackDate
);
...
...
@@ -410,7 +422,7 @@ function _videoUpdate(callbackDate){
}
if
((
classAllInfo
.
userRole
==
"normal"
)
&&
(
callbackDate
.
status
==
0
)
&&
(
callbackDate
.
fromNodeId
==
stu
NodeId
)){
if
((
classAllInfo
.
userRole
==
"normal"
)
&&
(
callbackDate
.
status
==
0
)
&&
(
callbackDate
.
fromNodeId
==
tea
NodeId
)){
//老师的流关闭
if
(
window
.
playflash
){
...
...
@@ -447,7 +459,7 @@ function _audioUpdate(callbackDate){
}
if
((
classAllInfo
.
userRole
==
"normal"
)
&&
(
callbackDate
.
status
==
1
)
&&
(
callbackDate
.
fromNodeId
==
stu
NodeId
)){
if
((
classAllInfo
.
userRole
==
"normal"
)
&&
(
callbackDate
.
status
==
1
)
&&
(
callbackDate
.
fromNodeId
==
tea
NodeId
)){
achievePlayAudioStream
(
callbackDate
);
}
...
...
@@ -473,7 +485,7 @@ function _audioUpdate(callbackDate){
}
if
((
classAllInfo
.
userRole
==
"normal"
)
&&
(
callbackDate
.
status
==
0
)
&&
(
callbackDate
.
fromNodeId
==
stu
NodeId
)){
if
((
classAllInfo
.
userRole
==
"normal"
)
&&
(
callbackDate
.
status
==
0
)
&&
(
callbackDate
.
fromNodeId
==
tea
NodeId
)){
if
(
window
.
playflashAudio
)
{
console
.
log
(
"playflashAudioId"
,
playflashAudioId
);
const
stopPlayInfo
=
JSON
.
stringify
({
...
...
请
注册
或
登录
后发表评论