/*!************************************************************************ * * ADOBE CONFIDENTIAL * ___________________ * * Copyright 2013 Adobe Systems Incorporated * All Rights Reserved. * * NOTICE: All information contained herein is, and remains * the property of Adobe Systems Incorporated and its suppliers, * if any. The intellectual and technical concepts contained * herein are proprietary to Adobe Systems Incorporated and its * suppliers and are protected by trade secret or copyright law. * Dissemination of this information or reproduction of this material * is strictly forbidden unless prior written permission is obtained * from Adobe Systems Incorporated. **************************************************************************/ if(typeof s7viewers=="undefined"){s7viewers={}}else{if(typeof s7viewers!="object"){throw new Error("Cannot initialize a root 's7viewers' package. s7viewers is not an object")}}if(!s7viewers.Video360Viewer){(function(){var a;s7viewers.Video360Viewer=function(b){this.sdkBasePath="../../s7viewersdk/3.12/Video360Viewer/";this.viewerFileName="Video360Viewer.js";this.cssSrcURL="Video360Viewer.css";this.utilsFilePath="js/s7sdk/utils/Utils.js";this.containerId=null;this.params={};this.handlers=[];this.onInitComplete=null;this.onInitFail=null;this.initializationComplete=false;this.initCalled=false;this.firstMediasetParsed=false;this.isDisposed=false;this.utilsScriptElm=null;this.fixinputmarker=null;this.sdkProvided=false;this.lockurldomains=true;if(typeof b=="object"){if(b.containerId){this.setContainerId(b.containerId)}if(b.params){for(var c in b.params){if(b.params.hasOwnProperty(c)&&b.params.propertyIsEnumerable(c)){this.setParam(c,b.params[c])}}}if(b.handlers){this.setHandlers(b.handlers)}if(b.localizedTexts){this.setLocalizedTexts(b.localizedTexts)}}};s7viewers.Video360Viewer.cssClassName="s7video360viewer";s7viewers.Video360Viewer.prototype.modifiers={};s7viewers.Video360Viewer.prototype.setContainerId=function(b){if(this.isDisposed){return}this.containerId=b||null};s7viewers.Video360Viewer.getCodeBase=function(){var h="";var c="";var f=null;if(document.scripts){f=document.scripts}else{f=document.getElementsByTagName("script")}for(var e=0;e-1){f+=this.s7params.params.config.split("/")[1]}else{f+=this.s7params.params.config}}this.s7params.setViewer("517,5.17.0"+f);var d={en:this.symbols,defaultLocale:"en"};this.s7params.setDefaultLocalizedTexts(d);for(var b in this.params){if(b!="localizedtexts"){this.s7params.push(b,this.params[b])}else{this.s7params.setLocalizedTexts(this.params[b])}}this.s7params.push("OOTBPresetCSSFileToClassMap",{html5_video360viewer:"s7video360viewer_nosocial",html5_video360viewersocial:""});this.trackingManager=new a.TrackingManager();this.mediaSet=null;this.container=null;this.video360Player=null;this.controls=null;this.playPauseButton=null;this.videoScrubber=null;this.videoTime=null;this.mutableVolume=null;this.fullScreenButton=null;this.storedPlayingState=false;this.socialShare=null;this.embedShare=null;this.linkShare=null;this.twitterShare=null;this.facebookShare=null;this.volumeButtonPosition=null;this.videoTimePosition=null;this.controlsDivID=null;this.storedSocialShareDisplayProp=null;this.isPosterImage=null;this.supportsInline=null;this.isOrientationMarkerForcedChanged=false;var c=this;function g(){c.s7params.push("aemmode",s7viewers.Video360Viewer.codebase.isDAM?"1":"0");var j=c.containerId+"_container";c.controlsDivID=c.containerId+"_controls";c.s7params.push("autoplay","0");c.s7params.push("singleclick","playPause");c.s7params.push("iconeffect","1,-1,0.3,0");c.s7params.push("bearing","fit-vertical");c.s7params.push("initialbitrate","1400");var k=c.getParam("fixinputmarker");if(k){c.fixinputmarker=(k=="s7touchinput"||k=="s7mouseinput")?c.fixinputmarker=k:null}var h=c.getURLParameter("fixinputmarker");if(h){c.fixinputmarker=(h=="s7touchinput"||h=="s7mouseinput")?c.fixinputmarker=h:null}if(c.fixinputmarker){if(c.fixinputmarker==="s7mouseinput"){c.addClass(c.containerId,"s7mouseinput")}else{if(c.fixinputmarker==="s7touchinput"){c.addClass(c.containerId,"s7touchinput")}}}else{if(a.browser.supportsTouch()){c.addClass(c.containerId,"s7touchinput")}else{c.addClass(c.containerId,"s7mouseinput")}}var i=c.s7params.get("presetClasses");if(i&&i.length>0){i.forEach(function(l){c.addClass(c.containerId,l)})}c.parseMods();c.container=new a.common.Container(c.containerId,c.s7params,j);c.trackingManager.attach(c.container);if(c.container.isInLayout()){e()}else{c.container.addEventListener(a.event.ResizeEvent.ADDED_TO_LAYOUT,e,false)}}function e(){c.container.removeEventListener(a.event.ResizeEvent.ADDED_TO_LAYOUT,e,false);var s=document.getElementById(c.containerId);var B=s.style.minHeight;s.style.minHeight="1px";var D=document.createElement("div");D.style.position="relative";D.style.width="100%";D.style.height="100%";s.appendChild(D);var h=D.offsetHeight;if(D.offsetHeight<=1){s.style.height="100%";h=D.offsetHeight}s.removeChild(D);s.style.minHeight=B;var i=false;switch(c.s7params.get("responsive","auto")){case"fit":i=false;break;case"constrain":i=true;break;default:i=h==0;break}c.updateCSSMarkers();c.updateOrientationMarkers();if(c.container.isFixedSize()){c.viewerMode="fixed"}else{if(i){c.viewerMode="ratio"}else{c.viewerMode="free"}}c.mediaSet=new a.MediaSet(null,c.s7params,c.containerId+"_mediaSet");c.video360Player=new a.video.Video360Player(c.container,c.s7params,c.containerId+"_video360Player");c.socialShare=new a.share.SocialShare(c.container,c.s7params,c.containerId+"_socialShare");c.embedShare=new a.share.EmbedShare(c.containerId+"_socialShare",c.s7params,c.containerId+"_embedShare");c.linkShare=new a.share.LinkShare(c.containerId+"_socialShare",c.s7params,c.containerId+"_linkShare");c.twitterShare=new a.share.TwitterShare(c.containerId+"_socialShare",c.s7params,c.containerId+"_twitterShare");c.facebookShare=new a.share.FacebookShare(c.containerId+"_socialShare",c.s7params,c.containerId+"_facebookShare");c.embedShare.addEventListener(a.event.SocialEvent.NOTF_SOCIAL_ACTIVATED,t,false);c.linkShare.addEventListener(a.event.SocialEvent.NOTF_SOCIAL_ACTIVATED,t,false);c.twitterShare.addEventListener(a.event.SocialEvent.NOTF_SOCIAL_ACTIVATED,t,false);c.facebookShare.addEventListener(a.event.SocialEvent.NOTF_SOCIAL_ACTIVATED,t,false);c.socialShare.addEventListener("mouseover",function(M){c.controls.allowAutoHide(false)});c.socialShare.addEventListener("mouseout",function(M){c.controls.allowAutoHide(true)});c.linkShare.setContentUrl(document.URL);c.supportsInline=c.video360Player.supportsInline();c.controls=new a.common.ControlBar(c.container,c.s7params,c.controlsDivID);c.controls.setCSS(".s7controlbar","visibility","hidden");c.controls.attachView(c.video360Player,false);if(a.browser.device.name!="iphone"){c.controls.attach(c.socialShare)}c.socialShare.addTrackedComponent(c.controls);c.playPauseButton=new a.common.PlayPauseButton(c.controlsDivID,c.s7params,c.containerId+"_playPauseButton");c.videoScrubber=new a.video.VideoScrubber(c.controlsDivID,c.s7params,c.containerId+"_videoScrubber");c.videoTime=new a.VideoTime(c.controlsDivID,c.s7params,c.containerId+"_videoTime");c.mutableVolume=new a.video.MutableVolume(c.controlsDivID,c.s7params,c.containerId+"_mutableVolume");c.mutableVolume.setSelected(c.video360Player.muted());c.volumeButtonPosition=C(document.getElementById(c.containerId+"_mutableVolume"),"right");c.volumeButtonPosition=Number(c.volumeButtonPosition.substring(0,c.volumeButtonPosition.length-2));c.videoTimePosition=C(document.getElementById(c.containerId+"_videoTime"),"right");c.videoTimePosition=Number(c.videoTimePosition.substring(0,c.videoTimePosition.length-2));c.fullScreenButton=new a.common.FullScreenButton(c.controlsDivID,c.s7params,c.containerId+"_fullScreenButton");c.mediaSet.addEventListener(a.AssetEvent.NOTF_SET_PARSED,w,false);c.container.addEventListener(a.event.ResizeEvent.COMPONENT_RESIZE,l,false);c.container.addEventListener(a.event.ResizeEvent.FULLSCREEN_RESIZE,n,false);c.container.addEventListener(a.event.ResizeEvent.REMOVED_FROM_LAYOUT,k,false);c.container.addEventListener(a.event.ResizeEvent.ADDED_TO_LAYOUT,F,false);c.container.addEventListener(a.event.ResizeEvent.SIZE_MARKER_CHANGE,y,false);c.video360Player.addEventListener(a.event.CapabilityStateEvent.NOTF_VIDEO_CAPABILITY_STATE,u,false);c.video360Player.addEventListener(a.event.VideoEvent.NOTF_DURATION,x,false);c.video360Player.addEventListener(a.event.VideoEvent.NOTF_LOAD_PROGRESS,K,false);c.video360Player.addEventListener(a.event.VideoEvent.NOTF_CURRENT_TIME,z,false);c.playPauseButton.addEventListener("click",G);c.videoScrubber.addEventListener(a.SliderEvent.NOTF_SLIDER_UP,q,false);c.mutableVolume.addEventListener("click",m);c.mutableVolume.addEventListener(a.SliderEvent.NOTF_SLIDER_DOWN,L,false);c.mutableVolume.addEventListener(a.SliderEvent.NOTF_SLIDER_MOVE,j,false);c.mutableVolume.addEventListener(a.SliderEvent.NOTF_SLIDER_UP,j,false);c.fullScreenButton.addEventListener("click",o);c.trackingManager.setCallback(A);if((typeof(AppMeasurementBridge)=="function")&&(c.isConfig2Exist==true)){c.appMeasurementBridge=new AppMeasurementBridge(c.trackingParams);c.appMeasurementBridge.setVideoPlayer(c.video360Player)}if(c.viewerMode=="ratio"){s.style.height="auto"}if(c.container.getWidth()>0&&c.container.getHeight()>0){v(c.container.getWidth(),c.container.getHeight())}function A(O,N,R,M,P){if(!c.handlers.trackEvent&&c.isConfig2Exist!=true&&a.Modifier.parse(c.s7params.get("launch","true"),[true]).values[0]){if(typeof(_satellite)!="undefined"&&_satellite._dmviewers_v001){c.handlers.trackEvent=_satellite._dmviewers_v001().trackingFn}}if(c.appMeasurementBridge){c.appMeasurementBridge.track(O,N,R,M,P)}if(c.handlers.trackEvent){if(typeof window.s7sdk=="undefined"){window.s7sdk=a}var Q=c.containerId;c.handlers.trackEvent(Q,N,R,M,P)}if("s7ComponentEvent" in window){s7ComponentEvent(O,N,R,M,P)}}function t(M){c.video360Player.pause()}function w(N){var M=N.s7event.asset;if(M instanceof a.MediaSetDesc){var Q={};if(c.viewerMode=="ratio"){var P=M.items[0];var O=P.width/P.height;c.container.setModifier({aspect:O})}Q.posterimage=c.isPoster?c.isPoster:"";c.video360Player.setModifier(Q);if(M.type==a.ItemDescType.VIDEO_SET||M.type==a.ItemDescType.VIDEO_GROUP){c.video360Player.setItem(M)}else{c.video360Player.setItem(M.items[0])}}else{throw new Error("Failed to get meta data for video: "+N.s7event.asset)}J();v(c.container.getWidth(),c.container.getHeight());if(c.embedShare){c.embedShare.setEmbedCode(r())}if((c.handlers.initComplete!=null)&&(typeof c.handlers.initComplete=="function")&&!c.firstMediasetParsed){if(typeof window.s7sdk=="undefined"){window.s7sdk=a}c.handlers.initComplete()}c.firstMediasetParsed=true;if(c.controls){c.controls.setCSS(".s7controlbar","visibility","inherit")}}function l(M){if((typeof(M.target)=="undefined")||(M.target==document.getElementById(c.containerId+"_container"))){if(!c.container.isInLayout()){return}v(M.s7event.w,M.s7event.h);c.fullScreenButton.setSelected(c.container.isFullScreen())}}function n(M){v(M.s7event.w,M.s7event.h);c.fullScreenButton.setSelected(c.container.isFullScreen());if(!c.container.isFullScreen()){c.onFullScreenExit(M)}else{c.onFullScreenEnter(M)}}function y(M){c.updateCSSMarkers()}function F(M){if(a.browser.device.name!="desktop"){}else{if(c.storedPlayingState){c.video360Player.play();c.storedPlayingState=false}}}function k(M){if(a.browser.device.name!="desktop"){}else{}if(c.video360Player.getCapabilityState().hasCapability(a.VideoCapabilityState.PAUSE)){c.storedPlayingState=true;a.Logger.log(a.Logger.INFO,"Pause video");c.video360Player.pause()}}function u(N){var M=N.s7event.state;if(M.hasCapability(a.VideoCapabilityState.PAUSE)){c.playPauseButton.setSelected(false)}else{if(M.hasCapability(a.VideoCapabilityState.PLAY)||M.hasCapability(a.VideoCapabilityState.REPLAY)){c.playPauseButton.setSelected(true)}}c.playPauseButton.enableReplay(M.hasCapability(a.VideoCapabilityState.REPLAY))}function x(M){c.videoTime.setDuration(M.s7event.data);c.videoScrubber.setDuration(M.s7event.data)}function K(M){c.videoScrubber.setLoadedPosition(M.s7event.data)}function z(M){c.videoTime.setPlayedTime(M.s7event.data);c.videoScrubber.setPlayedTime(M.s7event.data)}function G(M){if(!c.playPauseButton.isSelected()){var N=c.video360Player.getDuration()-c.video360Player.getCurrentTime();if(N<=1){c.video360Player.seek(0)}c.video360Player.play()}else{c.video360Player.pause()}}function q(M){c.video360Player.seek(M.s7event.position*c.video360Player.getDuration())}function m(M){if(c.mutableVolume.isSelected()){c.video360Player.mute()}else{c.video360Player.unmute();c.video360Player.setVolume(c.mutableVolume.getPosition())}}function L(M){c.video360Player.unmute()}function j(M){c.video360Player.setVolume(M.s7event.position)}function o(M){if(!c.container.isFullScreen()){c.container.requestFullScreen()}else{c.container.cancelFullScreen()}}function r(){var M="";if(c.s7params.params.style!=""&&c.s7params.params.style!=undefined){M=' video360Viewer.setParam("style", "'+c.s7params.params.style+'"); \n'}var N="";if(c.s7params.params.config!=""&&c.s7params.params.config!=undefined){N=' video360Viewer.setParam("config", "'+c.s7params.params.config+'"); \n'}var P="";if(c.s7params.params.config2!=""&&c.s7params.params.config2!=undefined){P=' video360Viewer.setParam("config2", "'+c.s7params.params.config2+'"); \n'}var O='