function PlayerPreview(){throw{msg:"Don't NEW a singleton."}}EventListener.apply(PlayerPreview),PlayerPreview.constructRTMPUrl=function(e,i){var r,t="";ControllerLogin.abilities.abilityChn[e]&&2==ControllerLogin.abilities.abilityChn[e].live.ver&&i===EnumStreamType.BALANCED&&(i=EnumStreamType.FLUENT),(ControllerLogin.abilities.abilityChn[e]&&2==ControllerLogin.abilities.abilityChn[e].live.ver&&i===EnumStreamType.BALANCED||!ControllerLogin.chkVersion("supportAutoTrackStream",1,e)&&[EnumStreamType.TRACK_FLUENT,EnumStreamType.TRACK_CLEAR].includes(i))&&(i=EnumStreamType.FLUENT);var n="";-1!==(r=ControllerLogin.getQueryDataByCount([],"PlayerPreview",1))&&(n=r.query);const a=ControllerMain.isNvr?3===ControllerLogin.abilities.abilityChn[e].channelType.ver:"SD7"===ControllerMain.deviceInfo.type;let l=["sub","ext","main","main","mobile","telephoto_sub","telephoto_main"][i];if(a&&("telephoto_sub"===l?l="autotrack_sub":"telephoto_main"===l&&(l="autotrack_main")),flashCheck())t="rtmp://"+window.location.hostname+":"+ControllerFlash.rtmpPort+"/bcs/channel"+e+"_"+l+".bcs?token="+infoHandler.recover2Str(ControllerLogin.token)+"&channel="+e+"&stream="+EnumRTMPStreamType[i]+"&"+n;else{var o=window.location.port?":"+window.location.port:"";t=window.location.protocol+"//"+window.location.hostname+o+"/flv?token="+infoHandler.recover2Str(ControllerLogin.token)+"&port="+ControllerFlash.rtmpPort+"&app=bcs&stream=channel"+e+"_"+l+".bcs&"+n}return console.dbg("PlayerPreview.constructRTMPUrl:",t),t},PlayerPreview.init=function(){this.waiter=new ViewWaiting({id:"pv-waiter"}),this.sliderIsMouseDown=!1,this.previewSoundVal=0,this.previewStreamSel=EnumStreamType.FLUENT,this.streanIntervalId=0,this.extendIntervalId=0,this.isShow=!0,this.rightSections=[],this.allRightSections=[],this.isRightViewShow=!0,this.presetListItemSel=0,this.trigger("init"),this.initEvents(),this.initPreviewRightData(),ViewEncode.initUI&&ViewEncode.initUI(),ViewOSD.initUI&&ViewOSD.initUI(),ViewImage.initUI&&ViewImage.initUI(),ViewISP.initUI&&ViewISP.initUI(),ViewClip.initUI&&ViewClip.initUI(),ViewStitch.initUI&&ViewStitch.initUI(),ViewPtz3DLocation.initUI&&ViewPtz3DLocation.initUI(),$(".pre_head_title").on("click",(function(){var e=ViewManager.getSelectedView();ViewManager.getMode()==EnumCurState.PREVIEW&&e&&$(this).parent().parent().height()<50&&!PlayerPreview.isRefreshingRightBar&&$("#view-block-PREVIEW-"+e.getId()+"-toolbar").trigger("click")})),delete this.init},PlayerPreview.initEvents=function(){$("#preview_default_button").on("click",(function(){PlayerPreview.trigger("setDefaultHSB")})),$("#channels_control_head").on("click",PlayerPreview.onRightHeadClick),$("#ptz_control_head").on("click",PlayerPreview.onRightHeadClick),$("#stitch_control_head").on("click",PlayerPreview.onRightHeadClick),$("#pre_img_control_head").on("click",PlayerPreview.onRightHeadClick),$("#advanced_control_head").on("click",PlayerPreview.onRightHeadClick),$("#clip_control_head").on("click",PlayerPreview.onRightHeadClick),$("#track_limit_control_head").on("click",PlayerPreview.onRightHeadClick),delete this.initEvents},PlayerPreview.reload=function(){PlayerPreview.initRightViewPos(!0),ViewManager.updateView(),PlayerPreview.previewChangePlayStreamSel(PlayerPreview.previewStreamSel)},PlayerPreview.initPreviewRightData=function(){let e=Object.keys(EnumPreRightItem),i=new Map([["CHANNELS","channels"],["PTZ","ptz"],["IMG","img"],["ADV","adv"],["CROP","clip"],["STITCH","stitch"],["TRACKLIMIT","track_limit"]]);for(let r=0;r span").on("click",(function(){$("#basic_setting_header .selected").removeClass("selected"),$(this).addClass("selected"),$(".basic_setting_box.visible").removeClass("visible"),$("#"+$(this).attr("bc-bind-id")).addClass("visible")}))},PlayerPreview.initRightViewPos=function(e){PlayerPreview.rightSections=[];let i=ViewManager.getSelectedView(),r=i?i.getChannelId():null;if(ControllerMain.deviceInfo.channelNum>1?($("#pre_channels_container").show(),PlayerPreview.rightSections.push(PlayerPreview.allRightSections[0])):$("#pre_channels_container").hide(),null!==r){"admin"!==ControllerLogin.level&&"admin"!==infoHandler.recover2Str(ControllerLogin.userName)||!ControllerLogin.chkLowestVersion("ptzType",0,r)?$("#pre_ptz_container").hide():($("#pre_ptz_container").show(),PlayerPreview.rightSections.push(PlayerPreview.allRightSections[1]),livePtzManager.showPage());var t=ControllerLogin.chkVersion("supportBinoStitch",1,r);"admin"!==ControllerLogin.level&&"admin"!==infoHandler.recover2Str(ControllerLogin.userName)||!t?$("#pre_stitch_container").hide():($("#pre_stitch_container").show(),PlayerPreview.rightSections.push(PlayerPreview.allRightSections[6]))}else $("#pre_ptz_container").hide(),$("#pre_stitch_container").hide();PlayerPreview.rightSections.push(PlayerPreview.allRightSections[3]),PlayerPreview.rightSections.push(PlayerPreview.allRightSections[4]);let n=!1;if(n=ControllerMain.isNvr?PCE.isReadable("videoClip",null!==r?r:0):PCE.isReadable("videoClip"),n?($("#pre_clip_container").show(),PlayerPreview.rightSections.push(PlayerPreview.allRightSections[5])):$("#pre_clip_container").hide(),null!==r){const e=ControllerLogin.chkVersion("supportAITrackLimit",1,r);"admin"!==ControllerLogin.level&&"admin"!==infoHandler.recover2Str(ControllerLogin.userName)||!e?$("#pre_track_limit_container").hide():($("#pre_track_limit_container").show(),PlayerPreview.rightSections.push(PlayerPreview.allRightSections[2]),trackLimitManager.showPage())}else $("#pre_track_limit_container").hide();e&&$("#channels_control_head").trigger("click")},PlayerPreview.redrawRightView=function(e){for(var i=0;i{!PlayerPreview.rightSections.includes(e)&&e.isShow&&(e.isShow=!1,e.headerView.className="pre_head_arrows header_arrows_stren",$(e.containerView).css({height:60}))});for(var e=0;e