TOP
墨星移动版二维码

墨星移动WAP端

m.mx-fm.com

手机扫描二维码访问

官方提示:一切第三方下载的APP皆为盗版

您的位置:网站首页免费封面大厅 > 《女尊皇帝成为虐文女主》古代言情小说封面制作
封面成品
《女尊皇帝成为虐文女主》小说封面制作

免费小说封面制作

小说类型: 古代言情

小说名字: 《女尊皇帝成为虐文女主》

小说作者: 睡觉了

下单时间:2024/10/6 20:12:07

关注人气: 人关注了此封面

定制说明
番茄小说网的logo
发表于番茄小说网
我是睡觉了,我的小说《女尊皇帝成为虐文女主》发表在番茄小说网,我选择了墨星封面网提供的番茄小说网终生免费封面制作服务。

我希望小说封面是这样的

人物数量:

人物描述:

我的小说简介描述

上一世,她征战四方,统一天下,成就宏图霸业,但天下太平后,文官说她暴虐成性。那文官不出半日就人头落地,她坐在皇位上俯视众臣。“说我暴虐也好,说我无情也罢,记住自己的身份,再让我听见这些闲言碎语,这就是你们的下场!”一朝宫宴,她喝了帝君送来的酒,没想到就此撒手人寰。再醒来时,已经到了一个既陌生又熟悉的世界。世界还是那个世界,只是全都倒转了过来,男人竟然也能称帝,科举入仕,笑话,简直是天大的笑话!【叮!宿主您好,您已绑定复仇系统。】她微微皱眉,半知半解,“这话什么意思?”【本书因太过虐女评分过低,您被读者选中作为复仇者重生,只要您能活过十年,就可以回到原来的世界哦。】不等她再问,意识就再次变得模糊。“小姐,今日是回府的日子,快些起来梳妆了。”#videoTogetherLoading{touch-action:none;height:50px;border:1pxsolid#c9c8c8;background:#ffffff;color:#212529;display:flex;align-items:center;z-index:2147483646;position:fixed;bottom:15px;right:15px;width:250px;text-align:center;box-shadow:03px6px-4px#0000001f,06px16px#00000014,09px28px8px#0000000d;border-radius:5px;}#videoTogetherLoadingwrap{width:100%;display:flex;align-items:center;justify-content:center;}#videoTogetherLoadingwrapimg{margin-right:12px;}#videoTogetherLoadingwrapa{color:#212529;text-decoration:none;}#videoTogetherLoadingwrapa:hover{color:#1890ff;text-decoration:underline;}r.json()).then(config=>Var.cdnConfig=config).then(()=>Var.cdnConfig)}asyncfunctiongetEasyShareHostChina(){returngetCdnConfig(encodedChinaCdnA).then(c=>c.easyShareHostChina)}let****ustedPolicy=undefined;functionupdateInnnerHTML(e,html){****y{e.innerHTML=html;}catch{if(****ustedPolicy==undefined){****ustedPolicy=****ustedTypes.createPolicy('videoTogetherExtensionVtJsPolicy',{createHTML:(s****ing)=>s****ing,create****:(s****ing)=>s****ing,create****URL:(url)=>url});}e.innerHTML=****ustedPolicy.createHTML(html);}}functionge****urationS****(duration){****y{le****=parseInt(duration);lets****=""letunits=["秒","分","小时"]for(letiinunits){if(d>0){s****=d%60units[i]s****;}d=Math.floor(d/60)}returns****;}catch{return"N/A"}}functiondownloadEnabled(){****y{if(window.VideoTogetherDownload=='disabled'){returnfalse;}consttype=VideoTogetherStorage.User****TypereturnparseInt(window.VideoTogetherStorage.LoaddingVersion)>=1694758378&&(type=="Chrome"||type=="Safari"||type=="Firefox")&&!isDownloadBlackLis****omain()}catch{returnfalse;}}functionisM3U8(textContent){returntextContent.****im().startsWith('#EXTM3U');}functionisMasterM3u8(textContent){returntextContent.includes('#EXT-X-S****EAM-INF:');}functiongetFirstMediaM3U8(m3u8Content,m3u8Url){if(!isMasterM3u8(m3u8Content)){returnnull;}constlines=m3u8Content.split('\n');for(constlineoflines){const****immedLine=line.****im();if(****immedLine&&!****immedLine.startsWith('#')&&****immedLine!=""){returnnewURL(****immedLine,m3u8Url);}}returnnull;}functionstar****ownload(_vtArgM3u8Url,_vtArgM3u8Content,_vtArgM3u8Urls,_vtArgTitle,_vtArgPageUrl){/*//*/(asyncfunction(){functionex****actExtXKeyUrls(m3u8Content,baseUrl){consturis=[];constlines=m3u8Content.split('\n');for(leti=0;i{constid=setTimeout(()=>{reader.cancel();rej(newError('S****eamreadtimedout'));},timeout);});returnPromise.race([reader.read(),timer]);}functiongenerateUUID(){if(crypto.randomUUID!=undefined){returncrypto.randomUUID();}return([1e7]-1e3-4e3-8e3-1e11).replace(/[018]/g,c=>(c^crypto.ge****andomValues(newUint8Array(1))[0]&15>>c/4).toS****ing(16));}window.updateM3u8Status=asyncfunctionupdateM3u8Status(m3u8Url,status){//0downloading1completed2deletingletm3u8mini=awai****eadFromIndexedDB('m3u8s-mini',m3u8Url);m3u8mini.status=statusawaitsaveToIndexedDB('m3u8s-mini',m3u8Url,m3u8mini);}asyncfunctionsaveM3u8(m3u8Url,m3u8Content){awaitsaveToIndexedDB('m3u8s',m3u8Url,{data:m3u8Content,title:vtArgTitle,pageUrl:vtArgPageUrl,m3u8Url:m3u8Url,m3u8Id:m3u8Id,status:0})}asyncfunctionblobToDataUrl(blob){returnnewPromise((resolve,reject)=>{cons****eader=newFileReader();reader.****=function(event){resolve(event.target.result);};reader.****=function(event){reject(newError("Failedtoreadblob"));};reader.readAsDataURL(blob);});}asyncfunctionsaveBlob(****,url,blob){returnnewPromise(async(res,rej)=>{****y{cons****ataUrl=awaitblobToDataUrl(blob);awaitsaveToIndexedDB(****,url,{data:dataUrl,m3u8Url:downloadM3u8Url,m3u8Id:m3u8Id,})res();}catch(e){rej(e);}})}window.regexMatchKeys=functionregexMatchKeys(****,regex){constqueryId=generateUUID()returnnewPromise((res,rej)=>{window.postMessage({source:"VideoTogether",type:2005,data:{****:****,regex:regex,id:queryId}},'*')regexCallback[queryId]=(data)=>{****y{res(data)}catch{rej()}}})}saveToIndexedDBThreads=1;window.saveToIndexedDB=asyncfunctionsaveToIndexedDB(****,key,data){while(saveToIndexedDBThreadssetTimeout(r,100));}saveToIndexedDBThreads--;constqueryId=generateUUID();returnnewPromise((res,rej)=>{data.saveTime=Date.now()window.postMessage({source:"VideoTogether",type:2001,data:{****:****,key:key,data:data,id:queryId,}},'*')data=null;saveCallback[queryId]=(error)=>{saveToIndexedDBThreads;if(error===0){res(0)}else{rej(error)}}})}window.iosDeleteByPrefix=asyncfunctioniosDeleteByPrefix(prefix){constqueryId=generateUUID();returnnewPromise((res,rej)=>{window.postMessage({source:"VideoTogether",type:3010,data:{prefix:prefix,id:queryId,}},'*')deleteByPrefix[queryId]=(error)=>{if(error===0){res(0)}else{rej(error)}}})}le****eadCallback={}le****egexCallback={}le****eleteCallback={}letsaveCallback={}le****eleteByPrefix={}window.addEventListener('message',asynce=>{if(e.data.source=="VideoTogether"){switch(e.data.type){case2003:{saveCallback[e.data.data.id](e.data.data.error)saveCallback[e.data.data.id]=undefinedbreak;}case2004:{readCallback[e.data.data.id](e.data.data.data)readCallback[e.data.data.id]=undefined;break;}case2006:{regexCallback[e.data.data.id](e.data.data.data)regexCallback[e.data.data.id]=undefined;break;}case2008:{deleteCallback[e.data.data.id](e.data.data.error);deleteCallback[e.data.data.id]=undefined;break;}case3011:{deleteByPrefix[e.data.data.id](e.data.data.error);deleteByPrefix[e.data.data.id]=undefined;break;}case2010:{console.log(e.data.data.data);break;}}}})window.requestStorageEstimate=functionrequestStorageEstimate(){window.postMessage({source:"VideoTogether",type:2009,data:{}},'*')}window.deleteFromIndexedDB=functiondeleteFromIndexedDB(****,key){constqueryId=generateUUID()window.postMessage({source:"VideoTogether",type:2007,data:{id:queryId,****:****,key:key,}},'*')returnnewPromise((res,rej)=>{deleteCallback[queryId]=(error)=>{if(error===0){res(****ue);}else{rej(error);}}})}window.readFromIndexedDB=functionreadFromIndexedDB(****,key){constqueryId=generateUUID();window.postMessage({source:"VideoTogether",type:2002,data:{****:****,key:key,id:queryId,}},'*')returnnewPromise((res,rej)=>{readCallback[queryId]=(data)=>{****y{res(data);}catch{rej()}}})}if(window.videoTogetherExtension===undefined){return;}if(window.location.hostname=='local.2gether.video'){return;}letvtArgM3u8Url=undefined;letvtArgM3u8Content=undefined;letvtArgM3u8Urls=undefined;letvtArgTitle=undefined;letvtArgPageUrl=undefined;****y{vtArgM3u8Url=_vtArgM3u8Url;vtArgM3u8Content=_vtArgM3u8Content;vtArgM3u8Urls=_vtArgM3u8Urls;vtArgTitle=_vtArgTitle;vtArgPageUrl=_vtArgPageUrl;}catch{return;}constm3u8Id=generateUUID()constm3u8IdHead=`-m3u8Id-${m3u8Id}-end-`cons****ownloadM3u8Url=vtArgM3u8Url;constnumThreads=10;letlastTotalBytes=0;lettotalBytes=0;letfailedUrls=[]leturls=vtArgM3u8UrlsletsuccessCount=0;videoTogetherExtension.downloadPercentage=0;constm3u8Key=m3u8IdHeaddownloadM3u8Urlif(downloadM3u8Url===undefined){return;}awaitsaveM3u8(m3u8Key,vtArgM3u8Content)constotherUrl=ex****actExtXKeyUrls(vtArgM3u8Content,downloadM3u8Url);consttotalCount=urls.lengthotherUrl.length;console.log(otherUrl);awai****ownloadInParallel('future',otherUrl,numThreads);setInterval(function(){videoTogetherExtension.downloadSpeedMb=(totalBytes-lastTotalBytes)/1024/1024;lastTotalBytes=totalBytes;},1000);awai****ownloadInParallel('videos',urls,numThreads);awaitupdateM3u8Status(m3u8Key,1)asyncfunctionfetchWithSpeed****acking(url){constcon****oller=newAbortCon****oller();consttimer=setTimeout(()=>{con****oller.abort();},20000);cons****esponse=awaitfetch(url,{signal:con****oller.signal});clearTimeout(timer)if(!response.****){thrownewError("ReadableS****eamnotyetsupportedinthisbrowser.");}constcontentType=response.headers.get("Content-Type")||"application/octet-s****eam";cons****eader=response.****.ge****eader();letchunks=[];asyncfunctionreadS****eam(){const{done,value}=awaittimeoutAsyncRead(reader,60000);if(done){return;}if(value){chunks.push(value);totalBytes=value.length;}//Continuereadingthes****eamreturnawai****eadS****eam();}awai****eadS****eam();constblob=newBlob(chunks,{type:contentType});chunks=null;returnblob;}asyncfunctiondownloadWorker(****,urls,index,step,total){if(index>=total){return;}consturl=urls[index];****y{letblob=awaitfetchWithSpeed****acking(url);awaitsaveBlob(****,m3u8IdHeadurl,blob);blob=null;successCount;videoTogetherExtension.downloadPercentage=Math.floor((successCount/totalCount)*100)console.log('downloadts:',****,index,'of',total);}catch(e){awaitnewPromise(r=>setTimeout(r,2000));failedUrls.push(url);console.error(e);}//Pickupthenextworkitemawai****ownloadWorker(****,urls,indexstep,step,total);}asyncfunctiondownloadInParallel(****,urls,numThreads){consttotal=urls.length;//StartnumThreadsdownloadworkersconstpromises=Array.from({length:numThreads},(_,i)=>{returndownloadWorker(****,urls,i,numThreads,total);});awaitPromise.all(promises);if(failedUrls.length!=0){urls=failedUrls;failedUrls=[];awai****ownloadInParallel(****,urls,numThreads);}}})()//*/}functionisLimited(){while(las****unQueue.length>0&&las****unQueue[0]timeLimitation){console.error("limited")return****ue;}las****unQueue.push(Date.now()/1000);returnfalse;}functiongetVideoTogetherStorage(key,defaultVal){****y{if(window.VideoTogetherStorage==undefined){returndefaultVal}else{if(window.VideoTogetherStorage[key]==undefined){returndefaultVal}else{returnwindow.VideoTogetherStorage[key];}}}catch{returndefaultVal}}functiongetEnableTextMessage(){returngetVideoTogetherStorage('EnableTextMessage',****ue);}functiongetEnableMiniBar(){returngetVideoTogetherStorage('EnableMiniBar',****ue);}functionskipIn****oLen(){****y{letlen=parseInt(window.VideoTogetherStorage.SkipIn****oLength);if(window.VideoTogetherStorage.SkipIn****o&&!isNaN(len)){returnlen;}}catch{}return0;}functionisEmpty(s){****y{returns.length==0;}catch{return****ue;}}functionemptyS****IfUdf(s){returns==undefined?"":s;}letisDownloadBlackLis****omainCache=undefined;functionisDownloadBlackLis****omain(){if(window.location.protocol!='http:'&&window.location.protocol!='https:'){return****ue;}cons****omains=['iqiyi.com','qq.com','youku.com','bilibili.com','baidu.com','quark.cn','aliyundrive.com',"115.com","acfun.cn","youtube.com",];if(isDownloadBlackLis****omainCache==undefined){consthostname=window.location.hostname;isDownloadBlackLis****omainCache=domains.some(domain=>hostname===domain||hostname.endsWith(`.${domain}`));}returnisDownloadBlackLis****omainCache;}letisEasyShareBlackLis****omainCache=undefined;functionisEasyShareBlackLis****omain(){if(window.location.protocol!='https:'){return****ue;}cons****omains=['iqiyi.com','qq.com','youku.com','bilibili.com','baidu.com','quark.cn','aliyundrive.com',"115.com","pornhub.com","acfun.cn","youtube.com",//--"missav.com","nivod4.tv"];if(isEasyShareBlackLis****omainCache==undefined){consthostname=window.location.hostname;isEasyShareBlackLis****omainCache=domains.some(domain=>hostname===domain||hostname.endsWith(`.${domain}`));}returnisEasyShareBlackLis****omainCache;}functionisEasyShareEnabled(){if(inDownload){returnfalse;}****y{if(isWeb()){returnfalse;}if(isEasyShareBlackLis****omain()){returnfalse;}returnwindow.VideoTogetherEasyShare!='disabled'&&window.VideoTogetherStorage.EasyShare!=false;}catch{returnfalse;}}functionisEasyShareMember(){****y{returnwindow.VideoTogetherEasyShareMemberSite==****ue;}catch{returnfalse;}}functionuseMobile****(videoDom){letisMobile=false;if(window.location.href.startsWith('https://m.bilibili.com/')){isMobile=****ue;}if(!isMobile){return;}****.****.childNodes.forEach(e=>{****y{if(e!=videoDom&&e.****&&e.id!='VideoTogetherWrapper'){e.****.display='none'}}catch{}});videoDom.setAt****ibute('con****ols',****ue);videoDom.****.width=videoDom.****.height="100%";videoDom.****.maxWidth=videoDom.****.maxHeight="100%";videoDom.****.display='block';if(videoDom.parentElement!=****.****){****.****.appendChild(videoDom);}}constmediaUrlsCache={}functionex****actMediaUrls(m3u8Content,m3u8Url){if(mediaUrlsCache[m3u8Url]==undefined){letlines=m3u8Content.split("\n");letmediaUrls=[];letbase=undefined;****y{base=newURL(m3u8Url);}catch{};for(leti=0;i`%${c.charCodeAt(0).toS****ing(16).toUpperCase()}`).replace(/%20/g,'');}functionfixedDecodeURIComponent(s****){returndecodeURIComponent(s****.replace(/\/g,''));}functionisWeb(){****y{lettype=window.VideoTogetherStorage.User****Type;returntype=='website'||type=='website_debug';}catch{returnfalse;}}/***@returns{Element}*/functionselect(query){lete=window.videoTogetherFlyPannel.wrapper.querySelector(query);returne;}functionhide(e){if(e)e.****.display='none';}functionshow(e){if(e)e.****.display=null;}functionisVideoLoadded(video){****y{if(isNaN(video.readyState)){return****ue;}returnvideo.readyState>=3;}catch{return****ue;}}functionisRoomProtected(){****y{returnwindow.VideoTogetherStorage==undefined||window.VideoTogetherStorage.PasswordProtectedRoom!=false;}catch{return****ue;}}functionchangeBackground(url){lete=select('.vt-modal-****');if(e){if(url==null||url==""){e.****.backgroundImage='none';}elseif(e.****.backgroundImage!=`url("${url}")`){e.****.backgroundImage=`url("${url}")`}}}functionchangeMemberCount(c){extension.ctxMemberCount=c;updateInnnerHTML(select('#memberCount'),S****ing.fromCodePoint("0x1f465")""c)}functiondsply(e,_show=****ue){_show?show(e):hide(e);}asyncfunctionisAudioVolumeRO(){leta=newAudio();a.volume=0.5;returnnewPromise(r=>setTimeout(()=>{r(!(a.volume==0.5))},1));}constGlobal={inited:false,NativePostMessageFunction:null,NativeAttachShadow:null,NativeFetch:null}functionAttachShadow(e,options){****y{returne.attachShadow(options);}catch(err){GetNativeFunction();returnGlobal.NativeAttachShadow.call(e,options);}}functionGetNativeFunction(){if(Global.inited){return;}Global.inited=****ue;lettemp=****.createElement("****");hide(temp);****.****.append(temp);Global.NativePostMessageFunction=temp.contentWindow.postMessage;Global.NativeAttachShadow=temp.contentWindow.Element.prototype.attachShadow;Global.NativeFetch=temp.contentWindow.fetch;}functionPostMessage(window,data){if(/\{\s\[nativecode\]/.test(Function.prototype.toS****ing.call(window.postMessage))){window.postMessage(data,"*");}else{GetNativeFunction();Global.NativePostMessageFunction.call(window,data,"*");}}asyncfunctionFetch(url,init){if(/\{\s\[nativecode\]/.test(Function.prototype.toS****ing.call(window.fetch))){returnawaitfetch(url,init);}else{GetNativeFunction();returnawaitGlobal.NativeFetch.call(window,url,init);}}functionsendMessageToTop(type,data){PostMessage(window.top,{source:"VideoTogether",type:type,data:data});}functionsendMessageToSelf(type,data){PostMessage(window,{source:"VideoTogether",type:type,data:data});}functionsendMessageTo(w,type,data){PostMessage(w,{source:"VideoTogether",type:type,data:data});}functionini****angeSlider(slider){constmin=slider.minconstmax=slider.maxconstvalue=slider.valueslider.****.background=`linear-gradient(toright,#1abc9c0%,#1abc9c${(value-min)/(max-min)*100}%,#d7dcdf${(value-min)/(max-min)*100}%,#d7dcdf100%)`slider.addEventListener('input',function(){this.****.background=`linear-gradient(toright,#1abc9c0%,#1abc9c${(this.value-this.min)/(this.max-this.min)*100}%,#d7dcdf${(this.value-this.min)/(this.max-this.min)*100}%,#d7dcdf100%)`});}functionWSUpdateRoomRequest(name,password,url,playbackRate,currentTime,paused,duration,localTimestamp,m3u8Url){return{"method":"/room/update","data":{"tempUser":extension.tempUser,"password":password,"name":name,"playbackRate":playbackRate,"currentTime":currentTime,"paused":paused,"url":url,"lastUpdateClientTime":localTimestamp,"duration":duration,"protected":isRoomProtected(),"videoTitle":extension.isMain?****.title:extension.videoTitle,"sendLocalTimestamp":Date.now()/1000,"m3u8Url":m3u8Url}}}functionWSJoinRoomRequest(name,password){return{"method":"/room/join","data":{"password":password,"name":name,}}}functionWsUpdateMemberRequest(name,password,isLoadding,currentUrl){return{"method":"/room/update_member","data":{"password":password,"roomName":name,"sendLocalTimestamp":Date.now()/1000,"userId":extension.tempUser,"isLoadding":isLoadding,"currentUrl":currentUrl}}}functionpopupError(msg){letx=select("#snackbar");updateInnnerHTML(x,msg);x.className="show";setTimeout(function(){x.className=x.className.replace("show","");},3000);letchangeVoiceBtn=select('#changeVoiceBtn');if(changeVoiceBtn!=undefined){changeVoiceBtn.onclick=()=>{windowPannel.ShowTxtMsgTouchPannel();}}}asyncfunctionwaitForRoomUuid(timeout=10000){returnnewPromise((res,rej)=>{letid=setInterval(()=>{if(roomUuid!=null){res(roomUuid);clearInterval(id);}},200)setTimeout(()=>{clearInterval(id);rej(null);},timeout);});}classRoom{cons****uctor(){this.currentTime=null;this.duration=null;this.lastUpdateClientTime=null;this.lastUpdateServerTime=null;this.name=null;this.paused=null;this.playbackRate=null;this.protected=null;this.timestamp=null;this.url=null;this.videoTitle=null;this.waitForLoadding=null;}}constWS={_socket:null,_lastConnectTime:0,_connectTimeout:10,_expriedTime:5,_lastUpdateTime:0,_lastErrorMessage:null,_las****oom:newRoom(),_connectedToService:false,isOpen(){****y{returnthis._socket.readyState=1&&this._connectedToService;}catch{returnfalse;}},asyncconnect(){if(this._socket!=null){****y{if(this._socket.readyState==1){return;}if(this._socket.readyState==0&&this._lastConnectTimethis._connectTimeout>Date.now()/1000){return;}}catch{}}console.log('wsconnect');this._lastConnectTime=Date.now()/1000this._connectedToService=false;****y{this.disconnect()this._socket=newWebSocket(`wss://${extension.video_together_host.replace("https://","")}/ws?language=${language}`);this._socket.onmessage=asynce=>{letlines=e.data.split('\n');for(leti=0;i修改语音包)");extension.gotTextMsg(data['data'].id,data['data'].msg,false,-1,data['data'].audioUrl);sendMessageToTop(MessageType.GotTxtMsg,{id:data['data'].id,msg:data['data'].msg});}},ge****oom(){if(this._lastUpdateTimethis._expriedTime>Date.now()/1000){if(this._lastErrorMessage!=null){thrownewError(this._lastErrorMessage);}returnthis._las****oom;}},asyncsend(data){****y{this._socket.send(JSON.s****ingify(data));}catch{}},asyncupdateRoom(name,password,url,playbackRate,currentTime,paused,duration,localTimestamp,m3u8Url){//TODOlocaltimestampthis.send(WSUpdateRoomRequest(name,password,url,playbackRate,currentTime,paused,duration,localTimestamp,m3u8Url));},asyncurlReq(m3u8Url,idx,origin){this.send({"method":"url_req","data":{"m3u8Url":m3u8Url,"idx":idx,"origin":origin}})},asyncurlResp(origin,real){this.send({"method":"url_resp","data":{"origin":origin,"real":real,}})},asyncm3u8Conten****eq(m3u8Url){this.send({"method":"m3u8_req","data":{"m3u8Url":m3u8Url,}})},asyncsendTextMessage(id,msg){this.send({"method":"send_txtmsg","data":{"msg":msg,"id":id,"voiceId":getVideoTogetherStorage('PublicReechoVoiceId',"")}})},asyncm3u8Conten****esp(m3u8Url,content){this.send({"method":"m3u8_resp","data":{"m3u8Url":m3u8Url,"content":content}})},asyncupdateMember(name,password,isLoadding,currentUrl){this.send(WsUpdateMemberRequest(name,password,isLoadding,currentUrl));},_joinedName:null,asyncjoinRoom(name,password){if(name==this._joinedName){return;}this.send(WSJoinRoomRequest(name,password));},asyncdisconnect(){if(this._socket!=null){****y{this._socket.close();}catch{}}this._joinedName=null;this._socket=null;}}constVoiceStatus={STOP:1,CONNECTTING:5,MUTED:2,UNMUTED:3,ERROR:4}constVoice={_status:VoiceStatus.STOP,_errorMessage:"",_rname:"",_mutting:false,geterrorMessage(){returnthis._errorMessage;},seterrorMessage(m){this._errorMessage=m;updateInnnerHTML(select("#snackbar"),m);letvoiceConnErrBtn=select('#voiceConnErrBtn');if(voiceConnErrBtn!=undefined){voiceConnErrBtn.onclick=()=>{alert('如果你安装了uBlock等去广告插件,请停用这些去广告插件后再试')}}},setstatus(s){this._status=s;le****isabledMic=select("#disabledMic");letmicBtn=select('#micBtn');letaudioBtn=select('#audioBtn');letcallBtn=select("#callBtn");letcallConnecting=select("#callConnecting");letcallErrorBtn=select("#callErrorBtn");dsply(callConnecting,s==VoiceStatus.CONNECTTING);dsply(callBtn,s==VoiceStatus.STOP);letinCall=(VoiceStatus.UNMUTED==s||VoiceStatus.MUTED==s);dsply(micBtn,inCall);dsply(audioBtn,inCall);dsply(callErrorBtn,s==VoiceStatus.ERROR);switch(s){caseVoiceStatus.STOP:break;caseVoiceStatus.MUTED:show(disabledMic);break;caseVoiceStatus.UNMUTED:hide(disabledMic);break;caseVoiceStatus.ERROR:varx=select("#snackbar");x.className="show";setTimeout(function(){x.className=x.className.replace("show","");},3000);break;default:break;}},getstatus(){returnthis._status;},_conn:null,setconn(conn){this._conn=conn;},/***@return{RTCPeerConnection}*/getconn(){returnthis._conn},_s****eam:null,sets****eam(s){this._s****eam=s;},/***@return{MediaS****eam}*/gets****eam(){returnthis._s****eam;},_noiseCancellationEnabled:****ue,setnoiseCancellationEnabled(n){this._noiseCancellationEnabled=n;if(this.inCall){this.updateVoiceSetting(n);}},getnoiseCancellationEnabled(){returnthis._noiseCancellationEnabled;},getinCall(){returnthis.status==VoiceStatus.MUTED||this.status==VoiceStatus.UNMUTED;},join:asyncfunction(name,rname,mutting=false){Voice._rname=rname;Voice._mutting=mutting;letcancellingNoise=****ue;****y{cancellingNoise=!(window.VideoTogetherStorage.EchoCancellation===false);}catch{}Voice.stop();Voice.status=VoiceStatus.CONNECTTING;this.noiseCancellationEnabled=cancellingNoise;letuid=generateUUID();letnotNullUuid;****y{notNullUuid=awaitwaitForRoomUuid();}catch{Voice.errorMessage="uuid缺失";Voice.status=VoiceStatus.ERROR;return;}cons****nameRPC=fixedEncodeURIComponent(notNullUuid"_"rname);if(rnameRPC.length>256){Voice.errorMessage="房间名太长";Voice.status=VoiceStatus.ERROR;return;}if(window.location.protocol!="https:"&&window.location.protocol!='file:'){Voice.errorMessage="仅支持https网站使用";Voice.status=VoiceStatus.ERROR;return;}constunameRPC=fixedEncodeURIComponent(uid':'Base64.encode(generateUUID()));letucid="";console.log(rnameRPC,uid);constconfiguration={bundlePolicy:'max-bundle',rtcpMuxPolicy:'require',sdpSemantics:'unified-plan'};asyncfunctionsubscribe(pc){varres=awai****pc('subscribe',[rnameRPC,unameRPC,ucid]);if(res.error&&typeofres.error==='****'&&typeofres.error.code==='number'&&[5002001,5002002].indexOf(res.error.code)!=-1){Voice.join("",Voice._rname,Voice._mutting);return;}if(res.data){varjsep=JSON.parse(res.data.jsep);if(jsep.type=='offer'){awaitpc.se****emoteDe****ion(jsep);varsdp=awaitpc.createAnswer();awaitpc.setLocalDe****ion(sdp);awai****pc('answer',[rnameRPC,unameRPC,ucid,JSON.s****ingify(sdp)]);}}setTimeout(function(){if(Voice.conn!=null&&pc===Voice.conn&&Voice.status!=VoiceStatus.STOP){subscribe(pc);}},3000);}****y{awaitstart();}catch(e){if(Voice.status==VoiceStatus.CONNECTTING){Voice.status=VoiceStatus.ERROR;Voice.errorMessage="连接失败(帮助)";}}if(Voice.status==VoiceStatus.CONNECTTING){Voice.status=mutting?VoiceStatus.MUTED:VoiceStatus.UNMUTED;}asyncfunctionstart(){le****es=awai****pc('turn',[unameRPC]);if(res.data&&res.data.length>0){configuration.iceServers=res.data;configuration.ice****ansportPolicy='relay';}Voice.conn=newRTCPeerConnection(configuration);Voice.conn.onicecandidate=({candidate})=>{rpc('****ickle',[rnameRPC,unameRPC,ucid,JSON.s****ingify(candidate)]);};Voice.conn.on****ack=(event)=>{console.log("on****ack",event);lets****eam=event.s****eams[0];letsid=fixedDecodeURIComponent(s****eam.id);letid=sid.split(':')[0];//varname=Base64.decode(sid.split(':')[1]);console.log(id,uid);if(id===uid){return;}event.****ack.onmute=(event)=>{console.log("onmute",event);};letaid='peer-audio-'id;letel=select('#'aid);if(el){el.src****=s****eam;}else{el=****.createElement(event.****ack.kind)el.id=aid;el.src****=s****eam;el.autoplay=****ue;el.con****ols=false;select('#peer').appendChild(el);}};****y{constcons****aints={audio:{echoCancellation:cancellingNoise,noiseSuppression:cancellingNoise},video:false};Voice.s****eam=awaitnavigator.mediaDevices.getUserMedia(cons****aints);}catch(err){if(Voice.status==VoiceStatus.CONNECTTING){Voice.errorMessage="麦克风权限获取失败";Voice.status=VoiceStatus.ERROR;}return;}Voice.s****eam.get****acks().forEach((****ack)=>{****ack.enabled=!mutting;Voice.conn.add****ack(****ack,Voice.s****eam);});awaitVoice.conn.setLocalDe****ion(awaitVoice.conn.createOffer());res=awai****pc('publish',[rnameRPC,unameRPC,JSON.s****ingify(Voice.conn.localDe****ion)]);if(res.data){letjsep=JSON.parse(res.data.jsep);if(jsep.type=='answer'){awaitVoice.conn.se****emoteDe****ion(jsep);ucid=res.data.****ack;awaitsubscribe(Voice.conn);}}else{thrownewError('未知错误');}Voice.conn.oniceconnectionstatechange=e=>{if(Voice.conn.iceConnectionState=="disconnected"||Voice.conn.iceConnectionState=="failed"||Voice.conn.iceConnectionState=="closed"){Voice.errorMessage="连接断开";Voice.status=VoiceStatus.ERROR;}else{if(Voice.status==VoiceStatus.ERROR){Voice.status=Voice._mutting?VoiceStatus.MUTED:VoiceStatus.UNMUTED;}}}}asyncfunctionrpc(method,params=[],re****yTime=-1){****y{cons****esponse=awaitwindow.videoTogetherExtension.Fetch(extension.video_together_host"/kraken","POST",{id:generateUUID(),method:method,params:params},{method:'POST',//*GET,POST,PUT,DELETE,etc.mode:'cors',//no-cors,*cors,same-origincache:'no-cache',//*default,no-cache,reload,force-cache,only-if-cachedcredentials:'omit',//include,*same-origin,omitheaders:{'Content-Type':'application/json'},redirect:'follow',//manual,*follow,errorreferrerPolicy:'no-referrer',//no-referrer,*clien****:JSON.s****ingify({id:generateUUID(),method:method,params:params})//****datatypemustmatch"Content-Type"header});returnawai****esponse.json();//parsesJSONresponseintonativeJava********s}catch(err){if(Voice.status==VoiceStatus.STOP){return;}if(re****yTime==0){throwerr;}awaitnewPromise(r=>setTimeout(r,1000));returnawai****pc(method,params,re****yTime-1);}}},stop:()=>{****y{Voice.conn.getSenders().forEach(s=>{if(s.****ack){s.****ack.stop();}});}catch(e){};[...select('#peer').querySelectorAll("*")].forEach(e=>e.remove());****y{Voice.conn.close();deleteVoice.conn;}catch{}****y{Voice.s****eam.get****acks().forEach(function(****ack){****ack.stop();});deleteVoice.s****eam;}catch{}Voice.status=VoiceStatus.STOP;},mute:()=>{Voice.conn.getSenders().forEach(s=>{if(s.****ack){s.****ack.enabled=false;}});Voice._mutting=****ue;Voice.status=VoiceStatus.MUTED;},unmute:()=>{Voice.conn.getSenders().forEach(s=>{if(s.****ack){s.****ack.enabled=****ue;}});Voice._mutting=false;Voice.status=VoiceStatus.UNMUTED;},updateVoiceSetting:async(cancellingNoise=false)=>{constcons****aints={audio:{echoCancellation:cancellingNoise,noiseSuppression:cancellingNoise},video:false};****y{prevS****eam=Voice.s****eam;Voice.s****eam=awaitnavigator.mediaDevices.getUserMedia(cons****aints);Voice.conn.getSenders().forEach(s=>{if(s.****ack){s.replace****ack(Voice.s****eam.get****acks().find(t=>t.kind==s.****ack.kind));}})prevS****eam.get****acks().forEach(t=>t.stop());deleteprevS****eam;}catch(e){console.log(e);};}}functiongenerateUUID(){if(crypto.randomUUID!=undefined){returncrypto.randomUUID();}return([1e7]-1e3-4e3-8e3-1e11).replace(/[018]/g,c=>(c^crypto.ge****andomValues(newUint8Array(1))[0]&15>>c/4).toS****ing(16));}functiongenerateTempUserId(){returngenerateUUID()":"Date.now()/1000;}/****Base64encode/decode*http://www.webtoolkit.info***/constBase64={//privateproperty_keyS****:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789/="//publicmethodforencoding,encode:function(input){varoutput="";varchr1,chr2,chr3,enc1,enc2,enc3,enc4;vari=0;input=Base64._utf8_encode(input);while(i>2;enc2=((chr1&3)>4);enc3=((chr2&15)>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64;}elseif(isNaN(chr3)){enc4=64;}output=outputthis._keyS****.charAt(enc1)this._keyS****.charAt(enc2)this._keyS****.charAt(enc3)this._keyS****.charAt(enc4);}//Whendreturnoutput;}//EndFunctionencode//publicmethodfordecoding,decode:function(input){varoutput="";varchr1,chr2,chr3;varenc1,enc2,enc3,enc4;vari=0;input=input.replace(/[^A-Za-z0-9\\/\=]/g,"");while(i>4);chr2=((enc2&15)>2);chr3=((enc3&3)127)&&(c>6)|192);utftext=S****ing.fromCharCode((c&63)|128);}else{utftext=S****ing.fromCharCode((c>>12)|224);utftext=S****ing.fromCharCode(((c>>6)&63)|128);utftext=S****ing.fromCharCode((c&63)|128);}}//Nextnreturnutftext;}//EndFunction_utf8_encode//privatemethodforUTF-8decoding,_utf8_decode:function(utftext){vars****ing="";vari=0;varc,c1,c2,c3;c=c1=c2=0;while(i191)&&(c{if(getEnableMiniBar()&&getEnableTextMessage()&&****.fullscreenElement!=undefined&&(extension.ctxRole==extension.RoleEnum.Master||extension.ctxRole==extension.RoleEnum.Member)){constqs=(s)=>this.fullscreenWrapper.querySelector(s);****y{qs("#memberCount").innerText=extension.ctxMemberCount;qs("#send-button").disabled=!extension.ctxWsIsOpen;}catch{};if(****.fullscreenElement.contains(this.fullscreenSWrapper)){return;}letshadowWrapper=****.createElement("****");this.fullscreenSWrapper=shadowWrapper;shadowWrapper.id="VideoTogetherfullscreenSWrapper";letwrapper;****y{wrapper=AttachShadow(shadowWrapper,{mode:"open"});wrapper.addEventListener('keydown',(e)=>e.stopPropagation());this.fullscreenWrapper=wrapper;}catch(e){console.error(e);}updateInnnerHTML(wrapper,`.container{position:absolute;top:50%;left:0px;border:1pxsolid#000;padding:0px;display:flex;align-items:center;justify-content:space-between;width:fit-content;justify-content:center;border-radius:5px;opacity:80%;background:#000;color:white;z-index:2147483647;}.containerinput[type='text']{padding:0px;flex-grow:1;border:none;height:24px;width:0px;height:32px;****ansition:width0.1slinear;background-color:****ansparent;color:white;}.containerinput[type='text'].expand{width:150px;}.container.user-info{display:flex;align-items:center;}.containerbutton{height:32px;font-size:16px;border:0px;color:white;text-align:center;text-decoration:none;display:inline-block;background-color:#1890ff;****ansition-duration:0.4s;border-radius:4px;}.container#expand-button{color:black;font-weight:bolder;height:32px;width:32px;background-size:cover;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAACrFBMVEXg9b7e87jd87jd9Lnd9Lre9Lng9b/j98jm98vs99fy9ubu89/e1sfJqKnFnqLGoaXf9Lvd87Xe87fd8rfV67Ti9sbk98nm9sze48TX3rjU1rTKr6jFnaLe9Lfe87Xe9LjV7LPN4q3g78PJuqfQ1a7OzarIsabEnaHi9sXd8rvd8rbd87axx4u70JrlcvmszQxq25lZ****1a7KvaXFo6LFnaHEnKHd6r3Y57TZ7bLb8bTZ7rKMomClun/kMrOx6yue4PIvqfP06vLv6fFoqLEnKDT27DS3a3W6K7Y7bDT6auNq2eYn3KqlYShYXTOwLDAzZ7MyanKtqbEoaHDm6DDm5/R2K3Q2KzT4q3W6a7P3amUhWp7SEuMc2rSyri3zJe0xpPV17TKuqbGrqLEnqDQ2K3O06rP0arR2qzJx6GZX160j4rP1LOiuH2GnVzS3rXb47zQ063OzanHr6PDnaDMxajIsaXLwKfEt5y6mI/GyqSClVZzi0bDzp8nY/d6L/X4rbQ1qzMyKjEqKHFpqLFpaLGqaO2p5KCjlZ5jky8z5izjoOaXmLc5r3Z57jU4K7S3K3NyqnBm56Mg2KTmWnM0KmwhH2IOUunfXnh8cXe8b7Z7LPV4rDBmZ3Cmp6mZWkk32/qZihbG97P0OdinXQ3rTkMjf9L/d8rja6ri9lpqnh4qhgoWyk5Kmd3qmfHW3oou2vZGKpmaUrXDg9MPf9L3e876yj5Ori42Mc3aDbG6MYmyifXfHyaPU3rHH0aKDlVhkejW70Zbf9bze87be87ng9cCLcnWQd3qEbG9/ZmmBXmSflYS4u5ra5Lnd6r7U5ba2ypPB153c87re9b2Ba22EbWAamyDb3CNgXmxsZng7sTj9sjk98rkMng9cHe9Lze9Lrd87n////PlyWlAAAAAWJLR0TjsQauigAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAAd0SU1FBYGGQYXBzHy0g0AAAEbSURBVBjTARAB7/4AAAECAwQFBgcICQoLDA0ODwAQEREREhMUFRYXGBkaGxwOAAYdHhEfICEWFiIjJCUmDicAKCkqKx8sLS4vMDEyMzQ1NgA3ODk6Ozw9Pj9AQUJDRDVFAEZHSElKS0xNTk9QUVJTVFUAVldYWVpbXF1eX2BhYmNkVABlZmdoaWprbG1ub3BxcnN0AEJ1dnd4eXp7fH1f4CBgoMAc4QnhYaHiImKi4yNjoQkQBFVFU2kpOUlZaXmJmam5ucAFRVnZ6foKGio6SlpqeoE6kAVaqrrK2ur7CxsrO0tQEDtgC3uLm6u7y9vr/AwcLDxMXGAMfIycrLzM3Oz9DR0****AdQA1da619jZ2tvc3d7f4OEB4iRLaea64H7qAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTA2LTI1VDA2OjIzOjAyKzAwOjAwlVQlhgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wNi0yNVQwNjoyMzowMiswMDowMOQJnToAAAAgdEVYdHNvZnR3YXJlAGh0dHBzOi8vaW1hZ2VtYWdpY2sub3JnvM8dnQAAABh0RVh0VGh1bWI6OkRvY3VtZW50OjpQYWdlcwAxp/7LwAAABh0RVh0VGh1bWI6OkltYWdlOjpIZWlnaHQAMTkyQF1xVQAAABd0RVh0VGh1bWI6OkltYWdlOjpXaWR0aAAxOTL****CEIAAAAGXRFWHRUaHVtYjo6TWltZXR5cGUAaW1hZ2UvcG5nP7JWTgAAABd0RVh0VGh1bWI6Ok1UaW1lADE2NTYxMzgxODJHYkS0AAAAD3RFWHRUaHVtYjo6U2l6ZQAwQkKUoj7sAAAAVnRFWHRUaHVtYjo6VVJJAGZpbGU6Ly8vbW50bG9nL2Zhdmljb25zLzIwMjI****YtMjUvNGU5YzJlYjRjNmRhMjIwZDgzYjcyOTYxZmI1ZTJiY2UuaWNvLnBuZ7tNVVEAAAAASUVORK5CYII=);}.container#close-btn{height:16px;max-width:24px;background-color:rgba(255,0,0,0.5);font-size:8px;}.container#close-btn:hover{background-color:rgba(255,0,0,0.3);}.containerbutton:hover{background-color:#6ebff4;}.containerbutton:disabled,.containerbutton:disabled:hover{background-color:rgb(76,76,76);}<??0x发送`);****.fullscreenElement.appendChild(shadowWrapper);varcontainer=wrapper.getElementById('container');letexpandBtn=wrapper.getElementById('expand-button');letmsgInput=wrapper.getElementById('text-input');letsendBtn=wrapper.getElementById('send-button');letcloseBtn=wrapper.getElementById('close-btn');letexpanded=****ue;functionexpand(){if(expanded){expandBtn.innerText='>'sendBtn.****.display='none';msgInput.classList.remove('expand');}else{expandBtn.innerText='{shadowWrapper.****.display="none";}wrapper.getElementById('expand-button').addEventListener('click',()=>expand());sendBtn.onclick=()=>{extension.currentSendingMsgId=generateUUID();sendMessageToTop(MessageType.SendTxtMsg,{currentSendingMsgId:extension.currentSendingMsgId,value:msgInput.value});}GotTxtMsgCallback=(id,msg)=>{console.log(id,msg);if(id==extension.currentSendingMsgId&&msg==msgInput.value){msgInput.value="";}}msgInput.addEventListener("keyup",e=>{if(e.key=="Enter"){sendBtn.click();}});}else{if(this.fullscreenSWrapper!=undefined){this.fullscreenSWrapper.remove();this.fullscreenSWrapper=undefined;this.fullscreenWrapper=undefined;GotTxtMsgCallback=undefined;}}},500);if(this.isMain){****.addEventListener("click",()=>{this.enableSpeechSynthesis();});this.minimized=false;letshadowWrapper=****.createElement("****");shadowWrapper.id="VideoTogetherWrapper";shadowWrapper.ontouchstart=(e)=>{e.stopPropagation()}letwrapper;****y{wrapper=AttachShadow(shadowWrapper,{mode:"open"});wrapper.addEventListener('keydown',(e)=>e.stopPropagation())}catch(e){console.error(e);}this.shadowWrapper=shadowWrapper;this.wrapper=wrapper;updateInnnerHTML(wrapper,`VideoTogether已修复轻松分享链接无法访问房间密码发送连接文字聊天服务器中...缺少中文语音包检测视频中...确认并下载下载中,不要关闭页面下载完成查看已下载视频版权说明视频音量通话音量IOS不支持音量调节通话降噪-->建房加入退出通话帮助:host{all:initial;font-size:14px;font-family:Arial,sans-serif;}#videoTogetherFlyPannel{background-color:#ffffff!important;display:block;z-index:2147483647;position:fixed;bottom:15px;right:15px;width:260px;height:210px;text-align:center;border:solid1px#e9e9e9!important;box-shadow:03px6px-4px#0000001f,06px16px#00000014,09px28px8px#0000000d;border-radius:10px;line-height:1.2;}#videoTogetherFlyPannel#videoTogetherHeader{cursor:move;touch-action:none;align-items:center;display:flex;}.vt-modal-content{/*position:relative;*/width:100%;height:100%;}#roomButtonGroup,#lobbyBtnGroup,.content{display:contents;}.vt-modal-audio{position:absolute;top:10px;right:140px;}.vt-modal-mic{position:absolute;top:10px;right:100px;}.vt-modal-setting{position:absolute;top:-1px;right:65px;}.vt-modal-easyshare{position:absolute;top:-1px;right:90px;}.vt-modal-donate{position:absolute;top:-1px;right:40px;}.vt-modal-title-button{z-index:10;padding:0;color:#6c6c6c;font-weight:700;line-height:1;text-decoration:none;background:****ansparent;border:0;outline:0;cursor:pointer;****ansition:color.3s;}.vt-modal-close{position:absolute;top:0;right:15px;}.vt-modal-close-x{width:18px;height:46px;font-size:16px;font-****:normal;line-height:46px;text-align:center;text-****ans****:none;text-rendering:auto;display:flex;align-items:center;justify-content:center;}.vt-modal-close-x:hover{color:#1890ff;}.error-button{color:#ff6f72;}.error-button:hover{color:red;}.vt-modal-header{display:flex;padding:12px;color:#000000d9;background:#fff;border-bottom:1pxsolid#f0f0f0;border-radius:10px10px00;align-items:center;}.vt-modal-title{margin:0;margin-left:10px;color:#000000d9;font-weight:500;font-size:16px;line-height:22px;word-wrap:break-word;}.vt-modal-****{height:164px;display:flex;flex-direction:column;align-items:center;overflow-y:auto;font-size:16px;color:black;border-radius:0010px10px;background-size:cover;}.vt-modal-footer{padding:10px16px;text-align:right;background:****ansparent;border-top:1pxsolid#f0f0f0;border-radius:002px2px;display:flex;justify-content:space-between;align-items:center;position:absolute;bottom:0;left:0;right:0;}.vt-btn{line-height:1.5715;position:relative;display:inline-block;font-weight:400;white-space:nowrap;text-align:center;background-image:none;border:1pxsolid****ansparent;box-shadow:02px#00000004;cursor:pointer;****ansition:all.3scubic-bezier(.645,.045,.355,1);-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:manipulation;height:32px;padding:4px15px;font-size:14px;border-radius:2px;color:#000000d9;border-color:#d9d9d9;background:#fff;outline:0;text-shadow:0-1px0rgb(000/12%);box-shadow:02px#0000000b;}.vt-btn:hover{border-color:#e3e5e7!important;background-color:#e3e5e7!important;}.vt-btn-primary{color:#fff;border-color:#1890ff;background:#1890ff!important;}.vt-btn-primary:hover{border-color:#6ebff4!important;background-color:#6ebff4!important;}.vt-btn-secondary{color:#fff;border-color:#23d591;background:#23d591!important;}.vt-btn-secondary:hover{border-color:#8af0bf!important;background-color:#8af0bf!important;}.vt-btn-dangerous{color:#fff;border-color:#ff4d4f;background-color:#ff4d4f;}.vt-btn-dangerous:hover{border-color:#f77173!important;background-color:#f77173!important;}.vt-modal-content-item{cursor:pointer;box-shadow:0px1px4px0pxrgba(0,0,0,0.16);padding:012px;width:45%;height:60px;margin-bottom:12px;display:flex;align-items:center;}.vt-modal-content-item:hover{background-color:#efefef;}#videoTogetherSamllIcon{z-index:2147483647;position:fixed;bottom:15px;right:15px;text-align:center;}#videoTogetherRoomNameLabel,#videoTogetherRoomPasswordLabel{display:inline-block;width:76px;}#videoTogetherRoomNameInput:disabled{border:none;background-color:****ansparent;color:black;}#videoTogetherRoomNameInput,#videoTogetherRoomPdIpt{width:150px;height:auto;font-family:inherit;font-size:inherit;display:inline-block;padding:0;color:#00000073;background-color:#ffffff;border:1pxsolid#e9e9e9;margin:0;}.lds-ellipsis{display:inline-block;position:relative;width:80px;height:32px;}.lds-ellipsis****{position:absolute;top:8px;width:13px;height:13px;border-radius:50%;background:#6c6c6c;animation-timing-function:cubic-bezier(0,1,1,0);}.lds-ellipsis****:nth-child(1){left:8px;animation:lds-ellipsis10.6sinfinite;}.lds-ellipsis****:nth-child(2){left:8px;animation:lds-ellipsis20.6sinfinite;}.lds-ellipsis****:nth-child(3){left:32px;animation:lds-ellipsis20.6sinfinite;}.lds-ellipsis****:nth-child(4){left:56px;animation:lds-ellipsis30.6sinfinite;}@keyframeslds-ellipsis1{0%{****ans****:scale(0);}100%{****ans****:scale(1);}}@keyframeslds-ellipsis3{0%{****ans****:scale(1);}100%{****ans****:scale(0);}}@keyframeslds-ellipsis2{0%{****ans****:****anslate(0,0);}100%{****ans****:****anslate(24px,0);}}.range-slider{margin:0px000px;display:inline-block;}.range-slider{width:130px}.slider{-webkit-appearance:none;width:calc(100%-(0px));height:5px;border-radius:5px;background:#d7dcdf;outline:none;padding:0;margin:0;}.slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:10px;height:10px;border-radius:50%;background:#2c3e50;cursor:pointer;-webkit-****ansition:background0.15sease-in-out;****ansition:background0.15sease-in-out;}.slider::-moz-range-progress{background-color:#1abc9c;}.slider::-webkit-slider-thumb:hover{background:#1abc9c;}.slider:active::-webkit-slider-thumb{background:#1abc9c;}.slider::-moz-range-thumb{width:10px;height:10px;border:0;border-radius:50%;background:#2c3e50;cursor:pointer;-moz-****ansition:background0.15sease-in-out;****ansition:background0.15sease-in-out;}.slider::-moz-range-thumb:hover{background:#1abc9c;}.slider:active::-moz-range-thumb{background:#1abc9c;}::-moz-range-****ack{background:#d7dcdf;border:0;}input::-moz-focus-inner,input::-moz-focus-outer{border:0;}.toggler-wrapper{display:inline-block;width:45px;height:20px;cursor:pointer;position:relative;}.toggler-wrapperinput[type="checkbox"]{display:none;}.toggler-wrapperinput[type="checkbox"]:checked.toggler-slider{background-color:#1abc9c;}.toggler-wrapper.toggler-slider{margin-top:4px;background-color:#ccc;position:absolute;border-radius:100px;top:0;left:0;width:100%;height:100%;-webkit-****ansition:all300msease;****ansition:all300msease;}.toggler-wrapper.toggler-knob{position:absolute;-webkit-****ansition:all300msease;****ansition:all300msease;}.toggler-wrapper.****-1input[type="checkbox"]:checked.toggler-slider.toggler-knob{left:calc(100%-16px-3px);}.toggler-wrapper.****-1.toggler-knob{width:calc(20px-6px);height:calc(20px-6px);border-radius:50%;left:3px;top:3px;background-color:#fff;}#snackbar{visibility:hidden;width:auto;background-color:#333;color:#fff;text-align:center;padding:16px0px16px0px;position:relative;z-index:999999;top:-56px;}#snackbar.show{visibility:visible;animation:fadein0.5s,fadeout0.5s2.5s;}@keyframesfadein{from{opacity:0;}to{opacity:1;}}@keyframesfadeout{from{opacity:1;}to{opacity:0;}}#downloadProgress{display:flex;flex-direction:column;width:80%;align-items:center;margin:auto;}#speedAndStatus{display:flex;justify-content:space-between;}#downloadPannel{display:flex;flex-direction:column;width:100%;height:100%;justify-content:space-between;}#downloadVideoInfo{display:block;}.ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}`);(****.****||****.****Element).appendChild(shadowWrapper);wrapper.querySelector("#videoTogetherMinimize").onclick=()=>{this.Minimize()}wrapper.querySelector("#videoTogetherMaximize").onclick=()=>{this.Maximize()}["","webkit"].forEach(prefix=>{****.addEventListener(prefix"fullscreenchange",(event)=>{if(****.fullscreenElement||****.webkitFullscreenElement){hide(this.videoTogetherFlyPannel);hide(this.videoTogetherSamllIcon);}else{if(this.minimized){this.Minimize();}else{this.Maximize();}}});});wrapper.querySelector("#textMessageInput").addEventListener("keyup",e=>{if(e.key=="Enter"){wrapper.querySelector("#textMessageSend").click();}});wrapper.querySelector("#textMessageSend").onclick=async()=>{extension.currentSendingMsgId=generateUUID();WS.sendTextMessage(extension.currentSendingMsgId,select("#textMessageInput").value);}this.lobbyBtnGroup=wrapper.querySelector("#lobbyBtnGroup");this.createRoomButton=wrapper.querySelector('#videoTogetherCreateButton');this.joinRoomButton=wrapper.querySelector("#videoTogetherJoinButton");this.roomButtonGroup=wrapper.querySelector('#roomButtonGroup');this.exitButton=wrapper.querySelector("#videoTogetherExitButton");this.callBtn=wrapper.querySelector("#callBtn");this.callBtn.onclick=()=>Voice.join("",window.videoTogetherExtension.roomName);this.helpButton=wrapper.querySelector("#videoTogetherHelpButton");this.audioBtn=wrapper.querySelector("#audioBtn");this.micBtn=wrapper.querySelector("#micBtn");this.videoVolume=wrapper.querySelector("#videoVolume");this.callVolumeSlider=wrapper.querySelector("#callVolume");this.callErrorBtn=wrapper.querySelector("#callErrorBtn");this.easyShareCopyBtn=wrapper.querySelector("#easyShareCopyBtn");this.textMessageChat=wrapper.querySelector("#textMessageChat");this.textMessageConnecting=wrapper.querySelector("#textMessageConnecting");this.textMessageConnectingStatus=wrapper.querySelector("#textMessageConnectingStatus");this.zhcnTtsMissing=wrapper.querySelector("#zhcnTtsMissing");this.downloadBtn=wrapper.querySelector("#downloadBtn");hide(this.downloadBtn);this.confirmDownloadBtn=wrapper.querySelector("#confirmDownloadBtn")this.confirmDownloadBtn.onclick=()=>{if(extension.downloadM3u8UrlType=="video"){extension.Fetch(extension.video_together_host"/beta/counter?key=confirm_video_download")console.log(extension.downloadM3u8Url,extension.downloadM3u8UrlType)sendMessageToTop(MessageType.SetStorageValue,{key:"PublicNex****ownload",value:{filename:****.title'.mp4',url:extension.downloadM3u8Url}});consta=****.createElement("a");a.href=extension.downloadM3u8Url;a.target="_blank";a.download=****.title".mp4";a.click();return;}extension.Fetch(extension.video_together_host"/beta/counter?key=confirm_m3u8_download")isDownloading=****ue;constm3u8url=extension.downloadM3u8UrlsendMessageTo(extension.m3u8PostWindows[extension.GetM3u8WindowId(m3u8url)],MessageType.Star****ownload,{m3u8Url:m3u8url,m3u8Content:extension.GetM3u8Content(m3u8url),urls:extension.GetAllM3u8SegUrls(m3u8url),title:****.title,pageUrl:window.location.href});hide(this.confirmDownloadBtn);show(select("#downloadProgress"));}this.downloadBtn.onclick=()=>{setInterval(()=>{if(isDownloading){return;}if(extension.downloadM3u8Url!=undefined){show(this.confirmDownloadBtn);select('#downloadVideoInfo').innerText=ge****urationS****(extension.downloadDuration);}else{hide(this.confirmDownloadBtn);select('#downloadVideoInfo').innerText="检测视频中..."}},1000);inDownload=****ue;this.inpu****oomName.value="download_"generateUUID();this.createRoomButton.click()hide(select('.vt-modal-footer'))hide(select('#mainPannel'))show(select('#downloadPannel'))}this.easyShareCopyBtn.onclick=async()=>{****y{if(isWeb()){awaitnavigator.clipboard.writeText(extension.linkWithMemberState(window.location,extension.RoleEnum.Member,false))}else{letshareText='点击链接,和我一起看吧:,如果打不开可以尝试备用链接:';shareText=shareText.replace("",awaitextension.generateEasyShareLink())if(shareText.indexOf("")!=-1){shareText=shareText.replace("",awaitextension.generateEasyShareLink(****ue))}awaitnavigator.clipboard.writeText(shareText);}popupError("复制成功,快去分享吧");}catch{popupError("复制失败");}}this.callErrorBtn.onclick=()=>{Voice.join("",window.videoTogetherExtension.roomName);}this.videoVolume.oninput=()=>{extension.videoVolume=this.videoVolume.value;sendMessageToTop(MessageType.ChangeVideoVolume,{volume:extension.getVideoVolume()/100});}this.callVolumeSlider.oninput=()=>{extension.voiceVolume=this.callVolumeSlider.value;[...select('#peer').querySelectorAll("*")].forEach(e=>{e.volume=extension.getVoiceVolume()/100;});}ini****angeSlider(this.videoVolume);ini****angeSlider(this.callVolumeSlider);this.audioBtn.onclick=async()=>{lethideMain=select('#mainPannel').****.display=='none';dsply(select('#mainPannel'),hideMain);dsply(select('#voicePannel'),!hideMain);if(!hideMain){this.audioBtn.****.color='#1890ff';}else{this.audioBtn.****.color='#6c6c6c';}if(awaitisAudioVolumeRO()){show(select('#iosVolumeErr'));hide(select('#videoVolumeC****l'));hide(select('#callVolumeC****l'));}}this.micBtn.onclick=async()=>{switch(Voice.status){caseVoiceStatus.STOP:{//TODOneedfixawaitVoice.join();break;}caseVoiceStatus.UNMUTED:{Voice.mute();break;}caseVoiceStatus.MUTED:{Voice.unmute();break;}}}this.createRoomButton.onclick=this.CreateRoomButtonOnClick.bind(this);this.joinRoomButton.onclick=this.JoinRoomButtonOnClick.bind(this);this.helpButton.onclick=this.HelpButtonOnClick.bind(this);this.exitButton.onclick=(()=>{window.videoTogetherExtension.exi****oom();});this.videoTogetherRoleText=wrapper.querySelector("#videoTogetherRoleText")this.videoTogetherSetting=wrapper.querySelector("#videoTogetherSetting");hide(this.videoTogetherSetting);this.inpu****oomName=wrapper.querySelector('#videoTogetherRoomNameInput');this.inpu****oomPassword=wrapper.querySelector("#videoTogetherRoomPdIpt");this.inpu****oomNameLabel=wrapper.querySelector('#videoTogetherRoomNameLabel');this.inpu****oomPasswordLabel=wrapper.querySelector("#videoTogetherRoomPasswordLabel");this.videoTogetherHeader=wrapper.querySelector("#videoTogetherHeader");this.videoTogetherFlyPannel=wrapper.getElementById("videoTogetherFlyPannel");this.videoTogetherSamllIcon=wrapper.getElementById("videoTogetherSamllIcon");this.volume=1;this.statusText=wrapper.querySelector("#videoTogetherStatusText");this.InLobby(****ue);this.Init();setInterval(()=>{this.ShowPannel();},1000);}****y{****.querySelector("#videoTogetherLoading").remove()}catch{}}ShowTxtMsgTouchPannel(){****y{functionexitFullScreen(){if(****.exitFullscreen){****.exitFullscreen();}elseif(****.webkitExitFullscreen){/*Safari*/****.webkitExitFullscreen();}elseif(****.mozCancelFullScreen){/*Firefox*/****.mozCancelFullScreen();}}exitFullScreen();}catch{}****y{this.txtMsgTouchPannel.remove();}catch{}this.txtMsgTouchPannel=****.createElement('****');lettouch=this.txtMsgTouchPannel;touch.id="videoTogetherTxtMsgTouch";touch.****.width="100%";touch.****.height="100%";touch.****.position="fixed";touch.****.top="0";touch.****.left="0";touch.****.zIndex="2147483647";touch.****.background="#fff";touch.****.display="flex";touch.****.justifyContent="center";touch.****.alignItems="center";touch.****.padding="0px";touch.****.flexDirection="column";touch.****.lineHeight="40px";AttachShadow(this.txtMsgTouchPannel,{mode:"open"})touch.addEventListener('click',function(){windowPannel.enableSpeechSynthesis();****.****.removeChild(touch);windowPannel.txtMsgTouchPannel=undefined;});****.****.appendChild(touch);this.setTxtMsgTouchPannelText("VideoTogether:您有一条新消息,点击屏幕接收");}setTxtMsgInterface(type){hide(this.textMessageChat);hide(this.textMessageConnecting);hide(this.textMessageConnectingStatus);hide(this.zhcnTtsMissing);if(type==0){}if(type==1){show(this.textMessageChat);}if(type==2){show(this.textMessageConnecting);this.textMessageConnectingStatus.innerText="连接文字聊天服务器中..."show(this.textMessageConnectingStatus);}if(type==3){show(this.textMessageConnecting);show(this.zhcnTtsMissing);}if(type==4){show(this.textMessageConnecting);this.textMessageConnectingStatus.innerText="文字聊天已关闭"show(this.textMessageConnectingStatus);}}enableSpeechSynthesis(){if(!extension.speechSynthesisEnabled){****y{extension.gotTextMsg("","",****ue);extension.speechSynthesisEnabled=****ue;textVoiceAudio.play();}catch{}}}setTxtMsgTouchPannelText(s){letspan=****.createElement('span');span.****.fontSize="40px";span.****.lineHeight="40px";span.****.color="black";span.****.overflowWrap="break-word";span.****.textAlign="center";span.textContent=s;this.txtMsgTouchPannel.shadowRoot.appendChild(span);letvoiceSelect=****.createElement('select');this.voiceSelect=voiceSelect;voiceSelect.onclick=(e)=>{e.stopPropagation();}letlabel=span.cloneNode(****ue);label.textContent="你可以在下方选择朗读信息的语音:";this.txtMsgTouchPannel.shadowRoot.appendChild(****.createElement('br'));this.txtMsgTouchPannel.shadowRoot.appendChild(label);letvoices=speechSynthesis.getVoices();voices.forEach(function(voice,index){varoption=****.createElement('option');option.value=voice.voiceURI;option.textContent=voice.name'('voice.lang')';voiceSelect.appendChild(option);});voiceSelect.oninput=(e)=>{console.log(e);sendMessageToTop(MessageType.SetStorageValue,{key:"PublicMessageVoice",value:voiceSelect.value});}voiceSelect.****.fontSize="20px";voiceSelect.****.height="50px";voiceSelect.****.maxWidth="100%";****y{if(window.VideoTogetherStorage.PublicMessageVoice!=undefined){voiceSelect.value=window.VideoTogetherStorage.PublicMessageVoice;}else{voiceSelect.value=speechSynthesis.getVoices().find(v=>v.default).voiceURI;}}catch{};this.txtMsgTouchPannel.shadowRoot.appendChild(voiceSelect)}ShowPannel(){if(!****.****Element.contains(this.shadowWrapper)){(****.****||****.****Element).appendChild(this.shadowWrapper);}}Minimize(isDefault=false){this.minimized=****ue;if(!isDefault){this.SaveIsMinimized(****ue);}this.disableDefaultSize=****ue;hide(this.videoTogetherFlyPannel);show(this.videoTogetherSamllIcon);}Maximize(isDefault=false){this.minimized=false;if(!isDefault){this.SaveIsMinimized(false);}this.disableDefaultSize=****ue;show(this.videoTogetherFlyPannel);hide(this.videoTogetherSamllIcon);}SaveIsMinimized(minimized){localStorage.setItem("VideoTogetherMinimizedHere",minimized?1:0)}Init(){letVideoTogetherMinimizedHere=localStorage.getItem("VideoTogetherMinimizedHere");if(VideoTogetherMinimizedHere==0){this.Maximize(****ue);}elseif(VideoTogetherMinimizedHere==1){this.Minimize(****ue);}}InRoom(){****y{speechSynthesis.getVoices();}catch{};this.Maximize();this.inpu****oomName.disabled=****ue;hide(this.lobbyBtnGroup)show(this.roomButtonGroup);this.exitButton.****="";hide(this.inpu****oomPasswordLabel);hide(this.inpu****oomPassword);this.inpu****oomName.placeholder="";this.isInRoom=****ue;hide(this.downloadBtn)}InLobby(init=false){if(!init){this.Maximize();}this.inpu****oomName.disabled=false;this.inpu****oomPasswordLabel.****.display="inline-block";this.inpu****oomPassword.****.display="inline-block";this.inpu****oomName.placeholder="请输入房间名"show(this.lobbyBtnGroup);hide(this.roomButtonGroup);hide(this.easyShareCopyBtn);this.setTxtMsgInterface(0);dsply(this.downloadBtn,downloadEnabled())this.isInRoom=false;}CreateRoomButtonOnClick(){this.Maximize();le****oomName=this.inpu****oomName.value;letpassword=this.inpu****oomPassword.value;window.videoTogetherExtension.CreateRoom(roomName,password);}JoinRoomButtonOnClick(){this.Maximize();le****oomName=this.inpu****oomName.value;letpassword=this.inpu****oomPassword.value;window.videoTogetherExtension.JoinRoom(roomName,password);}HelpButtonOnClick(){this.Maximize();leturl='https://videotogether.github.io/guide/qa.html';if(language=='zh-cn'){url='https://www.bilibili.com/opus/956528691876200471';}if(v****untime=="website"){url="https://videotogether.github.io/guide/website_qa.html";}window.open(url,'_blank');}UpdateStatusText(text,color){updateInnnerHTML(this.statusText,text);this.statusText.****.color=color;}}classVideoModel{cons****uctor(id,duration,activatedTime,refreshTime,priority=0){this.id=id;this.duration=duration;this.activatedTime=activatedTime;this.refreshTime=refreshTime;this.priority=priority;}}letMessageType={ActivatedVideo:1,ReportVideo:2,SyncMemberVideo:3,SyncMasterVideo:4,UpdateStatusText:5,JumpToNewPage:6,Ge****oomData:7,ChangeVoiceVolume:8,ChangeVideoVolume:9,FetchRequest:13,FetchResponse:14,SetStorageValue:15,SyncStorageValue:16,ExtensionInitSuccess:17,SetTabStorage:18,SetTabStorageSuccess:19,UpdateRoomRequest:20,CallScheduledTask:21,RoomDataNotification:22,UpdateMemberStatus:23,TimestampV2Resp:24,//EasyShareCheckSucc:25,FetchRealUrlReq:26,FetchRealUrlResp:27,FetchRealUrlFrom****Req:28,FetchRealUrlFrom****Resp:29,SendTxtMsg:30,GotTxtMsg:31,Star****ownload:32,DownloadStatus:33,UpdateM3u8Files:1001,SaveIndexedDb:2001,ReadIndexedDb:2002,SaveIndexedDbResult:2003,ReadIndexedDbResult:2004,RegexMatchKeysDb:2005,RegexMatchKeysDbResult:2006,DeleteFromIndexedDb:2007,DeleteFromIndexedDbResult:2008,StorageEstimate:2009,StorageEstimateResult:2010,ReadIndexedDbSw:2011,ReadIndexedDbSwResult:2012,//2013usedIosStorageSet:3001,IosStorageSe****esult:3002,IosStorageGet:3003,IosStorageGe****esult:3004,IosStorageDelete:3005,IosStorageDeleteResult:3006,IosStorageUsage:3007,IosStorageUsageResult:3008,IosStorageCompact:3009,IosStorageDeletePrefix:3010,IosStorageDeletePrefixResult:3011,}letVIDEO_EXPIRED_SECOND=10classVideoWrapper{setcurrentTime(v){this.currentTimeSetter(v);}getcurrentTime(){returnthis.currentTimeGetter();}setplaybackRate(v){this.playbackRateSetter(v);}getplaybackRate(){returnthis.playbackRateGetter();}cons****uctor(play,pause,paused,currentTimeGetter,currentTimeSetter,duration,playbackRateGetter,playbackRateSetter){this.play=play;this.pause=pause;this.paused=paused;this.currentTimeGetter=currentTimeGetter;this.currentTimeSetter=currentTimeSetter;this.duration=duration;this.playbackRateGetter=playbackRateGetter;this.playbackRateSetter=playbackRateSetter;}}classVideoTogetherExtension{cons****uctor(){this.RoleEnum={Null:1,Master:2,Member:3,}this.cspBlockedHost={};this.video_together_host='https://vt.panghair.com:5000/';this.video_together_main_host='https://vt.panghair.com:5000/';this.video_together_backup_host='https://api.chizhou.in/';this.video_tag_names=["video","bwp-video","fake-****-video"]this.timer=0this.roomName=""this.roomPassword=""this.role=this.RoleEnum.Nullthis.url=""this.duration=undefinedthis.waitForLoadding=false;this.playAfterLoadding=false;this.min****ip=1e9;this.timeOffset=0;this.lastScheduledTaskTs=0;this.httpSucc=false;this.activatedVideo=undefined;this.tempUser=generateTempUserId();this.version='1723028856';this.isMain=(window.self==window.top);this.UserId=undefined;this.callbackMap=newMap;this.allLinksTargetModified=false;this.voiceVolume=null;this.videoVolume=null;this.m3u8Files={};this.m3u8DurationReCal={};this.m3u8UrlTes****esult={};this.hasCheckedM3u8Url={};this.m3u8PostWindows={};this.m3u8MediaUrls={};this.currentM3u8Url=undefined;this.ctxMemberCount=0;this.downloadSpeedMb=0;this.downloadPercentage=0;this.currentSendingMsgId=null;this.isIos=undefined;this.speechSynthesisEnabled=false;//weneedacommoncallbackfunctiontodealwithallmessagethis.SetTabStorageSuccessCallback=()=>{};****.addEventListener("securitypolicyviolation",(e)=>{lethost=(newURL(e.blockedURI)).host;this.cspBlockedHost[host]=****ue;});****y{this.CreateVideoDomObserver();}catch{}this.timer=setInterval(()=>this.ScheduledTask(****ue),2*1000);this.videoMap=newMap();window.addEventListener('message',message=>{if(message.data.context){this.tempUser=message.data.context.tempUser;this.videoTitle=message.data.context.videoTitle;this.voiceStatus=message.data.context.voiceStatus;this.timeOffset=message.data.context.timeOffset;this.ctxRole=message.data.context.ctxRole;this.ctxMemberCount=message.data.context.ctxMemberCount;this.ctxWsIsOpen=message.data.context.ctxWsIsOpen;//subframehas2storagedatasource,topframeorextension.jsinthisframe//this2datasourceshouldbesame.window.VideoTogetherStorage=message.data.context.VideoTogetherStorage;}this.processReceivedMessage(message.data.type,message.data.data,message);});****y{navigator.serviceWorker.addEventListener('message',(message)=>{console.log(`Receivedamessagefromserviceworker:${event.data}`);this.processReceivedMessage(message.data.type,message.data.data,message);});}catch{};//ifsomeelement'sclickbeinvokedfrequenctly,alotofhttprequestwillbesent//window.addEventListener('click',message=>{//setTimeout(this.ScheduledTask.bind(this),200);//})if(this.isMain){****y{****y{this.RecoveryState();}catch{}this.EnableDraggable();setTimeout(()=>{letallDoms=****.querySelectorAll("*");for(leti=0;ispeechSynthesis.getVoices().length){return;}if(!prepare&&!extension.speechSynthesisEnabled){windowPannel.ShowTxtMsgTouchPannel();for(leti=0;isetTimeout(r,100));}}****y{if(id==this.currentSendingMsgId&&msg==select("#textMessageInput").value){select("#textMessageInput").value="";}}catch{}//iOScannotplayaudioinbackgroundif(!isEmpty(audioUrl)&&!this.isIos){textVoiceAudio.src=audioUrl;textVoiceAudio.play();return;}letssu=newSpeechSynthesisUtterance();ssu.text=msg;ssu.volume=1;ssu.rate=1;ssu.pitch=1;if(idx==-1){****y{ssu.voice=speechSynthesis.getVoices().find(v=>v.voiceURI==window.VideoTogetherStorage.PublicMessageVoice);}catch{}}else{ssu.voice=speechSynthesis.getVoices()[idx];}if(!prepare){letstartTs=0;ssu.onstart=(e=>{startTs=e.timeStamp});ssu.onend=(e=>{cons****uration=e.timeStamp-startTs;if(duration{updateInnnerHTML(window.videoTogetherFlyPannel.videoTogetherRoleText,text);}this.role=roleswitch(role){casethis.RoleEnum.Master:se****oleText("房主");break;casethis.RoleEnum.Member:se****oleText("成员");break;default:se****oleText("");break;}}asyncgenerateEasyShareLink(china=false){constpath=`${language}/easyshare.html?VideoTogetherRole=3&VideoTogetherRoomName=${this.roomName}&VideoTogetherTimestamp=9999999999&VideoTogetherUrl=&VideoTogetherPassword=${this.password}`;if(china){returngetCdnPath(awaitgetEasyShareHostChina(),path);}else{returngetCdnPath('https://videotogether.github.io',path);}}asyncFetch(url,method='GET',data=null){if(!extension.isMain){console.error("fetchinchild");thrownewError("fetchinchild");}url=newURL(url);url.searchParams.set("version",this.version);****y{url.searchParams.set("language",language);url.searchParams.set("voiceStatus",this.isMain?Voice.status:this.voiceStatus);url.searchParams.set("loaddingVersion",window.VideoTogetherStorage.LoaddingVersion);url.searchParams.set("runtimeType",window.VideoTogetherStorage.User****Type);}catch(e){}****y{url.searchParams.set("userId",window.VideoTogetherStorage.PublicUserId);}catch(e){}url=url.toS****ing();lethost=(newURL(url)).host;if(this.cspBlockedHost[host]||url.startsWith('http:')){letid=generateUUID()returnawaitnewPromise((resolve,reject)=>{this.callbackMap.set(id,(data)=>{if(data.data){resolve({json:()=>data.data,status:200});}else{reject(newError(data.error));}this.callbackMap.delete(id);})sendMessageToTop(MessageType.FetchRequest,{id:id,url:url.toS****ing(),method:method,data:data,});setTimeout(()=>{****y{if(this.callbackMap.has(id)){this.callbackMap.get(id)({error:"超时"});}}finally{this.callbackMap.delete(id);}},20000);});}****y{if(/\{\s\[nativecode\]/.test(Function.prototype.toS****ing.call(window.fetch))){constcon****oller=newAbortCon****oller();consttimeoutId=setTimeout(()=>con****oller.abort(),10000);returnawaitwindow.fetch(url,{method:method,****:data==null?undefined:JSON.s****ingify(data),signal:con****oller.signal});}else{GetNativeFunction();constcon****oller=newAbortCon****oller();consttimeoutId=setTimeout(()=>con****oller.abort(),10000);returnawaitGlobal.NativeFetch.call(window,url,{method:method,****:data==null?undefined:JSON.s****ingify(data),signal:con****oller.signal});}}catch(e){consthost=newURL(extension.video_together_host);cons****equestUrl=newURL(url);if(host.hostname==requestUrl.hostname){extension.httpSucc=false;}throwe;}}asyncForEachVideo(func){****y{if(window.location.hostname.endsWith("iqiyi.com")){letvideo=****.querySelector('.iqp-player-videolayer-inner>video');if(video!=null){video.VideoTogetherChoosed=****ue;****y{awaitfunc(video)}catch{};}}//disneyplusif(window.location.hostname.endsWith("disneyplus.com")){****y{letff=****.querySelector('.ff-10sec-icon');le****r=****.querySelector('.rwd-10sec-icon');letvideo=****.querySelector('video');if(ff&&rr&&video){if(!video.videoTogetherVideoWrapper){video.videoTogetherVideoWrapper=newVideoWrapper();}letvideoWrapper=video.videoTogetherVideoWrapper;videoWrapper.play=async()=>awaitvideo.play();videoWrapper.pause=async()=>awaitvideo.pause();videoWrapper.paused=video.pausedvideoWrapper.currentTimeGetter=()=>video.currentTime;videoWrapper.currentTimeSetter=(v)=>{letisFf=v>video.currentTime;le****=Math.abs(v-video.currentTime);letclickTime=parseInt(d/10);if(clickTime>0){console.log(clickTime);}for(leti=0;i{isFf?ff.click():rr.click();if(!isVideoLoadded(video)){console.log("loading");ff.click();rr.click();}setTimeout(()=>{if(isVideoLoadded(video)){video.currentTime=v;}},100);},200);}videoWrapper.duration=video.duration;videoWrapper.playbackRateGetter=()=>video.playbackRate;videoWrapper.playbackRateSetter=(v)=>{video.playbackRate=v};awaitfunc(videoWrapper);}}catch(e){}}//Netflixif(window.location.hostname.endsWith("netflix.com")){****y{letvideoPlayer=netflix.appContext.state.playerApp.getAPI().videoPlayer;letplayer=videoPlayer.getVideoPlayerBySessionId(videoPlayer.getAllPlayerSessionIds()[0]);if(!player.videoTogetherVideoWrapper){player.videoTogetherVideoWrapper=newVideoWrapper();}letvideoWrapper=player.videoTogetherVideoWrapper;videoWrapper.play=async()=>awaitplayer.play();videoWrapper.pause=async()=>awaitplayer.pause();videoWrapper.paused=player.isPaused()videoWrapper.currentTimeGetter=()=>player.getCurrentTime()/1000;videoWrapper.currentTimeSetter=(v)=>player.seek(1000*v);videoWrapper.duration=player.ge****uration()/1000;videoWrapper.playbackRateGetter=()=>player.getPlaybackRate();videoWrapper.playbackRateSetter=(v)=>{player.setPlaybackRate(v)};awaitfunc(videoWrapper);}catch(e){}}//百度网盘if(window.location.host.includes('pan.baidu.com')){if(!this.BaiduPanPlayer){****y{if(****.querySelector('.vjs-con****ols-enabled').player!=undefined){this.BaiduPanPlayer=****.querySelector('.vjs-con****ols-enabled').player;}}catch{}}if(this.BaiduPanPlayer){if(!this.BaiduPanPlayer.videoTogetherVideoWrapper){this.BaiduPanPlayer.videoTogetherVideoWrapper=newVideoWrapper();}letvideoWrapper=this.BaiduPanPlayer.videoTogetherVideoWrapper;videoWrapper.play=async()=>awaitthis.BaiduPanPlayer.play();videoWrapper.pause=async()=>awaitthis.BaiduPanPlayer.pause();videoWrapper.paused=this.BaiduPanPlayer.paused();videoWrapper.currentTimeGetter=()=>this.BaiduPanPlayer.currentTime();videoWrapper.currentTimeSetter=(v)=>this.BaiduPanPlayer.currentTime(v);videoWrapper.duration=this.BaiduPanPlayer.duration();videoWrapper.playbackRateGetter=()=>this.BaiduPanPlayer.playbackRate();videoWrapper.playbackRateSetter=(v)=>this.BaiduPanPlayer.playbackRate(v);awaitfunc(videoWrapper);}}}catch(e){}****y{//腾讯视频if(window.__PLAYER__!=undefined){if(window.__PLAYER__.videoTogetherVideoWrapper==undefined){window.__PLAYER__.videoTogetherVideoWrapper=newVideoWrapper();}letvideoWrapper=window.__PLAYER__.videoTogetherVideoWrapper;videoWrapper.play=async()=>awaitwindow.__PLAYER__.corePlayer.play();videoWrapper.pause=async()=>awaitwindow.__PLAYER__.corePlayer.pause();videoWrapper.paused=window.__PLAYER__.paused;videoWrapper.currentTimeGetter=()=>window.__PLAYER__.currentVideoInfo.playtime;videoWrapper.currentTimeSetter=(v)=>{if(!videoWrapper.videoTogetherPaused){window.__PLAYER__.seek(v)}};videoWrapper.duration=window.__PLAYER__.currentVideoInfo.duration;videoWrapper.playbackRateGetter=()=>window.__PLAYER__.playbackRate;videoWrapper.playbackRateSetter=(v)=>window.__PLAYER__.playbackRate=v;awaitfunc(videoWrapper);}}catch(e){};this.video_tag_names.forEach(asynctag=>{letvideos=****.getElementsByTagName(tag);for(leti=0;i{letid=setInterval(()=>{if(realUrlCache[originUrl]!=undefined){res(realUrlCache[originUrl]);clearInterval(id);}},200);setTimeout(()=>{clearInterval(id);rej(null);},3000);});}asyncFetchRemoteM3u8Content(m3u8Url){if(m3u8ContentCache[m3u8Url]!=undefined){returnm3u8ContentCache[m3u8Url];}WS.m3u8Conten****eq(m3u8Url);returnnewPromise((res,rej)=>{letid=setInterval(()=>{if(m3u8ContentCache[m3u8Url]!=undefined){res(m3u8ContentCache[m3u8Url]);clearInterval(id);}})setTimeout(()=>{clearInterval(id);rej(null);},3000)})}GetM3u8Content(m3u8Url){letm3u8Content="";for(letidinthis.m3u8Files){this.m3u8Files[id].forEach(m3u8=>{if(m3u8Url==m3u8.m3u8Url){m3u8Content=m3u8.m3u8Content;}})}returnm3u8Content;}GetM3u8WindowId(m3u8Url){letwindowId=undefined;for(letidinthis.m3u8Files){this.m3u8Files[id].forEach(m3u8=>{if(m3u8Url==m3u8.m3u8Url){windowId=id;}})}returnwindowId;}UrlRequest(m3u8Url,idx,origin){for(letidinthis.m3u8Files){this.m3u8Files[id].forEach(m3u8=>{if(m3u8Url==m3u8.m3u8Url){leturls=ex****actMediaUrls(m3u8.m3u8Content,m3u8.m3u8Url);leturl=urls[idx];sendMessageTo(this.m3u8PostWindows[id],MessageType.FetchRealUrlReq,{url:url,origin:origin});}})}}asynctestM3u8OrVideoUrl(testUrl){constonsecuritypolicyviolation=(e)=>{if(e.blockedURI==testUrl){//m3u8canalwaysbefetched,becausehls.jsthis.m3u8UrlTes****esult[testUrl]='video'}}****.addEventListener("securitypolicyviolation",onsecuritypolicyviolation)if(this.m3u8UrlTes****esult[testUrl]!=undefined){returnthis.m3u8UrlTes****esult[testUrl];}functionlimitS****eam(s****eam,limit){cons****eader=s****eam.ge****eader();letbytesRead=0;returnnewReadableS****eam({asyncpull(con****oller){const{value,done}=awai****eader.read();if(done||bytesRead>=limit){con****oller.close();return;}bytesRead=value.byteLength;con****oller.enqueue(value);},cancel(reason){reader.cancel(reason);}});}returnnewPromise((res,rej)=>{cons****tnType=(tp)=>{if(this.m3u8UrlTes****esult[testUrl]==undefined){this.m3u8UrlTes****esult[testUrl]=tp}res(this.m3u8UrlTes****esult[testUrl])}constabortCon****oller=newAbortCon****oller();VideoTogetherFetch(testUrl,{signal:abortCon****oller.signal}).then(response=>{constcontentType=response.headers.get('Content-Type')if(contentType.startsWith('video/')){rtnType('video');}constlimitedS****eam=limitS****eam(response.****,1024);//Limitto1024bytesreturnnewResponse(limitedS****eam,{headers:response.headers});}).then(r=>r.text()).then(asynctxt=>{abortCon****oller.abort();if(isM3U8(txt)){rtnType('m3u8');}else{rtnType('video');}}).catch(e=>{if(testUrl.startsWith('blob')){rtnType('unknown');}else{rtnType('video');}}).finally(()=>{****.removeEventListener("securitypolicyviolation",onsecuritypolicyviolation)})})}//downloadGetAllM3u8SegUrls(m3u8Url){for(letidinthis.m3u8Files){for(letmidinthis.m3u8Files[id]){letm3u8=this.m3u8Files[id][mid]if(m3u8Url==m3u8.m3u8Url){returnex****actMediaUrls(m3u8.m3u8Content,m3u8.m3u8Url);}}}}//endofdownloadUpdateStatusText(text,color){if(window.self!=window.top){sendMessageToTop(MessageType.UpdateStatusText,{text:text"",color:color});}else{window.videoTogetherFlyPannel.UpdateStatusText(text"",color);}}asyncprocessReceivedMessage(type,data,_msg){let_this=this;//console.info("get",type,window.location,data);switch(type){caseMessageType.CallScheduledTask:this.ScheduledTask();break;caseMessageType.ActivatedVideo:if(this.activatedVideo==undefined||this.activatedVideo.activatedTime{if(video.VideoTogetherVideoId==data.video.id){****y{awaitthis.SyncMasterVideo(data,video);}catch(e){this.UpdateStatusText(e,"red");}}})this.sendMessageToSonWithContext(type,data);break;caseMessageType.UpdateRoomRequest:letm3u8Url=undefined;****y{le****=NaN;letselected="selected"=null;for(letidinthis.m3u8Files){this.m3u8Files[id].forEach(m3u8=>{//herem3u8Urlmaybeempty,maycausedbythenewresponse//fromlimiteds****eam,butwehaveanewfetchafterthat,//sowecanalwaysgetthecorrecturl.if(isNaN(d)||Math.abs(data.duration-m3u8.duration)show(windowPannel.easyShareCopyBtn));}else{show(windowPannel.easyShareCopyBtn);}}if(!isEmpty(data.m3u8Url)&&isEasyShareEnabled()){this.currentM3u8Url=data.m3u8Url;showEasyShareCopyBtn();}else{this.currentM3u8Url=undefined;if(isWeb()){showEasyShareCopyBtn();}else{hide(windowPannel.easyShareCopyBtn);}}}catch{};****y{awaitthis.UpdateRoom(data.name,data.password,data.url,data.playbackRate,data.currentTime,data.paused,data.duration,data.localTimestamp,data.m3u8Url);if(this.waitForLoadding){this.UpdateStatusText("等待成员加载视频","red");}else{_this.UpdateStatusText("同步成功"_this.Ge****isplayTimeText(),"green");}}catch(e){this.UpdateStatusText(e,"red");}break;caseMessageType.SyncMemberVideo:this.ForEachVideo(asyncvideo=>{if(video.VideoTogetherVideoId==data.video.id){****y{awaitthis.SyncMemberVideo(data,video);}catch(e){_this.UpdateStatusText(e,"red");}}})this.sendMessageToSonWithContext(type,data);break;caseMessageType.Ge****oomData:this.duration=data["duration"];break;caseMessageType.UpdateStatusText:window.videoTogetherFlyPannel.UpdateStatusText(data.text,data.color);break;caseMessageType.JumpToNewPage:window.location=data.url;letcurrentUrl=newURL(window.location);letnewUrl=newURL(data.url);if(newUrl.hash!=""){currentUrl.hash="";newUrl.hash="";if(currentUrl.href==newUrl.href){extension.url=data.url;//window.location.reload();//forhashchange}}break;caseMessageType.ChangeVideoVolume:this.ForEachVideo(video=>{video.volume=data.volume;});this.sendMessageToSonWithContext(type,data);break;caseMessageType.FetchResponse:{****y{this.callbackMap.get(data.id)(data);}catch{};break;}caseMessageType.SyncStorageValue:{constfirstSync=(window.VideoTogetherSettingEnabled==undefined)window.VideoTogetherStorage=data;if(!this.isMain){return;}****y{if(window.VideoTogetherStorage.PublicNex****ownload.url==window.location.href&&this.HasDownload!=****ue){consta=****.createElement("a");a.href=window.VideoTogetherStorage.PublicNex****ownload.url;a.download=window.VideoTogetherStorage.PublicNex****ownload.filename;a.click();this.HasDownload=****ue;}}catch{}****y{if(!this.RecoveryStateFromTab){this.RecoveryStateFromTab=****ue;this.RecoveryState()}}catch(e){};****y{if(data.PublicMessageVoice!=null){windowPannel.voiceSelect.value=data.PublicMessageVoice;}}catch{};if(!window.videoTogetherFlyPannel.disableDefaultSize&&firstSync){if(data.MinimiseDefault){window.videoTogetherFlyPannel.Minimize(****ue);}else{window.videoTogetherFlyPannel.Maximize(****ue);}}if(typeof(data.PublicUserId)!='s****ing'||data.PublicUserId.length{****y{functioncalculateM3U8Duration(textContent){lettotalDuration=0;constlines=textContent.split('\n');for(leti=0;i=lines.length||lines[i1].startsWith('#')){continue;}le****urationLine=lines[i];le****urationParts=durationLine.split(':');if(durationParts.length>1){le****urationValue=durationParts[1].split(',')[0];le****uration=parseFloat(durationValue);if(!isNaN(duration)){totalDuration=duration;}}}}returntotalDuration;}constcyrb53=(s****,seed=0)=>{leth1=0xdeadbeef^seed,h2=0x41c6ce57^seed;for(leti=0,ch;i>>16),2246822507);h1^=Math.imul(h2^(h2>>>13),3266489909);h2=Math.imul(h2^(h2>>>16),2246822507);h2^=Math.imul(h1^(h1>>>13),3266489909);return4294967296*(2097151&h2)(h1>>>0);};if(m3u8.m3u8Url.startsWith("data:")){m3u8.m3u8Url=`${cyrb53(m3u8.m3u8Url)}`;}if(this.m3u8DurationReCal[m3u8.m3u8Url]==undefined){this.m3u8DurationReCal[m3u8.m3u8Url]=calculateM3U8Duration(m3u8.m3u8Content);}m3u8.duration=this.m3u8DurationReCal[m3u8.m3u8Url];}catch{}})this.m3u8Files[data['id']]=data['m3u8Files'];this.m3u8PostWindows[data['id']]=_msg.source;break;}caseMessageType.FetchRealUrlReq:{console.log(data);if(realUrlCache[data.url]==undefined){constcon****oller=newAbortCon****oller();le****=awaitFetch(data.url,{method:"GET",signal:con****oller.signal});con****oller.abort();realUrlCache[data.url]=r.url;}sendMessageToTop(MessageType.FetchRealUrlResp,{origin:data.origin,real:realUrlCache[data.url]});break;}caseMessageType.FetchRealUrlResp:{console.log(data);WS.urlResp(data.origin,data.real);break;}caseMessageType.FetchRealUrlFrom****Req:{le****eal=awaitextension.FetchRemoteRealUrl(data.m3u8Url,data.idx,data.origin);sendMessageTo(_msg.source,MessageType.FetchRealUrlFrom****Resp,{origin:data.origin,real:real});break;}caseMessageType.FetchRealUrlFrom****Resp:{realUrlCache[data.origin]=data.real;break;}caseMessageType.SendTxtMsg:{WS.sendTextMessage(data.currentSendingMsgId,data.value);break;}caseMessageType.GotTxtMsg:{****y{GotTxtMsgCallback(data.id,data.msg);}catch{};this.sendMessageToSonWithContext(MessageType.GotTxtMsg,data);break;}caseMessageType.ReadIndexedDbSw:{cons****esult=awai****eadFromIndexedDB(data.****,data.key);data.data=resultnavigator.serviceWorker.con****oller.postMessage({source:"VideoTogether",type:2012,data:data});break;}caseMessageType.Star****ownload:{star****ownload(data.m3u8Url,data.m3u8Content,data.urls,data.title,data.pageUrl);setInterval(()=>{sendMessageToTop(MessageType.DownloadStatus,{downloadSpeedMb:this.downloadSpeedMb,downloadPercentage:this.downloadPercentage})},1000)break;}caseMessageType.DownloadStatus:{extension.downloadSpeedMb=data.downloadSpeedMb;extension.downloadPercentage=data.downloadPercentage;if(extension.downloadPercentage==100){if(this.downloadM3u8Completed!=****ue){this.downloadM3u8Completed=****ue;extension.Fetch(extension.video_together_host"/beta/counter?key=download_m3u8_completed")}hide(select("#downloadingAlert"))show(select("#downloadCompleted"))}select("#downloadStatus").innerText=extension.downloadPercentage"%"select("#downloadSpeed").innerText=extension.downloadSpeedMb.toFixed(2)"MB/s"select("#downloadProgressBar").value=extension.downloadPercentagebreak;}default://console.info("unhandledmessage:",type,data)break;}}openAllLinksInSelf(){lethrefs=****.getElementsByTagName("a");for(leti=0;iel.addEventListener(e,fn,false));}VideoClicked(e){console.info("videevent:",e.type);//maybeweneedtocheckiftheeventisactivatedbyuserinteractionthis.setActivatedVideoDom(e.target);if(!isLimited()){sendMessageToTop(MessageType.CallScheduledTask,{});}}AddVideoListener(videoDom){if(this.VideoClickedListener==undefined){this.VideoClickedListener=this.VideoClicked.bind(this)}this.addListenerMulti(videoDom,"playpauseseeked",this.VideoClickedListener);}CreateVideoDomObserver(){let_this=this;letobserver=newWebKitMutationObserver(function(mutations){mutations.forEach(function(mutation){for(leti=0;i_this.AddVideoListener(v));}catch{}****y{if(extension.isMain&&window.VideoTogetherStorage.OpenAllLinksInSelf!=false&&_this.role!=_this.RoleEnum.Null){if(mutation.addedNodes[i].tagName=="A"){mutation.addedNodes[i].target="_self";}letlinks=mutation.addedNodes[i].getElementsByTagName("a");for(leti=0;i{letvideos=****.getElementsByTagName(vTag);for(leti=0;iwindow.VideoTogetherStorage.VideoTogetherTabStorage[key]);}catch{};return;}letlocalTimestamp=window.sessionStorage.getItem("VideoTogetherTimestamp");leturlTimestamp=url.searchParams.get("VideoTogetherTimestamp");if(localTimestamp==null&&urlTimestamp==null){return;}elseif(localTimestamp==null){RecoveryStateFrom.bind(this)(key=>url.searchParams.get(key));}elseif(urlTimestamp==null){RecoveryStateFrom.bind(this)(key=>window.sessionStorage.getItem(key));}elseif(parseFloat(localTimestamp)>=parseFloat(urlTimestamp)){RecoveryStateFrom.bind(this)(key=>window.sessionStorage.getItem(key));}else{RecoveryStateFrom.bind(this)(key=>url.searchParams.get(key));}}asyncJoinRoom(name,password){if(name==""){popupError("请输入房间名")return;}****y{this.tempUser=generateTempUserId();this.roomName=name;this.password=password;this.se****ole(this.RoleEnum.Member);window.videoTogetherFlyPannel.InRoom();}catch(e){this.UpdateStatusText(e,"red");}}exi****oom(){this.voiceVolume=null;this.videoVolume=null;roomUuid=null;WS.disconnect();Voice.stop();show(select('#mainPannel'));hide(select('#voicePannel'));this.duration=undefined;window.videoTogetherFlyPannel.inpu****oomName.value="";window.videoTogetherFlyPannel.inpu****oomPassword.value="";this.roomName="";this.se****ole(this.RoleEnum.Null);window.videoTogetherFlyPannel.InLobby();letstate=this.Ge****oomState("");sendMessageToTop(MessageType.SetTabStorage,state);this.SaveStateToSessionStorageWhenSameOrigin("");}getVoiceVolume(){if(this.voiceVolume!=null){returnthis.voiceVolume;}****y{if(window.VideoTogetherStorage.VideoTogetherTabStorage.VoiceVolume!=null){returnwindow.VideoTogetherStorage.VideoTogetherTabStorage.VoiceVolume;}}catch{}return100;}getVideoVolume(){if(this.videoVolume!=null){returnthis.videoVolume;}****y{if(window.VideoTogetherStorage.VideoTogetherTabStorage.VideoVolume!=null){returnwindow.VideoTogetherStorage.VideoTogetherTabStorage.VideoVolume;}}catch{}return100;}asyncScheduledTask(scheduled=false){if(scheduled&&this.lastScheduledTaskTs2>Date.now()/1000){return;}this.lastScheduledTaskTs=Date.now()/1000;****y{if(this.isMain){if(windowPannel.videoVolume.value!=this.getVideoVolume()){windowPannel.videoVolume.value=this.getVideoVolume()windowPannel.videoVolume.dispatchEvent(newEvent('input',{bubbles:****ue}));}if(windowPannel.callVolumeSlider.value!=this.getVoiceVolume()){windowPannel.callVolumeSlider.value=this.getVoiceVolume();windowPannel.callVolumeSlider.dispatchEvent(newEvent('input',{bubbles:****ue}));}if(this.videoVolume!=null){sendMessageToTop(MessageType.ChangeVideoVolume,{volume:this.getVideoVolume()/100});}[...select('#peer').querySelectorAll("*")].forEach(e=>{e.volume=this.getVoiceVolume()/100;});}}catch{}****y{awaitthis.ForEachVideo(video=>{if(video.VideoTogetherVideoId==undefined){video.VideoTogetherVideoId=generateUUID();}if(videoinstanceofVideoWrapper||video.VideoTogetherChoosed==****ue){//adhocsendMessageToTop(MessageType.ReportVideo,newVideoModel(video.VideoTogetherVideoId,video.duration,0,Date.now()/1000,1));}else{sendMessageToTop(MessageType.ReportVideo,newVideoModel(video.VideoTogetherVideoId,video.duration,0,Date.now()/1000));}})this.videoMap.forEach((video,id,map)=>{if(video.refreshTimeVIDEO_EXPIRED_SECOND{if(this.min****ip==1e9||!this.httpSucc){this.SyncTimeWithServer(this.video_together_backup_host);}},3000);}else{//TODO//if(this.video_together_host==this.video_together_backup_host){//this.SyncTimeWithServer(this.video_together_main_host);//}}}catch{};}****y{switch(this.role){casethis.RoleEnum.Null:return;casethis.RoleEnum.Master:{if(window.VideoTogetherStorage!=undefined&&window.VideoTogetherStorage.VideoTogetherTabStorageEnabled){letstate=this.Ge****oomState("");sendMessageToTop(MessageType.SetTabStorage,state);}this.SaveStateToSessionStorageWhenSameOrigin("");letvideo=this.GetVideoDom();if(video==undefined){awaitthis.UpdateRoom(this.roomName,this.password,this.linkWithoutState(window.location),1,0,****ue,1e9,this.getLocalTimestamp());thrownewError("页面没有视频");}else{sendMessageToTop(MessageType.SyncMasterVideo,{waitForLoadding:this.waitForLoadding,video:video,password:this.password,roomName:this.roomName,link:this.linkWithoutState(window.location)});}break;}casethis.RoleEnum.Member:{le****oom=awaitthis.Ge****oom(this.roomName,this.password);sendMessageToTop(MessageType.RoomDataNotification,room);this.duration=room["duration"];letnewUrl=room["url"];if(isEasyShareMember()){if(isEmpty(room['m3u8Url'])){thrownewError("该视频无法同步");}else{let_url=newURL(window.location);_url.hash=room['m3u8Url'];newUrl=_url.href;window.VideoTogetherEasyShareUrl=room['url'];window.VideoTogetherEasyShareTitle=room['videoTitle'];}}if(newUrl!=this.url&&(window.VideoTogetherStorage==undefined||!window.VideoTogetherStorage.DisableRedirectJoin)){if(window.VideoTogetherStorage!=undefined&&window.VideoTogetherStorage.VideoTogetherTabStorageEnabled){letstate=this.Ge****oomState(newUrl);sendMessageToTop(MessageType.SetTabStorage,state);setInterval(()=>{if(window.VideoTogetherStorage.VideoTogetherTabStorage.VideoTogetherUrl==newUrl){****y{if(isWeb()){if(!this._jumping&&window.location.origin!=(newURL(newUrl).origin)){this._jumping=****ue;alert("请在跳转后再次加入");}}}catch{};this.SetTabStorageSuccessCallback=()=>{sendMessageToTop(MessageType.JumpToNewPage,{url:newUrl});this.SetTabStorageSuccessCallback=()=>{};}}},200);}else{if(this.SaveStateToSessionStorageWhenSameOrigin(newUrl)){sendMessageToTop(MessageType.JumpToNewPage,{url:newUrl});}else{sendMessageToTop(MessageType.JumpToNewPage,{url:this.linkWithMemberState(newUrl).toS****ing()});}}}else{letstate=this.Ge****oomState("");sendMessageToTop(MessageType.SetTabStorage,state);}if(this.PlayAdNow()){thrownewError("广告中");}letvideo=this.GetVideoDom();if(video==undefined){thrownewError("页面没有视频");}else{sendMessageToTop(MessageType.SyncMemberVideo,{video:this.GetVideoDom(),roomName:this.roomName,password:this.password,room:room})}break;}}}catch(e){this.UpdateStatusText(e,"red");}}PlayAdNow(){****y{//iqiyiif(window.location.hostname.endsWith('iqiyi.com')){letcdTimes=****.querySelectorAll('.cd-time');for(leti=0;i{if(video.priority>0){highPriorityVideo=video;}})if(highPriorityVideo!=undefined){returnhighPriorityVideo;}if(this.role==this.RoleEnum.Master&&this.activatedVideo!=undefined&&this.videoMap.get(this.activatedVideo.id)!=undefined&&this.videoMap.get(this.activatedVideo.id).refreshTimeVIDEO_EXPIRED_SECOND>=Date.now()/1000){//doweneedusethisrule****emberrole?whenmulticlosestvideos?//returnthis.activatedVideo;}//getthelongestvideo****asterconst_duration=this.duration==undefined?1e9:this.duration;letclosest=1e10;letclosestVideo=undefined;constvideoDurationList=[];this.videoMap.forEach((video,id)=>{****y{if(!isFinite(video.duration)){return;}videoDurationList.push(video.duration);if(closestVideo==undefined){closestVideo=video;}if(Math.abs(video.duration-_duration)0&&videoDom.currentTime{if(r=='m3u8'&&this.hasCheckedM3u8Url[nativeSrc]!=****ue){fetch(nativeSrc).then(r=>r.text()).then(m3u8Content=>{if(isMasterM3u8(m3u8Content)){constmediaM3u8Url=getFirstMediaM3U8(m3u8Content,nativeSrc);fetch(mediaM3u8Url).then(r=>r.text()).then(()=>{this.hasCheckedM3u8Url[nativeSrc]=****ue;})}else{this.hasCheckedM3u8Url[nativeSrc]=****ue;}})}})m3u8UrlType=this.m3u8UrlTes****esult[nativeSrc]}catch{};sendMessageToTop(MessageType.UpdateRoomRequest,{name:data.roomName,password:data.password,url:data.link,playbackRate:videoDom.playbackRate,currentTime:videoDom.currentTime,paused:paused,duration:videoDom.duration,localTimestamp:this.getLocalTimestamp(),m3u8Url:m3u8Url,m3u8UrlType:m3u8UrlType})}linkWithoutState(link){leturl=newURL(link);url.searchParams.delete("VideoTogetherUrl");url.searchParams.delete("VideoTogetherRoomName");url.searchParams.delete("VideoTogetherRole");url.searchParams.delete("VideoTogetherPassword");url.searchParams.delete("VideoTogetherTimestamp");returnurl.toS****ing();}Ge****oomState(link){if(inDownload){return{};}if(this.role==this.RoleEnum.Null){return{};}letvoice=Voice.status;if(voice==VoiceStatus.CONNECTTING){****y{voice=window.VideoTogetherStorage.VideoTogetherTabStorage.VideoTogetherVoice;}catch{voice=VoiceStatus.STOP;}}return{VideoTogetherUrl:link,VideoTogetherRoomName:this.roomName,VideoTogetherPassword:this.password,VideoTogetherRole:this.role,VideoTogetherTimestamp:Date.now()/1000,VideoTogetherVoice:voice,VideoVolume:this.getVideoVolume(),VoiceVolume:this.getVoiceVolume()}}SaveStateToSessionStorageWhenSameOrigin(link){if(inDownload){returnfalse;}****y{letsameOrigin=false;if(link!=""){leturl=newURL(link);letcurrentUrl=newURL(window.location);sameOrigin=(url.origin==currentUrl.origin);}if(link==""||sameOrigin){window.sessionStorage.setItem("VideoTogetherUrl",link);window.sessionStorage.setItem("VideoTogetherRoomName",this.roomName);window.sessionStorage.setItem("VideoTogetherPassword",this.password);window.sessionStorage.setItem("VideoTogetherRole",this.role);window.sessionStorage.setItem("VideoTogetherTimestamp",Date.now()/1000);returnsameOrigin;}else{returnfalse;}}catch(e){console.error(e);}}linkWithMemberState(link,newRole=undefined,expire=****ue){leturl=newURL(link);lettmpSearch=url.search;url.search="";url.searchParams.set("VideoTogetherUrl",link);url.searchParams.set("VideoTogetherRoomName",this.roomName);url.searchParams.set("VideoTogetherPassword",this.password);url.searchParams.set("VideoTogetherRole",newRole?newRole:this.role);url.searchParams.set("VideoTogetherTimestamp",expire?Date.now()/1000:1e10);leturlS****=url.toS****ing();if(tmpSearch.length>1){urlS****=urlS****"&"tmpSearch.slice(1);}returnnewURL(urlS****);}CalculateRealCurrent(data){letplaybackRate=parseFloat(data["playbackRate"]);returndata["currentTime"](this.getLocalTimestamp()-data["lastUpdateClientTime"])*(isNaN(playbackRate)?1:playbackRate);}Ge****isplayTimeText(){le****ate=newDate();returndate.getHours()":"date.getMinutes()":"date.getSeconds();}asyncSyncMemberVideo(data,videoDom){****y{if(this.isMain){useMobile****(videoDom);}}catch{}if(this.lastSyncMemberVideo1>Date.now()/1000){return;}this.lastSyncMemberVideo=Date.now()/1000;le****oom=data.room;sendMessageToTop(MessageType.Ge****oomData,room);//uselessthis.duration=room["duration"];//uselessif(videoDom==undefined){thrownewError("没有视频");}constwaitForLoadding=room['waitForLoadding'];letpaused=room['paused'];if(waitForLoadding&&!paused&&!Var.isThisMemberLoading){paused=****ue;}letisLoading=(Math.abs(this.memberLastSeek-videoDom.currentTime)1){videoDom.currentTime=this.CalculateRealCurrent(room);}//playfailwillreturnsohereissafethis.memberLastSeek=videoDom.currentTime;}else{videoDom.videoTogetherPaused=****ue;if(Math.abs(videoDom.currentTime-room["currentTime"])>0.1){videoDom.currentTime=room["currentTime"];}}if(videoDom.paused!=paused){if(paused){console.info("pause");videoDom.pause();}else{****y{console.info("play");{//checkifthevideoisreadyif(window.location.hostname.endsWith('aliyundrive.com')){if(videoDom.readyState==0){thrownewError("请手动点击播放");}}}awaitvideoDom.play();if(videoDom.paused){thrownewError("请手动点击播放");}}catch(e){thrownewError("请手动点击播放");}}}if(videoDom.playbackRate!=room["playbackRate"]){****y{videoDom.playbackRate=parseFloat(room["playbackRate"]);}catch(e){}}if(isNaN(videoDom.duration)){thrownewError("请手动点击播放");}sendMessageToTop(MessageType.UpdateStatusText,{text:"同步成功"this.Ge****isplayTimeText(),color:"green"});setTimeout(()=>{****y{if(Math.abs(room["duration"]-videoDom.duration)awaitthis.UpdateRoom(name,password,url,1,0,****ue,0,this.getLocalTimestamp()),2);this.se****ole(this.RoleEnum.Master);this.roomName=name;this.password=password;window.videoTogetherFlyPannel.InRoom();}catch(e){this.UpdateStatusText(e,"red")}}setWaitForLoadding(b){letenabled=****ue;****y{enabled=(window.VideoTogetherStorage.WaitForLoadding!=false)}catch{}this.waitForLoadding=enabled&&b;}asyncUpdateRoom(name,password,url,playbackRate,currentTime,paused,duration,localTimestamp,m3u8Url=""){m3u8Url=emptyS****IfUdf(m3u8Url);****y{if(window.location.pathname=="/page"){leturl=newURL(atob(newURL(window.location).searchParams.get("url")));window.location=url;}}catch{}WS.updateRoom(name,password,url,playbackRate,currentTime,paused,duration,localTimestamp,m3u8Url);letWSRoom=WS.ge****oom();if(WSRoom!=null){this.setWaitForLoadding(WSRoom['waitForLoadding']);sendMessageToTop(MessageType.RoomDataNotification,WSRoom);returnWSRoom;}letapiUrl=newURL(this.video_together_host"/room/update");apiUrl.searchParams.set("name",name);apiUrl.searchParams.set("password",password);apiUrl.searchParams.set("playbackRate",playbackRate);apiUrl.searchParams.set("currentTime",currentTime);apiUrl.searchParams.set("paused",paused);apiUrl.searchParams.set("url",url);apiUrl.searchParams.set("lastUpdateClientTime",localTimestamp);apiUrl.searchParams.set("duration",duration);apiUrl.searchParams.set("tempUser",this.tempUser);apiUrl.searchParams.set("protected",isRoomProtected());apiUrl.searchParams.set("videoTitle",this.isMain?****.title:this.videoTitle);apiUrl.searchParams.set("m3u8Url",emptyS****IfUdf(m3u8Url));letstartTime=Date.now()/1000;le****esponse=awaitthis.Fetch(apiUrl);letendTime=Date.now()/1000;le****ata=awaitthis.CheckResponse(response);sendMessageToTop(MessageType.RoomDataNotification,data);this.UpdateTimestampIfneeded(data["timestamp"],startTime,endTime);returndata;}asyncUpdateTimestampIfneeded(serverTimestamp,startTime,endTime){if(typeofserverTimestamp=='number'&&typeofstartTime=='number'&&typeofendTime=='number'){if(endTime-startTime

增值服务

+ 酷炫立体封面

……敬请期待……

留言互动
我是作者,我要留言给该美工
  • 暂时没有交流留言信息