filesbox/web/dist/design/designstatic/newJS/chatroom/playCommon.js

12 lines
16 KiB
JavaScript
Raw Permalink Normal View History

2024-07-26 06:10:54 +00:00
(function(D){if(D.$){let x=function(){$("#setting_dialog .dialog_close").click(),$(".zeromodal-close").length>0&&$(".zeromodal-close").click()},k=function(){var e=/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent);if(e)return{f:0,v:0};var t=0,n=0;if(document.all){var i=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");i&&(t=1,VSwf=i.GetVariable("$version"),n=parseInt(VSwf.split(" ")[1].split(",")[0]))}else if(navigator.plugins&&navigator.plugins.length>0){var i=navigator.plugins["Shockwave Flash"];if(i){t=1;for(var a=i.description.split(" "),l=0;l<a.length;++l)isNaN(parseInt(a[l]))||(n=parseInt(a[l]))}}return{f:t,v:n}},b=function(){$("#danmu").danmu("setOpacity",0)},w=function(){$("#danmu").danmu("setOpacity",1),$("#danmu").danmu("danmuResume")},O=function(e,t,n){var i=S(n),a=new Date;a.setTime(a.getTime()+i*1),document.cookie=e+"="+escape(t)+";expires="+a.toGMTString()},A=function(e){for(var t=document.cookie,n=t.split("; "),i=0;i<n.length;i++){var a=n[i].split("=");if(a[0]==e)return a[1]}return""},S=function(e){var t=e.substring(1,e.length)*1,n=e.substring(0,1);if(n=="s")return t*1e3;if(n=="h")return t*60*60*1e3;if(n=="d")return t*24*60*60*1e3},y=function(){$("#danmu").danmu({left:0,top:0,zindex:2222223,height:"100%",width:"100%",speed:7e3,opacity:1,font_size_small:16,font_size_big:24,top_botton_danmu_time:6e3,maxCountInScreen:5e3,maxCountPerSec:5e3}),$("#danmu").css({"pointer-events":"none"});var e=document.createElement("style");e.classList.add("BULLET_ANIMATE");var t="from { visibility: visible; transform: translateX(".concat($("#danmu").width(),"px); }"),n="@keyframes RightToLeft { ".concat(t," ").concat("to { visibility: visible; transform: translateX(-100%); }"," }");e.innerHTML=n+`
.bullet-item-style {
cursor: pointer;
position: absolute;
left: 0;
animation-name: RightToLeft;
animation-timing-function: linear;
backface-visibility: hidden;
will-change: transform;
}
`,document.head.appendChild(e),C.clearInterval(),C.setInterval(function(){if((window.acceptDmList||[]).length){let i=window.acceptDmList.shift();i.time=$("#danmu").data("nowTime")+1,$("#danmu").danmu("addDanmu",i)}},50)},I=function(e={}){const t=$("#danmu").data("nowTime")+1,{color:n,position:i,size:a,text:l,isMy:h}=e;let g={color:`#${n}`,xposition:d.position,position:0,size:d.size,text:l,time:t};h?(g.isnew="",$("#danmu").danmu("addDanmu",g)):window.acceptDmList=[...window.acceptDmList||[],g]},F=function(){const e=$(".live_wap_bar input").val();liveObj.sendDm({type:"barrage",color:d.color.replace("#",""),position:d.position,text:e}),$(".live_wap_bar input").val("")},v=function(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)","i"),n=new RegExp("(^|/)"+e+"/([^/]*)(/|$)","i"),i=window.location.search.substr(1).match(t),a=window.location.pathname.substr(1).match(n);return i!=null?unescape(i[2]):a!=null?unescape(a[2]):null};var B=x,M=k,P=b,X=w,H=O,W=A,G=S,N=y,J=I,V=F,U=v;let m=!1,d={color:"#ffffff",opacity:1,size:1,position:0};$(function(){$(document).on("click",".js_msg_audio",function(){const o=$(this);o.toggleClass("audio_stop");const s=o.find("audio")[0],r=s.paused;$(".js_msg_audio").not(this).each(function(){$(this).removeClass("audio_stop").find("audio")[0].pause()}),r?s.play():s.pause()}),$(document).on("click",".tall-top-btn",function(){$("#content-list").animate({scrollTop:0})}),$(document).on("click",".tall-bottom-btn",function(){var o=$("#content-list"),s=parseInt($("#content-list > div:last").offset().top)+o.scrollTop();o.animate({scrollTop:s})}),$(document).on("touchstart",".menuBox",function(){var o=$(".operation_box"),s=$(".operation_shadow");o.hasClass("open")?(o.removeClass("open"),s.removeClass("open")):(o.addClass("open"),s.addClass("open"))}),$(document).on("click",".operation_close, .shareBox",function(){var o=$(".operation_box"),s=$(".operation_shadow");o.removeClass("open"),s.removeClass("open")});var e="";$(document).on("click",".hide-video-btn",function(){var o=$(this),s=parseInt($(".tab_box").height()),r=parseInt($("body").height()),c=$("#tall_all"),p=$("#tall_all .layui-tab-content"),u=$("#content-list"),f=$(".bottom_operation").height();o.hasClass("hide")?($("#course_video").removeClass("hide"),o.removeClass("hide"),$(".live_wap_bar").css("display",e)):($("#course_video").addClass("hide"),o.addClass("hide"),e=$(".live_wap_bar").css("display"),$(".live_wap_bar").hide()),liveObj.selfZoom()});var t=navigator.userAgent,n=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);console.log("isiOS",n),n&&($(".all-screen-btn").hide(),$(".live_wap_bar").css("right","50px"),$(".hide-video-btn").css("right","12px")),$(document).on("click",".all-screen-btn",function(){var o=$(".video video")[0];if($(this).hasClass("hide"))return!1;o?(o.requestFullscreen&&o.requestFullscreen(),o.webkitRequestFullScreen&&o.webkitRequestFullScreen()):layer.msg("\u64AD\u653E\u5668\u8FD8\u672A\u521B\u5EFA")}),$(document).on("click",".js_play_notice",function(){const o=$(this),s=o.parents(".studio_notice_box");o.toggleClass("header_up"),s.find(".studio_notice").slideToggle()}),$(document).on("click",".close_Btn_notice",function(){var o=$(this),s=o.parents(".studio_notice_box");s.remove()});const i=40;$(".js_inter_move").on({mousedown:function(o){let s=o.pageX;$(document).on("mousemove.drag",function(r){let c=event.pageX;if(c>i){const u=$(".camrem_list_box").width()+s-c;$(".camrem_list_box").width(u),s=c}}).on("mouseup",function(r){$(document).off("mousemove.drag")})}});const a=o=>{const s=`${o}% 100%`,r=o/100;if($("#whiteboard_box").find("object").length<1){const u=$("#online")[0];u&&(u.volume=r)}else window.getPlayer&&getPlayer("online").volume(r);$(".voice_change .percent").text(`${o}%`);const p=o!==0?"volume":"mute";$(".js_voice_btn img").attr("src",`/design/designstatic/chatroom/studio/img/${p}.png`),$(".js_bar_range").css({"background-size":s})};$(document).on("click",".js_voice_btn",function(){const o=!$(this).data("voice");$(this).data("voice",o);const s=o?100:0;$(".js_bar_range").val(s),$(".js-volume_panel").hide(),a(s)}),$(document).on("