").attr("id",d).addClass("vc-pctrl-profile-btn").addClass(selectClass).text(b).appendTo(".vc-pctrl-profile-setbox")}this.attachClickEvent(".vc-pctrl-profile-btn",this.onProfileButtonClicked)},initCCUI:function(e,d){if(e==null||e.length==0){this.hideCCBtn();return}this.showCCBtn();$(".vc-pctrl-cc-set-box").empty();this._isCCtoggle=false;this._CCList=e;this._currCCItemIndex=d;this.setCCUI(this.isCCOn());if(e.length==1){this._isCCtoggle=true;this._isCCtoggleOn=this.isCCOn();return}for(var b=0;b<=e.length;b++){var f="vc-pctrl-cc-item"+b.toString();var c;var a;if(b==this._currCCItemIndex){c="vc-pctrl-cc-item-selected"}else{c="vc-pctrl-cc-item-unselected"}if(b==this._CCList.length){a=VCPlayControllerMedia.CAPTION_OFF_LABEL}else{a=this._CCList[b].label}$("").attr("id",f).addClass("vc-pctrl-cc-item").addClass(c).text(a).appendTo(".vc-pctrl-cc-set-box");this.attachCCItemEvent(b)}},attachCCItemEvent:function(a){var b="#vc-pctrl-cc-item"+a.toString();this.attachClickEvent(b,this.onCCItemClicked)},initChapterUI:function(a){this._isShowChapterBtn=a;if(a){this.showChapterBtn()}else{this.hideChapterBtn()}},onCCItemClicked:function(){var a=bcPlayController.getPlayController();var b=$(this).attr("id").replace("vc-pctrl-cc-item","");a.changeCurrCCItemManually(Number(b));a.toggleCCManually()},showChapterBtn:function(){$(VCPlayControllerMedia.CHAPTER_BTN_CLASS).show()},hideChapterBtn:function(){$(VCPlayControllerMedia.CHAPTER_BTN_CLASS).hide()},setProfileName:function(a){$(".vc-pctrl-profile-btn").removeClass("selected");var b="vc-pctrl-profile-btn-"+a;$("#"+b).addClass("selected");$(".vc-pctrl-profile-toggle-btn").text(a)},onPlayPauseClicked:function(b){var a=bcPlayController.getPlayController();a.togglePlayPauseManually()},onRestartClicked:function(a){uniPlayer.restartPlayer(0)},showReloadPlayerBtn:function(){$(".vc-pctrl-reload-player-btn").show()},hideReloadPlayerBtn:function(){$(".vc-pctrl-reload-player-btn").hide()},onReloadPlayerClicked:function(b){var a=bcPlayController.getPlayController();if(a._eventTarget){a._eventTarget.fire(VCPlayControllerEvent.RELOAD_PLAYER)}},onMixedMultiClicked:function(b){var a=bcPlayController.getPlayController();if(skinManager.isMobile()){return}a.toggleMixedManually()},onVolumeButtonClicked:function(b){var a=bcPlayController.getPlayController();a.changeMuteOnOffManually()},onVolumeSliderTouchDown:function(b){var a=bcPlayController.getPlayController();a._volumeControlling=true;a.changeVolumeManually(a.getVolumeFromOffset(Util.getClientX(b)));if(skinManager.isLowIE()){a.attachMoveEvent(window.document,a.onVolumeSliderTouchMove);a.attachEndEvent(window.document,a.onVolumeSliderTouchEnd)}else{a.attachMoveEvent(window,a.onVolumeSliderTouchMove);a.attachEndEvent(window,a.onVolumeSliderTouchEnd)}},onVolumeSliderTouchMove:function(b){var a=bcPlayController.getPlayController();a.changeVolumeManually(a.getVolumeFromOffset(Util.getClientX(b)))},onVolumeSliderTouchEnd:function(b){var a=bcPlayController.getPlayController();a._volumeControlling=false;a.changeVolumeManually(a.getVolumeFromOffset(Util.getClientX(b)));if(skinManager.isLowIE()){a.detachMoveEvent(window.document,a.onVolumeSliderTouchMove);a.detachEndEvent(window.document,a.onVolumeSliderTouchEnd)}else{a.detachMoveEvent(window,a.onVolumeSliderTouchMove);a.detachEndEvent(window,a.onVolumeSliderTouchEnd)}if(!a._isMouseOnVolumeHoverArea){a.hideVolumeSettingPanel()}},onChapterButtonClicked:function(b){var a=bcPlayController.getPlayController();a.toggleChapterManually()},onFullScreenButtonClicked:function(b){var a=bcPlayController.getPlayController();if(uniPlayer.needToShowPopUpFullScreen()&&!uniPlayerConfig.getUniPlayerSettingsData().usePopupFullscreen){a.noticeFullScreenUnavailableInFallback();return}a.toggleFullScreenManually()},onCCButtonClicked:function(b){var a=bcPlayController.getPlayController();a._ccManipulated=true;if(a._isCCtoggle){a.toggleCCOnOff();a.toggleCCManually()}else{a.toggleCCSetBoxShowHide()}},onPlaybackRateSetBoxButtonClicked:function(b){var a=bcPlayController.getPlayController();if(!skinManager.isNeedFlashFallback()){a._playbackRateManipulated=true;a.toggleShowHidePlaybackRateSetBoxManually()}else{a.noticePlaybackRateUnavailableInFallback()}},onPlaybackRateButtonClicked:function(c){var b=bcPlayController.getPlayController();b.hidePlaybackRateSetBox();var d=$(this).attr("id");var a=b.getPlaybackRateFromBtnId(d);$(".vc-pctrl-playback-rate-toggle-btn").text("x "+a);$(".vc-pctrl-playback-rate-btn").removeClass("selected");$("#"+d).addClass("selected");b._eventTarget.fire(VCPlayControllerEvent.CHANGE_PLAYBACK_RATE,Number(a))},onProfileSetBoxButtonClicked:function(b){var a=bcPlayController.getPlayController();a._profileManipulated=true;a.toggleShowHideProfileSetBoxManually()},onProfileButtonClicked:function(c){var b=bcPlayController.getPlayController();b.hideProfileSetBox();var d=$(this).attr("id");var a=d.replace("vc-pctrl-profile-btn-","");$(".vc-pctrl-profile-btn").removeClass("selected");$("#"+d).addClass("selected");$(".vc-pctrl-profile-toggle-btn").text(a);b._eventTarget.fire(VCPlayControllerEvent.CHANGE_PROFILE,a)},onVolumeButtonMouseOver:function(b){var a=bcPlayController.getPlayController();if(!a._volumeControlling){a.showVolumeSettingPanel()}},onVolumeHoverAreaMouseOver:function(b){var a=bcPlayController.getPlayController();a._isMouseOnVolumeHoverArea=true},onVolumeHoverAreaMouseLeave:function(b){var a=bcPlayController.getPlayController();a._isMouseOnVolumeHoverArea=false;a.startHideVolumeTimeout()},onSwapVideoButtonClicked:function(b){var a=bcPlayController.getPlayController();var c=uniPlayerConfig.getMediaChannelConfig()._playingInfo.storyType;if(c==ContentType.VIDEO2){if(a._currVideoType==VideoType.MAIN_MEDIA){a.setCurrVideoType(VideoType.SUB_MEDIA)}else{a.setCurrVideoType(VideoType.MAIN_MEDIA)}a._eventTarget.fire(VCPlayControllerEvent.SWAP_VIDEO)}else{if(c==ContentType.VIDEO3){a._swapSelectManipulated=true;a.toggleSwapSelectBoxShowHide()}}},onSyncDocSwap:function(){var a=bcPlayController.getPlayController();if(a._currPlayMode==SyncVideoMobilePlayMode.VIDEO){a._currPlayMode=SyncVideoMobilePlayMode.SLIDE}else{a._currPlayMode=SyncVideoMobilePlayMode.VIDEO}a.setPlayModeUI(a._currPlayMode);a._eventTarget.fire(VCPlayControllerEvent.SWAP_SYNCDOC,a._currPlayMode)},startHideVolumeTimeout:function(){var a=bcPlayController.getPlayController();clearTimeout(a._hideVolumeTimeout);a._hideVolumeTimeout=setTimeout(function(){bcPlayController.getPlayController().tryToHideVolumeSettingPanel()},500)},tryToHideVolumeSettingPanel:function(b){var a=bcPlayController.getPlayController();if(!a._volumeControlling&&!a._isMouseOnVolumeHoverArea){a.hideVolumeSettingPanel()}else{a.startHideVolumeTimeout()}},onVolumeSettingPanelAnimationEnd:function(){$(".vc-pctrl-volume-setting-panel").removeClass("volume-hide-animation");$(".vc-pctrl-volume-setting-panel").removeClass("volume-show-up")},showVolumeSettingPanel:function(){$(".vc-pctrl-volume-setting-panel").removeClass("volume-hide-animation");$(".vc-pctrl-volume-setting-panel").addClass("volume-show-up-animation");$(".vc-pctrl-volume-setting-panel").css("width","56px")},hideVolumeSettingPanel:function(){$(".vc-pctrl-volume-setting-panel").removeClass("volume-show-up-animation");$(".vc-pctrl-volume-setting-panel").addClass("volume-hide-animation");$(".vc-pctrl-volume-setting-panel").css("width","0px")},getPlaybackRateFromBtnId:function(a){return Number(a.replace(VCPlayControllerMedia.PLAYBACK_RATE_BTN_ID,"")/10).toFixed(1)},onTimeTrackerTouchDown:function(c){var b=bcPlayController.getPlayController();if(!b._duration){return}if(!b._isSeekable){return}c.preventDefault();var a=b.getTimeFromOffset(Util.getClientX(c),b._duration);if(b._limitTime!=0&&b._limitTime+1
1)?1:a;b.changeVolumeManually(a)},onKeyDownDown:function(){var b=bcPlayController.getPlayController();var a=(b._volume-VCPlayControllerMedia.MOVING_VOLUME);a=(a<0)?0:a;b.changeVolumeManually(a)},onKeyForFullScreenDown:function(){var a=bcPlayController.getPlayController();if(skinManager.isIE11()){return}a.toggleFullScreenManually()},onKeyMDown:function(){var a=bcPlayController.getPlayController();a.changeMuteOnOffManually()},onKeyZDown:function(){var b=bcPlayController.getPlayController();var a="1.0";b.selectPlaybackRate(a);uniPlayer.setPlaybackRate(a);contentPlayer.changePlaybackRate(a)},onKeyXDown:function(){var c=bcPlayController.getPlayController();var b=uniPlayer.getPlaybackRate();var a=c.getPrevPlaybackRate(b);c.selectPlaybackRate(a);uniPlayer.setPlaybackRate(a);contentPlayer.changePlaybackRate(a)},onKeyCDown:function(){var c=bcPlayController.getPlayController();var b=uniPlayer.getPlaybackRate();var a=c.getNextPlaybackRate(b);c.selectPlaybackRate(a);uniPlayer.setPlaybackRate(a);contentPlayer.changePlaybackRate(a)},getPrevPlaybackRate:function(c){var a=["0.5","0.8","1.0","1.2","1.4","1.6","1.8","2.0"];for(var b=0;b1){b=1}if(b<0){b=0}return b},moveBackward:function(){var a=bcPlayController.getPlayController();if(!a._duration){return}var b=(a._currTime-VCPlayControllerMedia.MOVING_TIME);b=(b<0)?0:b;a.changeCurrTimeManually(b,VCPlayControllerEvent.SEEK_END)},moveForward:function(){var a=bcPlayController.getPlayController();if(!a._duration){return}var b=(a._currTime+VCPlayControllerMedia.MOVING_TIME);b=(b>a._duration)?a._duration:b;if(this._seekLimit){b=b>a._limitTime?a._limitTime:b}a.changeCurrTimeManually(b,VCPlayControllerEvent.SEEK_END)},changeCurrCCItemManually:function(c){this._currCCItemIndex=c;this._eventTarget.fire(VCPlayControllerEvent.CC_ITEM_SELECTED,c);this.hideCCSetBox();for(var a=0;a<=this._CCList.length;a++){var b="#vc-pctrl-cc-item"+a.toString();if(a==c){$(b).removeClass("vc-pctrl-cc-item-unselected").addClass("vc-pctrl-cc-item-selected")}else{$(b).addClass("vc-pctrl-cc-item-unselected").removeClass("vc-pctrl-cc-item-selected")}}},togglePlayPauseManually:function(){var a=bcPlayController.getPlayController();if(skinManager.isMobile()&&!a._isControllable){return}a.setIsPlaying(!a._isPlaying);if(a._isPlaying){a._eventTarget.fire(VCPlayControllerEvent.PLAY)}else{a._eventTarget.fire(VCPlayControllerEvent.PAUSE)}},changeCurrTimeManually:function(c,b){var a=bcPlayController.getPlayController();if(!a._isControllable){return}if(c>this._duration){c=this._duration}if(c<0){c=0}if(b!=VCPlayControllerEvent.SEEK_START){a.setCurrentTime(c,true)}switch(b){case VCPlayControllerEvent.SEEK_START:a._eventTarget.fire(VCPlayControllerEvent.SEEK_START);break;case VCPlayControllerEvent.SEEK_END:a._eventTarget.fire(VCPlayControllerEvent.SEEK_END,c);break}return 1},toggleSwapSelectBoxShowHide:function(){var a=bcPlayController.getPlayController();a._isSwapSelectBoxShown=!a._isSwapSelectBoxShown;if(a._isSwapSelectBoxShown){a.showSwapSelectBox()}else{a.hideSwapSelectBox()}},showCCBtn:function(){$(VCPlayControllerMedia.CC_BTN_CLASS).show()},hideCCBtn:function(){$(VCPlayControllerMedia.CC_BTN_CLASS).hide()},showCCSetBox:function(){var a=this.getControllerWidth();var e=$(".vc-pctrl-cc-btn").width();var d=a-$(".vc-pctrl-cc-btn").position().left-e;var c=$(".vc-pctrl-cc-set-box").width();if(Util.isIE11embedFullScreen()){d=this.getElementOuterWidthIfShown(".vc-pctrl-fullscreen-btn")+this.getElementOuterWidthIfShown(".vc-pctrl-chapter-btn");c=VCPlayControllerMedia.CC_SETBOX_WIDTH}var b=d+e/2-c/2;if(b<10){b=10}$(".vc-pctrl-cc-set-box").css("right",b);$(".vc-pctrl-cc-set-box").show();this._isCCSetBoxShown=true},hideCCSetBox:function(){$(".vc-pctrl-cc-set-box").hide();this._isCCSetBoxShown=false},toggleShowHidePlaybackRateSetBoxManually:function(){var a=bcPlayController.getPlayController();if(!a._isControllable){return}if(a._isPlaybackRateSetBoxShown){a.hidePlaybackRateSetBox()}else{a.showPlaybackRateSetBox()}},noticePlaybackRateUnavailableInFallback:function(){var a=bcPlayController.getPlayController();if(a._isPlaybackRateUnavailableNoticeOn){$(VCPlayControllerMedia.PLAYBACK_RATE_UNAVAILABLE_MSG).css("display","none");a._isPlaybackRateUnavailableNoticeOn=false;clearTimeout(a._hidePlaybackRateUnavailableNoticeTimeout);return}if(skinManager.isIE7()){$(VCPlayControllerMedia.PLAYBACK_RATE_UNAVAILABLE_MSG).css("display","block")}else{$(VCPlayControllerMedia.PLAYBACK_RATE_UNAVAILABLE_MSG).css("display","table")}a._isPlaybackRateUnavailableNoticeOn=true;a._hidePlaybackRateUnavailableNoticeTimeout=setTimeout(function(){$(VCPlayControllerMedia.PLAYBACK_RATE_UNAVAILABLE_MSG).css("display","none");a._isPlaybackRateUnavailableNoticeOn=false},2500)},noticeFullScreenUnavailableInFallback:function(){var a=bcPlayController.getPlayController();if(a._isFullScreenUnavailableNoticeOn){$(VCPlayControllerMedia.FULLSCREEN_UNAVAILABLE_MSG).css("display","none");a._isFullScreenUnavailableNoticeOn=false;clearTimeout(a._hideFullScreenUnavailableNoticeTimeout);return}if(skinManager.isIE7()){$(VCPlayControllerMedia.FULLSCREEN_UNAVAILABLE_MSG).css("display","block")}else{$(VCPlayControllerMedia.FULLSCREEN_UNAVAILABLE_MSG).css("display","table")}a._isFullScreenUnavailableNoticeOn=true;a._hideFullScreenUnavailableNoticeTimeout=setTimeout(function(){$(VCPlayControllerMedia.FULLSCREEN_UNAVAILABLE_MSG).css("display","none");a._isFullScreenUnavailableNoticeOn=false},2500)},toggleShowHideProfileSetBoxManually:function(){var a=bcPlayController.getPlayController();if(!a._isControllable){return}if(a._isProfileSetBoxShown){a.hideProfileSetBox()}else{a.showProfileSetBox()}},showPlaybackRateSetBox:function(){var e=$(".vc-pctrl-playback-rate-toggle-btn").position().left;var d=this.getControllerWidth();var a=$(".vc-pctrl-playback-rate-toggle-btn").width();var c=$(".vc-pctrl-playback-rate-setbox").width();if(Util.isIE11embedFullScreen()){a=VCPlayControllerMedia.PLAYBACKRATE_TOGGLE_BTN_WIDTH;e=d-this.getElementOuterWidthIfShown(".vc-pctrl-fullscreen-btn")-this.getElementOuterWidthIfShown(".vc-pctrl-chapter-btn")-this.getElementOuterWidthIfShown(".vc-pctrl-cc-btn")-this.getProfileToggleBtnWidthIfShown()-a;c=VCPlayControllerMedia.PLAYBACKRATE_SETBOX_WIDTH}$(".vc-pctrl-playback-rate-setbox").css("right",(d-e)-a/2-c/2);$(".vc-pctrl-playback-rate-setbox").show();var b=bcPlayController.getPlayController();b._isPlaybackRateSetBoxShown=true},hidePlaybackRateSetBox:function(){$(".vc-pctrl-playback-rate-setbox").hide();var a=bcPlayController.getPlayController();a._isPlaybackRateSetBoxShown=false},showProfileBtn:function(){$(VCPlayControllerMedia.PROFILE_BTN_CLASS).show()},hideProfileBtn:function(){$(VCPlayControllerMedia.PROFILE_BTN_CLASS).hide()},showProfileSetBox:function(){var a=$(".vc-pctrl-profile-toggle-btn").position().left;var d=this.getControllerWidth();var e=$(".vc-pctrl-profile-toggle-btn").innerWidth();var c=$(".vc-pctrl-profile-setbox").width();if(Util.isIE11embedFullScreen()){e=VCPlayControllerMedia.PROFILE_TOGGLE_BTN_WIDTH;a=d-this.getElementOuterWidthIfShown(".vc-pctrl-fullscreen-btn")-this.getElementOuterWidthIfShown(".vc-pctrl-chapter-btn")-this.getElementOuterWidthIfShown(".vc-pctrl-cc-btn")-e;c=VCPlayControllerMedia.PROFILE_SETBOX_WIDTH}$(".vc-pctrl-profile-setbox").css("right",(d-a)-e/2-c/2);$(".vc-pctrl-profile-setbox").show();var b=bcPlayController.getPlayController();b._isProfileSetBoxShown=true},hideProfileSetBox:function(){$(".vc-pctrl-profile-setbox").hide();var a=bcPlayController.getPlayController();a._isProfileSetBoxShown=false},toggleChapterManually:function(){this.setIsChapterOn(!this._isChapterOn);this.setChapterUI(this._isChapterOn);if(this._isChapterOn){this._eventTarget.fire(VCPlayControllerEvent.SHOW_CHAPTER)}else{this._eventTarget.fire(VCPlayControllerEvent.HIDE_CHAPTER)}},toggleFullScreenManually:function(){var a=bcPlayController.getPlayController();a.setIsFullScreen(!a._isFullScreen);if(a._isFullScreen){a._eventTarget.fire(VCPlayControllerEvent.FULL_SCREEN)}else{a._eventTarget.fire(VCPlayControllerEvent.CLOSE_FULL_SCREEN)}},toggleCCManually:function(){var a=this.isCCOn();this.setCCUI(a);if(a){this._eventTarget.fire(VCPlayControllerEvent.SHOW_CC)}else{this._eventTarget.fire(VCPlayControllerEvent.HIDE_CC)}},toggleCCOnOff:function(){if(this._isCCtoggleOn){this._eventTarget.fire(VCPlayControllerEvent.CC_ITEM_SELECTED,1);this._currCCItemIndex=1;this._isCCtoggleOn=false}else{this._eventTarget.fire(VCPlayControllerEvent.CC_ITEM_SELECTED,0);this._currCCItemIndex=0;this._isCCtoggleOn=true}},toggleCCSetBoxShowHide:function(){var a=bcPlayController.getPlayController();a._isCCSetBoxShown=!a._isCCSetBoxShown;if(a._isCCSetBoxShown){a.showCCSetBox()}else{a.hideCCSetBox()}},changeVolumeManually:function(b){var a=bcPlayController.getPlayController();a.setVolume(b);a._eventTarget.fire(VCPlayControllerEvent.CHANGE_VOLUME,b)},changeMuteOnOffManually:function(){if(this._isMuted){this.changeVolumeManually(this._volumeBeforeMute);this._volumeBeforeMute=-1}else{this._volumeBeforeMute=this._volume;this.changeVolumeManually(0)}},toggleMixedManually:function(){var a=bcPlayController.getPlayController();a.setIsMixed(!a._isMixed);if(a._isMixed){a._eventTarget.fire(VCPlayControllerEvent.SWAP_MIXED_VIDEO)}else{a._eventTarget.fire(VCPlayControllerEvent.SWAP_MULTI_VIDEO)}},setCurrVideoType:function(a){this._currVideoType=a;this.setCurrVideoTypeUI(a)},setCurrVideoTypeUI:function(b){if(b==null){return}var d=uniPlayerConfig.getMediaChannelConfig()._playingInfo.storyType;if(d==ContentType.VIDEO3){for(var a=0;a=1){this._swapVideoList.push(VideoType.EXTRA_MEDIA)}if(d>=2){this._swapVideoList.push(VideoType.EXTRA_MEDIA2)}for(var c=0;c").attr("id",f).addClass("vc-pctrl-swap-item").addClass(e).text(b).appendTo(".vc-pctrl-swap-select-box");this.attachSwapItemEvent(f)}},attachSwapItemEvent:function(a){a="#"+a;this.attachClickEvent(a,this.onSwapItemClicked)},hideMobileSwapVideoBtn:function(){$(".vc-pctrl-swap-video-btn").hide()},showSwapSelectBox:function(){var b=$(LayoutIdTable.PLAY_CONTROLLER).width();var c=$(".vc-pctrl-swap-video-btn").width();var a=b-$(".vc-pctrl-swap-video-btn").position().left-c;var d=$(".vc-pctrl-swap-select-box").width();$(".vc-pctrl-swap-select-box").css("right",a+c/2-d/2);$(".vc-pctrl-swap-select-box").show();this._isSwapSelectBoxShown=true},hideSwapSelectBox:function(){$(".vc-pctrl-swap-select-box").hide();this._isSwapSelectBoxShown=false},setDurationUI:function(a){if(!a){return}$(".vc-pctrl-total-duration").text(Util.secToTimerString(a))},setCurrentTimeUI:function(b,a){if(!a){return}$(".vc-pctrl-curr-time").text(Util.secToTimerString(b));this.setPlayProgressUI(b,a);this.setSeekThumbUI(b,a)},initIntroProgressUI:function(){$(".vc-pctrl-intro-play-progress").css("width","0%")},setPlayProgressUI:function(f,e){var d=this.getControllerWidth();var b=(d)/d*100;var c=(f/e*b).toFixed(2);if(c>100){c=100}c=c.toString();var a=(uniPlayerConfig.getMediaChannelConfig()._playingInfo.isIntro)?".vc-pctrl-intro-play-progress":".vc-pctrl-play-progress";$(a).css("width","{0}%".format(c))},setSeekLimitProgressUI:function(a,c){var b=(a/c)*100;$(".vc-pctrl-seek-limit-progress").css("width","{0}%".format(b))},setSeekThumbUI:function(f,e){var d=this.getControllerWidth();var b=$(".vc-pctrl-seek-thumb").width();var a=(d-b)/d*100;var c=f/e*a;if(c<0){c=0}c=c.toFixed(2).toString();$(".vc-pctrl-seek-thumb").css("left","{0}%".format(c))},setBufferedUI:function(a,c){if(!c){return}var b=((a/c)*100).toFixed(2);if(b>100){b=100}b=b.toString();$(".vc-pctrl-load-progress").css("width","{0}%".format(b))},setIsPlayingUI:function(a){if(a){$(".vc-pctrl-play-pause-btn").removeClass("vc-pctrl-on-pause").addClass("vc-pctrl-on-playing")}else{$(".vc-pctrl-play-pause-btn").removeClass("vc-pctrl-on-playing").addClass("vc-pctrl-on-pause")}this.setPlayPauseBtnTitle(a)},setIsFullScreenUI:function(a){if(a){$(".vc-pctrl-fullscreen-btn").removeClass("vc-pctrl-on-normal-screen").addClass("vc-pctrl-on-full-screen")}else{$(".vc-pctrl-fullscreen-btn").removeClass("vc-pctrl-on-full-screen").addClass("vc-pctrl-on-normal-screen")}this.setFullscreenBtnTitle(a)},setVolumeUI:function(a){this.setVolumeBtnUI(a);this.setVolumeGaugeUI(a);this.setVolumeThumbUI(a)},setVolumeBtnUI:function(a){if(a==0){$(".vc-pctrl-volume-btn").addClass("muted")}else{$(".vc-pctrl-volume-btn").removeClass("muted")}this.setVolumeBtnTitle(this._isMuted)},setVolumeGaugeUI:function(a){$(".vc-pctrl-volume-gauge").css("width","{0}%".format(a*100))},setVolumeThumbUI:function(b){var a=this.getVolumeSliderWidth();a=a-$(".vc-pctrl-volume-thumb").width();var c=a*b;$(".vc-pctrl-volume-thumb").css("margin-left","{0}px".format(c))},setPlaybackRateUI:function(){var a=uniPlayerConfig.getMediaChannelConfig().useRTMPStreaming();var b=uniPlayerConfig.getMediaChannelConfig().useHLSStreaming();if(uniPlayerConfig.getUniPlayerSettingsData().usePlaybackRate&&!a&&!(skinManager.isFirefox()&&false==skinManager.isHlsSupported())&&!uniPlayerConfig.getMediaChannelConfig()._playingInfo.isIntro){if(b&&true!=skinManager.isHlsSupported()){$(".vc-pctrl-playback-rate-toggle-btn").hide()}else{$(".vc-pctrl-playback-rate-toggle-btn").show()}}else{$(".vc-pctrl-playback-rate-toggle-btn").hide()}},selectPlaybackRate:function(a){$(".vc-pctrl-playback-rate-toggle-btn").text("x "+a);$(".vc-pctrl-playback-rate-btn").removeClass("selected");$(VCPlayControllerMedia.PLAYBACK_RATE_BTN_CLASS).each(function(){if(Number($(this).text())==a){$(this).addClass("selected")}})},setCCUI:function(a){if(a){$(".vc-pctrl-cc-btn").removeClass("vc-pctrl-cc-off").addClass("vc-pctrl-cc-on")}else{$(".vc-pctrl-cc-btn").removeClass("vc-pctrl-cc-on").addClass("vc-pctrl-cc-off")}},setChapterUI:function(a){if(a){$(".vc-pctrl-chapter-btn").addClass("selected")}else{$(".vc-pctrl-chapter-btn").removeClass("selected")}},setIsMixedUI:function(a){if(a){$(".vc-pctrl-mixed-multi-btn").removeClass("vc-pctrl-on-mixed").addClass("vc-pctrl-on-multi");$(".vc-pctrl-mixed-multi-btn").text("Multi")}else{$(".vc-pctrl-mixed-multi-btn").removeClass("vc-pctrl-on-multi").addClass("vc-pctrl-on-mixed");$(".vc-pctrl-mixed-multi-btn").text("Mixed")}this.setMixedMultiBtnTitle(a)},setDuration:function(a){this._duration=a;this.setDurationUI(a)},setCurrentTime:function(b,a){if(!a&&this._isSeeking){return}if(b>this._duration){b=this._duration}if(b<0){b=0}this._currTime=b;this.setCurrentTimeUI(b,this._duration);if(this._seekLimit&&this._limitTimeparseFloat(a)){$(c).addClass("seek-limit")}else{$(c).removeClass("seek-limit")}}},getChapterId:function(e,b,f){var d=Util.objectKeys(this._chapterList);if(d.length==0){return null}for(var a=0;ae){return c}}return null}});var ChapterTmplData=Base.extend({index:0,itemId:null,pageIdx:0,type:null,storyIdref:null,thumbUrl:null,time:null,index:null,description:null});var StoryTmplData=ChapterTmplData.extend({isStory:true});var SlideTmplData=ChapterTmplData.extend({isStory:false});var VCChapterHorizontal=VCChapter.extend({_isMouseOver:false,showChapter:function(){if(bcChapterHorizontal._chapterList==null){return}if(Util.objectKeys(bcChapterHorizontal._chapterList).length==0){return}$(LayoutIdTable.CHAPTER_HORIZONTAL).show()},hideChapter:function(){$(LayoutIdTable.CHAPTER_HORIZONTAL).hide()},showChapterPanel:function(){$(VCChapterHorizontal.CHAPTER_CONTAINER_CLASS_HORIZONTAL).css("visibility","visible");$(VCChapterHorizontal.CHAPTER_MASK_CLASS).css("visibility","hidden")},hideChapterPanel:function(){$(VCChapterHorizontal.CHAPTER_CONTAINER_CLASS_HORIZONTAL).css("visibility","hidden");$(VCChapterHorizontal.CHAPTER_MASK_CLASS).css("visibility","visible")},resize:function(){if(bcChapterHorizontal._chapterList){var a=bcChapterHorizontal._vcChapterHorizontal.getTotalChapterContentWidth();var b=$(window).innerWidth();if(b>=a){$(LayoutIdTable.CHAPTER_HORIZONTAL).css("height","108px")}else{$(LayoutIdTable.CHAPTER_HORIZONTAL).css("height","124px")}}if(this._scrollApi&&!this._scrollUpdateTimeout){this._scrollUpdateTimeout=setTimeout(this.updateScroll,50)}},updateScroll:function(){var a=bcChapterHorizontal.getChapter();a._scrollApi.reinitialise();a._scrollUpdateTimeout=null},attachChapterEvents:function(c,a){var b="#"+a+c.toString();this.attachClickEvent(b,function(f){var d=bcChapterHorizontal.getChapter();d.onChapterItemClicked(this)})},attachMouseEvent:function(){$(LayoutIdTable.CHAPTER_HORIZONTAL).bind("mouseover",this.onMouseOver);$(LayoutIdTable.CHAPTER_HORIZONTAL).bind("mouseleave",this.onMouseLeave)},attachScrollEvent:function(a){$(".vc-chapter-list-horizontal").on("scrollstart",function(){var b=bcChapterHorizontal.getChapter();b._isScrolled=true})},onChapterItemClicked:function(a){var b=bcChapterHorizontal.getChapter();var c=$(a).attr("id");b._eventTarget.fire(VCChapterEvent.ITEM_CLICKED,c)},addHighlight:function(a){$("#vc-chapter-item-horizontal-"+a).addClass("vc-chapter-highlighted")},removeHighlight:function(a){$("#vc-chapter-item-horizontal-"+a).removeClass("vc-chapter-highlighted")},writeChapterList:function(a,b){$(VCChapterHorizontal.LIST_CONTAINER_CLASS_HORIZONTAL).html(a);setTimeout(function(){var c=bcChapterHorizontal.getChapter();c.initScrolls();c.resize();b()},200)},initScrolls:function(){$(VCChapterHorizontal.LIST_CONTAINER_CLASS_HORIZONTAL).jScrollPane({animateScroll:true});this._scrollApi=$(VCChapterHorizontal.LIST_CONTAINER_CLASS_HORIZONTAL).data("jsp");this.attachClickEvent(VCChapterHorizontal.LEFT_BTN_CLASS,this.scrollMoveToLeft);this.attachClickEvent(VCChapterHorizontal.RIGHT_BTN_CLASS,this.scrollMoveToRight)},getChapterOffset:function(){var a=$(".vc-chapter-list-wrapper-horizontal").width();var b=$(".vc-chapter-item-horizontal").innerWidth();var c=a/b;return parseInt(c/2)},getTotalChapterContentWidth:function(){if(bcChapterHorizontal._chapterList==null){return 0}var j=Util.objectKeys(bcChapterHorizontal._chapterList);if(j.length==0){return 0}var k=[];var c=0;for(var d=0;d=1000){a=0.125}else{if(c<=770){a=0.035}else{a=0.035+(c-770)/(1000-770)*(0.125-0.035)}}var b=$(LayoutIdTable.CLOSED_CAPTION);b.css("left","{0}px".format(c*a));b.css("width","{0}px".format(c*(1-a*2)))},setFontSize:function(b,a){var c=b*0.7;$(VCClosedCaption.CAPTION_TEXT_CLASS).css("font-size","{0}px".format(b));$(VCClosedCaption.CAPTION_TEXT_CLASS).css("padding-left","{0}px".format(c));$(VCClosedCaption.CAPTION_TEXT_CLASS).css("padding-right","{0}px".format(c));$(VCClosedCaption.CAPTION_TEXT_CLASS).css("border-radius","{0}px".format(a))},setCaptionText:function(f,b){this.eraseCaptionText();var c=f.split("\n");var d=b*0.7;for(var a in c){var e=VCClosedCaption.CAPTION_TEXT_NAME+a.toString();$("").attr("id",e).addClass(VCClosedCaption.CAPTION_TEXT_NAME).css("font-size","{0}px".format(b)).css("padding-left","{0}px".format(d)).css("padding-right","{0}px".format(d)).text(c[a]).appendTo(VCClosedCaption.CAPTION_WINDOW_CLASS);if(Number(a)!=c.length-1){$("
").appendTo(VCClosedCaption.CAPTION_WINDOW_CLASS)}}},eraseCaptionText:function(){$(VCClosedCaption.CAPTION_WINDOW_CLASS).empty()},showHTML5InlineCaptionForMobile:function(a,d,b){this.hideHTML5InlineCaptionForMobile();if(d==null||b<0||b>=d.length){return}var c=d[b];$(" ');break;case ContentType.VIDEO2:$videoPlayer.find(VCVideoPlayDesktopFlash.MAIN_VIDEO_CONTAINER_CLASS).empty();$videoPlayer.find(VCVideoPlayDesktopFlash.MAIN_VIDEO_CONTAINER_CLASS).html('');$videoPlayer.find(VCVideoPlayDesktopFlash.SUB_VIDEO_CONTAINER_CLASS).empty();$videoPlayer.find(VCVideoPlayDesktopFlash.SUB_VIDEO_CONTAINER_CLASS).html('');break;case ContentType.VIDEO3:$videoPlayer.find(VCVideoPlayDesktopFlash.MAIN_VIDEO_CONTAINER_CLASS).empty();$videoPlayer.find(VCVideoPlayDesktopFlash.SUB_VIDEO_CONTAINER_CLASS).empty();$videoPlayer.find(VCVideoPlayDesktopFlash.EXTRA_VIDEO_CONTAINER_CLASS).empty();if(this._extraMediaCount==1){$videoPlayer.find(VCVideoPlayDesktopFlash.MAIN_VIDEO_CONTAINER_CLASS).html('');$videoPlayer.find(VCVideoPlayDesktopFlash.SUB_VIDEO_CONTAINER_CLASS).html('');$videoPlayer.find(VCVideoPlayDesktopFlash.EXTRA1_VIDEO_CONTAINER_CLASS).html('')}else{$videoPlayer.find(VCVideoPlayDesktopFlash.MAIN_VIDEO_CONTAINER_CLASS).html('');$videoPlayer.find(VCVideoPlayDesktopFlash.SUB_VIDEO_CONTAINER_CLASS).html('');$videoPlayer.find(VCVideoPlayDesktopFlash.EXTRA1_VIDEO_CONTAINER_CLASS).html('');$videoPlayer.find(VCVideoPlayDesktopFlash.EXTRA2_VIDEO_CONTAINER_CLASS).html('')}break}},initControls:function(){if(!this._contentInfo){return}switch(uniPlayerConfig.getMediaChannelConfig().getContentType()){case ContentType.VIDEO1:this.initMainMediaFlash(VCVideoPlayDesktopFlash.VIDEO1_MAIN_VIDEO_ELEMENT_ID);break;case ContentType.VIDEO2:this.initMainMediaFlash(VCVideoPlayDesktopFlash.VIDEO2_MAIN_VIDEO_ELEMENT_ID);if(false==this._contentInfo.getProfile().isAudio){this.initSubMediaFlash(VCVideoPlayDesktopFlash.VIDEO2_SUB_VIDEO_ELEMENT_ID)}break;case ContentType.VIDEO3:switch(this._extraMediaCount){case 1:this.initMainMediaFlash(VCVideoPlayDesktopFlash.VIDEO3_MAIN_VIDEO_ELEMENT_ID);if(false==this._contentInfo.getProfile().isAudio){this.initSubMediaFlash(VCVideoPlayDesktopFlash.VIDEO3_SUB_VIDEO_ELEMENT_ID);this.initExtraMediaList()}break;case 2:this.initMainMediaFlash(VCVideoPlayDesktopFlash.VIDEO4_MAIN_VIDEO_ELEMENT_ID);if(false==this._contentInfo.getProfile().isAudio){this.initSubMediaFlash(VCVideoPlayDesktopFlash.VIDEO4_SUB_VIDEO_ELEMENT_ID);this.initExtraMediaList()}break}break}this.setDesktopLayout();this.setVisibilityForMediaPlayMode();if(this._contentInfo.getProfile().isAudio){this.hideLayoutSetBox();this.hideVideoSeparator()}},initExtraMediaList:function(){switch(this._extraMediaCount){case 1:this.initExtraMediaFlash(VCVideoPlayDesktopFlash.VIDEO3_EXTRA_VIDEO_ELEMENT_ID,0);break;case 2:this.initExtraMediaFlash(VCVideoPlayDesktopFlash.VIDEO4_EXTRA_VIDEO_ELEMENT_ID,0);this.initExtraMediaFlash(VCVideoPlayDesktopFlash.VIDEO4_EXTRA2_VIDEO_ELEMENT_ID,1);break}},setVisibilityForMediaPlayMode:function(){if(this._contentInfo.getProfile().isAudio){$(this.getVideoPlayerElem()).css("width","0%");$(this.getVideoPlayerElem()).css("height","0%");$(VCVideoPlay.VIDEO_PLAYER_AUDIO_ID).show()}else{$(this.getVideoPlayerElem()).css("width","100%");$(this.getVideoPlayerElem()).css("height","100%");$(VCVideoPlay.VIDEO_PLAYER_AUDIO_ID).hide()}},initMainMediaFlash:function(a){this.createFlashVideo(a,VCVideoPlayDesktopFlash.MAIN_FLASH_ELEMENT_ID);this._mainMedia=document.getElementById(VCVideoPlayDesktopFlash.MAIN_FLASH_ELEMENT_ID);if(this._contentInfo.getProfile().isAudio){$(this._mainMedia).css("width","0%");$(this._mainMedia).css("height","0%")}else{$(this._mainMedia).css("width","100%");$(this._mainMedia).css("height","100%")}},initSubMediaFlash:function(a){this.createFlashVideo(a,VCVideoPlayDesktopFlash.SUB_FLASH_ELEMENT_ID);this._subMedia=document.getElementById(VCVideoPlayDesktopFlash.SUB_FLASH_ELEMENT_ID)},initExtraMediaFlash:function(a,b){switch(b){case 0:this.createFlashVideo(a,VCVideoPlayDesktopFlash.EXTRA_FLASH_ELEMENT_ID);this._extraMediaList[b]=document.getElementById(VCVideoPlayDesktopFlash.EXTRA_FLASH_ELEMENT_ID);break;case 1:this.createFlashVideo(a,VCVideoPlayDesktopFlash.EXTRA2_FLASH_ELEMENT_ID);this._extraMediaList[b]=document.getElementById(VCVideoPlayDesktopFlash.EXTRA2_FLASH_ELEMENT_ID);break}},createFlashVideo:function(j,h){var a="11.4.0";var d={};var e={};var i=uniPlayerConfig.getUniPlayerSettingsData().playerUri;var g=Util.urlMerge(i,"playerproductinstall.swf");e.quality="high";e.bgcolor="#000000";e.allowscriptaccess="always";e.allowfullscreen="true";e.wmode="transparent";var f={};f.id=h;f.name=h;f.align="middle";var b="100%";var k="100%";var c=Util.urlMerge(i,"flashvideofallback.swf");swfobject.embedSWF(c,j,b,k,a,g,d,e,f,this.callbackEmbedSWF);swfobject.createCSS(j,"display:block;text-align:left;")},callbackEmbedSWF:function(a){if(a.success==false){var b=uniPlayerConfig.getUniPlayerSettingsData().playerUri;document.location=Util.urlMerge(b,"downloadflashplayer.html")}},loadMedia:function(b,a){if(a.desktopMethod==MediaMethod.RTMP){var c=this.getRTMPMediaInfo(a.desktopMediaUri);b.fvLoad(MediaMethod.RTMP,c.serverUri,c.mediaUri);return}switch(a.flashFallbackMethod){case MediaMethod.PROGRESSIVE:case MediaMethod.PSEUDO:b.fvLoad(a.flashFallbackMethod,null,a.flashFallbackMediaUri);break;case MediaMethod.RTMP:var c=this.getRTMPMediaInfo(a.flashFallbackMediaUri);b.fvLoad(MediaMethod.RTMP,c.serverUri,c.mediaUri);break}},unloadMedia:function(b,a){switch(a.flashFallbackMethod){case MediaMethod.PROGRESSIVE:case MediaMethod.PSEUDO:b.fvLoad(a.flashFallbackMethod,null,null);break;case MediaMethod.RTMP:b.fvLoad(MediaMethod.RTMP,null,null);break}},getRTMPMediaInfo:function(a){var c=a.indexOf("mp4:");var d=a.substring(0,c);var b=a.substring(c+4);return{serverUri:d,mediaUri:b}},showVideoPlayer:function(){this.base();$videoPlayer=this.getVideoPlayerElem();$videoPlayer.show();$videoPlayer.css("visibility","visible");$videoPlayer.find(VCVideoPlayDesktopFlash.VIDEO_CONTAINER_CLASS).show()},hideVideoPlayer:function(){this.base();$videoPlayer=this.getVideoPlayerElem();$videoPlayer.hide();$videoPlayer.css("visibility","hidden");$videoPlayer.find(VCVideoPlayDesktopFlash.VIDEO_CONTAINER_CLASS).hide()},resizeVideoTags:function(){if(Util.isIE11embedFullScreen()){this.resizeVideoTagIE11Fullscreen()}else{if(this._mainMediaLoaded){this.resizeVideoTag(this._mainMedia)}if(this._subMediaLoaded&&this._subMedia){this.resizeVideoTag(this._subMedia)}if(this._extraMediaLoaded&&this._extraMediaList[0]){this.resizeVideoTag(this._extraMediaList[0])}if(this._extraMedia2Loaded&&this._extraMediaList[1]){this.resizeVideoTag(this._extraMediaList[1])}}},isNumber:function(a){return typeof a=="number"&&!isNaN(a)&&isFinite(a)},resizeVideoTag:function(d){var c=$(d).parent();var a=$(c).parent();var f=$(a).width();var e=$(a).height();var b=$(a).find(VCVideoPlay.VIDEO_BTNS_WRAPPER_CLASS);this.resizeVideoTagWithSize(d,f,e)},resizeVideoTagIE11Fullscreen:function(){switch(uniPlayerConfig.getMediaChannelConfig().getContentType()){case ContentType.VIDEO1:if(this._mainMediaLoaded){var d=$(window).innerWidth();var a=$(window).innerHeight();this.resizeVideoTagWithSize(this._mainMedia,d,a)}break;case ContentType.VIDEO2:if(this._mainMediaLoaded){var d=$(window).innerWidth()*this._mainMediaPercent/100;var a=$(window).innerHeight();this.resizeVideoTagWithSize(this._mainMedia,d,a)}if(this._subMediaLoaded){var b=$(window).innerWidth()*this._subMediaPercent/100;var e=$(window).innerHeight();this.resizeVideoTagWithSize(this._subMedia,b,e)}break;case ContentType.VIDEO3:if(this._mainMediaLoaded){var c=this.getVideo3ContainerSize(VideoType.MAIN_MEDIA);this.resizeVideoTagWithSize(this._mainMedia,c.width,c.height)}if(this._subMediaLoaded){var c=this.getVideo3ContainerSize(VideoType.SUB_MEDIA);this.resizeVideoTagWithSize(this._subMedia,c.width,c.height)}if(this._extraMediaLoaded){var c=this.getVideo3ContainerSize(VideoType.EXTRA_MEDIA);this.resizeVideoTagWithSize(this._extraMediaList[0],c.width,c.height)}if(this._extraMedia2Loaded){var c=this.getVideo3ContainerSize(VideoType.EXTRA_MEDIA);this.resizeVideoTagWithSize(this._extraMediaList[1],c.width,c.height)}break}},resizeVideoTagWithSize:function(c,k,l){var e=this.getVideoRatio(c);var j=videoPlayer.getVideoPlay();if(!this.isNumber(e)){setTimeout(function(){j.resizeVideoTag(c)},200);return}var h=$(c).parent();var f=k/l;var g,a,d,b;if(f>e){g=l*e;a=l;d=(k-g)/2;b=0}else{g=k;a=k/e;d=0;b=(l-a)/2}$(h).width(g);$(h).height(a);$(h).css("margin-left",d+"px");$(h).css("margin-top",b+"px");var i=$(h).parent().find(VCVideoPlay.VIDEO_BTNS_WRAPPER_CLASS);if(i){$(i).css("margin-left",d+"px");if($(i).hasClass(VCVideoPlay.BTN_BELOW_TOP_BAR)){if(uniPlayerConfig.getUniPlayerSettingsData().useTitle){b=(b>VCVideoPlay.METADATA_TOP_BAR_HEIGHT)?b:VCVideoPlay.METADATA_TOP_BAR_HEIGHT}}$(i).css("margin-top",b+"px");$(i).width(g)}},getVideoRatio:function(c){var a=c.getHeight();var b=c.getWidth();return b/a},setPlayerHeight:function(){var a="35px";if(videoPlayer.isHidePlayControllerMode()){a="0px"}$(VCVideoPlay.VIDEO_PLAY_WRAPPER_ID).css("bottom",a)},onFallbackReady:function(a){this._flashLoadCount++;if(this._totalMediaNumber!=this._flashLoadCount&&false==this._contentInfo.getProfile().isAudio){return}this.loadMedia(this._mainMedia,uniPlayerConfig.getMediaChannelConfig().getCurrentMainMedia());if(this._contentInfo.getProfile().isAudio){return}if(this._contentInfo.storyType!=ContentType.VIDEO1){this.loadMedia(this._subMedia,uniPlayerConfig.getMediaChannelConfig().getCurrentSubMedia());if(this._contentInfo.storyType!=ContentType.VIDEO2){for(var b=0;b=VCVideoPlayDesktopFlash.SYNC_BROKEN_INTERVAL)},play:function(){if(!this.isVideoSet()){return}if(!this._isWaiting){try{this._mainMedia.fvPlay()}catch(a){}if(this._subMedia){try{this._subMedia.fvPlay()}catch(a){}}if(this._extraMediaList[0]){try{this._extraMediaList[0].fvPlay()}catch(a){}}if(this._extraMediaList[1]){try{this._extraMediaList[1].fvPlay()}catch(a){}}}this._playCommandGiven=true},pause:function(){if(!this.isVideoSet()){return}try{this._mainMedia.fvPause()}catch(a){}if(this._subMedia){try{this._subMedia.fvPause()}catch(a){}}if(this._extraMediaList[0]){try{this._extraMediaList[0].fvPause()}catch(a){}}if(this._extraMediaList[1]){try{this._extraMediaList[1].fvPause()}catch(a){}}this._playCommandGiven=false},seekTo:function(a){if(!this.isVideoSet()){return}if(!this._isMetadataLoaded){this._currentTime=a;return}this._isSeeking=true;this._mainMedia.setCurrentTime(a);if(this._subMedia){this._subMedia.setCurrentTime(a)}if(this._extraMediaList[0]){this._extraMediaList[0].setCurrentTime(a)}if(this._extraMediaList[1]){this._extraMediaList[1].setCurrentTime(a)}this._eventTarget.fire(VCVideoPlayEvent.TIME_UPDATE,a);this.pauseForWaiting(true)},setPlaybackRate:function(a){},setVolume:function(a){if(this._mainMedia){this._mainMedia.setVolume(a)}},swapProfile:function(a){if(!this.base(a)){return}this._contentInfo.setProfile(a);this._currentTime=(this.isVideoSet())?this._mainMedia.getCurrentTime():0;this._isSwapping=true;this._metadataLoadCount=0;this._flashLoadCount=0;this._isMetadataLoaded=false;this._mainMediaLoaded=false;this._subMediaLoaded=false;this._extraMediaLoaded=false;this._extraMedia2Loaded=false;this.unloadMedia(this._mainMedia,uniPlayerConfig.getMediaChannelConfig().getCurrentMainMedia());if(this._subMedia){this.unloadMedia(this._subMedia,uniPlayerConfig.getMediaChannelConfig().getCurrentSubMedia());this._subMedia=null}if(this._extraMediaList[0]){this.unloadMedia(this._extraMediaList[0],uniPlayerConfig.getMediaChannelConfig().getCurrentExtraMedia(0));this._extraMediaList[0]=null}if(this._extraMediaList[1]){this.unloadMedia(this._extraMediaList[1],uniPlayerConfig.getMediaChannelConfig().getCurrentExtraMedia(1));this._extraMediaList[1]=null}this.clearVideoContainer();this.initControls();this._isFirstTime=true;this._isPlayable=true;this._eventTarget.fire(VCVideoPlayEvent.SWAPING)},getDuration:function(){if(!this._mainMedia){return 0}var b=0;try{b=this._mainMedia.getDuration()}catch(a){b=0}return b},getCurrentTime:function(){if(!this._mainMedia){return 0}var a=0;try{a=this._mainMedia.getCurrentTime()}catch(b){a=0}return a},getEntireVideoContainer:function(a){return this.getVideoPlayerElem(a).find(VCVideoPlayDesktopFlash.VIDEO_CONTAINER_CLASS)},pauseForWaiting:function(a){var b=videoPlayer.getVideoPlay();try{b._mainMedia.fvPause()}catch(c){}if(b._subMedia){try{b._subMedia.fvPause()}catch(c){}}if(b._extraMediaList[0]){try{b._extraMediaList[0].fvPause()}catch(c){}}if(b._extraMediaList[1]){try{b._extraMediaList[1].fvPause()}catch(c){}}b._isWaiting=true;b._isPlayable=false;if(a){b._eventTarget.fire(VCVideoPlayEvent.WAITING)}},releaseWaiting:function(){var a=videoPlayer.getVideoPlay();a._isWaiting=false;a._isPlayable=true;a._eventTarget.fire(VCVideoPlayEvent.PLAYING);if(a._playCommandGiven){try{a._mainMedia.fvPlay()}catch(b){}if(a._subMedia){try{a._subMedia.fvPlay()}catch(b){}}if(a._extraMediaList[0]){try{a._extraMediaList[0].fvPlay()}catch(b){}}if(a._extraMediaList[1]){try{a._extraMediaList[1].fvPlay()}catch(b){}}}},isVideoSet:function(){return(this._contentInfo.getProfile().isAudio&&this._mainMedia)||(this._totalMediaNumber==4&&this._mainMedia&&this._subMedia&&this._extraMediaList[0]&&this._extraMediaList[1])||(this._totalMediaNumber==3&&this._mainMedia&&this._subMedia&&this._extraMediaList[0])||(this._totalMediaNumber==2&&this._mainMedia&&this._subMedia)||(this._totalMediaNumber==1&&this._mainMedia)},isWaiting:function(){return this._isWaiting}},{VIDEO_CONTAINER_CLASS:".vc-vplay-container-flash-fallback",MAIN_VIDEO_CONTAINER_CLASS:".vc-vplay-video1-flash-fallback",SUB_VIDEO_CONTAINER_CLASS:".vc-vplay-video2-flash-fallback",EXTRA_VIDEO_CONTAINER_CLASS:".vc-vplay-video3-flash-fallback",EXTRA1_VIDEO_CONTAINER_CLASS:".vc-vplay-video3.vc-vplay-video3-flash-fallback",EXTRA2_VIDEO_CONTAINER_CLASS:".vc-vplay-video4.vc-vplay-video3-flash-fallback",VIDEO1_MAIN_VIDEO_ELEMENT_ID:"video1-main-flash-fallback",VIDEO2_MAIN_VIDEO_ELEMENT_ID:"video2-main-flash-fallback",VIDEO2_SUB_VIDEO_ELEMENT_ID:"video2-sub-flash-fallback",VIDEO3_MAIN_VIDEO_ELEMENT_ID:"video3-main-flash-fallback",VIDEO3_SUB_VIDEO_ELEMENT_ID:"video3-sub-flash-fallback",VIDEO3_EXTRA_VIDEO_ELEMENT_ID:"video3-extra-flash-fallback",VIDEO4_MAIN_VIDEO_ELEMENT_ID:"video4-main-flash-fallback",VIDEO4_SUB_VIDEO_ELEMENT_ID:"video4-sub-flash-fallback",VIDEO4_EXTRA_VIDEO_ELEMENT_ID:"video4-extra-flash-fallback",VIDEO4_EXTRA2_VIDEO_ELEMENT_ID:"video4-extra2-flash-fallback",MAIN_FLASH_ELEMENT_ID:"Fallback-video1",SUB_FLASH_ELEMENT_ID:"Fallback-video2",EXTRA_FLASH_ELEMENT_ID:"Fallback-video3",EXTRA2_FLASH_ELEMENT_ID:"Fallback-video4",SYNC_BROKEN_INTERVAL:0.5,NETSTREAM_PLAY_START:"NetStream.Play.Start",NETSTREAM_UNPAUSE_NOTIFY:"NetStream.Unpause.Notify",NETSTREAM_PAUSE_NOTIFY:"NetStream.Pause.Notify",NETSTREAM_BUFFER_FULL:"NetStream.Buffer.Full",NETSTREAM_BUFFER_FLUSH:"NetStream.Buffer.Flush",NETSTREAM_BUFFER_EMPTY:"NetStream.Buffer.Empty"});var VCVideoPlayEvent={METADATA_LOADED:"vplay_metadata_loaded",TIME_UPDATE:"vplay_time_update",READY_TO_PLAY:"vplay_ready_to_play",BUFFERED:"vplay_buffered",WAITING:"vplay_wating",PLAYING:"vplay_playing",ENDED:"vplay_ended",STATE_CHANGE:"vplay_state_change",ERROR:"vplay_error",SWAPING:"vplay_swaping",SWAPPED:"vplay_swapped",PLAYER_MOUSEMOVE:"vplay_mousemove",PLAYER_MOUSELEAVE:"vplay_mouseleave",CLICK_ENTIRE_AREA:"vplay_click_entire_area",PLAYER_AREA_TOUCHED:"vplay_player_area_touched",AUTO_PLAY_STARTED:"auto_play_started",LAYOUT_CHANGED:"vplay_layout_changed",RELOAD_PLAYER:"vplay_reload_plyaer",REMOVE_VIDEO:"vplay_remove_video",CHANGE_TO_FLASH:"vplay_change_to_flash"};var VCSyncDocPlay=VisualComponent.extend({_contentInfo:null,_slideListInfo:null,_eventList:null,_isFlash:false,_vcSyncDocSlide:null,_vcSyncDocSlideController:null,_playCommandGiven:false,_isLayoutAdjusting:false,_isMouseOverSeparator:false,_isMouseOverLayoutSetBox:false,_isSwapped:false,_swapTime:0,_layoutChangePoint:0,_mainMediaPercent:0,_mainMediaPercentForLayoutMove:0,_playbackRate:1,_eventTargetForVC:null,_layoutIndex:1,_isSyncMode:false,_contentsVerticalAlign:"center",initialize:function(a,c,b,d){this._contentInfo=a;this._slideListInfo=c;this._eventList=b;this._isSyncMode=d;this._contentsVerticalAlign=uniPlayerConfig.getUniPlayerSettingsData().contentsVerticalAlign;this._vcSyncDocSlide=new VCSlide();this._vcSyncDocSlideController=new VCSlideController();this.attachSyncDocPlayEvents();this.setPlayerHeight();if(skinManager.isDesktop()){this.initializeVideoSlidePosition()}},release:function(){this.getSlideVC().release();this.getSlideControllerVC().release();this.releaseSyncDocPlayEvents()},resetSlide:function(c){if(!this.getSlideVC()){return}this._isSyncMode=c;var a=this.getSlideVC()._currSlideId;var b=this.getSlideVC()._currImageIdx;this.getSlideVC().release();this._vcSyncDocSlide=new VCSlide();this.getSlideVC().addEventListener(this._eventTargetForVC);this.getSlideVC().initialize(this.getSyncDocPlayerElem(),this._slideListInfo,this._isSyncMode,a,b)},setSyncMode:function(a){this._isSyncMode=a;if(this.getSlideVC()){this.getSlideVC().setSyncMode(a)}if(this.getSlideControllerVC()){this.getSlideControllerVC().setSyncMode(a)}},attachSyncDocPlayEvents:function(){this._eventTargetForVC=new EventTargetArgs();this._eventTargetForVC.addListener(VCSlideEvent.INITIALIZED,this.onSlideInitialized);this._eventTargetForVC.addListener(VCSlideEvent.PAGE_CHANGED,this.onSlidePageChanged);this._eventTargetForVC.addListener(VCSlideControllerEvent.NEXT_PAGE,this.onSlideControllerNextPage);this._eventTargetForVC.addListener(VCSlideControllerEvent.PREV_PAGE,this.onSlideControllerPrevPage);this._eventTargetForVC.addListener(VCSlideControllerEvent.ZOOM_IN,this.onSlideControllerZoomIn);this._eventTargetForVC.addListener(VCSlideControllerEvent.ZOOM_OUT,this.onSlideControllerZoomOut);this._eventTargetForVC.addListener(VCSlideControllerEvent.FIT_TO_PAGE,this.onSlideControllerFitToPage);this._eventTargetForVC.addListener(VCSlideControllerEvent.FIT_TO_WIDTH,this.onSlideControllerFitToWidth);this._eventTargetForVC.addListener(VCSlideControllerEvent.SYNC_ON,this.onSlideControllerSyncOn);this._eventTargetForVC.addListener(VCSlideControllerEvent.SYNC_OFF,this.onSlideControllerSyncOff);if(skinManager.isMobile()){this.attachMobileEvents()}else{this.attachDesktopEvents()}},attachMobileEvents:function(){this.attachClickEvent(LayoutIdTable.UNI_PLAYER,this.onEntireAreaClicked,true);this.attachDownEvent(LayoutIdTable.SYNCDOC_PLAYER,this.onSyncDocAreaTouched)},attachDesktopEvents:function(){this.attachClickEvent(LayoutIdTable.UNI_PLAYER,this.onEntireAreaClicked);this.attachMouseEvents();switch(this._contentInfo.storyType){case ContentType.SYNCVIDEO:this.attachUserLayoutChangeEvent();this.attachLayoutButtonEvents();this.attachLayoutSwapButtonEvents();break;case ContentType.SYNCAUDIO:break}},attachMouseEvents:function(){$(LayoutIdTable.UNI_PLAYER).bind("mousemove",this.onPlayerMouseMove);$(LayoutIdTable.UNI_PLAYER).bind("mouseleave",this.onPlayerMouseLeave);$syncDocPlayer=this.getSyncDocPlayerElem();$syncDocPlayer.find(VCSyncDocPlay.SYNCDOC_SEPARATOR_CLASS).bind("mouseover",this.onSyncDocSeparatorOver);$syncDocPlayer.find(VCSyncDocPlay.SYNCDOC_SEPARATOR_CLASS).bind("mouseleave",this.onSyncDocSeparatorLeave);$syncDocPlayer.find(VCSyncDocPlay.SYNCDOC_LAYOUT_SETBOX_CLASS).bind("mouseover",this.onSyncDocLayoutSetBoxOver);$syncDocPlayer.find(VCSyncDocPlay.SYNCDOC_LAYOUT_SETBOX_CLASS).bind("mouseleave",this.onSyncDocLayoutSetBoxLeave)},attachUserLayoutChangeEvent:function(){this.attachDownEvent(LayoutIdTable.SYNCDOC_PLAYER,this.onSyncDocPlayDown)},attachLayoutButtonEvents:function(){for(var a=1;a<=VCSyncDocPlay.NUM_OF_LAYOUT;a++){var b=this.getLayoutBtnName(a);this.attachClickEvent("#"+b,this.onLayoutBtnClick)}},attachLayoutSwapButtonEvents:function(){this.attachClickEvent(VCSyncDocPlay.LAYOUT_SWAP_BTN_ID,this.swapVideoSlide)},releaseSyncDocPlayEvents:function(){if(skinManager.isMobile()){this.releaseMobileEvents()}else{this.releaseDesktopEvents()}},releaseMobileEvents:function(){this.detachClickEvent(LayoutIdTable.UNI_PLAYER,this.onEntireAreaClicked);this.detachDownEvent(LayoutIdTable.SYNCDOC_PLAYER,this.onSyncDocAreaTouched)},releaseDesktopEvents:function(){this.detachClickEvent(LayoutIdTable.UNI_PLAYER,this.onEntireAreaClicked);this.releaseMouseEvents();switch(this._contentInfo.storyType){case ContentType.SYNCVIDEO:this.releaseUserLayoutChangeEvent();this.releaseLayoutButtonEvents();this.releaseLayoutSwapButtonEvents();break;case ContentType.SYNCAUDIO:break}},releaseMouseEvents:function(){$(LayoutIdTable.UNI_PLAYER).unbind("mousemove",this.onPlayerMouseMove);$(LayoutIdTable.UNI_PLAYER).unbind("mouseleave",this.onPlayerMouseLeave);$syncDocPlayer=this.getSyncDocPlayerElem();$syncDocPlayer.find(VCSyncDocPlay.SYNCDOC_SEPARATOR_CLASS).unbind("mouseover",this.onSyncDocSeparatorOver);$syncDocPlayer.find(VCSyncDocPlay.SYNCDOC_SEPARATOR_CLASS).unbind("mouseleave",this.onSyncDocSeparatorLeave);$syncDocPlayer.find(VCSyncDocPlay.SYNCDOC_LAYOUT_SETBOX_CLASS).unbind("mouseover",this.onSyncDocLayoutSetBoxOver);$syncDocPlayer.find(VCSyncDocPlay.SYNCDOC_LAYOUT_SETBOX_CLASS).unbind("mouseleave",this.onSyncDocLayoutSetBoxLeave)},releaseUserLayoutChangeEvent:function(){this.detachDownEvent(LayoutIdTable.SYNCDOC_PLAYER,this.onSyncDocPlayDown)},releaseLayoutButtonEvents:function(){for(var a=1;a<=VCSyncDocPlay.NUM_OF_LAYOUT;a++){var b=this.getLayoutBtnName(a);this.detachClickEvent("#"+b,this.onLayoutBtnClick)}},releaseLayoutSwapButtonEvents:function(){this.detachClickEvent(VCSyncDocPlay.LAYOUT_SWAP_BTN_ID,this.swapVideoSlide)},showSyncDocPlayer:function(){$(LayoutIdTable.SYNCDOC_PLAYER).show();$syncDocPlayer=this.getSyncDocPlayerElem();$syncDocPlayer.show();$syncDocPlayer.css("visibility","visible");this.getSlideVC().showSlide()},hideSyncDocPlayer:function(){$(LayoutIdTable.SYNCDOC_PLAYER).hide();$syncDocPlayer=this.getSyncDocPlayerElem();$syncDocPlayer.hide();$syncDocPlayer.css("visibility","hidden");this.getSlideVC().hideSlide()},resize:function(){var a=syncDocPlayer.getSyncDocPlay();a.setPlayerHeight();a.setSyncDocSeparator();var d=$(VCSyncDocPlay.SLIDE_CONTAINER_CLASS);if((100-a._mainMediaPercent)<0.1){d.hide()}else{d.show()}if(Util.isIE11embedFullScreen()){switch(a._contentInfo.storyType){case ContentType.SYNCVIDEO:var c;if(a._contentInfo.getProfile().isAudio){c=$(window).innerWidth()}else{c=$(window).innerWidth()*(100-a._mainMediaPercent)/100}var b=$(window).innerHeight();a.getSlideVC().resizeWithSize(c,b);break;case ContentType.SYNCAUDIO:var c=$(window).innerWidth();var b=$(window).innerHeight();a.getSlideVC().resizeWithSize(c,b);break}}else{a.getSlideVC().resize();a.getSlideControllerVC().resize()}},setPlayerHeight:function(){if(!skinManager.isMobile()){var b=35;if(syncDocPlayer.isHidePlayControllerMode()){b=0}$(VCSyncDocPlay.SYNCDOC_PLAY_WRAPPER_ID).css("bottom",b.toString()+"px");if(skinManager.isIE7()){var a=$(LayoutIdTable.SYNCDOC_PLAYER).height()-b;$(VCSyncDocPlay.SYNCDOC_PLAY_WRAPPER_ID).height(a)}}},setLayoutIndex:function(a){this._layoutIndex=a-1;this.setDesktopLayout()},setDesktopLayout:function(e){if(this._contentInfo.storyType!=ContentType.SYNCVIDEO){return}var d,b;if(e){d=e._mainMediaWidth;b=e._subMediaWidth;if(e._isSwapped&&!(this._isSwapped)){this.swapVideoSlide()}}else{var c=uniPlayerConfig.getLayoutList(ContentType.SYNCVIDEO)[this._layoutIndex];d=c.getMainMediaWidth();b=c.getSubMediaWidth();if(this._isSwapped){var a=b;b=d;d=a}}if(skinManager.isIE7()){d=d-0.01;b=b-0.01}this._mainMediaPercent=d;d="{0}%".format(d);b="{0}%".format(b);$syncDocPlayer=this.getSyncDocPlayerElem();$syncDocPlayer.find(VCSyncDocPlay.MAIN_VIDEO_CONTAINER_CLASS).css("width",d);$syncDocPlayer.find(VCSyncDocPlay.SLIDE_CONTAINER_CLASS).css("width",b);if(this._isFlash){this.getVideoVC().setFlashVisible()}this.resize();this.fireLayoutChangeEvent(this._isSwapped,this._mainMediaPercent,100-this._mainMediaPercent)},swapVideoSlide:function(){var e=syncDocPlayer.getSyncDocPlay();var d,b,f,c,a;e._isSwapped=!e._isSwapped;if(e._isSwapped){d=VCSyncDocPlay.MAIN_VIDEO_CONTAINER_CLASS;b=VCSyncDocPlay.SLIDE_CONTAINER_CLASS;a="right";f=100-e._mainMediaPercent;c=e._mainMediaPercent}else{d=VCSyncDocPlay.SLIDE_CONTAINER_CLASS;b=VCSyncDocPlay.MAIN_VIDEO_CONTAINER_CLASS;a="left";f=e._mainMediaPercent;c=100-e._mainMediaPercent}e._mainMediaPercent=100-e._mainMediaPercent;$syncDocPlayer=e.getSyncDocPlayerElem();$syncDocPlayer.find(d).css("float",a);$syncDocPlayer.find(b).css("float",a);$syncDocPlayer.find(d).css("width","{0}%".format(f));$syncDocPlayer.find(b).css("width","{0}%".format(c));if(e._isFlash){e.getVideoVC().setFlashVisible()}e.resize();e.fireLayoutChangeEvent(e._isSwapped,e._mainMediaPercent,100-e._mainMediaPercent)},initializeVideoSlidePosition:function(){$syncDocPlayer=this.getSyncDocPlayerElem();var c=VCSyncDocPlay.MAIN_VIDEO_CONTAINER_CLASS;var b=VCSyncDocPlay.SLIDE_CONTAINER_CLASS;var a="left";$syncDocPlayer.find(c).css("float",a);$syncDocPlayer.find(b).css("float",a)},getLayoutBtnName:function(a){return VCSyncDocPlay.LAYOUT_BTN_ID+a.toString()},getIdxFromLayoutBtnId:function(a){return Number(a.replace(VCSyncDocPlay.LAYOUT_BTN_ID,""))},getVideoVC:function(){},getSlideVC:function(){return this._vcSyncDocSlide},getSlideControllerVC:function(){return this._vcSyncDocSlideController},getNotePanel:function(){$syncDocPlayer=this.getSyncDocPlayerElem();return $syncDocPlayer.find(VCSyncDocPlay.NOTE_PANEL_CLASS).get(0)},getSlideElement:function(){return syncDocPlayer.getSyncDocPlay().getSlideVC().getCurrentSlideElement()},getCurrentTime:function(){},getDocPlayerMode:function(){if(this.getSlideVC()){return this.getSlideVC().getDocPlayerMode()}},setSyncDocSeparator:function(){if(this.isSingleLayout()){this.hideSyncDocSeparator();return}var b;var c=$(LayoutIdTable.UNI_PLAYER_CONTENT_PLAYER).innerWidth();if(Util.isIE11embedFullScreen()){c=$(window).innerWidth()}if(this._isSwapped){b=(100-this._mainMediaPercent)/100*c}else{b=this._mainMediaPercent/100*c}var e;if(uniPlayer.getIsFullScreen()){e=$(window).innerHeight()}else{e=$(LayoutIdTable.SYNCDOC_PLAYER).height()}var a=52;var d=80;$syncDocPlayer=this.getSyncDocPlayerElem();$syncDocPlayer.find(VCSyncDocPlay.SYNCDOC_SEPARATOR_CLASS).css("left",b-a/2);$syncDocPlayer.find(VCSyncDocPlay.SYNCDOC_SEPARATOR_CLASS).css("top",(e-d)/2)},gotoSlide:function(b,a){var c=syncDocPlayer.getSyncDocPlay();c.getSlideVC().gotoSlide(b,a);c.getSlideControllerVC(c.getSlideVC().getCurrPageNum())},swapProfile:function(a){if(!this._contentInfo){return false}var c=this._contentInfo.profileList;var b=this._contentInfo.getCurrentMainMedia();if(c[b.profileId].name==a){return false}return true},onEntireAreaClicked:function(){var a=syncDocPlayer.getSyncDocPlay();a._eventTarget.fire(VCSyncDocPlayEvent.CLICK_ENTIRE_AREA)},onSyncDocAreaTouched:function(){var a=syncDocPlayer.getSyncDocPlay();a._eventTarget.fire(VCSyncDocPlayEvent.PLAYER_AREA_TOUCHED)},onPlayerMouseMove:function(){var a=syncDocPlayer.getSyncDocPlay();a.showSyncDocLayoutSetElements();a._eventTarget.fire(VCSyncDocPlayEvent.PLAYER_MOUSEMOVE)},onPlayerMouseLeave:function(){var a=syncDocPlayer.getSyncDocPlay();a.hideSyncDocLayoutSetElements();a._eventTarget.fire(VCSyncDocPlayEvent.PLAYER_MOUSELEAVE)},onLayoutBtnClick:function(c){var b=syncDocPlayer.getSyncDocPlay();var a=b.getIdxFromLayoutBtnId($(this).attr("id"));b.setLayoutIndex(a)},onSyncDocSeparatorOver:function(){syncDocPlayer.getSyncDocPlay()._isMouseOverSeparator=true},onSyncDocSeparatorLeave:function(){syncDocPlayer.getSyncDocPlay()._isMouseOverSeparator=false},onSyncDocLayoutSetBoxOver:function(){syncDocPlayer.getSyncDocPlay()._isMouseOverLayoutSetBox=true},onSyncDocLayoutSetBoxLeave:function(){syncDocPlayer.getSyncDocPlay()._isMouseOverLayoutSetBox=false},showSyncDocLayoutSetElements:function(){var a=syncDocPlayer.getSyncDocPlay();if(a._contentInfo.getProfile()){if(a._contentInfo.getProfile().isAudio){return}}a.showSyncBtn();a.showSyncDocSeparator();a.showLayoutSetBox()},hideSyncDocLayoutSetElements:function(){var a=syncDocPlayer.getSyncDocPlay();a.hideSyncBtn();a.hideSyncDocSeparator();a.hideLayoutSetBox()},showSyncBtn:function(){if(this.getSlideControllerVC()){this.getSlideControllerVC().showSyncBtn()}},hideSyncBtn:function(){if(this.getSlideControllerVC()){this.getSlideControllerVC().hideSyncBtn()}},showSyncDocSeparator:function(){if(this.isSingleLayout()){this.hideSyncDocSeparator();return}$syncDocPlayer=this.getSyncDocPlayerElem();$syncDocPlayer.find(VCSyncDocPlay.SYNCDOC_SEPARATOR_CLASS).show()},hideSyncDocSeparator:function(){$syncDocPlayer=this.getSyncDocPlayerElem();$syncDocPlayer.find(VCSyncDocPlay.SYNCDOC_SEPARATOR_CLASS).hide()},showLayoutSetBox:function(){if(this._contentInfo==null){return}if(this._contentInfo.storyType==ContentType.SYNCVIDEO){$syncDocPlayer=this.getSyncDocPlayerElem();$syncDocPlayer.find(VCSyncDocPlay.SYNCDOC_LAYOUT_SETBOX_CLASS).show()}},hideLayoutSetBox:function(){$syncDocPlayer=this.getSyncDocPlayerElem();$syncDocPlayer.find(VCSyncDocPlay.SYNCDOC_LAYOUT_SETBOX_CLASS).hide()},showSyncDocTouchMask:function(){$syncDocPlayer=this.getSyncDocPlayerElem();$syncDocPlayer.find(VCSyncDocPlay.TOUCH_MASK_WRAPPER_CLASS).show()},hideSyncDocTouchMask:function(){$syncDocPlayer=this.getSyncDocPlayerElem();$syncDocPlayer.find(VCSyncDocPlay.TOUCH_MASK_WRAPPER_CLASS).hide()},isSingleLayout:function(){var a=syncDocPlayer.getSyncDocPlay();var b=false;if(a._contentInfo.getProfile()){var b=a._contentInfo.getProfile().isAudio}return(b||a._mainMediaPercent<0.1||a._mainMediaPercent>99.9)},onSyncDocPlayDown:function(b){if($(b.target).attr("class")==VCSyncDocPlay.LAYOUT_BTN_CLASS){return}var a=syncDocPlayer.getSyncDocPlay();if(a.isSingleLayout()){return}if(!a._isSyncMode&&!a.isPointInSideVideo(b)){return}a._layoutChangePoint=b.clientX;a._isLayoutAdjusting=true;a._mainMediaPercentForLayoutMove=a._mainMediaPercent;if(skinManager.isLowIE()){a.attachMoveEvent(window.document,a.onSyncDocPlayMove);a.attachEndEvent(window.document,a.onSyncDocPlayMoveEnd)}else{a.attachMoveEvent(window,a.onSyncDocPlayMove);a.attachEndEvent(window,a.onSyncDocPlayMoveEnd)}},isPointInSideVideo:function(g){var a=Util.getClientX(g);var i=Util.getClientY(g);var d=$(VCSyncDocPlay.MAIN_VIDEO_CONTAINER_CLASS);var f=d.offset().left;var h=f+d.width();var b=d.offset().top;var c=b+d.height();return(a>=f&&a<=h&&i>=b&&i<=c)},onSyncDocPlayMove:function(g){var c=syncDocPlayer.getSyncDocPlay();if(!c._isLayoutAdjusting){return}var f=$(window).innerWidth();var d=(g.clientX-c._layoutChangePoint)/f*100;var b,a;if(c._isSwapped){b=c._mainMediaPercentForLayoutMove-d;a=100-b}else{b=c._mainMediaPercentForLayoutMove+d;a=100-b}if(b>VCSyncDocPlay.MIN_SYNCDOC_WIDTH){b=VCSyncDocPlay.MIN_SYNCDOC_WIDTH;a=100-VCSyncDocPlay.MIN_SYNCDOC_WIDTH}else{if(a>VCSyncDocPlay.MIN_SYNCDOC_WIDTH){b=100-VCSyncDocPlay.MIN_SYNCDOC_WIDTH;a=VCSyncDocPlay.MIN_SYNCDOC_WIDTH}}c._mainMediaPercent=b;$(VCSyncDocPlay.MAIN_VIDEO_CONTAINER_CLASS).css("width",b+"%");$(VCSyncDocPlay.SLIDE_CONTAINER_CLASS).css("width",a+"%");c.setSyncDocSeparator();c.resize();c.fireLayoutChangeEvent(c._isSwapped,c._mainMediaPercent,100-c._mainMediaPercent)},onSyncDocPlayMoveEnd:function(b){var a=syncDocPlayer.getSyncDocPlay();a._mainMediaPercent=($(VCSyncDocPlay.MAIN_VIDEO_CONTAINER_CLASS).width()/$(LayoutIdTable.SYNCDOC_PLAYER).width())*100;a._isLayoutAdjusting=false;if(skinManager.isLowIE()){a.detachMoveEvent(window.document,a.onSyncDocPlayMove);a.detachEndEvent(window.document,a.onSyncDocPlayMoveEnd)}else{a.detachMoveEvent(window,a.onSyncDocPlayMove);a.detachEndEvent(window,a.onSyncDocPlayMoveEnd)}},onSlideInitialized:function(f,b){var d=syncDocPlayer.getSyncDocPlay();var c=b[0];var a=b[1];d.getSlideControllerVC().setTotalPage(c);d.getSlideControllerVC().setCurrPage(a);d._eventTarget.fire(VCSyncDocPlayEvent.SLIDE_READY)},onSlidePageChanged:function(c,b){var a=syncDocPlayer.getSyncDocPlay();a.getSlideControllerVC().setCurrPage(b)},onSlideControllerSyncOn:function(b){var a=syncDocPlayer.getSyncDocPlay();a._eventTarget.fire(VCSyncDocPlayEvent.SLIDE_SYNC_ON)},onSlideControllerSyncOff:function(b){var a=syncDocPlayer.getSyncDocPlay();a._eventTarget.fire(VCSyncDocPlayEvent.SLIDE_SYNC_OFF)},onSlideControllerNextPage:function(b){var a=syncDocPlayer.getSyncDocPlay();a.getSlideVC().nextPage();a.getSlideControllerVC().setCurrPage(a.getSlideVC().getCurrPageNum())},onSlideControllerPrevPage:function(b){var a=syncDocPlayer.getSyncDocPlay();a.getSlideVC().prevPage();a.getSlideControllerVC().setCurrPage(a.getSlideVC().getCurrPageNum())},onSlideControllerZoomIn:function(b){var a=syncDocPlayer.getSyncDocPlay();a.getSlideVC().zoomIn()},onSlideControllerZoomOut:function(b){var a=syncDocPlayer.getSyncDocPlay();a.getSlideVC().zoomOut()},onSlideControllerFitToPage:function(b){var a=syncDocPlayer.getSyncDocPlay();a.getSlideVC().setScale(DocScaleValue.FIT_TO_SCALE)},onSlideControllerFitToWidth:function(b){var a=syncDocPlayer.getSyncDocPlay();a.getSlideVC().setScale(DocScaleValue.FIT_TO_WIDTH)},getSyncDocPlayerElem:function(){var a=this._contentInfo.storyType;switch(a){case ContentType.SYNCVIDEO:return $(VCSyncDocPlay.SYNC_VIDEO_PLAYER_ID);case ContentType.SYNCAUDIO:return $(VCSyncDocPlay.SYNC_AUDIO_PLAYER_ID)}return null},isLayoutAdjusting:function(){return this._isLayoutAdjusting},isMouseOverSeparator:function(){return this._isMouseOverSeparator},isMouseOverLayoutSetBox:function(){return this._isMouseOverLayoutSetBox},isPlayCommandGiven:function(){return this._playCommandGiven},fireLayoutChangeEvent:function(a,c,b){if(this._eventTarget){this._eventTarget.fire(VCSyncDocPlayEvent.LAYOUT_CHANGED,new LayoutSettingData(a,c,b))}}},{SYNC_VIDEO_PLAYER_ID:"#syncvideo-play",SYNC_AUDIO_PLAYER_ID:"#syncaudio-play",SYNCDOC_PLAY_WRAPPER_ID:"#syncdoc-play-wrapper",NOTE_PANEL_CLASS:".vc-sdplay-note",MAIN_VIDEO_CONTAINER_CLASS:".vc-sdplay-video",SLIDE_CONTAINER_CLASS:".vc-sdplay-slide",SYNCDOC_SEPARATOR_CLASS:".vc-sdplay-separator",SYNCDOC_LAYOUT_SETBOX_CLASS:".vc-sdplay-layout-set-box",TOUCH_MASK_WRAPPER_CLASS:".vc-sdplay-video-touch-mask-wrapper",LAYOUT_BTN_ID:"vc-sdplay-layout-",LAYOUT_BTN_CLASS:"vc-sdplay-layout-btn",LAYOUT_SWAP_BTN_ID:"#vc-sdplay-layout-swap",NUM_OF_LAYOUT:4,MIN_SYNCDOC_WIDTH:80});var VCSyncDocPlayEvent={VIDEO_METADATA_LOADED:"vsdp_video_metadata_loaded",VIDEO_READY_TO_PLAY:"vsdp_video_ready_to_play",VIDEO_TIME_UPDATE:"vsdp_video_time_update",VIDEO_SEEKING:"vsdp_video_seeking",VIDEO_SEEKED:"vsdp_video_seeked",VIDEO_BUFFERED:"vsdp_video_buffered",VIDEO_STATE_CHANGE:"vsdp_video_state_changed",VIDEO_ENDED:"vsdp_video_ended",AUDIO_METADATA_LOADED:"vsdp_audio_metadata_loaded",AUDIO_READY_TO_PLAY:"vsdp_audio_ready_to_play",AUDIO_TIME_UPDATE:"vsdp_audio_time_update",AUDIO_SEEKING:"vsdp_audio_seeking",AUDIO_SEEKED:"vsdp_audio_seeked",AUDIO_BUFFERED:"vsdp_audio_buffered",AUDIO_STATE_CHANGE:"vsdp_audio_state_changed",AUDIO_ENDED:"vsdp_audio_ended",METADATA_LOADED:"vsdp_metadata_loaded",READY_TO_PLAY:"vsdp_ready_to_play",TIME_UPDATE:"vsdp_time_update",SEEKING:"vsdp_seeking",SEEKED:"vsdp_seeked",BUFFERED:"vsdp_buffered",SWAPPING:"swapping",SWAPPED:"swapped",ENDED:"ended",SLIDE_READY:"vsdp_slide_ready",SLIDE_SYNC_ON:"vsdp_slide_sync_on",SLIDE_SYNC_OFF:"vsdp_slide_sync_off",STATE_CHANGE:"vsdp_state_change",PLAYER_MOUSEMOVE:"vsdp_mousemove",PLAYER_MOUSELEAVE:"vsdp_mouseleave",CLICK_ENTIRE_AREA:"vsdp_click_entire_area",PLAYER_AREA_TOUCHED:"vsdp_player_area_touched",LAYOUT_CHANGED:"vsdp_layout_changed",CHANGE_TO_FLASH:"vsdp_change_to_flash"};var VCSyncDocVideoPlayDesktop=VCSyncDocPlay.extend({_vcSyncDocVideo:null,_vcSyncDocAudio:null,initialize:function(a,c,b,d){this.base(a,c,b,d);if(skinManager.isNeedFlashFallback()||uniPlayerConfig.getMediaChannelConfig().useRTMPStreaming()||(uniPlayerConfig.getMediaChannelConfig().useHLSStreaming()&&true!=skinManager.isHlsSupported())){this._isFlash=true;this._vcSyncDocVideo=new VCSyncDocVideoFlash();this._vcSyncDocAudio=this._vcSyncDocVideo}else{this._vcSyncDocVideo=new VCSyncDocVideo();this._vcSyncDocAudio=new VCSyncDocAudio()}this.attachEvents();this.initControls()},release:function(){this.base();this.getVideoVC().release();this.getAudioVC().release()},resize:function(){this.base();var a=syncDocPlayer.getSyncDocPlay();this.getVideoVC().resizeVideoTag();this.setVerticalAlign();noteManager.resize()},setVerticalAlign:function(){if(this._contentsVerticalAlign==ContentsVerticalAlign.TOP){var c=(skinManager.isNeedFlashFallback())?("#"+VCSyncDocVideoFlash.VIDEO_FLASH_ELEMENT_ID):VCSyncDocVideo.VIDEO_CLASS_NAME;var b=parseInt($(VCSlide.SLIDE_CONTAINER_CLASS).css("margin-top"));var a=parseInt($(c).css("margin-top"));if(a>b){$(c).css("margin-top",b+"px")}else{$(VCSlide.SLIDE_CONTAINER_CLASS).css("margin-top",a+"px")}}},attachEvents:function(){this._eventTargetForVC.addListener(VCSyncDocPlayEvent.VIDEO_METADATA_LOADED,this.onMediaMetadataLoaded);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.VIDEO_READY_TO_PLAY,this.onMediaReadyToPlay);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.VIDEO_STATE_CHANGE,this.onStateChange);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.VIDEO_TIME_UPDATE,this.onMediaTimeUpdate);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.VIDEO_SEEKING,this.onSeeking);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.VIDEO_SEEKED,this.onSeeked);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.VIDEO_BUFFERED,this.onBuffered);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.VIDEO_ENDED,this.onEnded);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.CHANGE_TO_FLASH,this.onChangeToFlash);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_METADATA_LOADED,this.onMediaMetadataLoaded);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_READY_TO_PLAY,this.onMediaReadyToPlay);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_STATE_CHANGE,this.onStateChange);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_TIME_UPDATE,this.onMediaTimeUpdate);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_SEEKING,this.onSeeking);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_SEEKED,this.onSeeked);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_BUFFERED,this.onBuffered);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_ENDED,this.onEnded)},initControls:function(){this.getVideoVC().initialize(this._contentInfo);this.getVideoVC().addEventListener(this._eventTargetForVC);this.getAudioVC().initialize(this._contentInfo);this.getAudioVC().addEventListener(this._eventTargetForVC);this.getSlideVC().addEventListener(this._eventTargetForVC);this.getSlideVC().initialize(this.getSyncDocPlayerElem(),this._slideListInfo,this._isSyncMode);this.getSlideControllerVC().addEventListener(this._eventTargetForVC);this.getSlideControllerVC().initialize(this.getSyncDocPlayerElem(),this._isSyncMode);this.initMedia(0,true);this.setVisibilityForMediaPlayMode()},initMedia:function(c,b){var a=this._contentInfo.getProfile().isAudio;if(a){this.getVideoVC().releaseMedia();this.getAudioVC().initMedia(c,b)}else{this.getAudioVC().releaseMedia();this.getVideoVC().initMedia(c,b)}},setVisibilityForMediaPlayMode:function(){var a=this._contentInfo.getProfile().isAudio;if(a){this.hideSyncDocLayoutSetElements();$(VCSyncDocPlay.MAIN_VIDEO_CONTAINER_CLASS).css("width","0%");$(VCSyncDocPlay.SLIDE_CONTAINER_CLASS).css("width","100%")}else{this.setDesktopLayout(syncDocPlayer.getLayoutSettingData())}this.resize()},showSyncDocPlayer:function(){this.base();this.getVideoVC().showVideo()},hideSyncDocPlayer:function(){this.base();this.getVideoVC().hideVideo()},onMediaMetadataLoaded:function(c,b){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.METADATA_LOADED,b)}},onMediaReadyToPlay:function(b){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.READY_TO_PLAY)}if(a._isSwapping){a.videoSwapped()}},onStateChange:function(c,b){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.STATE_CHANGE,b)}},onSeeking:function(){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.SEEKING)}},onSeeked:function(){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.SEEKED)}},onBuffered:function(c,a){var b=syncDocPlayer.getSyncDocPlay();if(b._eventTarget){b._eventTarget.fire(VCSyncDocPlayEvent.BUFFERED,a)}},onEnded:function(b){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.ENDED)}},onChangeToFlash:function(b){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.CHANGE_TO_FLASH)}},onMediaTimeUpdate:function(c,b){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.TIME_UPDATE,b)}},videoSwapped:function(){this._eventTarget.fire(VCSyncDocPlayEvent.SWAPPED);this._isSwapping=false;if(this._playCommandGiven){this.getCurrentMedia().play()}if(this._contentInfo.getProfile().isAudio){this.getAudioVC().seekTo(this._swapTime)}else{this.getVideoVC().seekTo(this._swapTime)}},play:function(){this._playCommandGiven=true;this.getCurrentMedia().play()},pause:function(){this._playCommandGiven=false;this.getCurrentMedia().pause()},seekTo:function(a){this.getCurrentMedia().seekTo(a)},setPlaybackRate:function(a){this._playbackRate=a;if(uniPlayerConfig.getUniPlayerSettingsData().usePlaybackRate&&!skinManager.isNeedFlashFallback()){this.changePlaybackRate()}},changePlaybackRate:function(){if(this._contentInfo.getProfile().isAudio){this.getAudioVC().setAudioPlaybackRate(this._playbackRate)}else{this.getVideoVC().setVideoPlaybackRate(this._playbackRate)}},swapProfile:function(a){if(!this.base(a)){return}var c=this.getCurrentMedia()?this.getCurrentMedia().getCurrentTime():0;this._swapTime=c;this._contentInfo.setProfile(a);if(this._isFlash){var b=this.getVideoVC();b._isFirstTime=true;b._isMetadataLoaded=false;b.releaseMedia();b.clearVideoContainer();b.initMedia(c,true)}else{this.initMedia(c,true)}this.setVisibilityForMediaPlayMode();this._mediaReadyToPlayCount=0;this._isSwapping=true;this._eventTarget.fire(VCSyncDocPlayEvent.SWAPPING)},setVolume:function(a){this.getCurrentMedia().setVolume(a)},getCurrentMedia:function(){if(this._contentInfo.getProfile().isAudio){return this._vcSyncDocAudio}else{return this._vcSyncDocVideo}},getAudioVC:function(){return this._vcSyncDocAudio},getVideoVC:function(){return this._vcSyncDocVideo},getCurrentTime:function(){if(this._contentInfo.getProfile().isAudio){if(this.getAudioVC().isAudioSet()){return this.getAudioVC().getCurrentTime()}}else{if(this.getVideoVC().isVideoSet()){return this.getVideoVC().getCurrentTime()}}return 0},onFallbackReady:function(a){syncDocPlayer.getSyncDocPlay().getVideoVC().onFallbackReady(a)},onMetadataLoaded:function(a){syncDocPlayer.getSyncDocPlay().getVideoVC().onMetadataLoaded(a)},onStatusChange:function(a,b){syncDocPlayer.getSyncDocPlay().getVideoVC().onStatusChange(a,b)},onTimeUpdate:function(a,b){syncDocPlayer.getSyncDocPlay().getVideoVC().onTimeUpdate(a,b)}});var VCSyncDocVideoPlayMobile=VCSyncDocPlay.extend({_contentInfo:null,_slideListInfo:null,_eventList:null,_isAudioPlayingMode:false,_playMode:null,_syncDocVideo:null,_syncDocAudio:null,_loadedCallback:null,_mainMediaPercent:0,_mainMediaPercentForLayoutMove:0,_isLayoutAdjusting:false,_layoutChangePoint:0,_isSwapping:false,_eventTargetForVC:null,constructor:function(){this.base();this._syncDocVideo=new VCSyncDocVideo();this._syncDocAudio=new VCSyncDocAudio()},initialize:function(a,c,b,d){this.base(a,c,b,d);this.initControls();this.attachEvents()},release:function(){this.base();this.getVideoVC().release();this.getAudioVC().release()},resize:function(){this.base();noteManager.resize()},unload:function(){this.base();this.getVideoVC().unload();this.getAudioVC().unload()},initControls:function(){if(skinManager.isIPhoneOrIPod()){$(".vc-sdvplay-video-touch-mask-wrapper").hide()}this.getVideoVC().addEventListener(this._eventTargetForVC);this.getVideoVC().initialize(this._contentInfo);this.getAudioVC().addEventListener(this._eventTargetForVC);this.getAudioVC().initialize(this._contentInfo);this.getSlideVC().addEventListener(this._eventTargetForVC);this.getSlideVC().initialize(this.getSyncDocPlayerElem(),this._slideListInfo,this._isSyncMode);this.getSlideControllerVC().addEventListener(this._eventTargetForVC);this.getSlideControllerVC().initialize(this.getSyncDocPlayerElem(),this._isSyncMode);this.setCurrentPlayingMode()},setCurrentPlayingMode:function(){if(!this._playMode){this._playMode=SyncVideoMobilePlayMode.SLIDE}this._isAudioPlayingMode=(this._playMode==SyncVideoMobilePlayMode.SLIDE||this._contentInfo.getProfile().isAudio);if(!this._isAudioPlayingMode){$(VCSyncDocVideoPlayMobile.SLIDE_AREA_CLASS).hide();$(VCSyncDocVideoPlayMobile.VIDEO_AREA_CLASS).show()}else{$(VCSyncDocVideoPlayMobile.SLIDE_AREA_CLASS).show();$(VCSyncDocVideoPlayMobile.VIDEO_AREA_CLASS).hide();this.resize()}},attachEvents:function(){this._eventTargetForVC.addListener(VCSyncDocPlayEvent.VIDEO_METADATA_LOADED,this.onVideoMetadataLoaded);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.VIDEO_READY_TO_PLAY,this.onVideoReadyToPlay);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.VIDEO_STATE_CHANGE,this.onStateChange);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.VIDEO_TIME_UPDATE,this.onVideoTimeUpdate);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.VIDEO_SEEKING,this.onVideoSeeking);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.VIDEO_SEEKED,this.onVideoSeeked);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.VIDEO_BUFFERED,this.onVideoBuffered);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.VIDEO_ENDED,this.onVideoEnded);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_METADATA_LOADED,this.onAudioMetadataLoaded);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_READY_TO_PLAY,this.onAudioReadyToPlay);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_STATE_CHANGE,this.onStateChange);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_TIME_UPDATE,this.onAudioTimeUpdate);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_SEEKING,this.onAudioSeeking);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_SEEKED,this.onAudioSeeked);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_BUFFERED,this.onAudioBuffered);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_ENDED,this.onAudioEnded)},onVideoMetadataLoaded:function(c,b){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.METADATA_LOADED,b)}},onVideoReadyToPlay:function(b){var a=syncDocPlayer.getSyncDocPlay();a._eventTarget.fire(VCSyncDocPlayEvent.READY_TO_PLAY);if(!a._isAudioPlayingMode&&a._playCommandGiven){a.getVideoVC().play()}if(a._isSwapping){a.videoSwapped()}},onVideoSeeking:function(){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.SEEKING)}},onVideoSeeked:function(){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.SEEKED)}},onVideoTimeUpdate:function(c,b){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.TIME_UPDATE,b)}},videoSwapped:function(){this._eventTarget.fire(VCSyncDocPlayEvent.SWAPPED);this._isSwapping=false;if(this._playCommandGiven){this.getVideoVC().play()}},onVideoBuffered:function(c,a){var b=syncDocPlayer.getSyncDocPlay();if(b._eventTarget){b._eventTarget.fire(VCSyncDocPlayEvent.BUFFERED,a)}},onVideoEnded:function(b){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.ENDED)}},onAudioMetadataLoaded:function(c,b){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.METADATA_LOADED,b)}},onAudioReadyToPlay:function(){var a=syncDocPlayer.getSyncDocPlay();if(a._isAudioPlayingMode&&a._playCommandGiven){a.getAudioVC().play()}if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.READY_TO_PLAY)}if(a._isSwapping){a.audioSwapped()}},onStateChange:function(c,b){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.STATE_CHANGE,b)}},audioSwapped:function(){this._eventTarget.fire(VCSyncDocPlayEvent.SWAPPED);this._isSwapping=false;if(this._playCommandGiven){this.getAudioVC().play()}},onAudioSeeking:function(){var a=syncDocPlayer.getSyncDocPlay()},onAudioSeeked:function(){var a=syncDocPlayer.getSyncDocPlay()},onAudioTimeUpdate:function(c,b){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.TIME_UPDATE,b)}},onAudioBuffered:function(c,a){var b=syncDocPlayer.getSyncDocPlay();if(b._eventTarget){b._eventTarget.fire(VCSyncDocPlayEvent.BUFFERED,a)}},onAudioEnded:function(b){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.ENDED)}},initialLoad:function(a){this.setCurrentPlayingMode();if(!this._isAudioPlayingMode){this.getVideoVC().initMedia(a,true)}else{this.getAudioVC().initMedia(a,true)}},play:function(){this._playCommandGiven=true;if(!this._isAudioPlayingMode){this.getVideoVC().play()}else{this.getAudioVC().play()}},pause:function(){this._playCommandGiven=false;if(!this._isAudioPlayingMode){this.getVideoVC().pause()}else{this.getAudioVC().pause()}},seekTo:function(a){if(!this._isAudioPlayingMode){this.getVideoVC().seekTo(a)}else{this.getAudioVC().seekTo(a)}},setVolume:function(a){if(!this._isAudioPlayingMode){this.getVideoVC().setVolume(a)}else{this.getAudioVC().setVolume(a)}},swapProfile:function(a){if(!this.base(a)){return}this._contentInfo.setProfile(a);if(this._playMode==SyncVideoMobilePlayMode.SLIDE){return}this._isSwapCommandGiven=true;var b=this.getCurrMedia()?this.getCurrMedia().getCurrentTime():0;this.setCurrentPlayingMode();this.initMedia(b);this.resize();this._seekBeforePlayingDone=false;this._eventTarget.fire(VCVideoPlayEvent.SWAPING)},swap:function(){this._isSwapping=true;this._eventTarget.fire(VCSyncDocPlayEvent.SWAPPING);if(this._playMode==SyncVideoMobilePlayMode.VIDEO){this._playMode=SyncVideoMobilePlayMode.SLIDE}else{this._playMode=SyncVideoMobilePlayMode.VIDEO}var a=this.getCurrMedia()?this.getCurrMedia().getCurrentTime():0;this.setCurrentPlayingMode();this.initMedia(a);this.resize()},initMedia:function(a){if(!this._isAudioPlayingMode){if(this.getAudioVC()){this.getAudioVC().releaseMedia()}this.getVideoVC().initMedia(a,true)}else{if(this.getVideoVC()){this.getVideoVC().releaseMedia()}this.getAudioVC().initMedia(a,true)}},setPlayMode:function(a){if(!a){return}this._playMode=a;this.setCurrentPlayingMode()},getPlayMode:function(){return this._playMode},getVideoVC:function(){return this._syncDocVideo},getAudioVC:function(){return this._syncDocAudio},getCurrentTime:function(){var a=this.getCurrMedia();if(a){return a.getCurrentTime()}return 0},getCurrMedia:function(){if(this._isAudioPlayingMode){return this.getAudioVC()}else{return this.getVideoVC()}}},{SYNCDOC_PLAY_ELEMENT_ID:"#syncdoc-play",VIDEO_ID:"#vc-sdvplay-video",AUDIO_ID:"#vc-sdvplay-audio",VIDEO_SLIDE:"#vc-sdvplay-slide",NOTE_PANEL_ID:"vc-sdvplay-note",MAIN_VIDEO_CONTAINER_CLASS:".vc-sdvplay-video",SLIDE_CONTAINER_CLASS:".vc-sdvplay-slide",VIDEO_AREA_CLASS:".vc-sdplay-video-area",SLIDE_AREA_CLASS:".vc-sdplay-slide-area",MIN_SYNCDOC_WIDTH:80});var SyncVideoMobilePlayMode={VIDEO:"video",SLIDE:"slide"};var VCSyncDocAudioPlay=VCSyncDocPlay.extend({_vcSyncDocAudio:null,initialize:function(a,c,b,d){this.base(a,c,b,d);if(!skinManager.isMobile()&&(skinManager.isNeedFlashFallback()||uniPlayerConfig.getMediaChannelConfig().useRTMPStreaming()||(uniPlayerConfig.getMediaChannelConfig().useHLSStreaming()&&true!=skinManager.isHlsSupported()))){this._isFlash=true;this._vcSyncDocAudio=new VCSyncDocAudioFlash()}else{this._vcSyncDocAudio=new VCSyncDocAudio()}this.attachEvents();this.initControls()},release:function(){this.base();this.getAudioVC().release()},resize:function(){this.base();var a=syncDocPlayer.getSyncDocPlay();noteManager.resize()},attachEvents:function(){this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_METADATA_LOADED,this.onAudioMetadataLoaded);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_READY_TO_PLAY,this.onAudioideoReadyToPlay);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_STATE_CHANGE,this.onAudioStateChange);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_TIME_UPDATE,this.onAudioTimeUpdate);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_SEEKING,this.onSeeking);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_SEEKED,this.onSeeked);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_BUFFERED,this.onBuffered);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.AUDIO_ENDED,this.onEnded);this._eventTargetForVC.addListener(VCSyncDocPlayEvent.CHANGE_TO_FLASH,this.onChangeToFlash)},initControls:function(){this.getAudioVC().initialize(this._contentInfo);this.getAudioVC().addEventListener(this._eventTargetForVC);this.getAudioVC().initMedia(0,true);this.getSlideVC().addEventListener(this._eventTargetForVC);this.getSlideVC().initialize(this.getSyncDocPlayerElem(),this._slideListInfo,this._isSyncMode);this.getSlideControllerVC().addEventListener(this._eventTargetForVC);this.getSlideControllerVC().initialize(this.getSyncDocPlayerElem(),this._isSyncMode);this.resize()},initialLoad:function(a){if(this.getAudioVC()){this.getAudioVC().initMedia(a)}},showSyncDocPlayer:function(){this.base()},hideSyncDocPlayer:function(){this.base()},play:function(){this._playCommandGiven=true;this.getAudioVC().play()},pause:function(){this._playCommandGiven=false;this.getAudioVC().pause()},seekTo:function(a){this.getAudioVC().seekTo(a)},setPlaybackRate:function(a){this._playbackRate=a;if(uniPlayerConfig.getUniPlayerSettingsData().usePlaybackRate&&!skinManager.isNeedFlashFallback()){this.changePlaybackRate()}},changePlaybackRate:function(){if(this.getAudioVC()){this.getAudioVC().setAudioPlaybackRate(this._playbackRate)}},setVolume:function(a){this.getAudioVC().setVolume(a)},onAudioMetadataLoaded:function(c,b){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.METADATA_LOADED,b)}},onAudioideoReadyToPlay:function(){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.READY_TO_PLAY)}},onAudioStateChange:function(c,b){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.STATE_CHANGE,b)}},onAudioTimeUpdate:function(c,b){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.TIME_UPDATE,b)}},onSeeking:function(){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.SEEKING)}},onSeeked:function(){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.SEEKED)}},onBuffered:function(c,a){var b=syncDocPlayer.getSyncDocPlay();if(b._eventTarget){b._eventTarget.fire(VCSyncDocPlayEvent.BUFFERED,a)}},onEnded:function(){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.ENDED)}},onChangeToFlash:function(){var a=syncDocPlayer.getSyncDocPlay();if(a._eventTarget){a._eventTarget.fire(VCSyncDocPlayEvent.CHANGE_TO_FLASH)}},getCurrentTime:function(){if(this.getAudioVC()){return this.getAudioVC().getCurrentTime()}return 0},getAudioVC:function(){return this._vcSyncDocAudio},onFallbackReady:function(a){syncDocPlayer.getSyncDocPlay().getAudioVC().onFallbackReady(a)},onMetadataLoaded:function(a){syncDocPlayer.getSyncDocPlay().getAudioVC().onMetadataLoaded(a)},onStatusChange:function(a,b){syncDocPlayer.getSyncDocPlay().getAudioVC().onStatusChange(a,b)},onTimeUpdate:function(a,b){syncDocPlayer.getSyncDocPlay().getAudioVC().onTimeUpdate(a,b)}});var VCSyncDocVideo=VisualComponent.extend({_mainMedia:null,_mainMediaHls:null,_contentInfo:null,_playCommandGiven:false,_progressTimer:false,_playbackRate:1,_initialTime:0,_isInitialPlaying:true,_mediaReachedInitialTime:false,_mediaInitialPlayingFinished:false,_prevTime:-1,initialize:function(a){this._contentInfo=a;this._progressTimer=setInterval(this.checkProgress,200)},release:function(){this.releaseMedia();clearInterval(this._progressTimer)},releaseMedia:function(){if(this._mainMedia){this._mainMedia.pause();this._mainMedia.src="";this._mainMedia.removeEventListener("loadedmetadata",this.onMetaDataLoaded);this._mainMedia.removeEventListener("timeupdate",this.onTimeUpdate);this._mainMedia.removeEventListener("canplaythrough",this.onMediaReadyToPlay);this._mainMedia.removeEventListener("seeked",this.onMainMediaSeeked);this._mainMedia.removeEventListener("ended",this.onEnded);this._mainMedia.removeEventListener("error",this.onMediaError);this._mainMedia.removeEventListener("play",this.onStateChangePlay);this._mainMedia.removeEventListener("pause",this.onStateChangePause);this._mainMedia.removeEventListener("waiting",this.onStateChangeWaiting);this._mainMedia=null;if(this._mainMediaHls!=null){this._mainMediaHls.destroy();this._mainMediaHls=null}}},showVideo:function(){$syncDocPlayer=syncDocPlayer.getSyncDocPlay().getSyncDocPlayerElem();$syncDocPlayer.find(VCSyncDocVideo.VIDEO_CONTAINER_CLASS).show()},hideVideo:function(){$syncDocPlayer=syncDocPlayer.getSyncDocPlay().getSyncDocPlayerElem();$syncDocPlayer.find(VCSyncDocVideo.VIDEO_CONTAINER_CLASS).hide()},checkProgress:function(){var a=syncDocPlayer.getSyncDocPlay().getVideoVC();if(!a._mainMedia){return}if(skinManager.isMobile()){a.checkMediaReachedInitialTime();a.checkBeforeInitialPlaying()}a.notifyBuffered()},checkBeforeInitialPlaying:function(){var b=syncDocPlayer.getSyncDocPlay().getVideoVC();if(b._mediaInitialPlayingFinished){return}if(b._mainMedia==null){return}if(syncDocPlayer.isMobileIntroShowing()){return}var a=b._mainMedia.currentTime;if(b._prevTime!=-1&&(a>b._prevTime)){b._mediaInitialPlayingFinished=true;if(!b._playCommandGiven){b._mainMedia.pause()}}else{b._mainMedia.play();b._prevTime=a}},checkMediaReachedInitialTime:function(){if(this._mediaReachedInitialTime){return}if(syncDocPlayer.isMobileIntroShowing()){return}var a=this.isMediaCurrentTimeInValidTimeRange(this._mainMedia.currentTime);if(a){this._mediaReachedInitialTime=true}else{this._mainMedia.currentTime=this._initialTime}},isMediaCurrentTimeInValidTimeRange:function(c){var a=(this._initialTime+1);var b=(this._initialTime-1);return(c<=a&&c>=b)},notifyBuffered:function(){var a=this.getEndOfBuffered(this._mainMedia);this._eventTarget.fire(VCSyncDocPlayEvent.VIDEO_BUFFERED,a)},getEndOfBuffered:function(c){if(c==null){return}var a=c.buffered.length;for(var b=0;b=c.currentTime){return c.buffered.end(b)}}return -1},initMedia:function(c,b){var a;if(skinManager.isMobile()){a=this._contentInfo.getCurrentMainMedia().mobileMediaUri;this._mediaInitialPlayingFinished=false;this._prevTime=-1}else{a=this._contentInfo.getCurrentMainMedia().desktopMediaUri}this.initMainMedia(a,c,b)},initMainMedia:function(a,e,b){if(e<0||e>this._contentInfo.contentDuration){e=0}this._isInitialPlaying=b;this._initialTime=e;this._mediaReachedInitialTime=(e==0);$syncDocPlayer=syncDocPlayer.getSyncDocPlay().getSyncDocPlayerElem();this._mainMedia=$syncDocPlayer.find(VCSyncDocVideo.VIDEO_CLASS_NAME).get(0);if(skinManager.isDesktop()&&uniPlayerConfig.getMediaChannelConfig().useHLSStreaming()){var c=this;var d=true;this._mainMediaHls=new Hls();this._mainMediaHls.attachMedia(this._mainMedia);this._mainMediaHls.on(Hls.Events.MEDIA_ATTACHED,function(){c._mainMediaHls.loadSource(a);c._mainMediaHls.on(Hls.Events.FRAG_LOADED,function(f,g){if(d&&c._mainMedia.videoWidth!=0&&c._mainMedia.videoHeight!=0){c.getVideoRatio();contentPlayer.getSyncDocPlay().resize();d=false}})})}else{this._mainMedia.setAttribute("src",a)}this._mainMedia.addEventListener("error",this.onMediaError);this._mainMedia.addEventListener("loadedmetadata",this.onMetaDataLoaded,false);this._mainMedia.addEventListener("timeupdate",this.onTimeUpdate,false);this._mainMedia.addEventListener("canplaythrough",this.onMediaReadyToPlay,false);this._mainMedia.addEventListener("seeked",this.onMainMediaSeeked,false);this._mainMedia.addEventListener("ended",this.onEnded,false);this._mainMedia.addEventListener("play",this.onStateChangePlay,false);this._mainMedia.addEventListener("pause",this.onStateChangePause,false);this._mainMedia.addEventListener("waiting",this.onStateChangeWaiting,false);this._mainMedia.volume=1;this._mainMedia.load();$(this._mainMedia).bind("contextmenu",function(){return false})},getCurrentTime:function(){if(this._mainMedia){return this._mainMedia.currentTime}return 0},play:function(){if(!this.isVideoSet()){return}this._mainMedia.play();this._playCommandGiven=true;this.changePlaybackRate()},pause:function(){if(!this.isVideoSet()){return}this._mainMedia.pause();this._playCommandGiven=false},seekTo:function(a){if(!this.isVideoSet()){return}this._eventTarget.fire(VCSyncDocPlayEvent.VIDEO_SEEKING);this._mainMedia.currentTime=a},setVolume:function(a){if(this._mainMedia&&isFinite(a)){this._mainMedia.volume=a}},setVideoPlaybackRate:function(a){this._playbackRate=a;this.changePlaybackRate()},changePlaybackRate:function(){if(this._mainMedia){this._mainMedia.playbackRate=this._playbackRate;setTimeout(function(){var a=syncDocPlayer.getSyncDocPlay().getVideoVC();if(a&&a._mainMedia){a._mainMedia.playbackRate=1;a._mainMedia.playbackRate=a._playbackRate}},1000)}},getVideoRatio:function(){var a=this._mainMedia.videoHeight;var b=this._mainMedia.videoWidth;this._videoRatio=b/a},resizeVideoTag:function(){var b;var a;if(Util.isIE11embedFullScreen()){b=$(window).innerWidth()*syncDocPlayer.getSyncDocPlay()._mainMediaPercent/100;a=$(window).innerHeight()}else{b=$(VCSyncDocVideo.VIDEO_CONTAINER_CLASS).width();a=$(VCSyncDocVideo.VIDEO_CONTAINER_CLASS).height()}this.resizeVideoTagWithSize(b,a)},resizeVideoTagWithSize:function(g,f){var h=this._videoRatio;var e=g/f;if(!h){return}if(e>h){var b=f*h;var a=f;var d=(g-b)/2;var c=0;$(this._mainMedia).width(b);$(this._mainMedia).height(a);$(this._mainMedia).css("margin-left",d+"px");$(this._mainMedia).css("margin-top",c+"px")}else{var b=g;var a=g/h;var d=0;var c=(f-a)/2;$(this._mainMedia).width(b);$(this._mainMedia).height(a);$(this._mainMedia).css("margin-left",d+"px");$(this._mainMedia).css("margin-top",c+"px")}},onMetaDataLoaded:function(b){var a=syncDocPlayer.getSyncDocPlay().getVideoVC();a._eventTarget.fire(VCSyncDocPlayEvent.VIDEO_METADATA_LOADED,a._mainMedia.duration);a._mainMedia.currentTime=a._initialTime;a.getVideoRatio();contentPlayer.getSyncDocPlay().resize()},onTimeUpdate:function(b){if(syncDocPlayer==null||typeof syncDocPlayer=="undefined"){return}var a=syncDocPlayer.getSyncDocPlay().getVideoVC();a._eventTarget.fire(VCSyncDocPlayEvent.VIDEO_TIME_UPDATE,a._mainMedia.currentTime)},onMediaReadyToPlay:function(){if(syncDocPlayer==null||typeof syncDocPlayer=="undefined"){return}var a=syncDocPlayer.getSyncDocPlay().getVideoVC();a._eventTarget.fire(VCSyncDocPlayEvent.VIDEO_READY_TO_PLAY)},onMainMediaSeeked:function(){var a=syncDocPlayer.getSyncDocPlay().getVideoVC();a._eventTarget.fire(VCSyncDocPlayEvent.VIDEO_SEEKED)},onEnded:function(){var a=syncDocPlayer.getSyncDocPlay().getVideoVC();a._eventTarget.fire(VCSyncDocPlayEvent.VIDEO_ENDED)},onMediaError:function(b){var a=syncDocPlayer.getSyncDocPlay().getVideoVC();if(a._mainMedia&&a._mainMedia.error){apiManager.getPlayerEvent().html5VideoError(a._mainMedia.error.code,uniPlayerData.getCurrentTime())}a._eventTarget.fire(VCSyncDocPlayEvent.CHANGE_TO_FLASH)},isVideoSet:function(){return(this._mainMedia!=null)},onStateChangePlay:function(){if(syncDocPlayer==null||typeof syncDocPlayer=="undefined"){return}var a=syncDocPlayer.getSyncDocPlay().getVideoVC();a._eventTarget.fire(VCSyncDocPlayEvent.VIDEO_STATE_CHANGE,PlayState.PLAYING)},onStateChangePause:function(){if(syncDocPlayer==null||typeof syncDocPlayer=="undefined"){return}var a=syncDocPlayer.getSyncDocPlay().getVideoVC();a._eventTarget.fire(VCSyncDocPlayEvent.VIDEO_STATE_CHANGE,PlayState.PAUSED)}},{VIDEO_CONTAINER_CLASS:".vc-sdvideo-container",VIDEO_CLASS_NAME:".vc-sdvideo-video"});var VCSyncDocVideoFlash=VisualComponent.extend({_mainMedia:null,_contentInfo:null,_playCommandGiven:false,_progressTimer:false,_isSeeking:false,_initialTime:0,_isFirstTime:true,_mediaReachedInitialTime:false,_isMetadataLoaded:false,initialize:function(a){this._contentInfo=a},release:function(){this.releaseMedia();this.clearVideoContainer();clearInterval(this._progressTimer)},clearVideoContainer:function(){$syncDocPlayer=syncDocPlayer.getSyncDocPlay().getSyncDocPlayerElem();$syncDocPlayer.find(VCSyncDocVideoFlash.VIDEO_CONTAINER_CLASS).empty();$syncDocPlayer.find(VCSyncDocVideoFlash.VIDEO_CONTAINER_CLASS).html('')},releaseMedia:function(){if(this._mainMedia==null){return}var a=this._contentInfo.getCurrentMainMedia();switch(a.flashFallbackMethod){case MediaMethod.PROGRESSIVE:case MediaMethod.PSEUDO:this._mainMedia.fvLoad(a.flashFallbackMethod,null,null);break;case MediaMethod.RTMP:this._mainMedia.fvLoad(MediaMethod.RTMP,null,null);break}this._mainMedia=null},showVideo:function(){$syncDocPlayer=syncDocPlayer.getSyncDocPlay().getSyncDocPlayerElem();$syncDocPlayer.find(VCSyncDocVideoFlash.VIDEO_CONTAINER_CLASS).show()},hideVideo:function(){$syncDocPlayer=syncDocPlayer.getSyncDocPlay().getSyncDocPlayerElem();$syncDocPlayer.find(VCSyncDocVideoFlash.VIDEO_CONTAINER_CLASS).hide()},setFlashVisible:function(){if(skinManager.isChrome()){return}$syncDocPlayer=syncDocPlayer.getSyncDocPlay().getSyncDocPlayerElem();$flashContainer=$syncDocPlayer.find(VCSyncDocVideoFlash.VIDEO_CONTAINER_CLASS);if($flashContainer.width()==0){$flashContainer.hide()}else{$flashContainer.show()}},initMedia:function(c,b){var a;if(skinManager.isMobile()){a=this._contentInfo.getCurrentMainMedia().mobileMediaUri}else{a=this._contentInfo.getCurrentMainMedia().desktopMediaUri}this.initMainMedia(a,c,b)},initMainMedia:function(a,c,b){if(c<0||c>this._contentInfo.contentDuration){c=0}this._isInitialPlaying=b;this._initialTime=c;this._mediaReachedInitialTime=(c==0);this._currentTime=c;this.initMainMediaFlash()},initMainMediaFlash:function(){this.createFlashVideo(VCSyncDocVideoFlash.VIDEO_ELEMENT_ID,VCSyncDocVideoFlash.VIDEO_FLASH_ELEMENT_ID);this._mainMedia=document.getElementById(VCSyncDocVideoFlash.VIDEO_FLASH_ELEMENT_ID)},createFlashVideo:function(j,h){var a="11.4.0";var d={};var e={};var i=uniPlayerConfig.getUniPlayerSettingsData().playerUri;var g=Util.urlMerge(i,"playerproductinstall.swf");e.quality="high";e.bgcolor="#000000";e.allowscriptaccess="always";e.allowfullscreen="true";e.wmode="transparent";var f={};f.id=h;f.name=h;f.align="middle";var b="100%";var l="100%";var k=uniPlayerConfig.getMediaChannelConfig()._playingInfo.storyType;var c=Util.urlMerge(i,"flashvideofallback.swf");swfobject.embedSWF(c,j,b,l,a,g,d,e,f,this.callbackEmbedSWF);swfobject.createCSS(j,"display:block;text-align:left;")},callbackEmbedSWF:function(a){if(a.success==false){var b=uniPlayerConfig.getUniPlayerSettingsData().playerUri;document.location=Util.urlMerge(b,"downloadflashplayer.html")}},loadMedia:function(b,a){if(a.desktopMethod==MediaMethod.RTMP){var c=this.getRTMPMediaInfo(a.desktopMediaUri);b.fvLoad(MediaMethod.RTMP,c.serverUri,c.mediaUri);return}switch(a.flashFallbackMethod){case MediaMethod.PROGRESSIVE:case MediaMethod.PSEUDO:b.fvLoad(a.flashFallbackMethod,null,a.flashFallbackMediaUri);break;case MediaMethod.RTMP:var c=this.getRTMPMediaInfo(a.flashFallbackMediaUri);b.fvLoad(MediaMethod.RTMP,c.serverUri,c.mediaUri);break}},getRTMPMediaInfo:function(a){var c=a.indexOf("mp4:");var d=a.substring(0,c);var b=a.substring(c+4);return{serverUri:d,mediaUri:b}},getCurrentTime:function(){if(!this.isVideoSet()){return 0}var a=0;try{a=this._mainMedia.getCurrentTime()}catch(b){a=0}return a},play:function(){if(!this.isVideoSet()){return}try{this._mainMedia.fvPlay()}catch(a){}this._playCommandGiven=true},pause:function(){if(!this.isVideoSet()){return}try{this._mainMedia.fvPause()}catch(a){}this._playCommandGiven=false},seekTo:function(a){if(!this.isVideoSet()){return}if(!this._isMetadataLoaded){this._initialTime=a;return}this._isSeeking=true;this._eventTarget.fire(VCSyncDocPlayEvent.VIDEO_SEEKING);this._mainMedia.setCurrentTime(a);this._eventTarget.fire(VCSyncDocPlayEvent.VIDEO_TIME_UPDATE,a)},setVolume:function(a){if(this._mainMedia){this._mainMedia.setVolume(a)}},setAudioPlaybackRate:function(a){},setVideoPlaybackRate:function(a){},changePlaybackRate:function(){},getVideoRatio:function(){if(!this._isMetadataLoaded){return}var a=this._mainMedia.getHeight();var b=this._mainMedia.getWidth();this._videoRatio=b/a},isNumber:function(a){return typeof a=="number"&&!isNaN(a)&&isFinite(a)},resizeVideoTag:function(){var b;var a;if(Util.isIE11embedFullScreen()){b=$(window).innerWidth()*syncDocPlayer.getSyncDocPlay()._mainMediaPercent/100;a=$(window).innerHeight()}else{b=$(VCSyncDocVideoFlash.VIDEO_CONTAINER_CLASS).width();a=$(VCSyncDocVideoFlash.VIDEO_CONTAINER_CLASS).height()}this.resizeVideoTagWithSize(b,a)},resizeVideoTagWithSize:function(g,f){this.getVideoRatio();var h=this._videoRatio;if(!this.isNumber(h)){return}var e=g/f;if(e>h){var b=f*h;var a=f;var d=(g-b)/2;var c=0;$(this._mainMedia).width(b);$(this._mainMedia).height(a);$(this._mainMedia).css("margin-left",d+"px");$(this._mainMedia).css("margin-top",c+"px")}else{var b=g;var a=g/h;var d=0;var c=(f-a)/2;$(this._mainMedia).width(b);$(this._mainMedia).height(a);$(this._mainMedia).css("margin-left",d+"px");$(this._mainMedia).css("margin-top",c+"px")}},onFallbackReady:function(a){this.loadMedia(this._mainMedia,this._contentInfo.getCurrentMainMedia())},onMetadataLoaded:function(b){var d=syncDocPlayer.getSyncDocPlay().getVideoVC();d._isMetadataLoaded=true;d._eventTarget.fire(VCSyncDocPlayEvent.VIDEO_METADATA_LOADED);if(d._initialTime!=0){if(this._contentInfo.getProfile().isAudio){setTimeout(function(){d.seekTo(d._initialTime);d._initialTime=0},100)}else{var c=this._contentInfo.getCurrentMainMedia();var a=(c.desktopMethod==MediaMethod.RTMP)||(c.flashFallbackMethod==MediaMethod.RTMP);if(a){if(d._mainMedia){try{d._mainMedia.fvPlay()}catch(f){}}}d.seekTo(d._initialTime);d._initialTime=0}}if(d._playCommandGiven){d.play()}else{d.pause()}setTimeout(function(){d.getVideoRatio();d.resizeVideoTag();contentPlayer.getSyncDocPlay().setVerticalAlign()},200)},onStatusChange:function(a,b){var c=syncDocPlayer.getSyncDocPlay().getVideoVC();if(b==VCSyncDocVideoFlash.NETSTREAM_BUFFER_FLUSH||b==VCSyncDocVideoFlash.NETSTREAM_BUFFER_FULL){if(c._isFirstTime){c._eventTarget.fire(VCSyncDocPlayEvent.VIDEO_READY_TO_PLAY);c._isFirstTime=false}else{c._eventTarget.fire(VCSyncDocPlayEvent.VIDEO_SEEKED);if(false==c._playCommandGiven){c.pause()}}c._isSeeking=false}else{if(b==VCSyncDocVideoFlash.NETSTREAM_BUFFER_EMPTY){if(c._mainMedia.getDuration()-c._mainMedia.getCurrentTime()<10){c.onEnded()}}}switch(b){case VCSyncDocVideoFlash.NETSTREAM_UNPAUSE_NOTIFY:c._eventTarget.fire(VCSyncDocPlayEvent.VIDEO_STATE_CHANGE,PlayState.PLAYING);break;case VCSyncDocVideoFlash.NETSTREAM_PAUSE_NOTIFY:c._eventTarget.fire(VCSyncDocPlayEvent.VIDEO_STATE_CHANGE,PlayState.PAUSED);break}},onTimeUpdate:function(a,c){if(a==VCSyncDocVideoFlash.VIDEO_FLASH_ELEMENT_ID){var b=syncDocPlayer.getSyncDocPlay().getVideoVC();if(false==b._isSeeking){b._eventTarget.fire(VCSyncDocPlayEvent.VIDEO_TIME_UPDATE,c)}}},onEnded:function(){var a=syncDocPlayer.getSyncDocPlay().getVideoVC();a._eventTarget.fire(VCSyncDocPlayEvent.VIDEO_ENDED)},isVideoSet:function(){return(this._mainMedia!=null)},isAudioSet:function(){return(this._mainMedia!=null)}},{VIDEO_CONTAINER_CLASS:".vc-sdvideo-container-flash-fallback",VIDEO_ELEMENT_ID:"vc-sdvideo-video-flash-fallback",VIDEO_FLASH_ELEMENT_ID:"Fallback-vc-sdvideo-video",NETSTREAM_PLAY_START:"NetStream.Play.Start",NETSTREAM_UNPAUSE_NOTIFY:"NetStream.Unpause.Notify",NETSTREAM_PAUSE_NOTIFY:"NetStream.Pause.Notify",NETSTREAM_BUFFER_FULL:"NetStream.Buffer.Full",NETSTREAM_BUFFER_FLUSH:"NetStream.Buffer.Flush",NETSTREAM_BUFFER_EMPTY:"NetStream.Buffer.Empty"});var VCSyncDocAudio=VisualComponent.extend({_audio:null,_audioHls:null,_contentInfo:null,_progressTimer:false,_playbackRate:1,_initialTime:0,_isInitialPlaying:true,_mediaReachedInitialTime:false,initialize:function(a){this._contentInfo=a;this._progressTimer=setInterval(this.checkProgress,200)},release:function(){this.releaseMedia();clearInterval(this._progressTimer)},releaseMedia:function(){if(this._audio){this._audio.pause();this._audio.src="";this._audio.removeEventListener("loadedmetadata",this.onMetaDataLoaded);this._audio.removeEventListener("timeupdate",this.onTimeUpdate);this._audio.removeEventListener("canplaythrough",this.onMediaReadyToPlay);this._audio.removeEventListener("seeked",this.onMainMediaSeeked);this._audio.removeEventListener("ended",this.onEnded);this._audio.removeEventListener("error",this.onMediaError);this._audio.removeEventListener("play",this.onStateChangePlay);this._audio.removeEventListener("pause",this.onStateChangePause);this._audio.removeEventListener("waiting",this.onStateChangeWaiting);this._audio=null;if(this._audioHls!=null){this._audioHls.destroy();this._audioHls=null}}},checkProgress:function(){var a=syncDocPlayer.getSyncDocPlay().getAudioVC();if(!a._audio){return}if(skinManager.isMobile()){a.checkMediaReachedInitialTime()}a.notifyBuffered()},checkMediaReachedInitialTime:function(){if(this._mediaReachedInitialTime){return}if(syncDocPlayer.isMobileIntroShowing()){return}if(this._audio==null){return}var a=this.isMediaCurrentTimeInValidTimeRange(this._audio.currentTime);if(a){this._mediaReachedInitialTime=true}else{this._audio.currentTime=this._initialTime}},isMediaCurrentTimeInValidTimeRange:function(c){var a=(this._initialTime+1);var b=(this._initialTime-1);return(c<=a&&c>=b)},notifyBuffered:function(){var a=this.getEndOfBuffered(this._audio);this._eventTarget.fire(VCSyncDocPlayEvent.AUDIO_BUFFERED,a)},getEndOfBuffered:function(c){if(c==null){return}var a=c.buffered.length;for(var b=0;b=c.currentTime){return c.buffered.end(b)}}return -1},initMedia:function(c,b){var a;if(skinManager.isMobile()){a=this._contentInfo.getCurrentMainMedia().mobileMediaUri}else{a=this._contentInfo.getCurrentMainMedia().desktopMediaUri}this.initMainMedia(a,c,b)},initMainMedia:function(a,d,b){if(d<0||d>this._contentInfo.contentDuration){d=0}this._isInitialPlaying=b;this._initialTime=d;this._mediaReachedInitialTime=(d==0);this._currentTime=d;$syncDocPlayer=syncDocPlayer.getSyncDocPlay().getSyncDocPlayerElem();this._audio=$syncDocPlayer.find(VCSyncDocAudio.AUDIO_CLASS_NAME).get(0);if(skinManager.isDesktop()&&uniPlayerConfig.getMediaChannelConfig().useHLSStreaming()){var c=this;this._audioHls=new Hls();this._audioHls.attachMedia(this._audio);this._audioHls.on(Hls.Events.MEDIA_ATTACHED,function(){c._audioHls.loadSource(a)})}else{this._audio.setAttribute("src",a)}this._audio.addEventListener("error",this.onMediaError);this._audio.addEventListener("loadedmetadata",this.onMetaDataLoaded,false);this._audio.addEventListener("timeupdate",this.onTimeUpdate,false);this._audio.addEventListener("canplaythrough",this.onMediaReadyToPlay,false);this._audio.addEventListener("seeked",this.onMainMediaSeeked,false);this._audio.addEventListener("ended",this.onEnded,false);this._audio.addEventListener("play",this.onStateChangePlay,false);this._audio.addEventListener("pause",this.onStateChangePause,false);this._audio.addEventListener("waiting",this.onStateChangeWaiting,false);this._audio.volume=1;this._audio.load()},getCurrentTime:function(){if(this._audio){return this._audio.currentTime}return 0},play:function(){if(!this.isAudioSet()){return}this._audio.play();this._playCommandGiven=true},pause:function(){if(!this.isAudioSet()){return}this._audio.pause();this._playCommandGiven=false},seekTo:function(a){if(!this.isAudioSet()){return}this._eventTarget.fire(VCSyncDocPlayEvent.AUDIO_SEEKING);this._audio.currentTime=a},setVolume:function(a){if(this._audio&&isFinite(a)){this._audio.volume=a}},setAudioPlaybackRate:function(a){this._playbackRate=a;if(uniPlayerConfig.getUniPlayerSettingsData().usePlaybackRate&&!skinManager.isNeedFlashFallback()){this.changePlaybackRate()}},changePlaybackRate:function(){if(this._audio){this._audio.playbackRate=this._playbackRate;setTimeout(function(){var a=syncDocPlayer.getSyncDocPlay().getAudioVC();if(a._audio){a._audio.playbackRate=1;a._audio.playbackRate=a._playbackRate}},1000)}},onMetaDataLoaded:function(b){var a=syncDocPlayer.getSyncDocPlay().getAudioVC();a._eventTarget.fire(VCSyncDocPlayEvent.AUDIO_METADATA_LOADED,a._audio.duration);a._audio.currentTime=a._initialTime},onTimeUpdate:function(b){if(syncDocPlayer==null||typeof syncDocPlayer=="undefined"){return}var a=syncDocPlayer.getSyncDocPlay().getAudioVC();a._eventTarget.fire(VCSyncDocPlayEvent.AUDIO_TIME_UPDATE,a._audio.currentTime)},onMediaReadyToPlay:function(){if(syncDocPlayer==null||typeof syncDocPlayer=="undefined"){return}var a=syncDocPlayer.getSyncDocPlay().getAudioVC();a._eventTarget.fire(VCSyncDocPlayEvent.AUDIO_READY_TO_PLAY)},onMainMediaSeeked:function(){var a=syncDocPlayer.getSyncDocPlay().getAudioVC();a._eventTarget.fire(VCSyncDocPlayEvent.AUDIO_SEEKED)},onEnded:function(){var a=syncDocPlayer.getSyncDocPlay().getAudioVC();a._eventTarget.fire(VCSyncDocPlayEvent.AUDIO_ENDED)},onMediaError:function(b){var a=syncDocPlayer.getSyncDocPlay().getAudioVC();if(a._audio&&a._audio.error){apiManager.getPlayerEvent().html5VideoError(a._audio.error.code,uniPlayerData.getCurrentTime())}a._eventTarget.fire(VCSyncDocPlayEvent.CHANGE_TO_FLASH)},isAudioSet:function(){return(this._audio!=null)},onStateChangePlay:function(){if(syncDocPlayer==null||typeof syncDocPlayer=="undefined"){return}var a=syncDocPlayer.getSyncDocPlay().getAudioVC();a._eventTarget.fire(VCSyncDocPlayEvent.AUDIO_STATE_CHANGE,PlayState.PLAYING)},onStateChangePause:function(){if(syncDocPlayer==null||typeof syncDocPlayer=="undefined"){return}var a=syncDocPlayer.getSyncDocPlay().getAudioVC();a._eventTarget.fire(VCSyncDocPlayEvent.AUDIO_STATE_CHANGE,PlayState.PAUSED)}},{AUDIO_CLASS_NAME:".vc-sdaudio-audio"});var VCSyncDocAudioFlash=VisualComponent.extend({_audio:null,_contentInfo:null,_progressTimer:false,_initialTime:0,_isFirstTime:true,_mediaReachedInitialTime:false,_isMetadataLoaded:false,initialize:function(a){this._contentInfo=a;this._progressTimer=setInterval(this.checkProgress,200)},release:function(){this.releaseMedia();clearInterval(this._progressTimer)},releaseMedia:function(){if(this._audio==null){return}var a=this._contentInfo.getCurrentMainMedia();switch(a.flashFallbackMethod){case MediaMethod.PROGRESSIVE:case MediaMethod.PSEUDO:this._audio.fvLoad(a.flashFallbackMethod,null,null);break;case MediaMethod.RTMP:this._audio.fvLoad(MediaMethod.RTMP,null,null);break}this._audio=null;$syncDocPlayer=syncDocPlayer.getSyncDocPlay().getSyncDocPlayerElem();$syncDocPlayer.find(VCSyncDocAudioFlash.AUDIO_CONTAINER_CLASS).empty();$syncDocPlayer.find(VCSyncDocAudioFlash.AUDIO_CONTAINER_CLASS).html('')},checkProgress:function(){var a=syncDocPlayer.getSyncDocPlay().getAudioVC();if(!a._audio){return}if(skinManager.isMobile()){a.checkMediaReachedInitialTime()}},checkMediaReachedInitialTime:function(){if(this._mediaReachedInitialTime){return}if(syncDocPlayer.isMobileIntroShowing()){return}var a=this.isMediaCurrentTimeInValidTimeRange(this._audio.getCurrentTime());if(a){this._mediaReachedInitialTime=true}else{this._audio.setCurrentTime(this._initialTime)}},isMediaCurrentTimeInValidTimeRange:function(c){var a=(this._initialTime+1);var b=(this._initialTime-1);return(c<=a&&c>=b)},initMedia:function(c,b){var a;if(skinManager.isMobile()){a=this._contentInfo.getCurrentMainMedia().mobileMediaUri}else{a=this._contentInfo.getCurrentMainMedia().desktopMediaUri}this.initMainMedia(a,c,b)},initMainMedia:function(a,c,b){if(c<0||c>this._contentInfo.contentDuration){c=0}this._isInitialPlaying=b;this._initialTime=c;this._mediaReachedInitialTime=(c==0);this._currentTime=c;this.initMainMediaFlash()},initMainMediaFlash:function(){this.createFlashAudio(VCSyncDocAudioFlash.AUDIO_ELEMENT_ID,VCSyncDocAudioFlash.AUDIO_FLASH_ELEMENT_ID);this._audio=document.getElementById(VCSyncDocAudioFlash.AUDIO_FLASH_ELEMENT_ID)},createFlashAudio:function(j,h){var a="11.4.0";var d={};var e={};var i=uniPlayerConfig.getUniPlayerSettingsData().playerUri;var g=Util.urlMerge(i,"playerproductinstall.swf");e.quality="high";e.bgcolor="#000000";e.allowscriptaccess="always";e.allowfullscreen="true";e.wmode="transparent";var f={};f.id=h;f.name=h;f.align="middle";var b="100%";var l="100%";var k=uniPlayerConfig.getMediaChannelConfig()._playingInfo.storyType;var c=Util.urlMerge(i,"flashvideofallback.swf");swfobject.embedSWF(c,j,b,l,a,g,d,e,f,this.callbackEmbedSWF);swfobject.createCSS(j,"display:block;text-align:left;")},callbackEmbedSWF:function(a){if(a.success==false){var b=uniPlayerConfig.getUniPlayerSettingsData().playerUri;document.location=Util.urlMerge(b,"downloadflashplayer.html")}},loadMedia:function(b,a){if(a.desktopMethod==MediaMethod.RTMP){var c=this.getRTMPMediaInfo(a.desktopMediaUri);b.fvLoad(MediaMethod.RTMP,c.serverUri,c.mediaUri);return}switch(a.flashFallbackMethod){case MediaMethod.PROGRESSIVE:case MediaMethod.PSEUDO:b.fvLoad(a.flashFallbackMethod,null,a.flashFallbackMediaUri);break;case MediaMethod.RTMP:var c=this.getRTMPMediaInfo(a.flashFallbackMediaUri);b.fvLoad(MediaMethod.RTMP,c.serverUri,c.mediaUri);break}},getRTMPMediaInfo:function(a){var c=a.indexOf("mp4:");var d=a.substring(0,c);var b=a.substring(c+4);return{serverUri:d,mediaUri:b}},getCurrentTime:function(){if(!this.isAudioSet()){return 0}var a=0;try{a=this._audio.getCurrentTime()}catch(b){a=0}return a},play:function(){if(!this.isAudioSet()){return}try{this._audio.fvPlay()}catch(a){}this._playCommandGiven=true},pause:function(){if(!this.isAudioSet()){return}try{this._audio.fvPause()}catch(a){}this._playCommandGiven=false},seekTo:function(a){if(!this.isAudioSet()){return}if(!this._isMetadataLoaded){this._initialTime=a;return}this._eventTarget.fire(VCSyncDocPlayEvent.AUDIO_SEEKING);this._audio.setCurrentTime(a);this._eventTarget.fire(VCSyncDocPlayEvent.AUDIO_TIME_UPDATE,a)},setVolume:function(a){if(this._audio){this._audio.setVolume(a)}},onFallbackReady:function(a){this.loadMedia(this._audio,this._contentInfo.getCurrentMainMedia())},onMetadataLoaded:function(b){var a=syncDocPlayer.getSyncDocPlay().getAudioVC();a._isMetadataLoaded=true;a._eventTarget.fire(VCSyncDocPlayEvent.AUDIO_METADATA_LOADED);if(a._initialTime!=0){setTimeout(function(){a.seekTo(a._initialTime)},500)}if(a._playCommandGiven){a.play()}else{a.pause()}},onStatusChange:function(a,b){var c=syncDocPlayer.getSyncDocPlay().getAudioVC();if(b==VCSyncDocAudioFlash.NETSTREAM_BUFFER_FLUSH||b==VCSyncDocAudioFlash.NETSTREAM_BUFFER_FULL){if(c._isFirstTime){c._eventTarget.fire(VCSyncDocPlayEvent.AUDIO_READY_TO_PLAY);c._isFirstTime=false}else{c._initialTime=0;c._eventTarget.fire(VCSyncDocPlayEvent.AUDIO_SEEKED)}}else{if(b==VCSyncDocAudioFlash.NETSTREAM_BUFFER_EMPTY){if(c._audio.getDuration()-c._audio.getCurrentTime()<10){c.onEnded()}}}switch(b){case VCSyncDocAudioFlash.NETSTREAM_UNPAUSE_NOTIFY:c._eventTarget.fire(VCSyncDocPlayEvent.AUDIO_STATE_CHANGE,PlayState.PLAYING);break;case VCSyncDocAudioFlash.NETSTREAM_PAUSE_NOTIFY:c._eventTarget.fire(VCSyncDocPlayEvent.AUDIO_STATE_CHANGE,PlayState.PAUSED);break}},onTimeUpdate:function(b){var a=syncDocPlayer.getSyncDocPlay().getAudioVC();if(a._initialTime!=0&&false==a.isMediaCurrentTimeInValidTimeRange(a.getCurrentTime())){return}a._eventTarget.fire(VCSyncDocPlayEvent.AUDIO_TIME_UPDATE,a.getCurrentTime())},onEnded:function(){var a=syncDocPlayer.getSyncDocPlay().getAudioVC();a._eventTarget.fire(VCSyncDocPlayEvent.AUDIO_ENDED)},isAudioSet:function(){return(this._audio!=null)},setAudioPlaybackRate:function(a){}},{AUDIO_CONTAINER_CLASS:".vc-sdaudio-container-flash-fallback",AUDIO_ELEMENT_ID:"vc-sdaudio-audio-flash-fallback",AUDIO_FLASH_ELEMENT_ID:"Fallback-vc-sdaudio-audio",NETSTREAM_PLAY_START:"NetStream.Play.Start",NETSTREAM_UNPAUSE_NOTIFY:"NetStream.Unpause.Notify",NETSTREAM_PAUSE_NOTIFY:"NetStream.Pause.Notify",NETSTREAM_BUFFER_FULL:"NetStream.Buffer.Full",NETSTREAM_BUFFER_FLUSH:"NetStream.Buffer.Flush",NETSTREAM_BUFFER_EMPTY:"NetStream.Buffer.Empty"});var VCSyncDocPlayFactory=new function(){this.createSyncDocPlay=function(){var b=uniPlayerConfig.getMediaChannelConfig()._playingInfo.storyType;var a=skinManager.isMobile();if(b==ContentType.SYNCVIDEO){if(a){return new VCSyncDocVideoPlayMobile()}else{return new VCSyncDocVideoPlayDesktop()}}else{if(b==ContentType.SYNCAUDIO){return new VCSyncDocAudioPlay()}}return null}};var ContentType={UNKNOWN:"unknown",UPF:"upf",AUDIO:"audio",VIDEO1:"video1",VIDEO2:"video2",VIDEO3:"video3",DOCUMENT:"document",SYNCVIDEO:"syncvideo",SYNCAUDIO:"syncaudio",SHAREDOCS:"sharedocs",MIXED:"mixed"};var MediaMethod={PROGRESSIVE:"progressive",PSEUDO:"pseudo",RTMP:"rtmp",HLS:"hls"};var MediaType={DEFAULT:"default",VIDEO:"video",AUDIO:"audio"};var IntroImageData=Base.extend({uri:null,duration:0,constructor:function(b){this.uri=b;var a=arguments.length>=2?arguments[1]:IntroImageData.DEFAULT_DURATION;this.duration=a}},{DEFAULT_DURATION:3000});var VideoType={MAIN_MEDIA:"camera1",SUB_MEDIA:"screen",EXTRA_MEDIA:"camera2",EXTRA_MEDIA2:"camera3",MIXED_MEDIA:"mixed"};var EventType={SLIDE:"slide",ANIMATION:"animation",NOTE:"note",HIDEALL:"hideall"};var NoteType={MOUSE_CURVE:"mouse_curve",SPEED_CURVE:"speed_curve",LINE:"line",RECTANGLE:"rectangle",HIDE:"hide"};var ChapterType={SLIDE:"slide",STORY:"story"};var ChapterDisplayType={THUMBNAIL:"thumbnail",THUMBNAIL_LAYER:"thumbnail_layer",TEXT:"text",TEXT_LAYER:"text_layer"};var KeyCode={LEFT:37,UP:38,RIGHT:39,DOWN:40,SPACEBAR:32,ENTER:13,F:70,M:77,Z:90,X:88,C:67,P:80,BACKSPACE:8,PAGEUP:33,N:78,PAGEDOWN:34,HOME:36,END:35,ENTER:13};var ContentsVerticalAlign={TOP:"top",CENTER:"center"};var UniPlayerSettingsData=Base.extend({playerUri:null,skinUri:null,viewStatistics:null,lang:null,autoPlay:false,useContentInfo:true,usePlaybackRate:false,useShare:false,useContinueMsg:true,introVideoUri:null,introImage:null,seekLimited:false,useAndroidHtml5DefaultControls:false,useAndroidHLSDefaultPlayer:true,useTitle:false,useAndroidEnterFullScreen:false,chapterDisplayType:null,usePopupFullscreen:true,showDefaultCaption:false,contentsVerticalAlign:null,useEbookHardCover:true,useLocalContinue:true,captionBaseFontSize:null,docLayoutMode:null,getDocLayoutMode:function(){if(skinManager.isMobile()){switch(this.docLayoutMode){case"two_page":this.docLayoutMode="one_page";break;case"two_page_scroll":this.docLayoutMode="one_page_scroll";break}return this.docLayoutMode}else{return this.docLayoutMode}}});var UniPlayerSettingsParser=Base.extend({_uniPlayerSettingsData:null,getUniPlayerSettingsData:function(){return this._uniPlayerSettingsData},parseUniPlayerSettings:function(b,c){if(!b){return}var a=this;$.ajax({url:b,dataType:"xml",async:true,success:function(d){a._uniPlayerSettingsData=a.parseUniPlayerSettingsData($(d));c()}})},parseUniPlayerSettingsData:function(f){var w=new UniPlayerSettingsData();var o=f.find(UniPlayerSettingsXmlTag.PLAYER_URI);if(o.length>0){w.playerUri=o.text()}else{alert("uni-player-settings.xml parse fail: player_uri missing");return}var q=f.find(UniPlayerSettingsXmlTag.SKIN_URI);if(q.length>0){w.skinUri=q.text()}else{alert("uni-player-settings.xml parse fail: skin_uri missing");return}var v=f.find(UniPlayerSettingsXmlTag.VIEW_STATISTICS);if(v.length>0){w.viewStatistics=v.text()}var p=f.find(UniPlayerSettingsXmlTag.LANG);if(p.length>0){var c=p.text();w.lang=localizeManager.getLanguageCode(c)}var m=f.find(UniPlayerSettingsXmlTag.AUTO_PLAY);if(m.length>0){w.autoPlay=Util.getBooleanValue(m.text())}else{w.autoPlay=UniPlayerSettingsDefault.AUTO_PLAY}var g=f.find(UniPlayerSettingsXmlTag.USE_CONTENT_INFO);if(g.length>0){w.useContentInfo=Util.getBooleanValue(g.text())}else{w.useContentInfo=UniPlayerSettingsDefault.USE_CONTENT_INFO}var z=f.find(UniPlayerSettingsXmlTag.USE_PLAYBACK_RATE);if(z.length>0){w.usePlaybackRate=Util.getBooleanValue(z.text())}else{w.usePlaybackRate=UniPlayerSettingsDefault.USE_PLAYBACK_RATE}var u=f.find(UniPlayerSettingsXmlTag.USE_SHARE);if(u.length>0){w.useShare=Util.getBooleanValue(u.text())}else{w.useShare=UniPlayerSettingsDefault.USE_SHARE}var i=f.find(UniPlayerSettingsXmlTag.USE_CONTINUE_MSG);if(i.length>0){w.useContinueMsg=Util.getBooleanValue(i.text())}else{w.useContinueMsg=UniPlayerSettingsDefault.USE_CONTINUE_MSG}var d=f.find(UniPlayerSettingsXmlTag.INTRO_VIDEO_URI);if(d.length>0){w.introVideoUri=d.text()}var x=f.find(UniPlayerSettingsXmlTag.INTRO_IMAGE_URI);if(x.length>0){var j=x.text();w.introImage=new IntroImageData(j);var a=x.attr(UniPlayerSettingsXmlTag.ATTR_DURATION);if(a){w.introImage.duration=parseInt(a)}}var t=f.find(UniPlayerSettingsXmlTag.SEEK_LIMITED);if(t.length>0){w.seekLimited=Util.getBooleanValue(t.text())}else{w.seekLimited=UniPlayerSettingsDefault.SEEK_LIMITED}var h=f.find(UniPlayerSettingsXmlTag.USE_ANDROID_HTML5_DEFAULT_CONTROLS);if(h.length>0){w.useAndroidHtml5DefaultControls=Util.getBooleanValue(h.text())}else{w.useAndroidHtml5DefaultControls=UniPlayerSettingsDefault.USE_ANDROID_HTML5_DEFAULT_CONTROLS}var y=f.find(UniPlayerSettingsXmlTag.USE_ANDROID_HLS_DEFAULT_PLAYER);if(y.length>0){w.useAndroidHLSDefaultPlayer=Util.getBooleanValue(y.text())}else{w.useAndroidHLSDefaultPlayer=UniPlayerSettingsDefault.USE_ANDROID_HLS_DEFAULT_PLAYER}var n=f.find(UniPlayerSettingsXmlTag.USE_TITLE);if(n.length>0){w.useTitle=Util.getBooleanValue(n.text())}else{w.useTitle=UniPlayerSettingsDefault.USE_TITLE}var l=f.find(UniPlayerSettingsXmlTag.USE_ANDROID_ENTER_FULLSCREEN);if(l.length>0){w.useAndroidEnterFullScreen=Util.getBooleanValue(l.text())}else{w.useAndroidEnterFullScreen=UniPlayerSettingsDefault.USE_ANDROID_ENTER_FULLSCREEN}var B=f.find(UniPlayerSettingsXmlTag.CHAPTER_DISPLAY_TYPE);if(B.length>0){switch(B.text()){case ChapterDisplayType.THUMBNAIL:case ChapterDisplayType.THUMBNAIL_LAYER:case ChapterDisplayType.TEXT:case ChapterDisplayType.TEXT_LAYER:w.chapterDisplayType=B.text();break;default:w.chapterDisplayType=UniPlayerSettingsDefault.CHAPTER_DISPLAY_TYPE}}else{w.chapterDisplayType=UniPlayerSettingsDefault.CHAPTER_DISPLAY_TYPE}var s=f.find(UniPlayerSettingsXmlTag.USE_POPUP_FULLSCREEN);if(s.length>0){w.usePopupFullscreen=Util.getBooleanValue(s.text())}else{w.usePopupFullscreen=UniPlayerSettingsDefault.USE_POPUP_FULLSCREEN}var k=f.find(UniPlayerSettingsXmlTag.SHOW_DEFAULT_CAPTION);if(k.length>0){w.showDefaultCaption=Util.getBooleanValue(k.text())}else{w.showDefaultCaption=UniPlayerSettingsDefault.SHOW_DEFAULT_CAPTION}var C=f.find(UniPlayerSettingsXmlTag.CONTENTS_VERTICAL_ALIGN);if(C.length>0){w.contentsVerticalAlign=C.text()}else{w.contentsVerticalAlign=UniPlayerSettingsDefault.CONTENTS_VERTICAL_ALIGN}var r=f.find(UniPlayerSettingsXmlTag.USE_EBOOK_HARD_COVER);if(r.length>0){w.useEbookHardCover=Util.getBooleanValue(r.text())}else{w.useEbookHardCover=UniPlayerSettingsDefault.USE_EBOOK_HARD_COVER}var b=f.find(UniPlayerSettingsXmlTag.USE_LOCAL_CONTINUE);if(b.length>0){w.useLocalContinue=Util.getBooleanValue(b.text())}else{w.useLocalContinue=UniPlayerSettingsDefault.USE_LOCAL_CONTINUE}var e=f.find(UniPlayerSettingsXmlTag.CAPTION_BASE_FONT_SIZE);if(e.length>0&&!isNaN(parseFloat(e.text()))){w.captionBaseFontSize=parseFloat(e.text())}else{w.captionBaseFontSize=UniPlayerSettingsDefault.CAPTION_BASE_FONT_SIZE}var A=f.find(UniPlayerSettingsXmlTag.DOC_LAYOUT_MODE);if(A.length>0){switch(A.text().toLowerCase()){case"one_page":case"one_page_scroll":case"two_page":case"two_page_scroll":w.docLayoutMode=A.text().toLowerCase();break;default:w.docLayoutMode=UniPlayerSettingsDefault.DOC_LAYOUT_MODE}}else{w.docLayoutMode=UniPlayerSettingsDefault.DOC_LAYOUT_MODE}return w}});var UniPlayerSettingsXmlTag={PLAYER_URI:"player_uri",SKIN_URI:"skin_uri",VIEW_STATISTICS:"view_statistics",LANG:"lang",AUTO_PLAY:"auto_play",USE_CONTENT_INFO:"use_content_info",USE_PLAYBACK_RATE:"use_playback_rate",USE_SHARE:"use_share",USE_CONTINUE_MSG:"use_continue_msg",INTRO_VIDEO_URI:"intro_video_uri",INTRO_IMAGE_URI:"intro_image_uri",ATTR_DURATION:"duration",SEEK_LIMITED:"seek_limited",USE_ANDROID_HTML5_DEFAULT_CONTROLS:"use_android_html5_default_controls",USE_ANDROID_HLS_DEFAULT_PLAYER:"use_android_hls_default_player",USE_TITLE:"use_title",USE_ANDROID_ENTER_FULLSCREEN:"use_android_enter_fullscreen",CHAPTER_DISPLAY_TYPE:"chapter_display_type",USE_POPUP_FULLSCREEN:"use_popup_fullscreen",SHOW_DEFAULT_CAPTION:"show_default_caption",CONTENTS_VERTICAL_ALIGN:"contents_vertical_align",USE_EBOOK_HARD_COVER:"use_ebook_hard_cover",USE_LOCAL_CONTINUE:"use_local_continue",CAPTION_BASE_FONT_SIZE:"caption_base_font_size",DOC_LAYOUT_MODE:"doc_layout_mode",};var UniPlayerSettingsQueryParser=Base.extend({updateSettingsByQueryString:function(j){var q=Util.getQueryVariable(UniPlayerSettingsQueryName.AUTO_PLAY);if(q!=undefined){j.autoPlay=Util.getBooleanValue(q)}var m=Util.getQueryVariable(UniPlayerSettingsQueryName.USE_CONTENT_INFO);if(m!=undefined){j.useContentInfo=Util.getBooleanValue(m)}var h=Util.getQueryVariable(UniPlayerSettingsQueryName.USE_PLAYBACK_RATE);if(h!=undefined){j.usePlaybackRate=Util.getBooleanValue(h)}var t=Util.getQueryVariable(UniPlayerSettingsQueryName.USE_SHARE);if(t!=undefined){j.useShare=Util.getBooleanValue(t)}var g=Util.getQueryVariable(UniPlayerSettingsQueryName.USE_CONTINUE_MSG);if(g!=undefined){j.useContinueMsg=Util.getBooleanValue(g)}var l=Util.getQueryVariable(UniPlayerSettingsQueryName.INTRO_VIDEO_URI);if(l!=undefined){j.introVideoUri=l}var f=Util.getQueryVariable(UniPlayerSettingsQueryName.INTRO_IMAGE_URI);if(f!=undefined){j.introImage=new IntroImageData(f)}var d=Util.getQueryVariable(UniPlayerSettingsQueryName.SEEK_LIMITED);if(d!=undefined){j.seekLimited=Util.getBooleanValue(d)}var o=Util.getQueryVariable(UniPlayerSettingsQueryName.USE_ANDROID_HTML5_DEFAULT_CONTROLS);if(o!=undefined){j.useAndroidHtml5DefaultControls=Util.getBooleanValue(o)}var b=Util.getQueryVariable(UniPlayerSettingsQueryName.USE_ANDROID_HLS_DEFAULT_PLAYER);if(b!=undefined){j.useAndroidHLSDefaultPlayer=Util.getBooleanValue(b)}var e=Util.getQueryVariable(UniPlayerSettingsQueryName.USE_TITLE);if(e!=undefined){j.useTitle=Util.getBooleanValue(e)}var c=Util.getQueryVariable(UniPlayerSettingsQueryName.USE_ANDROID_ENTER_FULLSCREEN);if(c!=undefined){j.useAndroidEnterFullScreen=Util.getBooleanValue(c)}var u=Util.getQueryVariable(UniPlayerSettingsQueryName.CHAPTER_DISPLAY_TYPE);if(u!=undefined){switch(u){case ChapterDisplayType.THUMBNAIL:case ChapterDisplayType.THUMBNAIL_LAYER:case ChapterDisplayType.TEXT:case ChapterDisplayType.TEXT_LAYER:j.chapterDisplayType=u;break}}var r=Util.getQueryVariable(UniPlayerSettingsQueryName.USE_POPUP_FULLSCREEN);if(r!=undefined){j.usePopupFullscreen=Util.getBooleanValue(r)}var s=Util.getQueryVariable(UniPlayerSettingsQueryName.SHOW_DEFAULT_CAPTION);if(s!=undefined){j.showDefaultCaption=Util.getBooleanValue(s)}var n=Util.getQueryVariable(UniPlayerSettingsQueryName.CONTENTS_VERTICAL_ALIGN);if(n!=undefined){switch(n){case ContentsVerticalAlign.TOP:case ContentsVerticalAlign.CENTER:j.contentsVerticalAlign=n;break}}var i=Util.getQueryVariable(UniPlayerSettingsQueryName.USE_EBOOK_HARD_COVER);if(i!=undefined){j.useEbookHardCover=Util.getBooleanValue(i)}var a=Util.getQueryVariable(UniPlayerSettingsQueryName.USE_LOCAL_CONTINUE);if(a!=undefined){j.useLocalContinue=Util.getBooleanValue(a)}var p=Util.getQueryVariable(UniPlayerSettingsQueryName.CAPTION_BASE_FONT_SIZE);if(p!=undefined&&!isNaN(parseFloat(p))){j.captionBaseFontSize=parseFloat(p)}var k=Util.getQueryVariable(UniPlayerSettingsQueryName.DOC_LAYOUT_MODE);if(k!=undefined){switch(k.toLowerCase()){case"one_page":case"one_page_scroll":case"two_page":case"two_page_scroll":j.docLayoutMode=k.toLowerCase();break}}return j}});var UniPlayerSettingsQueryName={PLAYER_SETTINGS:"player_settings",PLAYING_INFO:"playing_info",CONTENT_METADATA:"content_metadata",CONTENT:"content",SERVICE_ROOT:"service_root",VIDEO_TYPE:"video_type",SYNC_VIDEO_MOBILE_PLAY_MODE:"sync_video_mobile_play_mode",LANG:"lg",AUTO_PLAY:"ap",USE_CONTENT_INFO:"uc",USE_PLAYBACK_RATE:"pr",USE_SHARE:"us",USE_CONTINUE_MSG:"ucm",VIEW_MODE:"vm",INTRO_VIDEO_URI:"ivu",INTRO_IMAGE_URI:"iiu",SEEK_LIMITED:"sl",START_TIME:"st",END_TIME:"et",USE_ANDROID_HTML5_DEFAULT_CONTROLS:"uadc",USE_ANDROID_HLS_DEFAULT_PLAYER:"uahdp",USE_TITLE:"ut",USE_ANDROID_ENTER_FULLSCREEN:"uaef",CHAPTER_DISPLAY_TYPE:"cdt",USE_POPUP_FULLSCREEN:"upfs",SYNC_VIDEO_INITIAL_LAYOUT:"svil",SHOW_DEFAULT_CAPTION:"sdc",CONTENTS_VERTICAL_ALIGN:"cva",USE_EBOOK_HARD_COVER:"uehc",USE_LOCAL_CONTINUE:"ulc",CAPTION_BASE_FONT_SIZE:"cbfs",DOC_LAYOUT_MODE:"dlm"};var UniPlayerSettingsDefault={LANG:"ko",AUTO_PLAY:false,USE_CONTENT_INFO:false,USE_PLAYBACK_RATE:true,USE_SHARE:false,USE_CONTINUE_MSG:false,SEEK_LIMITED:false,USE_ANDROID_HTML5_DEFAULT_CONTROLS:false,USE_ANDROID_HLS_DEFAULT_PLAYER:false,USE_TITLE:true,USE_ANDROID_ENTER_FULLSCREEN:false,CHAPTER_DISPLAY_TYPE:ChapterDisplayType.THUMBNAIL,USE_POPUP_FULLSCREEN:true,SHOW_DEFAULT_CAPTION:false,CONTENTS_VERTICAL_ALIGN:"center",USE_EBOOK_HARD_COVER:true,USE_LOCAL_CONTINUE:true,CAPTION_BASE_FONT_SIZE:48,DOC_LAYOUT_MODE:"one_page_scroll",};var ContentParser=Base.extend({_serviceRootData:null,_contentPlayingInfoData:null,_contentMetadata:null,_contentData:null,getServiceRootData:function(){return this._serviceRootData},getContentPlayingInfoData:function(){return this._contentPlayingInfoData},getContentMetadata:function(){return this._contentMetadata},parseServiceRootComponent:function(a,c){if(!a){c();return}var b=this;$.ajax({url:a,dataType:"xml",async:true,success:function(d){b._contentData=d;var e=new ServiceRootParser();if(e.parseServiceRoot($(d).find(ServiceRootXMLTag.SERVICE_ROOT))){b._serviceRootData=e.getServiceRootData()}c()},error:function(d){c()}})},parseContent:function(a,c){if(!a){c();return}if(this._contentData){this.parseContentData(this._contentData,c);return}var b=this;$.ajax({url:a,dataType:"xml",async:true,success:function(d){b.parseContentData(d,c)},error:function(d){c()}})},parseContentData:function(b,d){var c=new ContentPlayingInfoParser();this._contentPlayingInfoData=c.parseContentPlayingInfoData($(b).find(ContentPlayingInfoXmlTag.CONTENT_PLAYING_INFO));var a=new ContentMetadataParser();this._contentMetadata=a.parseContentMetadataData($(b).find(ContentMetadataXmlTag.CONTENT_METADATA));d()}});var ContentPlayingInfoData=Base.extend({lang:null,contentId:null,contentType:null,contentUri:null,contentBackgroundImageUri:null,contentThumbnailUri:null,originalContentDuration:null,contentDuration:null,contentStartTime:0,contentEndTime:0,syncVideoInitLayoutMobile:null,syncVideoInitLayoutDesktop:null,useSyncDocEvent:true,useSyncDocDocView:false,introVideoUri:null,isExistsProfileList:false,profileList:null,storyList:[],currStoryIdx:0,currStoryPlayingInfo:null,setStoryList:function(b){this.storyList=b;if(!(b instanceof Array)){return}var d=0;var c=0;for(var a=0;a=this.storyList.length){return}this.currStoryIdx=a;this.currStoryPlayingInfo=this.storyList[a]},getCurrentStoryPlayingInfo:function(){return this.currStoryPlayingInfo},getContentId:function(){return this.contentId},getContentDuration:function(){return this.contentDuration},getStoryPlayingInfoById:function(a){if(!(this.storyList instanceof Array)){return}for(var b=0;bc){var d=this.playSectionList[b];return d.storyStartTime}}return -1},getStoryEndtime:function(){if(this.playSectionList.length==0){return}return this.playSectionList[this.playSectionList.length-1].storyEndTime},setProfile:function(b){if(this.storyType==ContentType.SYNCAUDIO||this.storyType==ContentType.AUDIO){return}for(var a in this.profileList){if(this.profileList[a].name==b){this.currentProfile=this.profileList[a];break}}this.setCurrentMainMedia(b);this.setCurrentSubMedia(b);this.setCurrentExtraMedia(0,b)},getProfile:function(){if(this.profileList==null){return}if(this.currentProfile==null){this.setDefaultMainMedia()}return this.currentProfile},getProfileFromName:function(c){if(this.profileList==null){return null}var b=null;for(var a in this.profileList){if(this.profileList[a].name==c){b=this.profileList[a];break}}return b},getCurrentMainMedia:function(){if(this.currentMainMedia==null){if(this.mainMediaList==null){return null}this.setDefaultMainMedia()}return this.currentMainMedia},setDefaultMainMedia:function(){for(var a=0;a0){var b=r.text();w.lang=localizeManager.getLanguageCode(b)}var x=f.find(ContentPlayingInfoXmlTag.CONTENT_ID);if(x.length>0){w.contentId=x.text()}var o=f.find(ContentPlayingInfoXmlTag.CONTENT_TYPE);if(o.length>0){w.contentType=o.text()}var p=f.find(ContentPlayingInfoXmlTag.CONTENT_URI);if(p.length>0){w.contentUri=p.text()}if(uniPlayerConfig.getServiceRoot()&&uniPlayerConfig.getServiceRoot().webUri){w.contentUri=uniPlayerConfig.getServiceRoot().webUri}var q=f.find(ContentPlayingInfoXmlTag.CONTENT_BACKGROUND_IMAGE_URI);if(q.length>0){w.contentBackgroundImageUri=q.text()}var y=f.find(ContentPlayingInfoXmlTag.CONTENT_THUMBNAIL_URI);if(y.length>0){w.contentThumbnailUri=y.text()}var s=f.find(ContentPlayingInfoXmlTag.CONTENT_DURATION);if(s.length>0){if(s.text()==""){w.contentDuration=ContentPlayingInfoDefault.CONTENT_DURATION}else{w.contentDuration=parseFloat(s.text())}}else{w.contentDuration=ContentPlayingInfoDefault.CONTENT_DURATION}var B=f.find(ContentPlayingInfoXmlTag.CONTENT_START_TIME);if(B.length>0){w.contentStartTime=parseFloat(B.text())}else{w.contentStartTime=ContentPlayingInfoDefault.CONTENT_START_TIME}var m=f.find(ContentPlayingInfoXmlTag.CONTENT_END_TIME);if(m.length>0){w.contentEndTime=parseFloat(m.text())}else{w.contentEndTime=ContentPlayingInfoDefault.CONTENT_END_TIME}var l=f.find(ContentPlayingInfoXmlTag.SYNCVIDEO_INIT_LAYOUT);if(l.length>0){w.syncVideoInitLayoutMobile=l.text();w.syncVideoInitLayoutDesktop=l.text()}var e=f.find(ContentPlayingInfoXmlTag.USE_SYNCDOC_EVENT);if(e.length>0){w.useSyncDocEvent=Util.getBooleanValue(e.text())}else{w.useSyncDocEvent=ContentPlayingInfoDefault.USE_SYNCDOC_EVENT}var k=f.find(ContentPlayingInfoXmlTag.USE_SYNCDOC_DOCVIEW);if(k.length>0){w.useSyncDocDocView=Util.getBooleanValue(k.text())}else{w.useSyncDocDocView=ContentPlayingInfoDefault.USE_SYNCDOC_DOCVIEW}var j=f.find(ContentPlayingInfoXmlTag.PROFILE_LIST);if(j.length>0){var h=this.parseProfileList(j);w.profileList=this.checkAndSetDefaultProfile(h);w.isExistsProfileList=true}else{w.profileList={};var g=this.createDummyProfile();w.profileList[ContentPlayingInfoDefault.PROFILE_ID]=g;w.isExistsProfileList=false}var c=f.find(ContentPlayingInfoXmlTag.INTRO_VIDEO_URI);if(c.length>0){w.introVideoUri=c.text()}var A=Util.getQueryVariable(ContentPlayingInfoQueryName.INTRO_VIDEO_URI);if(A!=undefined){w.introVideoUri=A}var d=f.find(ContentPlayingInfoXmlTag.SHOW_CAPTION);if(d.length>0){var u=Util.getBooleanValue(d.text());uniPlayerConfig.getUniPlayerSettingsData().showDefaultCaption=u}var a=f.find(ContentPlayingInfoXmlTag.STORY_LIST);var v=[];if(!skinManager.isMobile()&&uniPlayerConfig.getViewMode()!=UniPlayerApp.VIEW_MODE_POPUP&&w.contentType!=ContentType.SHAREDOCS){var n=null;if(w.introVideoUri!=null&&typeof(w.introVideoUri)!="undefined"){switch(w.introVideoUri.toLowerCase()){case"default":n=uniPlayerConfig._uniPlayerSettingsData.introVideoUri;break;case"no_intro":n=null;break;default:n=w.introVideoUri;break}}else{n=uniPlayerConfig._uniPlayerSettingsData.introVideoUri}if(n!=null&&typeof(n)!="undefined"&&n!=""){v.push(this.generateIntroStory(n))}}if(a.length>0){v=v.concat(this.parseStoryList(a));w.setStoryList(v)}else{var z=new StoryPlayingInfoData();z.storyId=ContentPlayingInfoDefault.STORY_ID;z.storyType=w.contentType;z.storyDuration=w.contentDuration;z.storyFileNameList=this.parseStoryFileNameList(f,z.storyId);z.mainMediaList=this.parseMainMediaList(f,z.storyType);z.subMediaList=this.parseSubMediaList(f,z.storyType);z.extraMedias=this.parseSetOfExtraMediaList(f,z.storyType);if(false==this.hasUserDefinedMediaUrl()){z.mixedMediaList=this.parseMixedMediaList(f,z.storyType);if(z.mixedMediaList!=null&&z.mixedMediaList.length!=0){z.hasMixedMedia=true}}v.push(z);w.setStoryList(v)}if(skinManager.isMobile()){for(var t=0;t0){for(var b=0;b0){e={};for(var b=0;b0){for(var e=0;e0){c.each(function(){var e=new PlaySection();e.seq=Number($(this).attr(ContentPlayingInfoXmlTag.SECTION_SEQ));e.mediaStartTime=Number($(this).attr(ContentPlayingInfoXmlTag.SECTION_START_TIME));e.mediaEndTime=Number($(this).attr(ContentPlayingInfoXmlTag.SECTION_END_TIME));d.push(e)})}return d},parseStoryFileNameList:function(b,g){var f=new StoryFileNameList();var h=b.find(ContentPlayingInfoXmlTag.STORY_FILE_LIST);if(h.length>0){var a=$(h).find(ContentPlayingInfoXmlTag.STORY_CAPTION);if(a.length>0){f.caption=a.text()}var d=$(h).find(ContentPlayingInfoXmlTag.STORY_EVENTLIST);if(d.length>0){f.eventList=d.text()}var c=$(h).find(ContentPlayingInfoXmlTag.STORY_NOTE);if(c.length>0){f.note=c.text()}var e=$(h).find(ContentPlayingInfoXmlTag.STORY_SLIDELIST);if(e.length>0){f.slideList=e.text()}}else{f.caption=this.getStoryRelatedInfoXMLFileName(ClosedCaptionParser.XML_FILENAME,g);f.eventList=this.getStoryRelatedInfoXMLFileName(EventListParser.XML_FILENAME,g);f.note=this.getStoryRelatedInfoXMLFileName(NoteParser.XML_FILENAME,g);f.slideList=this.getStoryRelatedInfoXMLFileName(SlideListInfoParser.XML_FILENAME,g)}return f},getStoryRelatedInfoXMLFileName:function(a,b){if(a==null||b==null){return}if(b==ContentPlayingInfoDefault.STORY_ID){return a+".xml"}else{return"{0}_{1}.xml".format(a,b)}},parseMainMediaList:function(d,e){var b=null;var g=d.find(ContentPlayingInfoXmlTag.CONTENT_MAIN_MEDIA_LIST);if(g.length>0){b=this.parseMediaInfoList(g,ContentPlayingInfoXmlTag.CONTENT_MAIN_MEDIA,e)}else{var f=d.find(ContentPlayingInfoXmlTag.CONTENT_MAIN_MEDIA);if(f.length>0){b={};b.defaultMediaId=ContentPlayingInfoDefault.MEDIA_ID;b.list=[];var c=this.parseMediaInfo(f,e);c.mediaId=ContentPlayingInfoDefault.MEDIA_ID;c.profileId=ContentPlayingInfoDefault.PROFILE_ID;b.list.push(c);var a=Util.getQueryVariable(ContentPlayingInfoQueryName.MAIN_VIDEO_URI);if(a!=undefined){c.desktopMethod=MediaMethod.PROGRESSIVE;c.desktopMediaUri=a;c.flashFallbackMethod=MediaMethod.PROGRESSIVE;c.flashFallbackMediaUri=a;c.mobileMethod=MediaMethod.PROGRESSIVE;c.mobileMediaUri=a}}}return b},parseSubMediaList:function(e,f){var b=null;var a=e.find(ContentPlayingInfoXmlTag.CONTENT_SUB_MEDIA_LIST);if(a.length>0){b=this.parseMediaInfoList(a,ContentPlayingInfoXmlTag.CONTENT_SUB_MEDIA,f)}else{var d=e.find(ContentPlayingInfoXmlTag.CONTENT_SUB_MEDIA);if(d.length>0){b={};b.defaultMediaId=ContentPlayingInfoDefault.MEDIA_ID;b.list=[];var c=this.parseMediaInfo(d,f);c.mediaId=ContentPlayingInfoDefault.MEDIA_ID;c.profileId=ContentPlayingInfoDefault.PROFILE_ID;b.list.push(c);var g=Util.getQueryVariable(ContentPlayingInfoQueryName.SUB_VIDEO_URI);if(g!=undefined){c.desktopMethod=MediaMethod.PROGRESSIVE;c.desktopMediaUri=g;c.flashFallbackMethod=MediaMethod.PROGRESSIVE;c.flashFallbackMediaUri=g;c.mobileMethod=MediaMethod.PROGRESSIVE;c.mobileMediaUri=g}}}return b},parseSetOfExtraMediaList:function(d,f){var a=null;var b=d.find(ContentPlayingInfoXmlTag.CONTENT_EXTRA_MEDIA_LIST);if(b.length>0){a=[];for(var e=0;e0){c=this.parseMediaInfoList(f,ContentPlayingInfoXmlTag.CONTENT_MIXED_MEDIA,b)}else{var e=a.find(ContentPlayingInfoXmlTag.CONTENT_MIXED_MEDIA);if(e.length>0){c={};c.defaultMediaId=ContentPlayingInfoDefault.MEDIA_ID;c.list=[];var d=this.parseMediaInfo(e,b);d.mediaId=ContentPlayingInfoDefault.MEDIA_ID;d.profileId=ContentPlayingInfoDefault.PROFILE_ID;c.list.push(d)}}return c},checkAndSetDefaultProfile:function(e){var d=Util.objectKeys(e);var b=false;var c=false;for(var a=0;a0)?b.text():ContentPlayingInfoDefault.PROFILE_NAME;return e},createDummyProfile:function(){var a=new ProfileInfoData();a.id=ContentPlayingInfoDefault.PROFILE_ID;a.profileName=ContentPlayingInfoDefault.PROFILE_NAME;a.isMobileDefault=true;a.isDesktopDefault=true;return a},parseMediaInfoList:function(d,j,g){var m={};var h=d.attr(ContentPlayingInfoXmlTag.CONTENT_DEFAULT_MEDIA_ID);if(!h){h=ContentPlayingInfoDefault.MEDIA_ID}m.defaultMediaId=h;var a=d.find(j);var k=null;if(a.length>0){k=[];for(var e=0;e0){this.generateMediaInfoUsingXML(a,b)}else{this.generateMediaInfoUsingRootData(a,b.text(),c)}return a},generateMediaInfoUsingXML:function(h,a){var e=a.find(ContentPlayingInfoXmlTag.MEDIA_DESKTOP);var k=e.find(ContentPlayingInfoXmlTag.MEDIA_HTML5);var b=k.find(ContentPlayingInfoXmlTag.MEDIA_METHOD);h.desktopMethod=b.text().toLowerCase();var m=k.find(ContentPlayingInfoXmlTag.MEDIA_URI);h.desktopMediaUri=m.text();var d=e.find(ContentPlayingInfoXmlTag.MEDIA_FLASH_FALLBACK);var c=d.find(ContentPlayingInfoXmlTag.MEDIA_METHOD);h.flashFallbackMethod=c.text().toLowerCase();var l=d.find(ContentPlayingInfoXmlTag.MEDIA_URI);h.flashFallbackMediaUri=l.text();var g=a.find(ContentPlayingInfoXmlTag.MEDIA_MOBILE);var i=g.find(ContentPlayingInfoXmlTag.MEDIA_HTML5);var f=i.find(ContentPlayingInfoXmlTag.MEDIA_METHOD);h.mobileMethod=f.text().toLowerCase();var j=i.find(ContentPlayingInfoXmlTag.MEDIA_URI);h.mobileMediaUri=j.text()},generateMediaInfoUsingRootData:function(h,e,g){var c=uniPlayerConfig.getServiceRoot();if(!c){return}this._contentPlayingInfoData.contentUri=c.webUri;var i;var d;switch(g){case ContentType.AUDIO:case ContentType.SYNCAUDIO:i=MediaType.AUDIO;d=ServiceTarget.FLASH_FALLBACK_AUDIO;break;case ContentType.SYNCVIDEO:case ContentType.VIDEO1:case ContentType.VIDEO2:case ContentType.VIDEO3:i=MediaType.VIDEO;d=ServiceTarget.FLASH_FALLBACK_VIDEO;break}if(typeof this._contentPlayingInfoData.profileList[h.profileId]!="undefined"&&this._contentPlayingInfoData.profileList[h.profileId].isAudio){i=MediaType.AUDIO;d=ServiceTarget.FLASH_FALLBACK_AUDIO}var a=c.getServiceUriInfo(i,ServiceTarget.DESKTOP);if(a){h.desktopMethod=a.method;h.desktopMediaUri=this.replaceServiceRootUriFormat(a.uri,e)}var f=c.getServiceUriInfo(i,ServiceTarget.MOBILE);if(f){h.mobileMethod=f.method;h.mobileMediaUri=this.replaceServiceRootUriFormat(f.uri,e)}var b=c.getServiceUriInfo(i,d);if(b){h.flashFallbackMethod=b.method;h.flashFallbackMediaUri=this.replaceServiceRootUriFormat(b.uri,e)}},replaceServiceRootUriFormat:function(a,b){return a.replace(ServiceRootParser.CONTENT_ID_KEYWORD,this._contentPlayingInfoData.contentId).replace(ServiceRootParser.MEDIA_FILE_KEYWORD,b)},hasUserDefinedMediaUrl:function(){if(Util.getQueryVariable(ContentPlayingInfoQueryName.MAIN_VIDEO_URI)!=undefined||Util.getQueryVariable(ContentPlayingInfoQueryName.SUB_VIDEO_URI)!=undefined||Util.getQueryVariable(ContentPlayingInfoQueryName.EXTRA_VIDEO_URI)!=undefined){return true}return false}});var ContentPlayingInfoXmlTag={LANG:"lang",CONTENT_PLAYING_INFO:"content_playing_info",CONTENT_ID:"content_id",CONTENT_TYPE:"content_type",CONTENT_URI:"content_uri",CONTENT_FILE_LIST:"content_file_list",CONTENT_FILE:"content_file",CONTENT_FILE_TYPE:"type",CONTENT_FILE_NAME:"name",CONTENT_THUMBNAIL_URI:"content_thumbnail_uri",CONTENT_BACKGROUND_IMAGE_URI:"content_background_image_uri",CONTENT_DURATION:"content_duration",CONTENT_START_TIME:"start_time",CONTENT_END_TIME:"end_time",SYNCVIDEO_INIT_LAYOUT:"syncvideo_init_layout",USE_SYNCDOC_EVENT:"use_syncdoc_event",USE_SYNCDOC_DOCVIEW:"use_syncdoc_docview",MOBILE:"mobile",DESKTOP:"desktop",PROFILE_LIST:"profile_list",PROFILE:"profile",PROFILE_ID:"id",PROFILE_NAME:"name",IS_AUDIO:"is_audio",DESKTOP_DEFAULT:"desktop_default",MOBILE_DEFAULT:"mobile_default",STORY_LIST:"story_list",STORY:"story",STORY_ID:"id",STORY_TYPE:"story_type",STORY_DURATION:"story_duration",STORY_PLAY_SECTION_LIST:"story_play_section_list",PLAY_SECTION:"play_section",SECTION_SEQ:"seq",SECTION_START_TIME:"start_time",SECTION_END_TIME:"end_time",STORY_FILE_LIST:"story_file_list",STORY_CAPTION:"caption",STORY_EVENTLIST:"eventlist",STORY_NOTE:"note",STORY_SLIDELIST:"slidelist",CONTENT_MAIN_MEDIA_LIST:"main_media_list",CONTENT_SUB_MEDIA_LIST:"sub_media_list",CONTENT_EXTRA_MEDIA_LIST:"extra_media_list",CONTENT_MIXED_MEDIA_LIST:"mixed_media_list",CONTENT_MAIN_MEDIA:"main_media",CONTENT_SUB_MEDIA:"sub_media",CONTENT_EXTRA_MEDIA:"extra_media",CONTENT_MIXED_MEDIA:"mixed_media",CONTENT_PROFILE_ID:"profile_id",CONTENT_DEFAULT_MEDIA_ID:"default_media_id",CONTENT_MEDIA_ID:"media_id",CONTENT_INDEX:"index",MEDIA_DESKTOP:"desktop",MEDIA_MOBILE:"mobile",MEDIA_HTML5:"html5",MEDIA_FLASH_FALLBACK:"flash_fallback",MEDIA_METHOD:"method",MEDIA_URI:"media_uri",INTRO_VIDEO_URI:"intro_video_uri",SHOW_CAPTION:"show_caption"};var ContentPlayingInfoQueryParser=Base.extend({updateContentPlayingInfoByQueryString:function(j){var b=Util.getQueryVariable(ContentPlayingInfoQueryName.LANG);if(b!=undefined){var i=b.toLowerCase();j.lang=localizeManager.getLanguageCode(i)}var e=Util.getQueryVariable(ContentPlayingInfoQueryName.CONTENT_START_TIME_LEGACY);if(e!=undefined){j.contentStartTime=e}var c=Util.getQueryVariable(ContentPlayingInfoQueryName.CONTENT_START_TIME);if(c!=undefined){j.contentStartTime=c}var a=Util.getQueryVariable(ContentPlayingInfoQueryName.CONTENT_END_TIME_LEGACY);if(a!=undefined){j.contentEndTime=a}var f=Util.getQueryVariable(ContentPlayingInfoQueryName.CONTENT_END_TIME);if(f!=undefined){j.contentEndTime=f}var d=Util.getQueryVariable(ContentPlayingInfoQueryName.SYNCVIDEO_INIT_LAYOUT);if(d!=undefined){j.syncVideoInitLayoutMobile=d;j.syncVideoInitLayoutDesktop=d}var h=Util.getQueryVariable(ContentPlayingInfoQueryName.USE_SYNCDOC_EVENT);if(h!=undefined){j.useSyncDocEvent=Util.getBooleanValue(h)}var g=Util.getQueryVariable(ContentPlayingInfoQueryName.USE_SYNCDOC_DOCVIEW);if(g!=undefined){j.useSyncDocDocView=Util.getBooleanValue(g)}return j}});var ContentPlayingInfoQueryName={LANG:"lg",CONTENT_START_TIME_LEGACY:"startat",CONTENT_START_TIME:"st",CONTENT_END_TIME_LEGACY:"endat",CONTENT_END_TIME:"et",SYNCVIDEO_INIT_LAYOUT:"svil",USE_SYNCDOC_EVENT:"usde",USE_SYNCDOC_DOCVIEW:"usdv",INTRO_VIDEO_URI:"intro",MAIN_VIDEO_URI:"main_video",SUB_VIDEO_URI:"sub_video",EXTRA_VIDEO_URI:"extra_video"};var ContentPlayingInfoDefault={CONTENT_DURATION:0,CONTENT_START_TIME:-1,CONTENT_END_TIME:-1,PROFILE_ID:"dummy_profile_id",PROFILE_NAME:"default_profile_name",PROFILE_IS_AUDIO:false,STORY_ID:"default_story_id",INTRO_STORY_ID:"intro-story",LIST_ORDER:0,USE_SYNCDOC_EVENT:true,USE_SYNCDOC_DOCVIEW:false};var ContentMetadata=Base.extend({title:null,summary:null,tags:null,authorName:null,authorEmail:null,authorProfileImage:null,date:null});var ContentMetadataParser=Base.extend({_contentMetadata:null,getContentMetadata:function(){return this._contentMetadata},parseContentMetadata:function(a,c){if(!a){c();return}var b=this;$.ajax({url:a,dataType:"xml",async:true,success:function(d){b._contentMetadata=b.parseContentMetadataData($(d));c()},error:function(d){c()}})},parseContentMetadataData:function(d){var c=new ContentMetadata();var j=d.find(ContentMetadataXmlTag.TITLE);if(j.length>0){c.title=j.text()}var a=d.find(ContentMetadataXmlTag.SUMMARY);if(a.length>0){c.summary=a.text()}var g=d.find(ContentMetadataXmlTag.TAGS);if(g.length>0){c.tags=g.text()}var f=d.find(ContentMetadataXmlTag.AUTHOR);var i=f.find(ContentMetadataXmlTag.AUTHOR_NAME);if(i.length>0){c.authorName=i.text()}var b=f.find(ContentMetadataXmlTag.AUTHOR_EMAIL);if(b.length>0){c.authorEmail=b.text()}var e=f.find(ContentMetadataXmlTag.AUTHOR_PROFILE_IMAGE);if(e.length>0){c.authorProfileImage=e.text()}var h=d.find(ContentMetadataXmlTag.DATE);if(h.length>0){c.date=h.text()}return c}});var ContentMetadataXmlTag={CONTENT_METADATA:"content_metadata",TITLE:"title",SUMMARY:"summary",TAGS:"tags",AUTHOR:"author",AUTHOR_NAME:"name",AUTHOR_EMAIL:"email",AUTHOR_PROFILE_IMAGE:"profile_image",DATE:"date"};var LayoutData=Base.extend({_name:null,_mainMediaWidth:0,_subMediaWidth:0,constructor:function(b,c,a){this._name=b;this._mainMediaWidth=c;this._subMediaWidth=a},getMainMediaWidth:function(){return this._mainMediaWidth},getSubMediaWidth:function(){return this._subMediaWidth}});var LayoutSettingData=Base.extend({_isSwapped:false,_mainMediaWidth:0,_subMediaWidth:0,constructor:function(a,c,b){this._isSwapped=a;this._mainMediaWidth=c;this._subMediaWidth=b},getMainMediaWidth:function(){return this._mainMediaWidth},getSubMediaWidth:function(){return this._subMediaWidth}});var LayoutListParser=Base.extend({_layoutList:[],getLayoutList:function(){return this._layoutList},parseLayoutList:function(b,c){if(!b){return}var a=this;$.ajax({url:b,dataType:"xml",async:true,success:function(d){a.parseLayout(d);c()}})},parseLayout:function(d){var c=$(d).find(LayoutListXmlTag.LAYOUT_DATA);for(var a=0;aa.originalContentDuration){return null}for(var b=0;b=a.storyList[b].originalStartTimeOnContent){return a.storyList[b]}}return a.storyList[a.storyList.length-1]},getChapterStateFromStoryTime:function(b,a){if(b!=-1&&a!=-1){return ChapterState.INSIDE_PLAY_SECTION}else{if(b!=-1&&a==-1){return ChapterState.INTERSECT_PLAY_SECTION_START}else{if(b==-1&&a!=-1){return ChapterState.INTERSECT_PLAY_SECTION_END}else{return ChapterState.OUTSIDE_PLAY_SECTION}}}},getPlaySectionContainTime:function(d,e){var c=d.playSectionList;if(!c){return}for(var b in c){var a=c[b];if(e>=a.mediaStartTime&&ec.id});this._parseCompletedCallback(this._captionList.length)}},getCaptionList:function(){return this._captionList}},{XML_FILENAME:"caption_list"});var ClosedCaptionXmlTag={CAPTION:"caption",ID:"id",LABEL:"label",LANG:"lang",URI:"uri"};var SlideListInfoData=Base.extend({_slideFileList:[],_slideList:[],_slideIdWithSlideDataMap:{},setSlideList:function(c){this._slideList=c;if(!this._slideList){return}this._slideIdWithSlideDataMap={};for(var a=0,b=this._slideList.length;a0){for(var b=0;bb[1].x?b[0].x:b[1].x;c._y2=b[0].y>b[1].y?b[0].y:b[1].y;return c},parseHide:function(c,a){var b=new NoteDataHide();b._type=c;var d=$(a).find(NoteXmlTag.HIDE_PROPERTY);b._hideId=Number(d.find(NoteXmlTag.HIDE_ID).text());return b},parsePoint:function(f){var b=[];var d=$(f).find(NoteXmlTag.POINT_DATA).text().split(" ");var e={x:Number(d[0]),y:Number(d[1])};b.push(e);var c;for(c=1;c