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-02-28 18:05:55 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
98c5caa87d35e2f30bd92e272d6fe11ade2a56fc
98c5caa8
1 parent
fbf12c22
老师视频OK
隐藏空白字符变更
内嵌
并排对比
正在显示
5 个修改的文件
包含
255 行增加
和
372 行删除
css/main.css
index.html
js/draw.js
src/main.js
src/videoWithFlash.js
css/main.css
查看文件 @
98c5caa
...
...
@@ -949,6 +949,67 @@ height: 1080px;
/*上传效果*/
.spinner
{
display
:
none
;
z-index
:
10
;
position
:
absolute
;
top
:
130px
;
left
:
556px
;
margin
:
100px
auto
0
;
width
:
150px
;
text-align
:
center
;
}
.spinner
>
div
{
width
:
30px
;
height
:
30px
;
background-color
:
#3498db
;
border-radius
:
100%
;
display
:
inline-block
;
-webkit-animation
:
bouncedelay
1.4s
infinite
ease-in-out
;
animation
:
bouncedelay
1.4s
infinite
ease-in-out
;
/* Prevent first frame from flickering when animation starts */
-webkit-animation-fill-mode
:
both
;
animation-fill-mode
:
both
;
}
.spinner
.bounce1
{
-webkit-animation-delay
:
-0.32s
;
animation-delay
:
-0.32s
;
}
.spinner
.bounce2
{
-webkit-animation-delay
:
-0.16s
;
animation-delay
:
-0.16s
;
}
@-webkit-keyframes
bouncedelay
{
0
%,
80
%,
100
%
{
-webkit-transform
:
scale
(
0.0
)
}
40
%
{
-webkit-transform
:
scale
(
1.0
)
}
}
@keyframes
bouncedelay
{
0
%,
80
%,
100
%
{
transform
:
scale
(
0.0
);
-webkit-transform
:
scale
(
0.0
);
}
40
%
{
transform
:
scale
(
1.0
);
-webkit-transform
:
scale
(
1.0
);
}
}
.content
{
/*position: relative;*/
width
:
100%
;
...
...
@@ -1218,13 +1279,14 @@ height: 1080px;
.teacherVideo-video
{
position
:
absolute
;
left
:
3px
;
bottom
:
0
px
;
bottom
:
-5
px
;
cursor
:
pointer
;
color
:
#333333
;
margin
:
0px
5px
0px
5px
;
}
.teacherVideo-videoBg
{
display
:
none
;
position
:
absolute
;
left
:
3px
;
bottom
:
0px
;
...
...
@@ -1244,7 +1306,7 @@ height: 1080px;
.teacherVideo-voice
{
position
:
absolute
;
left
:
23px
;
bottom
:
10
px
;
bottom
:
4
px
;
width
:
16px
;
height
:
16px
;
font-size
:
16px
;
...
...
@@ -2327,26 +2389,45 @@ canvas {
}
.loginContent
li
:nth-of-type
(
5
)
{
height
:
40px
;
line-height
:
40px
;
width
:
270px
;
}
.loginContent
li
:nth-of-type
(
5
)
label
{
margin-left
:
10px
;
}
.loginContent
li
:nth-of-type
(
5
)
input
{
margin-left
:
22px
;
}
.loginContent
li
:nth-of-type
(
6
)
{
height
:
20px
;
line-height
:
20px
;
width
:
270px
;
/*border-bottom: 1px solid #ccc;*/
}
.loginContent
li
:nth-of-type
(
5
)
p
{
/*display: none;*/
.passWordTip
{
margin-left
:
67px
;
font-size
:
12px
;
color
:
#d95136
;
/*margin-left: 45px;*/
}
/*.loginContent li:nth-of-type(6) p{*/
/*!*display: none;*!*/
/**/
.loginContent
li
:nth-of-type
(
6
)
{
/*!*margin-left: 45px;*!*/
/*}*/
.loginContent
li
:nth-of-type
(
7
)
{
height
:
40px
;
width
:
270px
;
margin-top
:
54px
;
}
.loginContent
li
:nth-of-type
(
6
)
button
{
.loginContent
li
:nth-of-type
(
7
)
button
{
height
:
40px
;
width
:
270px
;
font-size
:
14px
;
...
...
index.html
查看文件 @
98c5caa
...
...
@@ -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.227.20"
></script>
<!--<script type="text/javascript" src="http://192.168.1.140/McuClient/McuClient.js?7299033236"></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?729903213236"></script>-->
<script
type=
"text/javascript"
src=
"js/jquery-1.11.3.min.js"
></script>
<script
type=
"text/javascript"
src=
"src/main.js"
></script>
...
...
@@ -25,8 +25,6 @@
<script
type=
"text/javascript"
src=
"js/index.js"
></script>
<script
src=
"js/draw.js"
></script>
<script
type=
"text/javascript"
src=
"js/pdf.js"
></script>
<script
type=
"text/javascript"
src=
"js/pdf.worker.js"
></script>
<script
type=
"text/javascript"
src=
"src/videoWithFlash.js"
></script>
<!--<script type="text/javascript" src="src/nativeVideo.js"></script>-->
...
...
@@ -319,9 +317,14 @@
<!--文档上传的列表-->
<div
class=
"am-modal am-modal-no-btn"
tabindex=
"-1"
id=
"doc-modal-1"
>
<div
class=
"spinner"
>
<div
class=
"bounce1"
></div>
<div
class=
"bounce2"
></div>
<div
class=
"bounce3"
></div>
</div>
<div
class=
"am-modal-dialog"
>
<div
class=
"doc-headline"
>
文档列表
<a
href=
"javascript: void(0)"
class=
"iconfont"
data-am-modal-close
>

</a>
<a
href=
"javascript: void(0)"
class=
"iconfont
doc-headline-a
"
data-am-modal-close
>

</a>
</div>
<div
class=
"am-modal-bd-file"
>
...
...
@@ -387,6 +390,7 @@
</div>
<img
class=
"teacherVideoBg"
/>
<div
id=
"teacherVideo-video"
class=
"teacherVideo-video iconfont"
>

</div>
<div
id=
"teacherVideo-videoBg"
class=
"teacherVideo-videoBg iconfont"
></div>
<div
id=
"teacherVideo-voice"
class=
"teacherVideo-voice iconfont"
>

</div>
</div>
...
...
@@ -607,9 +611,15 @@
<input
value=
"111111"
class=
"passWordInput"
type=
"text"
placeholder=
"请输入课堂密码"
>
</li>
<li>
<input
id=
"hostH"
type=
"radio"
name=
"userRole"
value=
"host"
onclick=
"getValue(this.value)"
><label
for=
"host"
>
老师
</label>
<input
id=
"normalN"
type=
"radio"
name=
"userRole"
value=
"normal"
onclick=
"getValue(this.value)"
><label
for=
"normal"
>
学生
</label>
</li>
<li>
<p
class=
"passWordTip"
></p>
</li>
<li
class=
"btnLoginLi"
>
<button
id=
"btnLogin"
>
登录
</button>
</li>
...
...
@@ -903,60 +913,31 @@
function
choose
(
agrs
)
{
switch
(
agrs
)
{
case
1
:
liColor1
.
style
.
width
=
'34px'
;
liColor1
.
style
.
height
=
'34px'
;
liColor1
.
style
.
background
=
'url("images/color1-p.png") no-repeat'
;
liColor1
.
style
.
margin
=
"3px 4px 0 8px"
;
chooseColor
.
style
.
background
=
'url("images/color1-n.png") no-repeat'
;
chooseColor
.
title
=
"#4fbd92"
;
break
;
case
2
:
liColor2
.
style
.
width
=
'34px'
;
liColor2
.
style
.
height
=
'34px'
;
liColor2
.
style
.
background
=
'url("images/color2-p.png") no-repeat'
;
liColor2
.
style
.
margin
=
"3px 4px 0 8px"
;
chooseColor
.
style
.
background
=
'url("images/color2-n.png") no-repeat'
;
chooseColor
.
title
=
"#0071bc"
;
break
;
case
3
:
liColor3
.
style
.
width
=
'34px'
;
liColor3
.
style
.
height
=
'34px'
;
liColor3
.
style
.
background
=
'url("images/color3-p.png") no-repeat'
;
liColor3
.
style
.
margin
=
"3px 4px 0 8px"
;
chooseColor
.
style
.
background
=
'url("images/color3-n.png") no-repeat'
;
chooseColor
.
title
=
"#6a0db2"
;
break
;
case
4
:
liColor4
.
style
.
width
=
'34px'
;
liColor4
.
style
.
height
=
'34px'
;
liColor4
.
style
.
background
=
'url("images/color4-p.png") no-repeat'
;
liColor4
.
style
.
margin
=
"3px 4px 0 8px"
;
chooseColor
.
style
.
background
=
'url("images/color4-n.png") no-repeat'
;
chooseColor
.
title
=
"#fae81b"
;
break
;
case
5
:
liColor5
.
style
.
width
=
'34px'
;
liColor5
.
style
.
height
=
'34px'
;
liColor5
.
style
.
background
=
'url("images/color5-p.png") no-repeat'
;
liColor5
.
style
.
margin
=
"3px 4px 0 8px"
;
chooseColor
.
style
.
background
=
'url("images/color5-n.png") no-repeat'
;
chooseColor
.
title
=
"#f7751e"
;
break
;
case
6
:
liColor6
.
style
.
width
=
'34px'
;
liColor6
.
style
.
height
=
'34px'
;
liColor6
.
style
.
background
=
'url("images/color6-p.png") no-repeat'
;
liColor6
.
style
.
margin
=
"3px 4px 0 8px"
;
chooseColor
.
style
.
background
=
'url("images/color6-n.png") no-repeat'
;
chooseColor
.
title
=
"#b8242a"
;
break
;
case
7
:
liColor7
.
style
.
width
=
'34px'
;
liColor7
.
style
.
height
=
'34px'
;
liColor7
.
style
.
background
=
'url("images/color1-p.png") no-repeat'
;
liColor7
.
style
.
margin
=
"3px 4px 0 8px"
;
chooseColor
.
style
.
background
=
'url("images/color1-n.png") no-repeat'
;
chooseColor
.
title
=
"#4fbd92"
;
break
;
...
...
js/draw.js
查看文件 @
98c5caa
...
...
@@ -60,7 +60,7 @@ var canvasLeft;
//画笔大小
var
size
=
2
;
var
color
=
'#
000000
'
;
var
color
=
'#
4fbd92
'
;
//画图形
function
draw_graph
(
graphType
,
obj
){
...
...
src/main.js
查看文件 @
98c5caa
...
...
@@ -59,6 +59,12 @@ var docfullPathArr=[];
var
imgUrlSingle
;
var
curPageNum
;
var
pageNum
;
var
fileItemIdx
;
//画布
var
canvas
;
...
...
@@ -100,6 +106,7 @@ $(function () {
});
function
initEngine
(){
...
...
@@ -113,6 +120,12 @@ function initEngine(){
videoWithFlash
.
flashInit
(
client
);
// nativeVideo.nativeInit(client);
}
//在窗口关闭前提示用户
...
...
@@ -159,6 +172,11 @@ function importFile() {
console
.
log
(
"文件名:"
+
name
+
"大小:"
+
size
+
"文件类型:"
+
mime
);
//上传时动画效果
$
(
".spinner"
).
css
(
"display"
,
"block"
);
var
fd
=
new
FormData
();
fd
.
append
(
"fileToUpload"
,
document
.
getElementById
(
'file'
).
files
[
0
]);
...
...
@@ -212,6 +230,8 @@ function showFile(_data){
});
}
$
(
".spinner"
).
css
(
"display"
,
"none"
);
$
(
".doc-headline-a"
).
trigger
(
"click"
);
// var strHTML = format(tplDoc, {
// name: _data.fileName,
...
...
@@ -227,6 +247,9 @@ function showFile(_data){
//删除文档
$
(
".deleteDoc"
).
click
(
function
(
e
)
{
$
(
".spinner"
).
css
(
"display"
,
"block"
);
$
(
this
).
parent
().
addClass
(
"xin"
);
// thisFileName=$(".forSwitch").children(".itemName").html()
thisFileName
=
$
(
this
).
parent
().
find
(
".itemName"
).
html
()
...
...
@@ -281,20 +304,23 @@ function showFile(_data){
//切换文档
function
switchDoc
(
msg
)
{
$
(
".spinner"
).
css
(
"display"
,
"block"
);
var
paramInfo
=
{
"itemIdx"
:
msg
,
"visible"
:
true
};
client
.
sendDocumentSwitchDoc
(
paramInfo
);
console
.
log
(
"此时数组中存储的数====="
,
fileFromArr
);
}
//将上传文件的信息,传递给底层
function
uploadFile
(
msg
){
console
.
log
(
"服务器返回的文件信息"
);
console
.
log
(
msg
);
// fileInfo.fileName=msg.fileName;//文档名字
...
...
@@ -339,6 +365,8 @@ function showInter(_data,isPage){
console
.
log
(
"当前文档类型"
,
_data
.
fileType
);
fileItemIdx
=
_data
.
itemIdx
if
(
_data
.
fileType
==
"doc"
||
_data
.
fileType
==
"pdf"
){
$
(
"#showImg"
).
css
(
"display"
,
"none"
);
...
...
@@ -352,71 +380,27 @@ function showInter(_data,isPage){
"relativeUrl"
:
_data
.
relativeUrl
};
docfullPath
=
client
.
getDocImageFullPath
(
_paramInfo
);
// console.log("mcu返回给我的地址==========");
// console.log(docfullPath);
console
.
log
(
"mcu返回给我的地址=========="
);
console
.
log
(
docfullPath
);
// imgUrl = docfullPath[0];
// $("#docImage").css("display","block");
var
curPageNum
=
_data
.
curPageNo
;
var
pageNum
=
_data
.
pageNum
;
curPageNum
=
_data
.
curPageNo
;
pageNum
=
_data
.
pageNum
;
$
(
"#curPageNum"
).
html
(
curPageNum
);
$
(
"#totalPageNum"
).
html
(
pageNum
);
for
(
var
i
=
0
;
i
<=
docfullPath
.
length
;
i
++
){
console
.
log
(
"curPageNum"
,
curPageNum
);
for
(
var
i
=
0
;
i
<
docfullPath
.
length
;
i
++
){
var
docfullSingle
=
docfullPath
[
curPageNum
-
1
];
$
(
"#docImage"
).
attr
(
"src"
,
docfullSingle
);
}
//点击下一页
$
(
"#nextPage"
).
on
(
"click"
,
function
(
e
)
{
if
(
curPageNum
!==
pageNum
){
for
(
var
i
=
0
;
i
<=
docfullPath
.
length
;
i
++
){
var
docfullSingle
=
docfullPath
[
curPageNum
];
console
.
log
(
"curPageNum,docfullSingle"
,
curPageNum
,
docfullSingle
);
$
(
"#docImage"
).
attr
(
"src"
,
docfullSingle
);
}
curPageNum
++
;
}
var
paramInfo
=
{
"itemIdx"
:
_data
.
itemIdx
,
"curPageNo"
:
curPageNum
};
console
.
log
(
"paramInfo=======>"
,
paramInfo
)
client
.
sendDocumentSwitchPage
(
paramInfo
);
$
(
"#curPageNum"
).
html
(
curPageNum
);
});
//点击上一页
$
(
"#prevPage"
).
on
(
"click"
,
function
(
e
)
{
if
(
curPageNum
>
1
){
curPageNum
--
;
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
);
}
}
var
paramInfo
=
{
"itemIdx"
:
_data
.
itemIdx
,
"curPageNo"
:
curPageNum
};
client
.
sendDocumentSwitchPage
(
paramInfo
);
$
(
"#curPageNum"
).
html
(
curPageNum
);
});
...
...
@@ -504,63 +488,18 @@ function showTurnPage() {
}
//翻页模块
function
turnPage
(
_data
){
console
.
log
(
"翻页模块"
)
console
.
log
(
_data
);
var
curPageNum
=
_data
.
curPageNo
;
var
pageNum
=
_data
.
pageNum
;
$
(
"#curPageNum"
).
html
(
curPageNum
);
$
(
"#totalPageNum"
).
html
(
pageNum
);
//点击下一页
$
(
"#nextPage"
).
on
(
"click"
,
function
(
e
)
{
if
(
curPageNum
<
pageNum
){
curPageNum
++
;
}
var
paramInfo
=
{
"itemIdx"
:
_data
.
itemIdx
,
"curPageNo"
:
curPageNum
};
client
.
sendDocumentSwitchPage
(
paramInfo
);
$
(
"#curPageNum"
).
html
(
curPageNum
);
// openPage(pdf, curPageNum);
});
//点击上一页
$
(
"#prevPage"
).
on
(
"click"
,
function
(
e
)
{
if
(
curPageNum
>
1
){
curPageNum
--
;
}
var
paramInfo
=
{
"itemIdx"
:
_data
.
itemIdx
,
"curPageNo"
:
curPageNum
};
client
.
sendDocumentSwitchPage
(
paramInfo
);
$
(
"#curPageNum"
).
html
(
curPageNum
);
// openPage(pdf, curPageNum);
});
}
//监听文档删除
function
docDelete
(
callbackData
){
console
.
log
(
"监听文档删除"
);
console
.
log
(
callbackData
);
//
updateDocList
(
callbackData
,
1
);
//操作页面
$
(
"li"
).
remove
(
".xin"
);
$
(
".spinner"
).
css
(
"display"
,
"none"
);
$
(
".doc-headline-a"
).
trigger
(
"click"
);
}
...
...
@@ -695,12 +634,20 @@ function classFailed(callbackData) {
case
207
:
break
;
case
300
:
break
;
case
301
:
break
;
case
20000
:
mcuErrorTip
();
break
;
default
:
break
;
}
}
//mcu报错,进不去课堂
function
mcuErrorTip
(){
$
(
".passWordTip"
).
css
(
"margin-left"
,
"45px"
);
$
(
".passWordTip"
)[
0
].
innerHTML
=
"请稍后再试,正在重新连接"
;
}
//课堂密码错误 进行提示
function
classPwdErrorTip
()
{
$
(
".passWordTip"
).
css
(
"margin-left"
,
"45px"
);
...
...
@@ -899,7 +846,6 @@ function showParmasInput(){
// var fourParams={};
fourParams
=
{
classId
:
classId
,
userRole
:
classLoadInfo
.
userRole
,
portal
:
"112.126.80.182:90"
,
...
...
@@ -910,14 +856,10 @@ function showParmasInput(){
client
.
init
(
fourParams
,
classInitSuccess
,
classFailed
);
});
}
//加入课堂成功
function
classJoinSuccess
(
callbackData
){
classAllInfo
=
callbackData
;
console
.
log
(
"classJoinSuccess"
,
callbackData
);
console
.
log
(
callbackData
);
...
...
@@ -935,10 +877,6 @@ if (callbackData.userRole=="normal"){
}
classAllInfo
=
callbackData
;
//准备主页面
layoutView
();
//开始课堂
...
...
@@ -951,23 +889,14 @@ function startClass() {
//监听到聊天信息
client
.
on
(
MessageTypes
.
CHAT_RECEIVE
,
chatReceive
);
client
.
on
(
MessageTypes
.
WHITEBOARD_ANNOTATION_UPDATE
,
whiteboardUpdate
);
//监听白板更新
client
.
on
(
MessageTypes
.
DOC_DELETE
,
docDelete
);
//监听删除文档
client
.
on
(
MessageTypes
.
DOC_UPDATE
,
docUpdate
);
//监听更新文档
}
}
//登录成功后,登录页隐藏,主页面显示
function
layoutView
(
)
{
console
.
log
(
"123000000000000000000000000000000000000"
);
//输入4个参数的页面隐藏
$
(
".fourParamsOut"
).
css
(
"display"
,
"none"
);
//登录成功后,登录页隐藏
...
...
@@ -998,124 +927,6 @@ function layoutView( ) {
//
// //老师的视频区域
// var teaVideo = document.getElementById("teacherVideo-video");
// var teaVv = document.getElementById("teacherVideo-voice");
// var closeVideo = document.getElementById("close-video");
// var closeVoice = document.getElementById("close-voice");
//
// var throbberLoader1 = document.getElementById("throbber-loader1");
// var throbberLoader2 = document.getElementById("throbber-loader2");
// var throbberLoader3 = document.getElementById("throbber-loader3");
// var throbberLoader4 = document.getElementById("throbber-loader4");
// var throbberLoader5 = document.getElementById("throbber-loader5");
// var throbberLoader6 = document.getElementById("throbber-loader6");
//
//
// //老师点击麦克按钮
// var showflag = 0;
// teaVv.onclick = function () {
// if (showflag == "0") {
// closeVoice.style.display = "none";
// showflag++;
// console.log(showflag);
//
// throbberLoader1.className = "throbber-loader1";
// throbberLoader2.className = "throbber-loader2";
// throbberLoader3.className = "throbber-loader3";
// throbberLoader4.className = "throbber-loader4";
// throbberLoader5.className = "throbber-loader5";
// throbberLoader6.className = "throbber-loader6";
// $(".teacherVideoBg").css("display","none");
//
// } else if (showflag == "1") {
// closeVoice.style.display = "block";
// showflag--;
// console.log(showflag);
// throbberLoader1.className = "teacherVideo-voice-progress-span-1";
// throbberLoader2.className = "teacherVideo-voice-progress-span-2";
// throbberLoader3.className = "teacherVideo-voice-progress-span-3";
// throbberLoader4.className = "teacherVideo-voice-progress-span-4";
// throbberLoader5.className = "teacherVideo-voice-progress-span-5";
// throbberLoader6.className = "teacherVideo-voice-progress-span-6";
// $(".teacherVideoBg").css("display","block");
// }
// }
//
// //老师点击视频按钮
// var Videoflag = 0;
// teaVideo.onclick = function () {
// console.log(navigator.mediaDevices);
// navigator.mediaDevices = navigator.mediaDevices || ((navigator.mozGetUserMedia || navigator.webkitGetUserMedia) ? {
// getUserMedia: function (c) {
// return new Promise(function (y, n) {
// (navigator.mozGetUserMedia ||
// navigator.webkitGetUserMedia).call(navigator, c, y, n);
// });
// }
// } : null);
// console.log(navigator.mediaDevices);
// if (Videoflag == "0") {
// closeVideo.style.display = "none";
// closeVoice.style.display = "none";
// Videoflag++;
// throbberLoader1.className = "throbber-loader1";
// throbberLoader2.className = "throbber-loader2";
// throbberLoader3.className = "throbber-loader3";
// throbberLoader4.className = "throbber-loader4";
// throbberLoader5.className = "throbber-loader5";
// throbberLoader6.className = "throbber-loader6";
//
// var constraints = {audio: true, video: true};
//
// navigator.mediaDevices.getUserMedia(constraints)
// .then(function (stream) {
// if (window.URL) {
// console.log(window.URL);
// var newSrc = window.URL.createObjectURL(stream);
// //将老师流地址给老师的Video
// $("#teacherVideoInfo").attr("src",newSrc);
// } else {
// $("#teacherVideoInfo").src = stream;
// }
// $(".teacherVideoInfo").autoplay = true;
//
// var videoName=stream.getVideoTracks()[0].label;
// var audioName=stream.getAudioTracks()[0].label;
// console.log(videoName);
// console.log(audioName);
//
// }
// )
// .catch(function (err) {
// console.log(err.name + ": " + err.message);
// });
//
//
//
// $(".teacherVideoBg").css("display","none");
// } else if (Videoflag == "1") {
// closeVideo.style.display = "block";
// closeVoice.style.display = "block";
// Videoflag--;
// throbberLoader1.className = "teacherVideo-voice-progress-span-1";
// throbberLoader2.className = "teacherVideo-voice-progress-span-2";
// throbberLoader3.className = "teacherVideo-voice-progress-span-3";
// throbberLoader4.className = "teacherVideo-voice-progress-span-4";
// throbberLoader5.className = "teacherVideo-voice-progress-span-5";
// throbberLoader6.className = "teacherVideo-voice-progress-span-6";
//
// $(".teacherVideoBg").css("display","block");
// $("#teacherVideoInfo").attr("src","");
// }
//
// }
//发送聊天消息
$
(
"#btn_send"
).
click
(
function
(
e
)
{
console
.
log
(
"点击了发送消息按钮------->"
);
...
...
@@ -1124,95 +935,80 @@ function layoutView( ) {
});
// 文件上传
$
(
"#pushFile"
).
click
(
function
()
{
$
(
"#file"
).
click
();
});
//点击下一页
$
(
"#nextPage"
).
on
(
"click"
,
function
(
e
)
{
console
.
log
(
curPageNum
);
// //视频按钮点击
// $("#teacherVideo-video").click(function (e) {
// console.log("teacherVideo-video点击");
// $("#teacherVideo-video").html(" ");
// $("#teacherVideo-video").removeClass("teacherVideo-video");
// $("#teacherVideo-video").addClass("teacherVideo-videoBg");
//
//
// $("#teacherVideo-voice").html("");
// $("#teacherVideo-voice").addClass("teacherVideo-voice");
// $("#teacherVideo-voice").removeClass("teacherVideo-voiceBg");
//
//
// //获取推流地址
// achieveStream();
var
paramInfo
=
{
"itemIdx"
:
fileItemIdx
,
"curPageNo"
:
curPageNum
+
1
};
console
.
log
(
"paramInfo=======>"
,
paramInfo
)
client
.
sendDocumentSwitchPage
(
paramInfo
);
$
(
"#curPageNum"
).
html
(
curPageNum
);
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++;
}
// });
//音频按钮点击
$
(
"#teacherVideo-voice"
).
click
(
function
(
e
)
{
});
console
.
log
(
"teacherVideo-voice点击"
);
$
(
"#teacherVideo-video"
).
html
(
""
);
$
(
"#teacherVideo-video"
).
removeClass
(
"teacherVideo-videoBg"
);
$
(
"#teacherVideo-video"
).
addClass
(
"teacherVideo-video"
);
//点击上一页
$
(
"#prevPage"
).
on
(
"click"
,
function
(
e
)
{
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
=
{
"itemIdx"
:
fileItemIdx
,
"curPageNo"
:
curPageNum
-
1
};
console
.
log
(
"paramInfo=======>"
,
paramInfo
)
client
.
sendDocumentSwitchPage
(
paramInfo
);
$
(
"#curPageNum"
).
html
(
curPageNum
);
$
(
"#teacherVideo-voice"
).
html
(
""
);
$
(
"#teacherVideo-voice"
).
removeClass
(
"teacherVideo-voice"
);
$
(
"#teacherVideo-voice"
).
addClass
(
"teacherVideo-voiceBg"
);
});
}
function
whiteboardUpdate
(
callbackData
)
{
console
.
log
(
"同步canvas消息==========================="
);
console
.
log
(
"同步canvas消息"
);
console
.
log
(
callbackData
);
draw
.
drawCanvas
(
callbackData
);
// canvasInfoUpdate=callbackData;
//
// // canvasInfoUpArr.push(canvasInfoUpdate.itemIdx);
//
// console.log("同步的存到数组中");
// console.log(canvasInfoUpArr);
//
// draw.ss(canvasInfoUpdate);
// draw.trans(canvasInfoUpArr);
}
function
whiteboardDelete
(
callbackData
)
{
console
.
log
(
"监听白板删除的消息============================"
);
console
.
log
(
callbackData
);
draw
.
clearContextCan
();
canvasInfoUpArr
=
[];
canvasInfoArr
=
[];
$
(
".spinner"
).
css
(
"display"
,
"none"
);
$
(
".doc-headline-a"
).
trigger
(
"click"
);
}
//接收聊天消息
function
chatReceive
(
callbackData
){
console
.
log
()
console
.
log
(
"777777777777777777777777777777"
);
console
.
log
(
callbackData
);
var
tpl
=
callbackData
.
fromRole
==
"host"
?
tpl_message_teacher
:
tpl_message_student
;
var
message
=
(
callbackData
.
message
+
""
).
replace
(
/
\[
img:
([^\[
:
\]]
*
)\]
/ig
,
function
(
match
,
group
,
index
)
{
return
'<img src="images/face/'
+
group
+
'.gif"/>'
;
});
var
strHTML
=
format
(
tpl
,
{
name
:
callbackData
.
fromName
,
message
:
message
});
$
(
"#panel_message"
).
append
(
strHTML
);
$
(
"#panel_message"
)[
0
].
scrollTop
=
$
(
"#panel_message"
)[
0
].
scrollHeight
;
}
//将地址转化成一个对象
function
GetUrlParam
()
{
var
url
=
location
.
search
;
...
...
@@ -1278,6 +1074,7 @@ function loading() {
}
//在页面loading时,提交验证,传给底层
function
urlParamsJudge
(){
//1.地址栏获取参数
...
...
@@ -1327,20 +1124,4 @@ function format(str, obj) {
return
str
.
replace
(
/
\{(\w
+
)\}
/g
,
function
(
match
,
group
,
index
)
{
return
obj
[
group
];
});
}
// //获取推流地址
// function achieveStream(){
//
// var paramInfo={
// "type": "flash"
// };
// var result=client.getVideoPublishPath(paramInfo);
//
// console.log("执行getPublishVideoPath,返回的结果")
// console.log(result);
//
// };
\ No newline at end of file
}
\ No newline at end of file
...
...
src/videoWithFlash.js
查看文件 @
98c5caa
...
...
@@ -5,9 +5,9 @@
var
client
;
//客户端
var
pubResultObj
;
// 存储底层给我的推流结果
var
publishObj
;
var
videoWithFlash
=
{};
...
...
@@ -63,15 +63,17 @@ $(function () {
$
(
"#teacherVideo-video"
).
click
(
function
(
e
)
{
console
.
log
(
"teacherVideo-video点击"
);
$
(
"#teacherVideo-video"
).
html
(
" "
);
$
(
"#teacherVideo-video"
).
removeClass
(
"teacherVideo-video"
);
$
(
"#teacherVideo-video"
).
addClass
(
"teacherVideo-videoBg"
);
// $("#teacherVideo-video").removeClass("teacherVideo-video");
// $("#teacherVideo-video").addClass("teacherVideo-videoBg");
$
(
".teacherVideo-videoBg"
).
css
(
"display"
,
"block"
);
$
(
".teacherVideo-video"
).
css
(
"display"
,
"none"
);
$
(
"#teacherVideo-voice"
).
html
(
""
);
$
(
"#teacherVideo-voice"
).
addClass
(
"teacherVideo-voice"
);
$
(
"#teacherVideo-voice"
).
removeClass
(
"teacherVideo-voiceBg"
);
$
(
".teacherVideoBg"
).
css
(
"display"
,
"none"
);
$
(
".teacherVideo"
).
css
(
"background"
,
"#CCCCCC"
);
$
(
".teacherVideo-voice"
).
css
(
"bottom"
,
"4px"
);
...
...
@@ -81,9 +83,7 @@ $(function () {
});
//老师音频按钮点击
$
(
"#teacherVideo-voice"
).
click
(
function
(
e
)
{
$
(
".teacherVideo-voice"
).
click
(
function
(
e
)
{
console
.
log
(
"teacherVideo-voice点击"
);
$
(
"#teacherVideo-video"
).
html
(
""
);
$
(
"#teacherVideo-video"
).
removeClass
(
"teacherVideo-videoBg"
);
...
...
@@ -94,6 +94,34 @@ $(function () {
$
(
"#teacherVideo-voice"
).
addClass
(
"teacherVideo-voiceBg"
);
});
//老师视频关闭按钮点击
$
(
"#teacherVideo-videoBg"
).
click
(
function
(
e
)
{
if
(
window
.
publishflash
)
{
const
stopInfo
=
JSON
.
stringify
({
type
:
5
,
videoId
:
publishflashVideoId
,
});
console
.
log
(
publishflash
.
_js2native
(
stopInfo
));
}
var
paramInfo
=
{
"nodeId"
:
Number
(
classAllInfo
.
nodeId
)
//用户的nodeId
};
client
.
stopPublishVideo
(
paramInfo
);
$
(
".publish"
).
css
(
"display"
,
"none"
);
$
(
".teacherVideo"
).
css
(
"background"
,
"#f5f9fb"
);
$
(
".teacherVideoBg"
).
css
(
"display"
,
"block"
);
$
(
"#teacherVideo-video"
).
css
(
"display"
,
"block"
);
$
(
"#teacherVideo-videoBg"
).
css
(
"display"
,
"none"
);
});
});
//获取推流地址
...
...
@@ -114,8 +142,6 @@ $(function () {
//code为0,代表成功
if
(
pubResult
.
code
==
0
){
if
(
!
window
.
publishflash
)
{
flashvideo
(
'publish'
,
...
...
@@ -136,7 +162,6 @@ $(function () {
var
_msg
=
JSON
.
parse
(
msg
);
console
.
log
(
"_msg===========>"
,
_msg
);
if
(
_msg
.
data
.
result
==
0
){
debugger
;
//将之前底层取的推流结果传递给底层
var
_successErrorResult
=
client
.
publishVideo
(
pubResult
);
console
.
log
(
"_successErrorResult======>"
,
_successErrorResult
)
...
...
@@ -149,6 +174,9 @@ $(function () {
}
else
{
console
.
error
(
'publish error'
);
}
}
)
...
...
@@ -158,10 +186,9 @@ $(function () {
publishURL
(
pubResult
.
publishUrl
);
}
}
}
else
if
(
pubResult
.
code
==
1
){
}
}
function
publishURL
(
rtmpURL
)
{
const
msg
=
JSON
.
stringify
({
...
...
@@ -184,7 +211,21 @@ function publishURL(rtmpURL) {
achievePlayStream
(
playCallbackDate
);
}
if
(
callbackDate
.
status
==
0
){
if
(
window
.
playflash
){
console
.
log
(
"playflashVideoId"
,
playflashVideoId
);
const
stopPlayInfo
=
JSON
.
stringify
({
type
:
5
,
videoId
:
playflashVideoId
});
console
.
log
(
playflash
.
_js2native
(
stopPlayInfo
));
}
$
(
"#teacherVideo-videoBg"
).
css
(
"display"
,
"none"
);
$
(
"#teacherVideo-video"
).
html
(
""
);
$
(
".play"
).
css
(
"display"
,
"none"
);
$
(
".teacherVideo"
).
css
(
"background"
,
"#f5f9fb"
);
$
(
".teacherVideoBg"
).
css
(
"display"
,
"block"
);
...
...
@@ -205,12 +246,11 @@ function publishURL(rtmpURL) {
};
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"
);
// $(".publish").css("display","none");
if
(
!
window
.
playflash
)
{
flashvideo
(
...
...
请
注册
或
登录
后发表评论