正在显示
5 个修改的文件
包含
255 行增加
和
372 行删除
@@ -949,6 +949,67 @@ height: 1080px; | @@ -949,6 +949,67 @@ height: 1080px; | ||
949 | 949 | ||
950 | 950 | ||
951 | 951 | ||
952 | +/*上传效果*/ | ||
953 | +.spinner { | ||
954 | + display:none ; | ||
955 | + z-index: 10; | ||
956 | + position: absolute; | ||
957 | + top: 130px; | ||
958 | + left: 556px; | ||
959 | + margin: 100px auto 0; | ||
960 | + width: 150px; | ||
961 | + text-align: center; | ||
962 | + | ||
963 | + | ||
964 | +} | ||
965 | + | ||
966 | +.spinner > div { | ||
967 | + width: 30px; | ||
968 | + height: 30px; | ||
969 | + background-color: #3498db; | ||
970 | + | ||
971 | + border-radius: 100%; | ||
972 | + display: inline-block; | ||
973 | + -webkit-animation: bouncedelay 1.4s infinite ease-in-out; | ||
974 | + animation: bouncedelay 1.4s infinite ease-in-out; | ||
975 | + /* Prevent first frame from flickering when animation starts */ | ||
976 | + -webkit-animation-fill-mode: both; | ||
977 | + animation-fill-mode: both; | ||
978 | +} | ||
979 | + | ||
980 | +.spinner .bounce1 { | ||
981 | + -webkit-animation-delay: -0.32s; | ||
982 | + animation-delay: -0.32s; | ||
983 | +} | ||
984 | + | ||
985 | +.spinner .bounce2 { | ||
986 | + -webkit-animation-delay: -0.16s; | ||
987 | + animation-delay: -0.16s; | ||
988 | +} | ||
989 | + | ||
990 | +@-webkit-keyframes bouncedelay { | ||
991 | + 0%, 80%, 100% { -webkit-transform: scale(0.0) } | ||
992 | + 40% { -webkit-transform: scale(1.0) } | ||
993 | +} | ||
994 | + | ||
995 | +@keyframes bouncedelay { | ||
996 | + 0%, 80%, 100% { | ||
997 | + transform: scale(0.0); | ||
998 | + -webkit-transform: scale(0.0); | ||
999 | + } 40% { | ||
1000 | + transform: scale(1.0); | ||
1001 | + -webkit-transform: scale(1.0); | ||
1002 | + } | ||
1003 | +} | ||
1004 | + | ||
1005 | + | ||
1006 | + | ||
1007 | + | ||
1008 | + | ||
1009 | + | ||
1010 | + | ||
1011 | + | ||
1012 | + | ||
952 | .content { | 1013 | .content { |
953 | /*position: relative;*/ | 1014 | /*position: relative;*/ |
954 | width: 100%; | 1015 | width: 100%; |
@@ -1218,13 +1279,14 @@ height: 1080px; | @@ -1218,13 +1279,14 @@ height: 1080px; | ||
1218 | .teacherVideo-video{ | 1279 | .teacherVideo-video{ |
1219 | position: absolute; | 1280 | position: absolute; |
1220 | left: 3px; | 1281 | left: 3px; |
1221 | - bottom: 0px; | 1282 | + bottom: -5px; |
1222 | cursor: pointer; | 1283 | cursor: pointer; |
1223 | color: #333333; | 1284 | color: #333333; |
1224 | margin: 0px 5px 0px 5px; | 1285 | margin: 0px 5px 0px 5px; |
1225 | 1286 | ||
1226 | } | 1287 | } |
1227 | .teacherVideo-videoBg{ | 1288 | .teacherVideo-videoBg{ |
1289 | + display: none; | ||
1228 | position: absolute; | 1290 | position: absolute; |
1229 | left: 3px; | 1291 | left: 3px; |
1230 | bottom: 0px; | 1292 | bottom: 0px; |
@@ -1244,7 +1306,7 @@ height: 1080px; | @@ -1244,7 +1306,7 @@ height: 1080px; | ||
1244 | .teacherVideo-voice{ | 1306 | .teacherVideo-voice{ |
1245 | position: absolute; | 1307 | position: absolute; |
1246 | left:23px; | 1308 | left:23px; |
1247 | - bottom: 10px; | 1309 | + bottom: 4px; |
1248 | width: 16px; | 1310 | width: 16px; |
1249 | height: 16px; | 1311 | height: 16px; |
1250 | font-size: 16px; | 1312 | font-size: 16px; |
@@ -2327,26 +2389,45 @@ canvas { | @@ -2327,26 +2389,45 @@ canvas { | ||
2327 | } | 2389 | } |
2328 | 2390 | ||
2329 | .loginContent li:nth-of-type(5){ | 2391 | .loginContent li:nth-of-type(5){ |
2392 | + height: 40px; | ||
2393 | + line-height: 40px; | ||
2394 | + width: 270px; | ||
2395 | +} | ||
2396 | +.loginContent li:nth-of-type(5) label{ | ||
2397 | + margin-left: 10px; | ||
2398 | +} | ||
2399 | +.loginContent li:nth-of-type(5) input{ | ||
2400 | + margin-left: 22px; | ||
2401 | +} | ||
2402 | + | ||
2403 | + | ||
2404 | +.loginContent li:nth-of-type(6){ | ||
2330 | height: 20px; | 2405 | height: 20px; |
2331 | line-height: 20px; | 2406 | line-height: 20px; |
2332 | width: 270px; | 2407 | width: 270px; |
2408 | + | ||
2333 | /*border-bottom: 1px solid #ccc;*/ | 2409 | /*border-bottom: 1px solid #ccc;*/ |
2334 | } | 2410 | } |
2335 | -.loginContent li:nth-of-type(5) p{ | ||
2336 | - /*display: none;*/ | 2411 | +.passWordTip{ |
2412 | + margin-left: 67px; | ||
2337 | font-size: 12px; | 2413 | font-size: 12px; |
2338 | color: #d95136; | 2414 | color: #d95136; |
2339 | - /*margin-left: 45px;*/ | ||
2340 | - | ||
2341 | } | 2415 | } |
2416 | +/*.loginContent li:nth-of-type(6) p{*/ | ||
2417 | + /*!*display: none;*!*/ | ||
2418 | + /**/ | ||
2342 | 2419 | ||
2343 | -.loginContent li:nth-of-type(6){ | 2420 | + /*!*margin-left: 45px;*!*/ |
2421 | + | ||
2422 | +/*}*/ | ||
2423 | + | ||
2424 | +.loginContent li:nth-of-type(7){ | ||
2344 | height: 40px; | 2425 | height: 40px; |
2345 | width: 270px; | 2426 | width: 270px; |
2346 | - margin-top: 54px; | 2427 | + |
2347 | 2428 | ||
2348 | } | 2429 | } |
2349 | -.loginContent li:nth-of-type(6) button{ | 2430 | +.loginContent li:nth-of-type(7) button{ |
2350 | height: 40px; | 2431 | height: 40px; |
2351 | width: 270px; | 2432 | width: 270px; |
2352 | font-size: 14px; | 2433 | font-size: 14px; |
@@ -16,8 +16,8 @@ | @@ -16,8 +16,8 @@ | ||
16 | <script type="text/javascript" src="js/xdyEvent.js"></script> | 16 | <script type="text/javascript" src="js/xdyEvent.js"></script> |
17 | <script type="text/javascript" src="js/drag.js"></script> | 17 | <script type="text/javascript" src="js/drag.js"></script> |
18 | 18 | ||
19 | - <script type="text/javascript" src="js/McuClient.js?v=1.0.227.20"></script> | ||
20 | - <!--<script type="text/javascript" src="http://192.168.1.140/McuClient/McuClient.js?7299033236"></script>--> | 19 | + <script type="text/javascript" src="js/McuClient.js?v=1.0.228.14"></script> |
20 | + <!--<script type="text/javascript" src="http://192.168.1.140/McuClient/McuClient.js?729903213236"></script>--> | ||
21 | <script type="text/javascript" src="js/jquery-1.11.3.min.js"></script> | 21 | <script type="text/javascript" src="js/jquery-1.11.3.min.js"></script> |
22 | 22 | ||
23 | <script type="text/javascript" src="src/main.js"></script> | 23 | <script type="text/javascript" src="src/main.js"></script> |
@@ -25,8 +25,6 @@ | @@ -25,8 +25,6 @@ | ||
25 | <script type="text/javascript" src="js/index.js"></script> | 25 | <script type="text/javascript" src="js/index.js"></script> |
26 | <script src="js/draw.js"></script> | 26 | <script src="js/draw.js"></script> |
27 | 27 | ||
28 | - <script type="text/javascript" src="js/pdf.js"></script> | ||
29 | - <script type="text/javascript" src="js/pdf.worker.js"></script> | ||
30 | 28 | ||
31 | <script type="text/javascript" src="src/videoWithFlash.js"></script> | 29 | <script type="text/javascript" src="src/videoWithFlash.js"></script> |
32 | <!--<script type="text/javascript" src="src/nativeVideo.js"></script>--> | 30 | <!--<script type="text/javascript" src="src/nativeVideo.js"></script>--> |
@@ -319,9 +317,14 @@ | @@ -319,9 +317,14 @@ | ||
319 | 317 | ||
320 | <!--文档上传的列表--> | 318 | <!--文档上传的列表--> |
321 | <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-1"> | 319 | <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-1"> |
320 | + <div class="spinner"> | ||
321 | + <div class="bounce1"></div> | ||
322 | + <div class="bounce2"></div> | ||
323 | + <div class="bounce3"></div> | ||
324 | + </div> | ||
322 | <div class="am-modal-dialog"> | 325 | <div class="am-modal-dialog"> |
323 | <div class="doc-headline">文档列表 | 326 | <div class="doc-headline">文档列表 |
324 | - <a href="javascript: void(0)" class="iconfont" data-am-modal-close></a> | 327 | + <a href="javascript: void(0)" class="iconfont doc-headline-a" data-am-modal-close></a> |
325 | </div> | 328 | </div> |
326 | <div class="am-modal-bd-file"> | 329 | <div class="am-modal-bd-file"> |
327 | 330 | ||
@@ -387,6 +390,7 @@ | @@ -387,6 +390,7 @@ | ||
387 | </div> | 390 | </div> |
388 | <img class="teacherVideoBg"/> | 391 | <img class="teacherVideoBg"/> |
389 | <div id="teacherVideo-video" class="teacherVideo-video iconfont"></div> | 392 | <div id="teacherVideo-video" class="teacherVideo-video iconfont"></div> |
393 | + <div id="teacherVideo-videoBg" class="teacherVideo-videoBg iconfont"></div> | ||
390 | <div id="teacherVideo-voice" class="teacherVideo-voice iconfont"></div> | 394 | <div id="teacherVideo-voice" class="teacherVideo-voice iconfont"></div> |
391 | 395 | ||
392 | </div> | 396 | </div> |
@@ -607,9 +611,15 @@ | @@ -607,9 +611,15 @@ | ||
607 | <input value="111111" class="passWordInput" type="text" placeholder="请输入课堂密码"> | 611 | <input value="111111" class="passWordInput" type="text" placeholder="请输入课堂密码"> |
608 | </li> | 612 | </li> |
609 | <li> | 613 | <li> |
614 | + <input id="hostH" type="radio" name="userRole" value="host" onclick="getValue(this.value)"><label for="host">老师</label> | ||
615 | + <input id="normalN" type="radio" name="userRole" value="normal" onclick="getValue(this.value)"><label for="normal">学生</label> | ||
616 | + </li> | ||
617 | + <li> | ||
610 | <p class="passWordTip"></p> | 618 | <p class="passWordTip"></p> |
611 | </li> | 619 | </li> |
612 | 620 | ||
621 | + | ||
622 | + | ||
613 | <li class="btnLoginLi"> | 623 | <li class="btnLoginLi"> |
614 | <button id="btnLogin">登录</button> | 624 | <button id="btnLogin">登录</button> |
615 | </li> | 625 | </li> |
@@ -903,60 +913,31 @@ | @@ -903,60 +913,31 @@ | ||
903 | function choose(agrs) { | 913 | function choose(agrs) { |
904 | switch (agrs) { | 914 | switch (agrs) { |
905 | case 1: | 915 | case 1: |
906 | - liColor1.style.width = '34px'; | ||
907 | - liColor1.style.height = '34px'; | ||
908 | - liColor1.style.background = 'url("images/color1-p.png") no-repeat'; | ||
909 | - liColor1.style.margin = "3px 4px 0 8px"; | ||
910 | chooseColor.style.background = 'url("images/color1-n.png") no-repeat'; | 916 | chooseColor.style.background = 'url("images/color1-n.png") no-repeat'; |
911 | chooseColor.title = "#4fbd92"; | 917 | chooseColor.title = "#4fbd92"; |
912 | break; | 918 | break; |
913 | case 2: | 919 | case 2: |
914 | - liColor2.style.width = '34px'; | ||
915 | - liColor2.style.height = '34px'; | ||
916 | - liColor2.style.background = 'url("images/color2-p.png") no-repeat'; | ||
917 | - liColor2.style.margin = "3px 4px 0 8px"; | ||
918 | chooseColor.style.background = 'url("images/color2-n.png") no-repeat'; | 920 | chooseColor.style.background = 'url("images/color2-n.png") no-repeat'; |
919 | chooseColor.title = "#0071bc"; | 921 | chooseColor.title = "#0071bc"; |
920 | break; | 922 | break; |
921 | case 3: | 923 | case 3: |
922 | - liColor3.style.width = '34px'; | ||
923 | - liColor3.style.height = '34px'; | ||
924 | - liColor3.style.background = 'url("images/color3-p.png") no-repeat'; | ||
925 | - liColor3.style.margin = "3px 4px 0 8px"; | 924 | + |
926 | chooseColor.style.background = 'url("images/color3-n.png") no-repeat'; | 925 | chooseColor.style.background = 'url("images/color3-n.png") no-repeat'; |
927 | chooseColor.title = "#6a0db2"; | 926 | chooseColor.title = "#6a0db2"; |
928 | break; | 927 | break; |
929 | case 4: | 928 | case 4: |
930 | - liColor4.style.width = '34px'; | ||
931 | - liColor4.style.height = '34px'; | ||
932 | - liColor4.style.background = 'url("images/color4-p.png") no-repeat'; | ||
933 | - liColor4.style.margin = "3px 4px 0 8px"; | ||
934 | chooseColor.style.background = 'url("images/color4-n.png") no-repeat'; | 929 | chooseColor.style.background = 'url("images/color4-n.png") no-repeat'; |
935 | chooseColor.title = "#fae81b"; | 930 | chooseColor.title = "#fae81b"; |
936 | - | ||
937 | break; | 931 | break; |
938 | case 5: | 932 | case 5: |
939 | - liColor5.style.width = '34px'; | ||
940 | - liColor5.style.height = '34px'; | ||
941 | - liColor5.style.background = 'url("images/color5-p.png") no-repeat'; | ||
942 | - liColor5.style.margin = "3px 4px 0 8px"; | ||
943 | chooseColor.style.background = 'url("images/color5-n.png") no-repeat'; | 933 | chooseColor.style.background = 'url("images/color5-n.png") no-repeat'; |
944 | chooseColor.title = "#f7751e"; | 934 | chooseColor.title = "#f7751e"; |
945 | - | ||
946 | break; | 935 | break; |
947 | case 6: | 936 | case 6: |
948 | - liColor6.style.width = '34px'; | ||
949 | - liColor6.style.height = '34px'; | ||
950 | - liColor6.style.background = 'url("images/color6-p.png") no-repeat'; | ||
951 | - liColor6.style.margin = "3px 4px 0 8px"; | ||
952 | chooseColor.style.background = 'url("images/color6-n.png") no-repeat'; | 937 | chooseColor.style.background = 'url("images/color6-n.png") no-repeat'; |
953 | chooseColor.title = "#b8242a"; | 938 | chooseColor.title = "#b8242a"; |
954 | break; | 939 | break; |
955 | case 7: | 940 | case 7: |
956 | - liColor7.style.width = '34px'; | ||
957 | - liColor7.style.height = '34px'; | ||
958 | - liColor7.style.background = 'url("images/color1-p.png") no-repeat'; | ||
959 | - liColor7.style.margin = "3px 4px 0 8px"; | ||
960 | chooseColor.style.background = 'url("images/color1-n.png") no-repeat'; | 941 | chooseColor.style.background = 'url("images/color1-n.png") no-repeat'; |
961 | chooseColor.title = "#4fbd92"; | 942 | chooseColor.title = "#4fbd92"; |
962 | break; | 943 | break; |
@@ -59,6 +59,12 @@ var docfullPathArr=[]; | @@ -59,6 +59,12 @@ var docfullPathArr=[]; | ||
59 | var imgUrlSingle; | 59 | var imgUrlSingle; |
60 | 60 | ||
61 | 61 | ||
62 | +var curPageNum; | ||
63 | +var pageNum; | ||
64 | + | ||
65 | +var fileItemIdx; | ||
66 | + | ||
67 | + | ||
62 | 68 | ||
63 | //画布 | 69 | //画布 |
64 | var canvas ; | 70 | var canvas ; |
@@ -100,6 +106,7 @@ $(function () { | @@ -100,6 +106,7 @@ $(function () { | ||
100 | 106 | ||
101 | 107 | ||
102 | 108 | ||
109 | + | ||
103 | }); | 110 | }); |
104 | 111 | ||
105 | function initEngine(){ | 112 | function initEngine(){ |
@@ -113,6 +120,12 @@ function initEngine(){ | @@ -113,6 +120,12 @@ function initEngine(){ | ||
113 | videoWithFlash.flashInit(client); | 120 | videoWithFlash.flashInit(client); |
114 | // nativeVideo.nativeInit(client); | 121 | // nativeVideo.nativeInit(client); |
115 | 122 | ||
123 | + | ||
124 | + | ||
125 | + | ||
126 | + | ||
127 | + | ||
128 | + | ||
116 | } | 129 | } |
117 | 130 | ||
118 | //在窗口关闭前提示用户 | 131 | //在窗口关闭前提示用户 |
@@ -159,6 +172,11 @@ function importFile() { | @@ -159,6 +172,11 @@ function importFile() { | ||
159 | console.log("文件名:" + name + "大小:" + size+"文件类型:"+mime); | 172 | console.log("文件名:" + name + "大小:" + size+"文件类型:"+mime); |
160 | 173 | ||
161 | 174 | ||
175 | + //上传时动画效果 | ||
176 | + $(".spinner").css("display","block"); | ||
177 | + | ||
178 | + | ||
179 | + | ||
162 | 180 | ||
163 | var fd = new FormData(); | 181 | var fd = new FormData(); |
164 | fd.append("fileToUpload", document.getElementById('file').files[0]); | 182 | fd.append("fileToUpload", document.getElementById('file').files[0]); |
@@ -212,6 +230,8 @@ function showFile(_data){ | @@ -212,6 +230,8 @@ function showFile(_data){ | ||
212 | }); | 230 | }); |
213 | 231 | ||
214 | } | 232 | } |
233 | + $(".spinner").css("display","none"); | ||
234 | + $(".doc-headline-a").trigger("click"); | ||
215 | 235 | ||
216 | // var strHTML = format(tplDoc, { | 236 | // var strHTML = format(tplDoc, { |
217 | // name: _data.fileName, | 237 | // name: _data.fileName, |
@@ -227,6 +247,9 @@ function showFile(_data){ | @@ -227,6 +247,9 @@ function showFile(_data){ | ||
227 | //删除文档 | 247 | //删除文档 |
228 | $(".deleteDoc").click(function (e) { | 248 | $(".deleteDoc").click(function (e) { |
229 | 249 | ||
250 | + $(".spinner").css("display","block"); | ||
251 | + | ||
252 | + | ||
230 | $(this).parent().addClass("xin"); | 253 | $(this).parent().addClass("xin"); |
231 | // thisFileName=$(".forSwitch").children(".itemName").html() | 254 | // thisFileName=$(".forSwitch").children(".itemName").html() |
232 | thisFileName=$(this).parent().find(".itemName").html() | 255 | thisFileName=$(this).parent().find(".itemName").html() |
@@ -281,20 +304,23 @@ function showFile(_data){ | @@ -281,20 +304,23 @@ function showFile(_data){ | ||
281 | 304 | ||
282 | //切换文档 | 305 | //切换文档 |
283 | function switchDoc(msg) { | 306 | function switchDoc(msg) { |
307 | + $(".spinner").css("display","block"); | ||
284 | var paramInfo={ | 308 | var paramInfo={ |
285 | "itemIdx": msg, | 309 | "itemIdx": msg, |
286 | "visible":true | 310 | "visible":true |
287 | }; | 311 | }; |
288 | client.sendDocumentSwitchDoc(paramInfo); | 312 | client.sendDocumentSwitchDoc(paramInfo); |
289 | console.log("此时数组中存储的数=====",fileFromArr); | 313 | console.log("此时数组中存储的数=====",fileFromArr); |
290 | - | ||
291 | - | ||
292 | } | 314 | } |
293 | 315 | ||
294 | 316 | ||
295 | 317 | ||
296 | //将上传文件的信息,传递给底层 | 318 | //将上传文件的信息,传递给底层 |
297 | function uploadFile(msg){ | 319 | function uploadFile(msg){ |
320 | + | ||
321 | + | ||
322 | + | ||
323 | + | ||
298 | console.log("服务器返回的文件信息"); | 324 | console.log("服务器返回的文件信息"); |
299 | console.log(msg); | 325 | console.log(msg); |
300 | // fileInfo.fileName=msg.fileName;//文档名字 | 326 | // fileInfo.fileName=msg.fileName;//文档名字 |
@@ -339,6 +365,8 @@ function showInter(_data,isPage){ | @@ -339,6 +365,8 @@ function showInter(_data,isPage){ | ||
339 | console.log("当前文档类型",_data.fileType); | 365 | console.log("当前文档类型",_data.fileType); |
340 | 366 | ||
341 | 367 | ||
368 | + fileItemIdx=_data.itemIdx | ||
369 | + | ||
342 | if(_data.fileType=="doc"||_data.fileType=="pdf"){ | 370 | if(_data.fileType=="doc"||_data.fileType=="pdf"){ |
343 | 371 | ||
344 | $("#showImg").css("display","none"); | 372 | $("#showImg").css("display","none"); |
@@ -352,71 +380,27 @@ function showInter(_data,isPage){ | @@ -352,71 +380,27 @@ function showInter(_data,isPage){ | ||
352 | "relativeUrl": _data.relativeUrl | 380 | "relativeUrl": _data.relativeUrl |
353 | }; | 381 | }; |
354 | docfullPath=client.getDocImageFullPath(_paramInfo); | 382 | docfullPath=client.getDocImageFullPath(_paramInfo); |
355 | - // console.log("mcu返回给我的地址=========="); | ||
356 | - // console.log(docfullPath); | 383 | + console.log("mcu返回给我的地址=========="); |
384 | + console.log(docfullPath); | ||
357 | 385 | ||
358 | // imgUrl = docfullPath[0]; | 386 | // imgUrl = docfullPath[0]; |
359 | // $("#docImage").css("display","block"); | 387 | // $("#docImage").css("display","block"); |
360 | 388 | ||
361 | 389 | ||
362 | 390 | ||
363 | - var curPageNum =_data.curPageNo; | ||
364 | - var pageNum=_data.pageNum; | 391 | + curPageNum =_data.curPageNo; |
392 | + pageNum=_data.pageNum; | ||
365 | $("#curPageNum").html(curPageNum); | 393 | $("#curPageNum").html(curPageNum); |
366 | $("#totalPageNum").html(pageNum); | 394 | $("#totalPageNum").html(pageNum); |
367 | - for (var i=0;i<=docfullPath.length;i++){ | 395 | + |
396 | + console.log("curPageNum",curPageNum); | ||
397 | + for (var i=0;i<docfullPath.length;i++){ | ||
368 | var docfullSingle=docfullPath[curPageNum-1]; | 398 | var docfullSingle=docfullPath[curPageNum-1]; |
369 | $("#docImage").attr("src",docfullSingle); | 399 | $("#docImage").attr("src",docfullSingle); |
370 | } | 400 | } |
371 | 401 | ||
372 | 402 | ||
373 | - //点击下一页 | ||
374 | - $("#nextPage").on("click",function (e) { | ||
375 | - | ||
376 | - if (curPageNum!==pageNum){ | ||
377 | - for (var i=0;i<=docfullPath.length;i++){ | ||
378 | - var docfullSingle=docfullPath[curPageNum]; | ||
379 | - console.log("curPageNum,docfullSingle",curPageNum,docfullSingle); | ||
380 | - $("#docImage").attr("src",docfullSingle); | ||
381 | - } | ||
382 | - curPageNum++; | ||
383 | - } | ||
384 | - | ||
385 | - var paramInfo={ | ||
386 | - "itemIdx": _data.itemIdx, | ||
387 | - "curPageNo":curPageNum | ||
388 | - }; | ||
389 | - console.log("paramInfo=======>",paramInfo) | ||
390 | - client.sendDocumentSwitchPage(paramInfo); | ||
391 | - | ||
392 | - $("#curPageNum").html(curPageNum); | ||
393 | - | ||
394 | - | ||
395 | - }); | ||
396 | - | ||
397 | - //点击上一页 | ||
398 | 403 | ||
399 | - $("#prevPage").on("click",function (e) { | ||
400 | - if (curPageNum>1){ | ||
401 | - curPageNum--; | ||
402 | - console.log("curPageNum",curPageNum); | ||
403 | - for (var i=0;i<=docfullPath.length;i++){ | ||
404 | - var docfullSingle=docfullPath[curPageNum-1]; | ||
405 | - console.log("curPageNum,docfullSingle",curPageNum,docfullSingle); | ||
406 | - $("#docImage").attr("src",docfullSingle); | ||
407 | - | ||
408 | - | ||
409 | - } | ||
410 | - | ||
411 | - } | ||
412 | - var paramInfo={ | ||
413 | - "itemIdx": _data.itemIdx, | ||
414 | - "curPageNo":curPageNum | ||
415 | - }; | ||
416 | - client.sendDocumentSwitchPage(paramInfo); | ||
417 | - $("#curPageNum").html(curPageNum); | ||
418 | - | ||
419 | - }); | ||
420 | 404 | ||
421 | 405 | ||
422 | 406 | ||
@@ -504,63 +488,18 @@ function showTurnPage() { | @@ -504,63 +488,18 @@ function showTurnPage() { | ||
504 | } | 488 | } |
505 | 489 | ||
506 | 490 | ||
507 | -//翻页模块 | ||
508 | -function turnPage(_data){ | ||
509 | - console.log("翻页模块") | ||
510 | - console.log(_data); | ||
511 | - var curPageNum =_data.curPageNo; | ||
512 | - var pageNum=_data.pageNum; | ||
513 | 491 | ||
514 | - $("#curPageNum").html(curPageNum); | ||
515 | - $("#totalPageNum").html(pageNum); | ||
516 | - | ||
517 | - | ||
518 | - //点击下一页 | ||
519 | - $("#nextPage").on("click",function (e) { | ||
520 | - if (curPageNum<pageNum){ | ||
521 | - curPageNum++; | ||
522 | - | ||
523 | - } | ||
524 | - var paramInfo={ | ||
525 | - "itemIdx": _data.itemIdx, | ||
526 | - "curPageNo":curPageNum | ||
527 | - }; | ||
528 | - client.sendDocumentSwitchPage(paramInfo); | ||
529 | - | ||
530 | - $("#curPageNum").html(curPageNum); | ||
531 | - // openPage(pdf, curPageNum); | ||
532 | - | ||
533 | - }); | ||
534 | - | ||
535 | - //点击上一页 | ||
536 | - | ||
537 | - $("#prevPage").on("click",function (e) { | ||
538 | - if (curPageNum>1){ | ||
539 | - curPageNum--; | ||
540 | - } | ||
541 | - var paramInfo={ | ||
542 | - "itemIdx": _data.itemIdx, | ||
543 | - "curPageNo":curPageNum | ||
544 | - }; | ||
545 | - client.sendDocumentSwitchPage(paramInfo); | ||
546 | - | ||
547 | - $("#curPageNum").html(curPageNum); | ||
548 | - // openPage(pdf, curPageNum); | ||
549 | - | ||
550 | - | ||
551 | - }); | ||
552 | - | ||
553 | -} | ||
554 | 492 | ||
555 | //监听文档删除 | 493 | //监听文档删除 |
556 | function docDelete(callbackData){ | 494 | function docDelete(callbackData){ |
557 | console.log("监听文档删除"); | 495 | console.log("监听文档删除"); |
558 | console.log(callbackData); | 496 | console.log(callbackData); |
559 | - // | ||
560 | updateDocList(callbackData,1); | 497 | updateDocList(callbackData,1); |
561 | 498 | ||
562 | //操作页面 | 499 | //操作页面 |
563 | $("li").remove(".xin"); | 500 | $("li").remove(".xin"); |
501 | + $(".spinner").css("display","none"); | ||
502 | + $(".doc-headline-a").trigger("click"); | ||
564 | 503 | ||
565 | } | 504 | } |
566 | 505 | ||
@@ -695,12 +634,20 @@ function classFailed(callbackData) { | @@ -695,12 +634,20 @@ function classFailed(callbackData) { | ||
695 | case 207:break; | 634 | case 207:break; |
696 | case 300:break; | 635 | case 300:break; |
697 | case 301:break; | 636 | case 301:break; |
637 | + case 20000:mcuErrorTip();break; | ||
698 | default:break; | 638 | default:break; |
699 | } | 639 | } |
700 | 640 | ||
701 | 641 | ||
702 | } | 642 | } |
703 | 643 | ||
644 | +//mcu报错,进不去课堂 | ||
645 | +function mcuErrorTip(){ | ||
646 | + $(".passWordTip").css("margin-left","45px"); | ||
647 | + $(".passWordTip")[0].innerHTML="请稍后再试,正在重新连接"; | ||
648 | +} | ||
649 | + | ||
650 | + | ||
704 | //课堂密码错误 进行提示 | 651 | //课堂密码错误 进行提示 |
705 | function classPwdErrorTip() { | 652 | function classPwdErrorTip() { |
706 | $(".passWordTip").css("margin-left","45px"); | 653 | $(".passWordTip").css("margin-left","45px"); |
@@ -899,7 +846,6 @@ function showParmasInput(){ | @@ -899,7 +846,6 @@ function showParmasInput(){ | ||
899 | // var fourParams={}; | 846 | // var fourParams={}; |
900 | 847 | ||
901 | fourParams={ | 848 | fourParams={ |
902 | - | ||
903 | classId:classId, | 849 | classId:classId, |
904 | userRole:classLoadInfo.userRole, | 850 | userRole:classLoadInfo.userRole, |
905 | portal:"112.126.80.182:90", | 851 | portal:"112.126.80.182:90", |
@@ -910,14 +856,10 @@ function showParmasInput(){ | @@ -910,14 +856,10 @@ function showParmasInput(){ | ||
910 | 856 | ||
911 | client.init(fourParams,classInitSuccess,classFailed); | 857 | client.init(fourParams,classInitSuccess,classFailed); |
912 | }); | 858 | }); |
913 | - | ||
914 | - | ||
915 | } | 859 | } |
916 | - | ||
917 | - | ||
918 | //加入课堂成功 | 860 | //加入课堂成功 |
919 | function classJoinSuccess(callbackData){ | 861 | function classJoinSuccess(callbackData){ |
920 | - | 862 | + classAllInfo=callbackData; |
921 | console.log("classJoinSuccess",callbackData); | 863 | console.log("classJoinSuccess",callbackData); |
922 | console.log(callbackData); | 864 | console.log(callbackData); |
923 | 865 | ||
@@ -935,10 +877,6 @@ if (callbackData.userRole=="normal"){ | @@ -935,10 +877,6 @@ if (callbackData.userRole=="normal"){ | ||
935 | 877 | ||
936 | } | 878 | } |
937 | 879 | ||
938 | - | ||
939 | - | ||
940 | - classAllInfo=callbackData; | ||
941 | - | ||
942 | //准备主页面 | 880 | //准备主页面 |
943 | layoutView(); | 881 | layoutView(); |
944 | //开始课堂 | 882 | //开始课堂 |
@@ -951,23 +889,14 @@ function startClass() { | @@ -951,23 +889,14 @@ function startClass() { | ||
951 | 889 | ||
952 | //监听到聊天信息 | 890 | //监听到聊天信息 |
953 | client.on(MessageTypes.CHAT_RECEIVE,chatReceive); | 891 | client.on(MessageTypes.CHAT_RECEIVE,chatReceive); |
954 | - | ||
955 | - | ||
956 | client.on(MessageTypes.WHITEBOARD_ANNOTATION_UPDATE,whiteboardUpdate);//监听白板更新 | 892 | client.on(MessageTypes.WHITEBOARD_ANNOTATION_UPDATE,whiteboardUpdate);//监听白板更新 |
957 | - | ||
958 | client.on(MessageTypes.DOC_DELETE,docDelete);//监听删除文档 | 893 | client.on(MessageTypes.DOC_DELETE,docDelete);//监听删除文档 |
959 | client.on(MessageTypes.DOC_UPDATE,docUpdate);//监听更新文档 | 894 | client.on(MessageTypes.DOC_UPDATE,docUpdate);//监听更新文档 |
960 | - | ||
961 | - | ||
962 | - | ||
963 | - | ||
964 | } | 895 | } |
965 | } | 896 | } |
966 | 897 | ||
967 | //登录成功后,登录页隐藏,主页面显示 | 898 | //登录成功后,登录页隐藏,主页面显示 |
968 | function layoutView( ) { | 899 | function layoutView( ) { |
969 | - | ||
970 | - console.log("123000000000000000000000000000000000000"); | ||
971 | //输入4个参数的页面隐藏 | 900 | //输入4个参数的页面隐藏 |
972 | $(".fourParamsOut").css("display","none"); | 901 | $(".fourParamsOut").css("display","none"); |
973 | //登录成功后,登录页隐藏 | 902 | //登录成功后,登录页隐藏 |
@@ -998,124 +927,6 @@ function layoutView( ) { | @@ -998,124 +927,6 @@ function layoutView( ) { | ||
998 | 927 | ||
999 | 928 | ||
1000 | 929 | ||
1001 | - | ||
1002 | - | ||
1003 | - | ||
1004 | - // | ||
1005 | - // //老师的视频区域 | ||
1006 | - // var teaVideo = document.getElementById("teacherVideo-video"); | ||
1007 | - // var teaVv = document.getElementById("teacherVideo-voice"); | ||
1008 | - // var closeVideo = document.getElementById("close-video"); | ||
1009 | - // var closeVoice = document.getElementById("close-voice"); | ||
1010 | - // | ||
1011 | - // var throbberLoader1 = document.getElementById("throbber-loader1"); | ||
1012 | - // var throbberLoader2 = document.getElementById("throbber-loader2"); | ||
1013 | - // var throbberLoader3 = document.getElementById("throbber-loader3"); | ||
1014 | - // var throbberLoader4 = document.getElementById("throbber-loader4"); | ||
1015 | - // var throbberLoader5 = document.getElementById("throbber-loader5"); | ||
1016 | - // var throbberLoader6 = document.getElementById("throbber-loader6"); | ||
1017 | - // | ||
1018 | - // | ||
1019 | - // //老师点击麦克按钮 | ||
1020 | - // var showflag = 0; | ||
1021 | - // teaVv.onclick = function () { | ||
1022 | - // if (showflag == "0") { | ||
1023 | - // closeVoice.style.display = "none"; | ||
1024 | - // showflag++; | ||
1025 | - // console.log(showflag); | ||
1026 | - // | ||
1027 | - // throbberLoader1.className = "throbber-loader1"; | ||
1028 | - // throbberLoader2.className = "throbber-loader2"; | ||
1029 | - // throbberLoader3.className = "throbber-loader3"; | ||
1030 | - // throbberLoader4.className = "throbber-loader4"; | ||
1031 | - // throbberLoader5.className = "throbber-loader5"; | ||
1032 | - // throbberLoader6.className = "throbber-loader6"; | ||
1033 | - // $(".teacherVideoBg").css("display","none"); | ||
1034 | - // | ||
1035 | - // } else if (showflag == "1") { | ||
1036 | - // closeVoice.style.display = "block"; | ||
1037 | - // showflag--; | ||
1038 | - // console.log(showflag); | ||
1039 | - // throbberLoader1.className = "teacherVideo-voice-progress-span-1"; | ||
1040 | - // throbberLoader2.className = "teacherVideo-voice-progress-span-2"; | ||
1041 | - // throbberLoader3.className = "teacherVideo-voice-progress-span-3"; | ||
1042 | - // throbberLoader4.className = "teacherVideo-voice-progress-span-4"; | ||
1043 | - // throbberLoader5.className = "teacherVideo-voice-progress-span-5"; | ||
1044 | - // throbberLoader6.className = "teacherVideo-voice-progress-span-6"; | ||
1045 | - // $(".teacherVideoBg").css("display","block"); | ||
1046 | - // } | ||
1047 | - // } | ||
1048 | - // | ||
1049 | - // //老师点击视频按钮 | ||
1050 | - // var Videoflag = 0; | ||
1051 | - // teaVideo.onclick = function () { | ||
1052 | - // console.log(navigator.mediaDevices); | ||
1053 | - // navigator.mediaDevices = navigator.mediaDevices || ((navigator.mozGetUserMedia || navigator.webkitGetUserMedia) ? { | ||
1054 | - // getUserMedia: function (c) { | ||
1055 | - // return new Promise(function (y, n) { | ||
1056 | - // (navigator.mozGetUserMedia || | ||
1057 | - // navigator.webkitGetUserMedia).call(navigator, c, y, n); | ||
1058 | - // }); | ||
1059 | - // } | ||
1060 | - // } : null); | ||
1061 | - // console.log(navigator.mediaDevices); | ||
1062 | - // if (Videoflag == "0") { | ||
1063 | - // closeVideo.style.display = "none"; | ||
1064 | - // closeVoice.style.display = "none"; | ||
1065 | - // Videoflag++; | ||
1066 | - // throbberLoader1.className = "throbber-loader1"; | ||
1067 | - // throbberLoader2.className = "throbber-loader2"; | ||
1068 | - // throbberLoader3.className = "throbber-loader3"; | ||
1069 | - // throbberLoader4.className = "throbber-loader4"; | ||
1070 | - // throbberLoader5.className = "throbber-loader5"; | ||
1071 | - // throbberLoader6.className = "throbber-loader6"; | ||
1072 | - // | ||
1073 | - // var constraints = {audio: true, video: true}; | ||
1074 | - // | ||
1075 | - // navigator.mediaDevices.getUserMedia(constraints) | ||
1076 | - // .then(function (stream) { | ||
1077 | - // if (window.URL) { | ||
1078 | - // console.log(window.URL); | ||
1079 | - // var newSrc = window.URL.createObjectURL(stream); | ||
1080 | - // //将老师流地址给老师的Video | ||
1081 | - // $("#teacherVideoInfo").attr("src",newSrc); | ||
1082 | - // } else { | ||
1083 | - // $("#teacherVideoInfo").src = stream; | ||
1084 | - // } | ||
1085 | - // $(".teacherVideoInfo").autoplay = true; | ||
1086 | - // | ||
1087 | - // var videoName=stream.getVideoTracks()[0].label; | ||
1088 | - // var audioName=stream.getAudioTracks()[0].label; | ||
1089 | - // console.log(videoName); | ||
1090 | - // console.log(audioName); | ||
1091 | - // | ||
1092 | - // } | ||
1093 | - // ) | ||
1094 | - // .catch(function (err) { | ||
1095 | - // console.log(err.name + ": " + err.message); | ||
1096 | - // }); | ||
1097 | - // | ||
1098 | - // | ||
1099 | - // | ||
1100 | - // $(".teacherVideoBg").css("display","none"); | ||
1101 | - // } else if (Videoflag == "1") { | ||
1102 | - // closeVideo.style.display = "block"; | ||
1103 | - // closeVoice.style.display = "block"; | ||
1104 | - // Videoflag--; | ||
1105 | - // throbberLoader1.className = "teacherVideo-voice-progress-span-1"; | ||
1106 | - // throbberLoader2.className = "teacherVideo-voice-progress-span-2"; | ||
1107 | - // throbberLoader3.className = "teacherVideo-voice-progress-span-3"; | ||
1108 | - // throbberLoader4.className = "teacherVideo-voice-progress-span-4"; | ||
1109 | - // throbberLoader5.className = "teacherVideo-voice-progress-span-5"; | ||
1110 | - // throbberLoader6.className = "teacherVideo-voice-progress-span-6"; | ||
1111 | - // | ||
1112 | - // $(".teacherVideoBg").css("display","block"); | ||
1113 | - // $("#teacherVideoInfo").attr("src",""); | ||
1114 | - // } | ||
1115 | - // | ||
1116 | - // } | ||
1117 | - | ||
1118 | - | ||
1119 | //发送聊天消息 | 930 | //发送聊天消息 |
1120 | $("#btn_send").click(function (e) { | 931 | $("#btn_send").click(function (e) { |
1121 | console.log("点击了发送消息按钮------->"); | 932 | console.log("点击了发送消息按钮------->"); |
@@ -1124,95 +935,80 @@ function layoutView( ) { | @@ -1124,95 +935,80 @@ function layoutView( ) { | ||
1124 | }); | 935 | }); |
1125 | 936 | ||
1126 | // 文件上传 | 937 | // 文件上传 |
1127 | - | ||
1128 | $("#pushFile").click(function () { | 938 | $("#pushFile").click(function () { |
1129 | $("#file").click(); | 939 | $("#file").click(); |
1130 | }); | 940 | }); |
1131 | 941 | ||
942 | + //点击下一页 | ||
943 | + $("#nextPage").on("click",function (e) { | ||
944 | + console.log(curPageNum); | ||
1132 | 945 | ||
1133 | - // //视频按钮点击 | ||
1134 | - // $("#teacherVideo-video").click(function (e) { | ||
1135 | - // console.log("teacherVideo-video点击"); | ||
1136 | - // $("#teacherVideo-video").html(" "); | ||
1137 | - // $("#teacherVideo-video").removeClass("teacherVideo-video"); | ||
1138 | - // $("#teacherVideo-video").addClass("teacherVideo-videoBg"); | ||
1139 | - // | ||
1140 | - // | ||
1141 | - // $("#teacherVideo-voice").html(""); | ||
1142 | - // $("#teacherVideo-voice").addClass("teacherVideo-voice"); | ||
1143 | - // $("#teacherVideo-voice").removeClass("teacherVideo-voiceBg"); | ||
1144 | - // | ||
1145 | - // | ||
1146 | - // //获取推流地址 | ||
1147 | - // achieveStream(); | 946 | + var paramInfo={ |
947 | + "itemIdx": fileItemIdx, | ||
948 | + "curPageNo":curPageNum+1 | ||
949 | + }; | ||
950 | + console.log("paramInfo=======>",paramInfo) | ||
951 | + client.sendDocumentSwitchPage(paramInfo); | ||
952 | + $("#curPageNum").html(curPageNum); | ||
1148 | 953 | ||
954 | + if (curPageNum!==pageNum){ | ||
955 | + console.log(curPageNum); | ||
956 | + for (var i=0;i<docfullPath.length;i++){ | ||
957 | + var docfullSingle=docfullPath[curPageNum-1]; | ||
958 | + console.log("curPageNum,docfullSingle",curPageNum,docfullSingle); | ||
959 | + $("#docImage").attr("src",docfullSingle); | ||
960 | + } | ||
961 | + // curPageNum++; | ||
962 | + } | ||
1149 | 963 | ||
1150 | - // }); | ||
1151 | 964 | ||
1152 | -//音频按钮点击 | ||
1153 | - $("#teacherVideo-voice").click(function (e) { | 965 | + }); |
1154 | 966 | ||
1155 | - console.log("teacherVideo-voice点击"); | ||
1156 | - $("#teacherVideo-video").html(""); | ||
1157 | - $("#teacherVideo-video").removeClass("teacherVideo-videoBg"); | ||
1158 | - $("#teacherVideo-video").addClass("teacherVideo-video"); | 967 | + //点击上一页 |
968 | + $("#prevPage").on("click",function (e) { | ||
969 | + if (curPageNum>1){ | ||
970 | + console.log("curPageNum",curPageNum); | ||
971 | + for (var i=0;i<docfullPath.length;i++){ | ||
972 | + var docfullSingle=docfullPath[curPageNum-1]; | ||
973 | + console.log("curPageNum,docfullSingle",curPageNum,docfullSingle); | ||
974 | + $("#docImage").attr("src",docfullSingle); | ||
975 | + } | ||
976 | + } | ||
977 | + console.log(curPageNum); | ||
978 | + var paramInfo={ | ||
979 | + "itemIdx": fileItemIdx, | ||
980 | + "curPageNo":curPageNum-1 | ||
981 | + }; | ||
982 | + console.log("paramInfo=======>",paramInfo) | ||
983 | + client.sendDocumentSwitchPage(paramInfo); | ||
984 | + $("#curPageNum").html(curPageNum); | ||
1159 | 985 | ||
1160 | - $("#teacherVideo-voice").html(""); | ||
1161 | - $("#teacherVideo-voice").removeClass("teacherVideo-voice"); | ||
1162 | - $("#teacherVideo-voice").addClass("teacherVideo-voiceBg"); | ||
1163 | }); | 986 | }); |
1164 | 987 | ||
1165 | } | 988 | } |
1166 | function whiteboardUpdate(callbackData) { | 989 | function whiteboardUpdate(callbackData) { |
1167 | - | ||
1168 | - console.log("同步canvas消息==========================="); | 990 | + console.log("同步canvas消息"); |
1169 | console.log(callbackData); | 991 | console.log(callbackData); |
1170 | - | ||
1171 | draw.drawCanvas(callbackData); | 992 | draw.drawCanvas(callbackData); |
1172 | - // canvasInfoUpdate=callbackData; | ||
1173 | - // | ||
1174 | - // // canvasInfoUpArr.push(canvasInfoUpdate.itemIdx); | ||
1175 | - // | ||
1176 | - // console.log("同步的存到数组中"); | ||
1177 | - // console.log(canvasInfoUpArr); | ||
1178 | - // | ||
1179 | - // draw.ss(canvasInfoUpdate); | ||
1180 | - // draw.trans(canvasInfoUpArr); | ||
1181 | -} | ||
1182 | -function whiteboardDelete(callbackData) { | ||
1183 | - console.log("监听白板删除的消息============================"); | ||
1184 | - console.log(callbackData); | ||
1185 | - draw.clearContextCan(); | ||
1186 | - canvasInfoUpArr=[]; | ||
1187 | - canvasInfoArr=[]; | ||
1188 | - | 993 | + $(".spinner").css("display","none"); |
994 | + $(".doc-headline-a").trigger("click"); | ||
1189 | } | 995 | } |
1190 | 996 | ||
1191 | //接收聊天消息 | 997 | //接收聊天消息 |
1192 | function chatReceive(callbackData){ | 998 | function chatReceive(callbackData){ |
1193 | - console.log() | ||
1194 | - | ||
1195 | - console.log("777777777777777777777777777777"); | ||
1196 | console.log(callbackData); | 999 | console.log(callbackData); |
1197 | var tpl = callbackData.fromRole == "host"? tpl_message_teacher : tpl_message_student; | 1000 | var tpl = callbackData.fromRole == "host"? tpl_message_teacher : tpl_message_student; |
1198 | var message = (callbackData.message + "").replace(/\[img:([^\[:\]]*)\]/ig, function (match, group, index) { | 1001 | var message = (callbackData.message + "").replace(/\[img:([^\[:\]]*)\]/ig, function (match, group, index) { |
1199 | return '<img src="images/face/' + group + '.gif"/>'; | 1002 | return '<img src="images/face/' + group + '.gif"/>'; |
1200 | }); | 1003 | }); |
1201 | - | ||
1202 | var strHTML = format(tpl, { | 1004 | var strHTML = format(tpl, { |
1203 | name: callbackData.fromName, | 1005 | name: callbackData.fromName, |
1204 | message: message | 1006 | message: message |
1205 | }); | 1007 | }); |
1206 | - | ||
1207 | $("#panel_message").append(strHTML); | 1008 | $("#panel_message").append(strHTML); |
1208 | $("#panel_message")[0].scrollTop=$("#panel_message")[0].scrollHeight; | 1009 | $("#panel_message")[0].scrollTop=$("#panel_message")[0].scrollHeight; |
1209 | - | ||
1210 | - | ||
1211 | - | ||
1212 | } | 1010 | } |
1213 | 1011 | ||
1214 | - | ||
1215 | - | ||
1216 | //将地址转化成一个对象 | 1012 | //将地址转化成一个对象 |
1217 | function GetUrlParam() { | 1013 | function GetUrlParam() { |
1218 | var url = location.search; | 1014 | var url = location.search; |
@@ -1278,6 +1074,7 @@ function loading() { | @@ -1278,6 +1074,7 @@ function loading() { | ||
1278 | 1074 | ||
1279 | 1075 | ||
1280 | } | 1076 | } |
1077 | + | ||
1281 | //在页面loading时,提交验证,传给底层 | 1078 | //在页面loading时,提交验证,传给底层 |
1282 | function urlParamsJudge(){ | 1079 | function urlParamsJudge(){ |
1283 | //1.地址栏获取参数 | 1080 | //1.地址栏获取参数 |
@@ -1327,20 +1124,4 @@ function format(str, obj) { | @@ -1327,20 +1124,4 @@ function format(str, obj) { | ||
1327 | return str.replace(/\{(\w+)\}/g, function (match, group, index) { | 1124 | return str.replace(/\{(\w+)\}/g, function (match, group, index) { |
1328 | return obj[group]; | 1125 | return obj[group]; |
1329 | }); | 1126 | }); |
1330 | -} | ||
1331 | - | ||
1332 | - | ||
1333 | - | ||
1334 | - | ||
1335 | -// //获取推流地址 | ||
1336 | -// function achieveStream(){ | ||
1337 | -// | ||
1338 | -// var paramInfo={ | ||
1339 | -// "type": "flash" | ||
1340 | -// }; | ||
1341 | -// var result=client.getVideoPublishPath(paramInfo); | ||
1342 | -// | ||
1343 | -// console.log("执行getPublishVideoPath,返回的结果") | ||
1344 | -// console.log(result); | ||
1345 | -// | ||
1346 | -// }; | ||
1127 | +} |
@@ -5,9 +5,9 @@ | @@ -5,9 +5,9 @@ | ||
5 | 5 | ||
6 | 6 | ||
7 | var client; //客户端 | 7 | var client; //客户端 |
8 | -var pubResultObj; // 存储底层给我的推流结果 | ||
9 | 8 | ||
10 | -var publishObj; | 9 | + |
10 | + | ||
11 | 11 | ||
12 | var videoWithFlash={}; | 12 | var videoWithFlash={}; |
13 | 13 | ||
@@ -63,15 +63,17 @@ $(function () { | @@ -63,15 +63,17 @@ $(function () { | ||
63 | $("#teacherVideo-video").click(function (e) { | 63 | $("#teacherVideo-video").click(function (e) { |
64 | console.log("teacherVideo-video点击"); | 64 | console.log("teacherVideo-video点击"); |
65 | $("#teacherVideo-video").html(" "); | 65 | $("#teacherVideo-video").html(" "); |
66 | - $("#teacherVideo-video").removeClass("teacherVideo-video"); | ||
67 | - $("#teacherVideo-video").addClass("teacherVideo-videoBg"); | 66 | + // $("#teacherVideo-video").removeClass("teacherVideo-video"); |
67 | + // $("#teacherVideo-video").addClass("teacherVideo-videoBg"); | ||
68 | + $(".teacherVideo-videoBg").css("display","block"); | ||
69 | + $(".teacherVideo-video").css("display","none"); | ||
70 | + | ||
68 | 71 | ||
69 | 72 | ||
70 | $("#teacherVideo-voice").html(""); | 73 | $("#teacherVideo-voice").html(""); |
71 | $("#teacherVideo-voice").addClass("teacherVideo-voice"); | 74 | $("#teacherVideo-voice").addClass("teacherVideo-voice"); |
72 | $("#teacherVideo-voice").removeClass("teacherVideo-voiceBg"); | 75 | $("#teacherVideo-voice").removeClass("teacherVideo-voiceBg"); |
73 | $(".teacherVideoBg").css("display","none"); | 76 | $(".teacherVideoBg").css("display","none"); |
74 | - | ||
75 | $(".teacherVideo").css("background", "#CCCCCC"); | 77 | $(".teacherVideo").css("background", "#CCCCCC"); |
76 | $(".teacherVideo-voice").css("bottom","4px"); | 78 | $(".teacherVideo-voice").css("bottom","4px"); |
77 | 79 | ||
@@ -81,9 +83,7 @@ $(function () { | @@ -81,9 +83,7 @@ $(function () { | ||
81 | }); | 83 | }); |
82 | 84 | ||
83 | //老师音频按钮点击 | 85 | //老师音频按钮点击 |
84 | - $("#teacherVideo-voice").click(function (e) { | ||
85 | - | ||
86 | - | 86 | + $(".teacherVideo-voice").click(function (e) { |
87 | console.log("teacherVideo-voice点击"); | 87 | console.log("teacherVideo-voice点击"); |
88 | $("#teacherVideo-video").html(""); | 88 | $("#teacherVideo-video").html(""); |
89 | $("#teacherVideo-video").removeClass("teacherVideo-videoBg"); | 89 | $("#teacherVideo-video").removeClass("teacherVideo-videoBg"); |
@@ -94,6 +94,34 @@ $(function () { | @@ -94,6 +94,34 @@ $(function () { | ||
94 | $("#teacherVideo-voice").addClass("teacherVideo-voiceBg"); | 94 | $("#teacherVideo-voice").addClass("teacherVideo-voiceBg"); |
95 | }); | 95 | }); |
96 | 96 | ||
97 | + //老师视频关闭按钮点击 | ||
98 | + $("#teacherVideo-videoBg").click(function (e) { | ||
99 | + if(window.publishflash) { | ||
100 | + const stopInfo = JSON.stringify({ | ||
101 | + type: 5, | ||
102 | + videoId: publishflashVideoId, | ||
103 | + }); | ||
104 | + console.log(publishflash._js2native(stopInfo)); | ||
105 | + } | ||
106 | + | ||
107 | + var paramInfo={ | ||
108 | + "nodeId": Number(classAllInfo.nodeId)//用户的nodeId | ||
109 | + }; | ||
110 | + client.stopPublishVideo(paramInfo); | ||
111 | + | ||
112 | + $(".publish").css("display","none"); | ||
113 | + $(".teacherVideo").css("background", "#f5f9fb"); | ||
114 | + $(".teacherVideoBg").css("display","block"); | ||
115 | + $("#teacherVideo-video").css("display","block"); | ||
116 | + $("#teacherVideo-videoBg").css("display","none"); | ||
117 | + | ||
118 | + | ||
119 | + | ||
120 | + | ||
121 | + | ||
122 | + | ||
123 | + }); | ||
124 | + | ||
97 | }); | 125 | }); |
98 | 126 | ||
99 | //获取推流地址 | 127 | //获取推流地址 |
@@ -114,8 +142,6 @@ $(function () { | @@ -114,8 +142,6 @@ $(function () { | ||
114 | 142 | ||
115 | //code为0,代表成功 | 143 | //code为0,代表成功 |
116 | if (pubResult.code==0){ | 144 | if (pubResult.code==0){ |
117 | - | ||
118 | - | ||
119 | if(! window.publishflash) { | 145 | if(! window.publishflash) { |
120 | flashvideo( | 146 | flashvideo( |
121 | 'publish', | 147 | 'publish', |
@@ -136,7 +162,6 @@ $(function () { | @@ -136,7 +162,6 @@ $(function () { | ||
136 | var _msg=JSON.parse(msg); | 162 | var _msg=JSON.parse(msg); |
137 | console.log("_msg===========>",_msg); | 163 | console.log("_msg===========>",_msg); |
138 | if(_msg.data.result == 0){ | 164 | if(_msg.data.result == 0){ |
139 | - debugger; | ||
140 | //将之前底层取的推流结果传递给底层 | 165 | //将之前底层取的推流结果传递给底层 |
141 | var _successErrorResult= client.publishVideo(pubResult); | 166 | var _successErrorResult= client.publishVideo(pubResult); |
142 | console.log("_successErrorResult======>",_successErrorResult) | 167 | console.log("_successErrorResult======>",_successErrorResult) |
@@ -149,6 +174,9 @@ $(function () { | @@ -149,6 +174,9 @@ $(function () { | ||
149 | 174 | ||
150 | }else { | 175 | }else { |
151 | console.error('publish error'); | 176 | console.error('publish error'); |
177 | + | ||
178 | + | ||
179 | + | ||
152 | } | 180 | } |
153 | } | 181 | } |
154 | ) | 182 | ) |
@@ -158,10 +186,9 @@ $(function () { | @@ -158,10 +186,9 @@ $(function () { | ||
158 | publishURL(pubResult.publishUrl); | 186 | publishURL(pubResult.publishUrl); |
159 | } | 187 | } |
160 | 188 | ||
161 | - } | ||
162 | - | ||
163 | - | 189 | + }else if(pubResult.code==1){ |
164 | 190 | ||
191 | + } | ||
165 | } | 192 | } |
166 | function publishURL(rtmpURL) { | 193 | function publishURL(rtmpURL) { |
167 | const msg = JSON.stringify({ | 194 | const msg = JSON.stringify({ |
@@ -184,7 +211,21 @@ function publishURL(rtmpURL) { | @@ -184,7 +211,21 @@ function publishURL(rtmpURL) { | ||
184 | 211 | ||
185 | achievePlayStream(playCallbackDate); | 212 | achievePlayStream(playCallbackDate); |
186 | 213 | ||
187 | - | 214 | + } |
215 | + if(callbackDate.status==0){ | ||
216 | + if(window.playflash){ | ||
217 | + console.log("playflashVideoId",playflashVideoId); | ||
218 | + const stopPlayInfo = JSON.stringify({ | ||
219 | + type: 5, | ||
220 | + videoId: playflashVideoId | ||
221 | + }); | ||
222 | + console.log(playflash._js2native(stopPlayInfo)); | ||
223 | + } | ||
224 | + $("#teacherVideo-videoBg").css("display","none"); | ||
225 | + $("#teacherVideo-video").html(""); | ||
226 | + $(".play").css("display","none"); | ||
227 | + $(".teacherVideo").css("background", "#f5f9fb"); | ||
228 | + $(".teacherVideoBg").css("display","block"); | ||
188 | 229 | ||
189 | 230 | ||
190 | 231 | ||
@@ -205,12 +246,11 @@ function publishURL(rtmpURL) { | @@ -205,12 +246,11 @@ function publishURL(rtmpURL) { | ||
205 | }; | 246 | }; |
206 | var streamInfo=client.getVideoPlayPath(_paramInfo); | 247 | var streamInfo=client.getVideoPlayPath(_paramInfo); |
207 | console.log("result是=============>",streamInfo); | 248 | console.log("result是=============>",streamInfo); |
208 | - | 249 | + $(".play").css("display","block"); |
209 | $(".teacherVideoBg").css("display","none"); | 250 | $(".teacherVideoBg").css("display","none"); |
210 | 251 | ||
211 | $(".teacherVideo").css("background", "#CCCCCC"); | 252 | $(".teacherVideo").css("background", "#CCCCCC"); |
212 | $(".teacherVideo-voice").css("bottom","4px"); | 253 | $(".teacherVideo-voice").css("bottom","4px"); |
213 | - // $(".publish").css("display","none"); | ||
214 | 254 | ||
215 | if(! window.playflash) { | 255 | if(! window.playflash) { |
216 | flashvideo( | 256 | flashvideo( |
-
请 注册 或 登录 后发表评论