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-07 14:27:12 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3c81e0b72f131c9d00851bc37dd5a73664014d2a
3c81e0b7
1 parent
01b21204
增加 在老师进入课堂 为开始上课 不能点击结束课堂
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
138 行增加
和
75 行删除
css/main.css
index.html
src/main.js
src/videoWithFlash.js
css/main.css
查看文件 @
3c81e0b
...
...
@@ -291,6 +291,15 @@ height: 1080px;
.am-dropdown-content-li-rest
{
display
:
none
;
}
.am-dropdown-content-li-stop-gray
{
display
:
none
;
color
:
#999999
;
cursor
:
default
;
}
#classes-status-gray
{
color
:
#999999
;
cursor
:
default
;
}
...
...
@@ -1304,11 +1313,29 @@ height: 1080px;
font-size
:
15px
;
}
.curStuUserTip
{
position
:
absolute
;
left
:
70px
;
bottom
:
40px
;
width
:
auto
;
height
:
16px
;
color
:
#333333
;
font-size
:
15px
;
}
.curTeaUserTip
{
position
:
absolute
;
left
:
70px
;
bottom
:
40px
;
width
:
auto
;
height
:
16px
;
color
:
#333333
;
font-size
:
15px
;
}
.curStuUserName
{
position
:
absolute
;
left
:
68px
;
bottom
:
40px
;
left
:
47px
;
bottom
:
5px
;
width
:
auto
;
height
:
16px
;
color
:
#333333
;
...
...
index.html
查看文件 @
3c81e0b
...
...
@@ -160,6 +160,7 @@
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"
...
...
@@ -178,6 +179,13 @@
href=
"#"
>
继续上课
</button>
</li>
<li
id=
"am-dropdown-content-li-stop-gray"
class=
"am-dropdown-content-li-stop-gray stopGray"
><span
class=
"am-dropdown-content-span iconfont"
>

</span>
<button
id=
"classes-status-gray"
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"
...
...
@@ -353,7 +361,8 @@
<div
id=
"stuPlay"
></div>
</div>
<img
class=
"stuVideoBg"
/>
<div
class=
"curStuUserName"
>
学生未进入课堂
</div>
<div
class=
"curStuUserTip"
>
学生未进入课堂
</div>
<div
class=
"curStuUserName"
></div>
<div
id=
"stuVideo-video"
class=
"stuVideo-video iconfont"
title=
"发起学生视频"
>

</div>
<div
id=
"stuVideo-videoBg"
class=
"stuVideo-videoBg iconfont"
></div>
<div
id=
"stuVideo-videoNotClick"
class=
"stuVideo-videoNotClick iconfont"
title=
"当前不能点击"
>

</div>
...
...
@@ -365,7 +374,7 @@
</div>
<div
class=
"teacherVideo"
>
<div
class=
"publish"
style=
"position:absolute;top: 0; width:240px;height:180px"
>
<div
class=
"publish"
style=
"position:absolute;top: 0; width:240px;height:180px
; -webkit-transform:scale(1.25);
"
>
<div
id=
"publish"
></div>
</div>
<div
class=
"play"
style=
"position:absolute;top: 0; width:240px;height:180px"
>
...
...
@@ -373,6 +382,7 @@
</div>
<img
class=
"teacherVideoBg"
/>
<img
class=
"teacherVoicing"
/>
<div
class=
"curTeaUserTip"
>
老师未进入课堂
</div>
<div
class=
"curUserName"
></div>
<div
id=
"teacherVideo-video"
class=
"teacherVideo-video iconfont"
title=
"发起视频"
>

</div>
<div
id=
"teacherVideo-videoBg"
class=
"teacherVideo-videoBg iconfont"
></div>
...
...
src/main.js
查看文件 @
3c81e0b
...
...
@@ -49,10 +49,12 @@ function mainTimeStamp() {
}
$
(
function
()
{
initEngine
();
//加载MCUClientEngine;
listenClass
();
//监听事件
loading
();
urlParamsJudge
();
//对地址栏参数的数据进行判断
});
function
initEngine
(){
...
...
@@ -73,7 +75,7 @@ function listenClass() {
if
(
client
){
// client.on(MessageTypes.UPDATE_CLASS_TIMER,updateClassTime);// 监听会议时间更新
client
.
on
(
MessageTypes
.
CLASS_UPTATE_STATUS
,
classUpdateStatus
);
//监听
会议
状态更新
client
.
on
(
MessageTypes
.
CLASS_UPTATE_STATUS
,
classUpdateStatus
);
//监听
课堂
状态更新
client
.
on
(
MessageTypes
.
CHAT_RECEIVE
,
chatReceive
);
//监听到聊天信息
client
.
on
(
MessageTypes
.
WHITEBOARD_ANNOTATION_UPDATE
,
whiteboardUpdate
);
//监听白板更新
client
.
on
(
MessageTypes
.
DOC_DELETE
,
docDelete
);
//监听删除文档
...
...
@@ -950,6 +952,8 @@ function classJoinSuccess(callbackData){
$
(
"#teacherVideo-video"
).
css
(
"display"
,
"none"
);
$
(
"#teacherVideo-voice"
).
css
(
"display"
,
"none"
);
$
(
".curStuUserName"
).
css
(
"display"
,
"none"
);
$
(
".curStuUserTip"
).
css
(
"display"
,
"none"
);
$
(
".stuVideo-videoNotClick"
).
css
(
"display"
,
"none"
);
$
(
".stuVideo-voiceNotClick"
).
css
(
"display"
,
"none"
);
}
...
...
@@ -969,6 +973,45 @@ function layoutView( ) {
"display"
:
"block"
});
//加入课堂成功后,点击开始上课
$
(
"#classes-status-begin"
).
click
(
function
()
{
$
(
".am-dropdown-content-li-stop-gray"
).
css
(
"display"
,
"none"
);
$
(
".am-dropdown-content-li-stop"
).
css
(
"display"
,
"block"
);
$
(
".am-dropdown-content-li-begin"
).
css
(
"display"
,
"none"
);
$
(
".am-dropdown-content-li-pause"
).
css
(
"display"
,
"block"
);
$
(
".span-classes"
).
html
(
""
);
$
(
"#class-now"
).
html
(
"直播中"
);
client
.
sendStartClass
();
});
//暂停课堂
$
(
"#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"
);
});
//继续上课
$
(
"#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
(
"直播中"
);
});
...
...
@@ -1151,83 +1194,37 @@ function whiteboardUpdate(callbackData) {
// function updateClassTime(callbackData){
//
// }
//监听
会议
状态更新
//监听
课堂
状态更新
function
classUpdateStatus
(
callbackData
)
{
console
.
log
(
"监听
会议
状态更新======>"
,
callbackData
);
console
.
log
(
"监听
课堂
状态更新======>"
,
callbackData
);
//当前课堂的状态0(未开始) 、1(已经开始) 2(暂停中)
if
(
callbackData
.
classStatus
==
0
){
//加入课堂成功后,点击开始上课
$
(
"#classes-status-begin"
).
click
(
function
()
{
$
(
".stopGray"
).
css
(
"display"
,
"block"
);
$
(
".am-dropdown-content-li-stop"
).
css
(
"display"
,
"none"
);
$
(
".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
){
}
if
(
callbackData
.
classStatus
==
1
){
$
(
".span-classes"
).
html
(
""
);
$
(
"#class-now"
).
html
(
"直播中"
);
$
(
".am-dropdown-content-li-pause"
).
css
(
"display"
,
"block"
);
$
(
".am-dropdown-content-li-begin"
).
css
(
"display"
,
"none"
);
//暂停课堂
$
(
"#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
();
});
$
(
".am-dropdown-content-li-stop"
).
css
(
"display"
,
"block"
);
$
(
".am-dropdown-content-li-stop-gary"
).
css
(
"display"
,
"none"
);
//结束课堂,课堂的状态还原为未开始状态,所有人都要离开课堂。
$
(
"#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
){
}
if
(
callbackData
.
classStatus
==
2
){
$
(
".span-classes"
).
html
(
""
);
$
(
"#class-now"
).
html
(
"休息中"
);
$
(
".am-dropdown-content-li-begin"
).
css
(
"display"
,
"none"
);
$
(
".am-dropdown-content-li-rest"
).
css
(
"display"
,
"block"
);
//继续上课
$
(
"#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
{
$
(
".am-dropdown-content-li-stop"
).
css
(
"display"
,
"block"
);
$
(
".am-dropdown-content-li-stop-gary"
).
css
(
"display"
,
"none"
);
}
...
...
@@ -1269,11 +1266,13 @@ function GetUrlParam() {
//将用户名和密码提交给底层
function
onJoinClass
(
userName
,
password
)
{
//加入课堂的信息
var
classInfo
=
{};
if
(
classInfo
)
{
classInfo
.
userName
=
userName
;
classInfo
.
password
=
password
;
classInfo
.
autoLogin
=
classParamInfo
.
m
;
client
.
joinClass
(
classInfo
,
classJoinSuccess
);
}
else
{
console
.
log
(
"error"
);
...
...
@@ -1326,7 +1325,7 @@ function urlParamsJudge(){
classParamInfo
.
userId
=
classLoadInfo
.
userId
;
//第三方用户id
classParamInfo
.
userType
=
classLoadInfo
.
userType
;
//用户的身份 默认1
classParamInfo
.
userName
=
classLoadInfo
.
userName
;
//第三方用户名称
// classParamInfo.passWord=classLoadInfo.passWord; //用户密码
classParamInfo
.
m
=
classLoadInfo
.
m
;
//m
console
.
log
(
"传给底层,进行初始化的数据"
);
console
.
log
(
classParamInfo
);
...
...
@@ -1354,7 +1353,7 @@ function getURLParams(){
classLoadInfo
.
userType
=
parseInt
(
classUrlParam
.
userType
)
||
1
;
classLoadInfo
.
userId
=
classUrlParam
.
userId
?
classUrlParam
.
userId
:
"0"
;
classLoadInfo
.
portal
=
classLoadInfo
.
portalIP
+
":"
+
classLoadInfo
.
portalPort
;
// classLoadInfo.passWord=classUrlParam.passWord
||"";
classLoadInfo
.
m
=
classUrlParam
.
m
||
""
;
console
.
log
(
classLoadInfo
);
return
classLoadInfo
;
...
...
src/videoWithFlash.js
查看文件 @
3c81e0b
...
...
@@ -347,7 +347,9 @@ function userListUpdate(callbackData) {
console
.
log
(
"人员进入"
,
callbackData
);
if
(
classAllInfo
.
userRole
==
"host"
){
if
(
classAllInfo
.
nodeId
==
callbackData
.
nodeId
)
{
$
(
".curUserName"
).
html
(
callbackData
.
nodeData
.
name
);
$
(
".curTeaUserTip"
).
css
(
"display"
,
"none"
);
}
else
{
console
.
log
(
"callbackData.nodeId================>"
,
callbackData
.
nodeId
)
stuNodeId
=
callbackData
.
nodeId
;
...
...
@@ -356,15 +358,23 @@ function userListUpdate(callbackData) {
$
(
".stuVideo-voice"
).
css
(
"display"
,
"block"
);
$
(
".stuVideo-videoNotClick"
).
css
(
"display"
,
"none"
);
$
(
".stuVideo-voiceNotClick"
).
css
(
"display"
,
"none"
);
$
(
".curStuUserName"
).
css
(
"display"
,
"block"
);
$
(
".curStuUserName"
).
html
(
callbackData
.
nodeData
.
name
);
$
(
".curStuUserTip"
).
css
(
"display"
,
"none"
);
}
}
if
(
classAllInfo
.
userRole
==
"normal"
){
if
(
classAllInfo
.
nodeId
==
callbackData
.
nodeId
)
{
console
.
log
(
"callbackData.nodeId=====normal===========>"
,
callbackData
.
nodeId
);
stuNodeId
=
callbackData
.
nodeId
;
$
(
".curStuUserName"
).
css
(
"display"
,
"block"
);
$
(
".curStuUserName"
).
html
(
callbackData
.
nodeData
.
name
);
}
else
{
$
(
".curTeaUserTip"
).
css
(
"display"
,
"none"
);
$
(
".curUserName"
).
css
(
"display"
,
"block"
);
$
(
".curUserName"
).
html
(
callbackData
.
nodeData
.
name
);
teaNodeId
=
callbackData
.
nodeId
;
console
.
log
(
"callbackData.nodeId=====teaNodeIdnormal===========>"
,
teaNodeId
,
callbackData
.
nodeId
)
...
...
@@ -375,14 +385,28 @@ function userListUpdate(callbackData) {
}
//人员离开
function
userListLeave
(
callbackData
){
console
.
log
(
teaNodeId
,
stuNodeId
);
console
.
log
(
"人员离开"
,
callbackData
);
if
(
classAllInfo
.
nodeId
!=
callbackData
.
nodeId
)
{
$
(
".curStuUserName"
).
html
(
"学生已离开"
);
$
(
".stuVideo-video"
).
css
(
"display"
,
"none"
);
$
(
".stuVideo-voice"
).
css
(
"display"
,
"none"
);
$
(
".stuVideo-videoNotClick"
).
css
(
"display"
,
"block"
);
$
(
".stuVideo-voiceNotClick"
).
css
(
"display"
,
"block"
);
console
.
log
(
classAllInfo
.
nodeId
,
callbackData
.
nodeId
);
if
(
callbackData
.
nodeId
==
stuNodeId
){
if
(
classAllInfo
.
userRole
==
"host"
){
$
(
".curStuUserTip"
).
html
(
"学生已离开课堂"
);
$
(
".curStuUserTip"
).
css
(
"display"
,
"block"
);
$
(
".curStuUserName"
).
css
(
"display"
,
"none"
);
$
(
".stuVideo-video"
).
css
(
"display"
,
"none"
);
$
(
".stuVideo-voice"
).
css
(
"display"
,
"none"
);
$
(
".stuVideo-videoNotClick"
).
css
(
"display"
,
"block"
);
$
(
".stuVideo-voiceNotClick"
).
css
(
"display"
,
"block"
);
}
}
if
(
callbackData
.
nodeId
==
teaNodeId
){
if
(
classAllInfo
.
userRole
==
"normal"
){
$
(
".curTeaUserTip"
).
html
(
"老师已离开课堂"
);
$
(
".curTeaUserTip"
).
css
(
"display"
,
"block"
);
$
(
".curUserName"
).
css
(
"display"
,
"none"
);
}
}
}
// 监听当前是否有视频流更新
...
...
@@ -851,7 +875,7 @@ function publishTeaAudioURL(rtmpURL) {
//获取老师推音视频流地址
function
achieveTeaVideoStream
(){
$
(
".publish"
).
css
({
"width"
:
"240px"
,
"height"
:
"180px"
});
//
$(".publish").css({"width":"240px","height":"180px"});
$
(
".play"
).
css
({
"width"
:
"1px"
,
"height"
:
"1px"
});
var
paramInfo
=
{
"type"
:
"flash"
...
...
@@ -864,8 +888,8 @@ function achieveTeaVideoStream(){
if
(
!
window
.
publishflash
)
{
flashvideo
(
'publish'
,
'100%'
,
'100%'
,
'400'
,
'300'
,
function
(
error
,
publishflash
)
{
if
(
error
)
{
return
console
.
error
(
error
);
...
...
@@ -916,6 +940,8 @@ function publishURL(rtmpURL) {
type
:
10
,
videoId
:
publishflashVideoId
,
data
:
{
vwidth
:
240
,
vheight
:
180
,
video
:
true
,
audio
:
true
,
url
:
rtmpURL
...
...
@@ -923,6 +949,7 @@ function publishURL(rtmpURL) {
});
console
.
log
(
"publishflashVideoId======>"
,
publishflashVideoId
);
console
.
log
(
publishflash
.
_js2native
(
msg
));
}
...
...
请
注册
或
登录
后发表评论