正在显示
4 个修改的文件
包含
124 行增加
和
105 行删除
| @@ -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.0303.10"></script> | ||
| 20 | - <!--<script type="text/javascript" src="http://192.168.1.140/McuClient/McuClient.js?722836"></script>--> | 19 | + <!--<script type="text/javascript" src="js/McuClient.js?v=1.0.0303.10"></script>--> |
| 20 | + <script type="text/javascript" src="http://192.168.1.140/McuClient/McuClient.js?722898936"></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> |
| @@ -92,19 +92,6 @@ $(function (){ | @@ -92,19 +92,6 @@ $(function (){ | ||
| 92 | }); | 92 | }); |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | - //->点击焦点实现切换 | ||
| 96 | - // $tipList.bind("touchstart", function (e) { | ||
| 97 | - // console.log("触摸事件touchstart1"); | ||
| 98 | - // step = $(this).index(); | ||
| 99 | - // if (document.documentElement.clientWidth > 1366) { | ||
| 100 | - // $inner.stop().animate({left: -step * 360}, 500); | ||
| 101 | - // } else if (document.documentElement.clientWidth <= 1366 && document.documentElement.clientWidth > 1280) { | ||
| 102 | - // $inner.stop().animate({left: -step * 256}, 500); | ||
| 103 | - // } else if (document.documentElement.clientWidth <= 1280) { | ||
| 104 | - // $inner.stop().animate({left: -step * 238}, 500); | ||
| 105 | - // } | ||
| 106 | - // changeTip(); | ||
| 107 | - // }); | ||
| 108 | 95 | ||
| 109 | 96 | ||
| 110 | $tipList.bind("click", function () { | 97 | $tipList.bind("click", function () { |
| @@ -119,17 +106,14 @@ $(function (){ | @@ -119,17 +106,14 @@ $(function (){ | ||
| 119 | changeTip(); | 106 | changeTip(); |
| 120 | }); | 107 | }); |
| 121 | 108 | ||
| 122 | - // $(".inner-slide").on("touchstart", "li", function (e) { | ||
| 123 | - // console.log("触摸事件touchstart2"); | ||
| 124 | - // $("#txt_message").val($("#txt_message").val() + "[img:" + $(this).find("img").attr("data-type") + "]"); | ||
| 125 | - // }); | 109 | + |
| 126 | $(".inner-slide").on("click", "li", function (e) { | 110 | $(".inner-slide").on("click", "li", function (e) { |
| 127 | $("#txt_message").val($("#txt_message").val() + "[img:" + $(this).find("img").attr("data-type") + "]"); | 111 | $("#txt_message").val($("#txt_message").val() + "[img:" + $(this).find("img").attr("data-type") + "]"); |
| 112 | + | ||
| 113 | + | ||
| 114 | + faceList.style.display="none"; | ||
| 128 | }); | 115 | }); |
| 129 | 116 | ||
| 130 | - // $(".inner-slide")[0].onclick=function () { | ||
| 131 | - // $("#txt_message").val($("#txt_message").val() + "[img:" + $(this).find("img").attr("data-type") + "]"); | ||
| 132 | - // } | ||
| 133 | 117 | ||
| 134 | 118 | ||
| 135 | 119 |
| @@ -484,9 +484,12 @@ function docDelete(callbackData){ | @@ -484,9 +484,12 @@ function docDelete(callbackData){ | ||
| 484 | console.log("监听文档删除"); | 484 | console.log("监听文档删除"); |
| 485 | console.log(callbackData); | 485 | console.log(callbackData); |
| 486 | updateDocList(callbackData,1); | 486 | updateDocList(callbackData,1); |
| 487 | - | ||
| 488 | - | ||
| 489 | - | 487 | + $("#docImage").attr("src",""); |
| 488 | + $("#showImage").attr("src",""); | ||
| 489 | + if (classAllInfo.userRole=="normal"){ | ||
| 490 | + $("#docImage").attr("src",""); | ||
| 491 | + $("#showImage").attr("src",""); | ||
| 492 | + } | ||
| 490 | 493 | ||
| 491 | //操作页面 | 494 | //操作页面 |
| 492 | $("li").remove(".xin"); | 495 | $("li").remove(".xin"); |
| @@ -57,10 +57,7 @@ $(function () { | @@ -57,10 +57,7 @@ $(function () { | ||
| 57 | }; | 57 | }; |
| 58 | console.log("stuNodeId",stuNodeId); | 58 | console.log("stuNodeId",stuNodeId); |
| 59 | client.sendVideoBroadcastMsg(paramInfo); | 59 | client.sendVideoBroadcastMsg(paramInfo); |
| 60 | - if (classAllInfo.userRole=="normal"){ | ||
| 61 | - $(".stuVideo-voice").css("display","none"); | ||
| 62 | - $(".stuVideo-video").css("display","none"); | ||
| 63 | - } | 60 | + |
| 64 | 61 | ||
| 65 | }); | 62 | }); |
| 66 | 63 | ||
| @@ -74,15 +71,13 @@ $(function () { | @@ -74,15 +71,13 @@ $(function () { | ||
| 74 | }; | 71 | }; |
| 75 | client.sendVideoBroadcastMsg(paramInfo); | 72 | client.sendVideoBroadcastMsg(paramInfo); |
| 76 | 73 | ||
| 77 | - | ||
| 78 | - | ||
| 79 | - | ||
| 80 | - $("#stuVideo-video").css("display","block"); | ||
| 81 | - $("#stuVideo-videoBg").css("display","none"); | 74 | + if (classAllInfo.userRole=="host"){ |
| 75 | + $("#stuVideo-video").css("display","block"); | ||
| 76 | + $("#stuVideo-videoBg").css("display","none"); | ||
| 77 | + } | ||
| 82 | 78 | ||
| 83 | }); | 79 | }); |
| 84 | 80 | ||
| 85 | - | ||
| 86 | //学生音频按钮点击 | 81 | //学生音频按钮点击 |
| 87 | $("#stuVideo-voice").click(function (e) { | 82 | $("#stuVideo-voice").click(function (e) { |
| 88 | 83 | ||
| @@ -93,12 +88,10 @@ $(function () { | @@ -93,12 +88,10 @@ $(function () { | ||
| 93 | $(".stuVideo-voiceBg").css("display","block"); | 88 | $(".stuVideo-voiceBg").css("display","block"); |
| 94 | $(".stuVideo-voice").css("display","none"); | 89 | $(".stuVideo-voice").css("display","none"); |
| 95 | } | 90 | } |
| 96 | - | ||
| 97 | - | ||
| 98 | - var stuVideoDisplay= $(".stuVideo-videoBg").css("display"); | ||
| 99 | - if(stuVideoDisplay=="block"){ | ||
| 100 | - $("#stuVideo-videoBg").trigger("click"); | ||
| 101 | - } | 91 | + // var stuVideoDisplay= $(".stuVideo-videoBg").css("display"); |
| 92 | + // if(stuVideoDisplay=="block"){ | ||
| 93 | + // $("#stuVideo-videoBg").trigger("click"); | ||
| 94 | + // } | ||
| 102 | 95 | ||
| 103 | 96 | ||
| 104 | var paramInfo={ | 97 | var paramInfo={ |
| @@ -108,14 +101,7 @@ $(function () { | @@ -108,14 +101,7 @@ $(function () { | ||
| 108 | }; | 101 | }; |
| 109 | console.log("stuNodeId",stuNodeId); | 102 | console.log("stuNodeId",stuNodeId); |
| 110 | client.sendAudioBroadcastMsg(paramInfo); | 103 | client.sendAudioBroadcastMsg(paramInfo); |
| 111 | - if (classAllInfo.userRole=="normal"){ | ||
| 112 | - $(".stuVideo-voice").css("display","none"); | ||
| 113 | - $(".stuVideo-video").css("display","none"); | ||
| 114 | - $("#stuVideo-voice").css("display","none"); | ||
| 115 | - $("#stuVideo-voiceBg").css("display","block"); | ||
| 116 | - $(".stuPublish").css({"width":"240px","height":"180px"}); | ||
| 117 | - $(".studentVideoBg").css("display","none"); | ||
| 118 | - } | 104 | + |
| 119 | 105 | ||
| 120 | 106 | ||
| 121 | }); | 107 | }); |
| @@ -127,23 +113,29 @@ $(function () { | @@ -127,23 +113,29 @@ $(function () { | ||
| 127 | "data":"0" | 113 | "data":"0" |
| 128 | }; | 114 | }; |
| 129 | client.sendAudioBroadcastMsg(paramInfo); | 115 | client.sendAudioBroadcastMsg(paramInfo); |
| 130 | - $("#stuVideo-voice").css("display","block"); | ||
| 131 | - $("#stuVideo-voiceBg").css("display","none"); | ||
| 132 | - if (classAllInfo.userRole=="normal"){ | ||
| 133 | - $(".stuVideo-voice").css("display","none"); | ||
| 134 | - $(".stuVideo-video").css("display","none"); | 116 | + if (classAllInfo.userRole=="host"){ |
| 117 | + $("#stuVideo-voice").css("display","block"); | ||
| 118 | + $("#stuVideo-voiceBg").css("display","none"); | ||
| 135 | } | 119 | } |
| 136 | 120 | ||
| 121 | + // if (classAllInfo.userRole=="normal"){ | ||
| 122 | + // $(".stuVideo-voice").css("display","none"); | ||
| 123 | + // $(".stuVideo-video").css("display","none"); | ||
| 124 | + // } | ||
| 125 | + | ||
| 137 | }); | 126 | }); |
| 138 | 127 | ||
| 139 | 128 | ||
| 140 | //老师视频按钮点击 | 129 | //老师视频按钮点击 |
| 141 | $("#teacherVideo-video").click(function (e) { | 130 | $("#teacherVideo-video").click(function (e) { |
| 142 | console.log("teacherVideo-video点击"); | 131 | console.log("teacherVideo-video点击"); |
| 143 | - var teaVoiceDisplay= $(".teacherVideo-voiceBg").css("display"); | ||
| 144 | - if(teaVoiceDisplay=="block"){ | ||
| 145 | - $("#teacherVideo-voiceBg").trigger("click"); | ||
| 146 | - } | 132 | + $(".teacherVideo-voice").css("color","#cccccc"); |
| 133 | + // $(".teacherVideo-voice").unbind("click");//音频按钮不可点 | ||
| 134 | + | ||
| 135 | + // var teaVoiceDisplay= $(".teacherVideo-voiceBg").css("display"); | ||
| 136 | + // if(teaVoiceDisplay=="block"){ | ||
| 137 | + // $("#teacherVideo-voiceBg").trigger("click"); | ||
| 138 | + // } | ||
| 147 | if (classAllInfo.userRole=="host"){ | 139 | if (classAllInfo.userRole=="host"){ |
| 148 | $(".teacherVideo-videoBg").css("display","block"); | 140 | $(".teacherVideo-videoBg").css("display","block"); |
| 149 | $(".teacherVideo-video").css("display","none"); | 141 | $(".teacherVideo-video").css("display","none"); |
| @@ -163,6 +155,8 @@ $(function () { | @@ -163,6 +155,8 @@ $(function () { | ||
| 163 | }); | 155 | }); |
| 164 | //老师视频关闭按钮点击 | 156 | //老师视频关闭按钮点击 |
| 165 | $("#teacherVideo-videoBg").click(function (e) { | 157 | $("#teacherVideo-videoBg").click(function (e) { |
| 158 | + | ||
| 159 | + $(".teacherVideo-voice").css("color","#333333"); | ||
| 166 | if(window.publishflash) { | 160 | if(window.publishflash) { |
| 167 | const stopInfo = JSON.stringify({ | 161 | const stopInfo = JSON.stringify({ |
| 168 | type: 5, | 162 | type: 5, |
| @@ -192,13 +186,14 @@ $(function () { | @@ -192,13 +186,14 @@ $(function () { | ||
| 192 | 186 | ||
| 193 | 187 | ||
| 194 | }); | 188 | }); |
| 189 | + | ||
| 195 | //老师音频按钮点击 | 190 | //老师音频按钮点击 |
| 196 | $("#teacherVideo-voice").click(function (e) { | 191 | $("#teacherVideo-voice").click(function (e) { |
| 197 | console.log("teacherVideo-voice点击"); | 192 | console.log("teacherVideo-voice点击"); |
| 198 | - var teaVideoDisplay= $(".teacherVideo-videoBg").css("display"); | ||
| 199 | - if(teaVideoDisplay=="block"){ | ||
| 200 | - $("#teacherVideo-videoBg").trigger("click"); | ||
| 201 | - } | 193 | + // var teaVideoDisplay= $(".teacherVideo-videoBg").css("display"); |
| 194 | + // if(teaVideoDisplay=="block"){ | ||
| 195 | + // | ||
| 196 | + // } | ||
| 202 | 197 | ||
| 203 | if (classAllInfo.userRole=="host"){ | 198 | if (classAllInfo.userRole=="host"){ |
| 204 | $(".publish").css({"width":"240px","height":"180px"}); | 199 | $(".publish").css({"width":"240px","height":"180px"}); |
| @@ -223,6 +218,7 @@ $(function () { | @@ -223,6 +218,7 @@ $(function () { | ||
| 223 | $(".teacherVoicing").css("display","none"); | 218 | $(".teacherVoicing").css("display","none"); |
| 224 | $(".teacherVideo-voiceBg").css("display","none"); | 219 | $(".teacherVideo-voiceBg").css("display","none"); |
| 225 | $(".teacherVideo-voice").css("display","block"); | 220 | $(".teacherVideo-voice").css("display","block"); |
| 221 | + $(".teacherVideoBg").css("display","block"); | ||
| 226 | } | 222 | } |
| 227 | var paramInfo={ | 223 | var paramInfo={ |
| 228 | "nodeId": Number(classAllInfo.nodeId)//用户的nodeId | 224 | "nodeId": Number(classAllInfo.nodeId)//用户的nodeId |
| @@ -240,6 +236,24 @@ $(function () { | @@ -240,6 +236,24 @@ $(function () { | ||
| 240 | 236 | ||
| 241 | 237 | ||
| 242 | }); | 238 | }); |
| 239 | + | ||
| 240 | +//老师音频点击事件 | ||
| 241 | +function teaAudioClick(){ | ||
| 242 | + console.log("teacherVideo-voice点击"); | ||
| 243 | + | ||
| 244 | + if (classAllInfo.userRole=="host"){ | ||
| 245 | + $(".publish").css({"width":"240px","height":"180px"}); | ||
| 246 | + $(".play").css({"width":"1px","height":"1px"}); | ||
| 247 | + $("#teacherVideo-voice").css("display","none"); | ||
| 248 | + $("#teacherVideo-voiceBg").css("display","block"); | ||
| 249 | + $(".teacherVideoBg").css("display","none"); | ||
| 250 | + } | ||
| 251 | + | ||
| 252 | + // /获取老师只推音频地址 | ||
| 253 | + achieveTeaAudioStream(); | ||
| 254 | +} | ||
| 255 | + | ||
| 256 | + | ||
| 243 | //监听学生视频更新 | 257 | //监听学生视频更新 |
| 244 | function stuBroadcast(callbackDate){ | 258 | function stuBroadcast(callbackDate){ |
| 245 | if(callbackDate.fromNodeId === classAllInfo.nodeId) return; | 259 | if(callbackDate.fromNodeId === classAllInfo.nodeId) return; |
| @@ -300,14 +314,33 @@ function stuBroadcast(callbackDate){ | @@ -300,14 +314,33 @@ function stuBroadcast(callbackDate){ | ||
| 300 | function stuAudioBroadcast(callbackDate){ | 314 | function stuAudioBroadcast(callbackDate){ |
| 301 | if(callbackDate.fromNodeId === classAllInfo.nodeId) return; | 315 | if(callbackDate.fromNodeId === classAllInfo.nodeId) return; |
| 302 | if (callbackDate.actionType==1){ | 316 | if (callbackDate.actionType==1){ |
| 303 | - $(".stuVideoBg").css("display","none"); | ||
| 304 | - $(".stuPlay").css({"width":"1px","height":"1px"}); | 317 | + |
| 305 | if(classAllInfo.userRole=="normal"){ | 318 | if(classAllInfo.userRole=="normal"){ |
| 319 | + $(".stuVideoBg").css("display","none"); | ||
| 320 | + $(".stuPublish").css({"width":"240px","height":"180px"}); | ||
| 321 | + $(".stuPlay").css({"width":"1px","height":"1px"}); | ||
| 322 | + | ||
| 323 | + | ||
| 306 | //获取学生只推音频地址 | 324 | //获取学生只推音频地址 |
| 307 | achieveStuVoice(); | 325 | achieveStuVoice(); |
| 308 | } | 326 | } |
| 327 | + if(classAllInfo.userRole=="host"){ | ||
| 328 | + $(".stuVideoBg").css("display","none"); | ||
| 329 | + } | ||
| 309 | } | 330 | } |
| 310 | - if(callbackDate.actionType==2){ | 331 | + else if(callbackDate.actionType==2){ |
| 332 | + if(classAllInfo.userRole=="normal"){ | ||
| 333 | + var paramInfo={ | ||
| 334 | + "nodeId": Number(classAllInfo.nodeId)//用户的nodeId | ||
| 335 | + }; | ||
| 336 | + client.stopPublishAudio(paramInfo); | ||
| 337 | + | ||
| 338 | + $(".stuPlay").css({"width":"1px","height":"1px"}); | ||
| 339 | + $(".stuPublish").css({"width":"1px","height":"1px"}); | ||
| 340 | + $(".studentVideo").css("background", "#f5f9fb"); | ||
| 341 | + $(".stuVideoBg").css("display","block"); | ||
| 342 | + | ||
| 343 | + } | ||
| 311 | if(window.publishflashStuVoice) { | 344 | if(window.publishflashStuVoice) { |
| 312 | const stopStuInfo = JSON.stringify({ | 345 | const stopStuInfo = JSON.stringify({ |
| 313 | type: 5, | 346 | type: 5, |
| @@ -316,23 +349,7 @@ function stuAudioBroadcast(callbackDate){ | @@ -316,23 +349,7 @@ function stuAudioBroadcast(callbackDate){ | ||
| 316 | console.log(publishflashStuVoice._js2native(stopStuInfo)); | 349 | console.log(publishflashStuVoice._js2native(stopStuInfo)); |
| 317 | } | 350 | } |
| 318 | 351 | ||
| 319 | - var paramInfo={ | ||
| 320 | - "nodeId": Number(stuNodeId)//用户的nodeId | ||
| 321 | - }; | ||
| 322 | - client.stopPublishAudio(paramInfo); | ||
| 323 | 352 | ||
| 324 | - $(".stuPlay").css({"width":"1px","height":"1px"}); | ||
| 325 | - $(".stuPublish").css({"width":"1px","height":"1px"}); | ||
| 326 | - $(".studentVideo").css("background", "#f5f9fb"); | ||
| 327 | - $(".stuVideoBg").css("display","block"); | ||
| 328 | - $("#stuVideo-video").css("display","block"); | ||
| 329 | - $("#stuVideo-videoBg").css("display","none"); | ||
| 330 | - | ||
| 331 | - if (classAllInfo.userRole=="normal"){ | ||
| 332 | - $(".stuVideo-voice").css("display","none"); | ||
| 333 | - $(".stuVideo-video").css("display","none"); | ||
| 334 | - $(".stuPublish").css({"width":"240px","height":"180px"}); | ||
| 335 | - } | ||
| 336 | } | 353 | } |
| 337 | } | 354 | } |
| 338 | 355 | ||
| @@ -383,6 +400,9 @@ function _videoUpdate(callbackDate){ | @@ -383,6 +400,9 @@ function _videoUpdate(callbackDate){ | ||
| 383 | $("#stuVideo-voice").css("display","block"); | 400 | $("#stuVideo-voice").css("display","block"); |
| 384 | $("#stuVideo-voiceBg").css("display","none"); | 401 | $("#stuVideo-voiceBg").css("display","none"); |
| 385 | $(".stuVideoBg").css("display","block"); | 402 | $(".stuVideoBg").css("display","block"); |
| 403 | + $(".stuVideo-video").css("display","block"); | ||
| 404 | + $(".stuVideo-videoBg").css("display","none"); | ||
| 405 | + | ||
| 386 | 406 | ||
| 387 | } | 407 | } |
| 388 | if((classAllInfo.userRole=="normal")&&(callbackDate.status==0)&&(callbackDate.fromNodeId == stuNodeId)){ | 408 | if((classAllInfo.userRole=="normal")&&(callbackDate.status==0)&&(callbackDate.fromNodeId == stuNodeId)){ |
| @@ -422,29 +442,13 @@ function _audioUpdate(callbackDate){ | @@ -422,29 +442,13 @@ function _audioUpdate(callbackDate){ | ||
| 422 | 442 | ||
| 423 | } | 443 | } |
| 424 | 444 | ||
| 425 | - | ||
| 426 | if ((classAllInfo.userRole=="normal")&&(callbackDate.status==1)&&(callbackDate.fromNodeId==stuNodeId)){ | 445 | if ((classAllInfo.userRole=="normal")&&(callbackDate.status==1)&&(callbackDate.fromNodeId==stuNodeId)){ |
| 427 | achievePlayAudioStream(callbackDate); | 446 | achievePlayAudioStream(callbackDate); |
| 428 | 447 | ||
| 429 | } | 448 | } |
| 430 | - if(callbackDate.status==0){ | ||
| 431 | - $(".teacherVideoBg").css("display","block"); | ||
| 432 | - $(".teacherVideo").css("background", "#f5f9fb"); | ||
| 433 | - if(window.playflashAudio) { | ||
| 434 | - console.log("playflashVoiceId", playflashAudioId); | ||
| 435 | 449 | ||
| 436 | - if (callbackDate.fromNodeId == stuNodeId) { | ||
| 437 | - | ||
| 438 | - if (classAllInfo.userRole=="normal"){ | ||
| 439 | - $(".play").css({"width":"1px","height":"1px"}); | ||
| 440 | - } | ||
| 441 | - const stopPlayInfo = JSON.stringify({ | ||
| 442 | - type: 5, | ||
| 443 | - videoId: playflashAudioId | ||
| 444 | - }); | ||
| 445 | - console.log(playflashAudio._js2native(stopPlayInfo)); | ||
| 446 | - } | ||
| 447 | - } | 450 | + //流状态为0 |
| 451 | + if ((classAllInfo.userRole=="host")&&(callbackDate.status==0)&&(callbackDate.fromNodeId==stuNodeId)){ | ||
| 448 | if(window.playflashStuAudio) { | 452 | if(window.playflashStuAudio) { |
| 449 | const stopStuInfo = JSON.stringify({ | 453 | const stopStuInfo = JSON.stringify({ |
| 450 | type: 5, | 454 | type: 5, |
| @@ -452,13 +456,33 @@ function _audioUpdate(callbackDate){ | @@ -452,13 +456,33 @@ function _audioUpdate(callbackDate){ | ||
| 452 | }); | 456 | }); |
| 453 | console.log(playflashStuAudio._js2native(stopStuInfo)); | 457 | console.log(playflashStuAudio._js2native(stopStuInfo)); |
| 454 | } | 458 | } |
| 455 | - | 459 | + $(".stuPublish").css({"width":"1px","height":"1px"}); |
| 460 | + $(".stuPlay").css({"width":"1px","height":"1px"}); | ||
| 461 | + $(".studentVideo").css("background", "#f5f9fb"); | ||
| 462 | + $("#stuVideo-voice").css("display","block"); | ||
| 463 | + $("#stuVideo-voiceBg").css("display","none"); | ||
| 464 | + $(".stuVideoBg").css("display","block"); | ||
| 465 | + $(".stuVideo-video").css("display","block"); | ||
| 466 | + $(".stuVideo-videoBg").css("display","none"); | ||
| 456 | 467 | ||
| 457 | 468 | ||
| 458 | 469 | ||
| 459 | } | 470 | } |
| 471 | + if ((classAllInfo.userRole=="normal")&&(callbackDate.status==0)&&(callbackDate.fromNodeId==stuNodeId)){ | ||
| 472 | + if(window.playflashAudio) { | ||
| 473 | + console.log("playflashAudioId", playflashAudioId); | ||
| 474 | + const stopPlayInfo = JSON.stringify({ | ||
| 475 | + type: 5, | ||
| 476 | + videoId: playflashAudioId | ||
| 477 | + }); | ||
| 478 | + console.log(playflashAudio._js2native(stopPlayInfo)); | ||
| 460 | 479 | ||
| 461 | - | 480 | + } |
| 481 | + $(".play").css({"width":"1px","height":"1px"}); | ||
| 482 | + $(".stuVideo-voice").css("display","none"); | ||
| 483 | + $(".teacherVideoBg").css("display","block"); | ||
| 484 | + $(".teacherVideo").css("background", "#f5f9fb"); | ||
| 485 | + } | ||
| 462 | 486 | ||
| 463 | } | 487 | } |
| 464 | 488 | ||
| @@ -628,7 +652,7 @@ function achieveStuVoice() { | @@ -628,7 +652,7 @@ function achieveStuVoice() { | ||
| 628 | console.log(' [publish] native 2 js', msg); | 652 | console.log(' [publish] native 2 js', msg); |
| 629 | var _msg=JSON.parse(msg); | 653 | var _msg=JSON.parse(msg); |
| 630 | console.log("_msg===========>",_msg); | 654 | console.log("_msg===========>",_msg); |
| 631 | - if(_msg.data.result == 0){ | 655 | + if((_msg.data.result == 0)&&(_msg.data.type==10)){ |
| 632 | 656 | ||
| 633 | //将之前底层取的推流结果传递给底层 | 657 | //将之前底层取的推流结果传递给底层 |
| 634 | var _successErrorResult= client.publishAudio(pubStuAudioResult); | 658 | var _successErrorResult= client.publishAudio(pubStuAudioResult); |
| @@ -640,7 +664,11 @@ function achieveStuVoice() { | @@ -640,7 +664,11 @@ function achieveStuVoice() { | ||
| 640 | console.log("底层广播推流失败,关闭推流"); | 664 | console.log("底层广播推流失败,关闭推流"); |
| 641 | } | 665 | } |
| 642 | 666 | ||
| 643 | - }else { | 667 | + }else if((_msg.data.result == 0)&&(_msg.data.type==5)){ |
| 668 | + console.log("5,flash把学生音频流关闭成功"); | ||
| 669 | + } | ||
| 670 | + | ||
| 671 | + else { | ||
| 644 | console.error('publish error'); | 672 | console.error('publish error'); |
| 645 | } | 673 | } |
| 646 | } | 674 | } |
| @@ -684,7 +712,7 @@ function achieveStuPlayAudioStream(_pubResultObj){ | @@ -684,7 +712,7 @@ function achieveStuPlayAudioStream(_pubResultObj){ | ||
| 684 | var streamInfo=client.getAudioPlayPath(_paramInfo); | 712 | var streamInfo=client.getAudioPlayPath(_paramInfo); |
| 685 | console.log("result是=============>",streamInfo); | 713 | console.log("result是=============>",streamInfo); |
| 686 | $(".stuPlay").css({"width":"240px","height":"180px"}); | 714 | $(".stuPlay").css({"width":"240px","height":"180px"}); |
| 687 | - $(".teacherVideoBg").css("display","none"); | 715 | + // $(".teacherVideoBg").css("display","none"); |
| 688 | // $(".teacherVideo").css("background", "#CCCCCC"); | 716 | // $(".teacherVideo").css("background", "#CCCCCC"); |
| 689 | $(".teacherVideo-voice").css("bottom","4px"); | 717 | $(".teacherVideo-voice").css("bottom","4px"); |
| 690 | 718 | ||
| @@ -729,6 +757,8 @@ function stuPlayAudioURL(rtmpURL){ | @@ -729,6 +757,8 @@ function stuPlayAudioURL(rtmpURL){ | ||
| 729 | 757 | ||
| 730 | //获取老师只推音频 | 758 | //获取老师只推音频 |
| 731 | function achieveTeaAudioStream() { | 759 | function achieveTeaAudioStream() { |
| 760 | + $(".publish").css({"width":"240px","height":"180px"}); | ||
| 761 | + $(".play").css({"width":"1px","height":"1px"}); | ||
| 732 | var paramInfo={ | 762 | var paramInfo={ |
| 733 | "type": "flash" | 763 | "type": "flash" |
| 734 | }; | 764 | }; |
| @@ -757,7 +787,6 @@ function achieveTeaAudioStream() { | @@ -757,7 +787,6 @@ function achieveTeaAudioStream() { | ||
| 757 | var _msg=JSON.parse(msg); | 787 | var _msg=JSON.parse(msg); |
| 758 | console.log("_msg===========>",_msg); | 788 | console.log("_msg===========>",_msg); |
| 759 | if(_msg.data.result == 0){ | 789 | if(_msg.data.result == 0){ |
| 760 | - | ||
| 761 | //将之前底层取的推流结果传递给底层 | 790 | //将之前底层取的推流结果传递给底层 |
| 762 | var _successErrorResult= client.publishAudio(pushTeaAudioResult); | 791 | var _successErrorResult= client.publishAudio(pushTeaAudioResult); |
| 763 | console.log("_successErrorResult======>",_successErrorResult) | 792 | console.log("_successErrorResult======>",_successErrorResult) |
| @@ -785,6 +814,7 @@ function achieveTeaAudioStream() { | @@ -785,6 +814,7 @@ function achieveTeaAudioStream() { | ||
| 785 | 814 | ||
| 786 | 815 | ||
| 787 | } | 816 | } |
| 817 | +//推老师音频 js2native | ||
| 788 | function publishTeaAudioURL(rtmpURL) { | 818 | function publishTeaAudioURL(rtmpURL) { |
| 789 | const msg = JSON.stringify({ | 819 | const msg = JSON.stringify({ |
| 790 | type: 10, | 820 | type: 10, |
| @@ -887,6 +917,8 @@ function achievePlayAudioStream(_pubResultObj){ | @@ -887,6 +917,8 @@ function achievePlayAudioStream(_pubResultObj){ | ||
| 887 | console.log("result是=============>",streamInfo); | 917 | console.log("result是=============>",streamInfo); |
| 888 | $(".play").css({"width":"240px","height":"180px"}); | 918 | $(".play").css({"width":"240px","height":"180px"}); |
| 889 | $(".teacherVideoBg").css("display","none"); | 919 | $(".teacherVideoBg").css("display","none"); |
| 920 | + | ||
| 921 | + | ||
| 890 | // $(".teacherVideo").css("background", "#CCCCCC"); | 922 | // $(".teacherVideo").css("background", "#CCCCCC"); |
| 891 | $(".teacherVideo-voice").css("bottom","4px"); | 923 | $(".teacherVideo-voice").css("bottom","4px"); |
| 892 | 924 |
-
请 注册 或 登录 后发表评论