From b3787f43c737c463f038f309f47c3c9b20df550d Mon Sep 17 00:00:00 2001 From: Ritesh Zaveri Date: Thu, 15 Jun 2023 18:44:41 +0530 Subject: [PATCH 01/13] fix_recyclerview_scrolling_issue --- sdk/src/com/appnexus/opensdk/AdFetcher.java | 8 ++++++++ sdk/src/com/appnexus/opensdk/AdView.java | 10 ++++++++++ sdk/src/com/appnexus/opensdk/AdViewRequestManager.java | 4 ++++ sdk/src/com/appnexus/opensdk/BannerAdView.java | 3 ++- sdk/src/com/appnexus/opensdk/BaseAdDispatcher.java | 6 ++++++ sdk/src/com/appnexus/opensdk/NativeAdRequest.java | 5 +++++ 6 files changed, 35 insertions(+), 1 deletion(-) diff --git a/sdk/src/com/appnexus/opensdk/AdFetcher.java b/sdk/src/com/appnexus/opensdk/AdFetcher.java index adf1f36c..d57fa64e 100644 --- a/sdk/src/com/appnexus/opensdk/AdFetcher.java +++ b/sdk/src/com/appnexus/opensdk/AdFetcher.java @@ -257,6 +257,14 @@ synchronized public void handleMessage(Message msg) { Clog.e(Clog.lazyLoadLogTag, "Lazy Load Fetching"); ((AdView)fetcher.owner).deactivateWebviewForNextCall(); } + + // Checks if the AdResponseReceived is enabled (isAdResponseReceived - boolean in the AdView) + if (fetcher.owner != null && fetcher.owner instanceof BannerAdView) { + if(((AdView)fetcher.owner).isAdResponseReceived) { + ((AdView)fetcher.owner).isAdResponseReceived = false; + } + } + fetcher.lastFetchTime = System.currentTimeMillis(); // Spawn an AdRequest diff --git a/sdk/src/com/appnexus/opensdk/AdView.java b/sdk/src/com/appnexus/opensdk/AdView.java index bc38b389..0bd15d61 100644 --- a/sdk/src/com/appnexus/opensdk/AdView.java +++ b/sdk/src/com/appnexus/opensdk/AdView.java @@ -106,6 +106,11 @@ public abstract class AdView extends FrameLayout implements Ad, MultiAd, Visibil // Client suggested change for memory leak in VisibilityDetector private boolean isDestroyed = false; + /** + * This variable keeps track if the AdRequest has been completed and the AdResponse is received or not + * This does not ascertain that the received response is valid or not + */ + protected boolean isAdResponseReceived = false; /** * Begin Construction @@ -1181,6 +1186,11 @@ public void run() { }); } + @Override + public void onAdResponseReceived() { + isAdResponseReceived = true; + } + private void handleNativeAd(AdResponse ad) { setAdType(AdType.NATIVE); diff --git a/sdk/src/com/appnexus/opensdk/AdViewRequestManager.java b/sdk/src/com/appnexus/opensdk/AdViewRequestManager.java index a2d3c236..e767dac4 100644 --- a/sdk/src/com/appnexus/opensdk/AdViewRequestManager.java +++ b/sdk/src/com/appnexus/opensdk/AdViewRequestManager.java @@ -180,6 +180,10 @@ public void onReceiveAd(AdResponse ad) { public void onReceiveUTResponse(UTAdResponse response) { super.onReceiveUTResponse(response); Clog.d(Clog.baseLogTag, "onReceiveUTResponse"); + Ad ownerAd = owner.get(); + if(ownerAd != null && ownerAd.getAdDispatcher() != null) { + ownerAd.getAdDispatcher().onAdResponseReceived(); + } processUTResponse(response); } diff --git a/sdk/src/com/appnexus/opensdk/BannerAdView.java b/sdk/src/com/appnexus/opensdk/BannerAdView.java index 39d7482d..f2c19a3b 100644 --- a/sdk/src/com/appnexus/opensdk/BannerAdView.java +++ b/sdk/src/com/appnexus/opensdk/BannerAdView.java @@ -906,7 +906,8 @@ protected void onWindowVisibilityChanged(int visibility) { //The only time we want to request on visibility changes is if an ad hasn't been loaded yet (loadAdHasBeenCalled) // shouldReloadOnResume is true // OR auto_refresh is enabled - if (loadAdHasBeenCalled && (shouldReloadOnResume || (period > 0))) { + // OR isAdResponseReceived is false + if (loadAdHasBeenCalled && (shouldReloadOnResume || (period > 0) || !isAdResponseReceived)) { //If we're MRAID mraid_is_closing or expanding, don't load. if (!mraid_is_closing && !mraid_changing_size_or_visibility diff --git a/sdk/src/com/appnexus/opensdk/BaseAdDispatcher.java b/sdk/src/com/appnexus/opensdk/BaseAdDispatcher.java index aebf2146..721f0bbb 100644 --- a/sdk/src/com/appnexus/opensdk/BaseAdDispatcher.java +++ b/sdk/src/com/appnexus/opensdk/BaseAdDispatcher.java @@ -49,4 +49,10 @@ public interface BaseAdDispatcher { * Called on ad impression */ public void onAdImpression(); + + /** + * Called when an ad request is completed + * and ad response is received + */ + public void onAdResponseReceived(); } diff --git a/sdk/src/com/appnexus/opensdk/NativeAdRequest.java b/sdk/src/com/appnexus/opensdk/NativeAdRequest.java index 3af9c7ce..3b02bd9b 100644 --- a/sdk/src/com/appnexus/opensdk/NativeAdRequest.java +++ b/sdk/src/com/appnexus/opensdk/NativeAdRequest.java @@ -562,6 +562,11 @@ public void onAdClicked(String clickUrl) { public void onAdImpression() { Clog.d(Clog.nativeLogTag, "onAdImpression"); } + + @Override + public void onAdResponseReceived() { + + } } @Override From 529c6b38af45b8f3b1570d3d86e8c026e03116e9 Mon Sep 17 00:00:00 2001 From: Ritesh Zaveri Date: Thu, 15 Jun 2023 19:18:00 +0530 Subject: [PATCH 02/13] updated test cases --- .../java/com/appnexus/opensdk/instreamvideo/VideoAd.java | 5 +++++ sdk/test/com/appnexus/opensdk/MRAIDImplementationTest.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/instreamvideo/src/main/java/com/appnexus/opensdk/instreamvideo/VideoAd.java b/instreamvideo/src/main/java/com/appnexus/opensdk/instreamvideo/VideoAd.java index adf8bcf6..65c1c461 100644 --- a/instreamvideo/src/main/java/com/appnexus/opensdk/instreamvideo/VideoAd.java +++ b/instreamvideo/src/main/java/com/appnexus/opensdk/instreamvideo/VideoAd.java @@ -573,6 +573,11 @@ public void onAdClicked(String clickUrl) { public void onAdImpression() { Clog.d(Clog.videoLogTag, "onAdImpression"); } + + @Override + public void onAdResponseReceived() { + + } } public void activityOnDestroy() { diff --git a/sdk/test/com/appnexus/opensdk/MRAIDImplementationTest.java b/sdk/test/com/appnexus/opensdk/MRAIDImplementationTest.java index 8d333825..4e3e167c 100644 --- a/sdk/test/com/appnexus/opensdk/MRAIDImplementationTest.java +++ b/sdk/test/com/appnexus/opensdk/MRAIDImplementationTest.java @@ -424,5 +424,10 @@ public void onAdClicked(String clickUrl) { public void onAdImpression() { adImpression = true; } + + @Override + public void onAdResponseReceived() { + + } } } From c35efdb40f9d9319710dc5da560f0fc230350986 Mon Sep 17 00:00:00 2001 From: Abhas Vohra Date: Wed, 28 Jun 2023 19:19:11 +0530 Subject: [PATCH 03/13] Added debug logs for onAdResponseReceived --- .../main/java/com/appnexus/opensdk/instreamvideo/VideoAd.java | 2 +- sdk/src/com/appnexus/opensdk/AdView.java | 1 + sdk/src/com/appnexus/opensdk/NativeAdRequest.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/instreamvideo/src/main/java/com/appnexus/opensdk/instreamvideo/VideoAd.java b/instreamvideo/src/main/java/com/appnexus/opensdk/instreamvideo/VideoAd.java index 65c1c461..ce212e8f 100644 --- a/instreamvideo/src/main/java/com/appnexus/opensdk/instreamvideo/VideoAd.java +++ b/instreamvideo/src/main/java/com/appnexus/opensdk/instreamvideo/VideoAd.java @@ -576,7 +576,7 @@ public void onAdImpression() { @Override public void onAdResponseReceived() { - + Clog.d(Clog.videoLogTag, "onAdResponseReceived"); } } diff --git a/sdk/src/com/appnexus/opensdk/AdView.java b/sdk/src/com/appnexus/opensdk/AdView.java index 0bd15d61..df728c47 100644 --- a/sdk/src/com/appnexus/opensdk/AdView.java +++ b/sdk/src/com/appnexus/opensdk/AdView.java @@ -1188,6 +1188,7 @@ public void run() { @Override public void onAdResponseReceived() { + Clog.d(Clog.baseLogTag, "onAdResponseReceived"); isAdResponseReceived = true; } diff --git a/sdk/src/com/appnexus/opensdk/NativeAdRequest.java b/sdk/src/com/appnexus/opensdk/NativeAdRequest.java index 3b02bd9b..ecd5aa3d 100644 --- a/sdk/src/com/appnexus/opensdk/NativeAdRequest.java +++ b/sdk/src/com/appnexus/opensdk/NativeAdRequest.java @@ -565,7 +565,7 @@ public void onAdImpression() { @Override public void onAdResponseReceived() { - + Clog.d(Clog.nativeLogTag, "onAdResponseReceived"); } } From 60878996ff8e494c2780ebf8ef1b565f5cd57bcc Mon Sep 17 00:00:00 2001 From: Abhas Vohra Date: Wed, 28 Jun 2023 19:24:27 +0530 Subject: [PATCH 04/13] Added inline comment --- sdk/src/com/appnexus/opensdk/BaseAdDispatcher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/src/com/appnexus/opensdk/BaseAdDispatcher.java b/sdk/src/com/appnexus/opensdk/BaseAdDispatcher.java index 721f0bbb..0cf9ec7a 100644 --- a/sdk/src/com/appnexus/opensdk/BaseAdDispatcher.java +++ b/sdk/src/com/appnexus/opensdk/BaseAdDispatcher.java @@ -52,7 +52,7 @@ public interface BaseAdDispatcher { /** * Called when an ad request is completed - * and ad response is received + * and successful ad response is received */ public void onAdResponseReceived(); } From 890d2bd792d30db82a58953052d83397189ed5ad Mon Sep 17 00:00:00 2001 From: Abhas Vohra Date: Wed, 28 Jun 2023 19:29:34 +0530 Subject: [PATCH 05/13] Added log message --- sdk/src/com/appnexus/opensdk/AdFetcher.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/src/com/appnexus/opensdk/AdFetcher.java b/sdk/src/com/appnexus/opensdk/AdFetcher.java index d57fa64e..07c5bc4c 100644 --- a/sdk/src/com/appnexus/opensdk/AdFetcher.java +++ b/sdk/src/com/appnexus/opensdk/AdFetcher.java @@ -259,9 +259,10 @@ synchronized public void handleMessage(Message msg) { } // Checks if the AdResponseReceived is enabled (isAdResponseReceived - boolean in the AdView) - if (fetcher.owner != null && fetcher.owner instanceof BannerAdView) { + if (fetcher.owner != null && fetcher.owner instanceof AdView) { if(((AdView)fetcher.owner).isAdResponseReceived) { ((AdView)fetcher.owner).isAdResponseReceived = false; + Clog.d(Clog.baseLogTag, "Resetting isAdResponseReceived for Banner / Interstitial"); } } From f88c0c3ca2f1005d1a3566ea576787f6e5bfd557 Mon Sep 17 00:00:00 2001 From: Ritesh Zaveri Date: Wed, 28 Jun 2023 14:02:02 +0000 Subject: [PATCH 06/13] Pull request #710: Retrieve AAID only if permitted Merge in MOBILE-SDK/app_mobile-sdk-android from MS-5332_retrieve_aaid_if_permitted to develop Squashed commit of the following: commit fb01658ee439e00cc0c2db3ab5d69e331b410fb9 Author: Ritesh Zaveri Date: Wed Jun 21 13:52:54 2023 +0530 added check while retrieving aaid --- .../opensdk/utils/AdvertisingIDUtil.java | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/sdk/src/com/appnexus/opensdk/utils/AdvertisingIDUtil.java b/sdk/src/com/appnexus/opensdk/utils/AdvertisingIDUtil.java index be884faa..e2b13f30 100644 --- a/sdk/src/com/appnexus/opensdk/utils/AdvertisingIDUtil.java +++ b/sdk/src/com/appnexus/opensdk/utils/AdvertisingIDUtil.java @@ -63,30 +63,31 @@ private static Pair getAAID(Context context) { Boolean limited = false; // attempt to retrieve AAID from GooglePlayServices via reflection + if (Settings.getSettings().deviceAccessAllowed && !SDKSettings.isAAIDUsageDisabled() && !Settings.getSettings().doNotTrack) { + try { + if (context != null) { + // NPE catches null objects + Class cInfo = Class.forName(cAdvertisingIdClientInfoName); + Class cClient = Class.forName(cAdvertisingIdClientName); - try { - if (context != null) { - // NPE catches null objects - Class cInfo = Class.forName(cAdvertisingIdClientInfoName); - Class cClient = Class.forName(cAdvertisingIdClientName); - - Method mGetAdvertisingIdInfo = cClient.getMethod("getAdvertisingIdInfo", Context.class); - Method mGetId = cInfo.getMethod("getId"); - Method mIsLimitAdTrackingEnabled = cInfo.getMethod("isLimitAdTrackingEnabled"); + Method mGetAdvertisingIdInfo = cClient.getMethod("getAdvertisingIdInfo", Context.class); + Method mGetId = cInfo.getMethod("getId"); + Method mIsLimitAdTrackingEnabled = cInfo.getMethod("isLimitAdTrackingEnabled"); - Object adInfoObject = cInfo.cast(mGetAdvertisingIdInfo.invoke(null, context)); + Object adInfoObject = cInfo.cast(mGetAdvertisingIdInfo.invoke(null, context)); - aaid = (String) mGetId.invoke(adInfoObject); - limited = (Boolean) mIsLimitAdTrackingEnabled.invoke(adInfoObject); + aaid = (String) mGetId.invoke(adInfoObject); + limited = (Boolean) mIsLimitAdTrackingEnabled.invoke(adInfoObject); + } + } catch (ClassNotFoundException ignored) { + } catch (InvocationTargetException ignored) { + } catch (NoSuchMethodException ignored) { + } catch (IllegalAccessException ignored) { + } catch (ClassCastException ignored) { + } catch (NullPointerException ignored) { + } catch (Exception ignored) { + // catches GooglePlayServicesRepairableException, GooglePlayServicesNotAvailableException } - } catch (ClassNotFoundException ignored) { - } catch (InvocationTargetException ignored) { - } catch (NoSuchMethodException ignored) { - } catch (IllegalAccessException ignored) { - } catch (ClassCastException ignored) { - } catch (NullPointerException ignored) { - } catch (Exception ignored) { - // catches GooglePlayServicesRepairableException, GooglePlayServicesNotAvailableException } // set or clear the AAID depending on success/failure From fab9d9df9783cf563a2bb8dd56f5c4f91357d139 Mon Sep 17 00:00:00 2001 From: ksubramanian Date: Wed, 28 Jun 2023 22:49:36 -0400 Subject: [PATCH 07/13] Changes for video orientation --- .../com/example/simplebanner/MyActivity.java | 26 +++++- sdk/assets/mobilevastplayer.js | 18 ++--- sdk/src/com/appnexus/opensdk/AdWebView.java | 43 ++++++++++ .../com/appnexus/opensdk/BannerAdView.java | 79 +++++++++++++++++++ .../appnexus/opensdk/VideoImplementation.java | 16 +++- 5 files changed, 171 insertions(+), 11 deletions(-) diff --git a/examples/java/SimpleBanner/app/src/main/java/com/example/simplebanner/MyActivity.java b/examples/java/SimpleBanner/app/src/main/java/com/example/simplebanner/MyActivity.java index 51d9da05..2cd87f42 100644 --- a/examples/java/SimpleBanner/app/src/main/java/com/example/simplebanner/MyActivity.java +++ b/examples/java/SimpleBanner/app/src/main/java/com/example/simplebanner/MyActivity.java @@ -24,7 +24,10 @@ import android.widget.Toast; import com.appnexus.opensdk.ANClickThroughAction; +import com.appnexus.opensdk.Ad; import com.appnexus.opensdk.AdListener; +import com.appnexus.opensdk.AdSize; +import com.appnexus.opensdk.AdType; import com.appnexus.opensdk.AdView; import com.appnexus.opensdk.BannerAdView; import com.appnexus.opensdk.InitListener; @@ -54,6 +57,10 @@ public void onInitFinished(boolean success) { Log.d("sdkVersion", "sdkVersion: "+ SDKSettings.getSDKVersion()); // This is your AppNexus placement ID. bav.setPlacementID("17058950"); + bav.setAllowBannerDemand(false); + bav.setAllowVideoDemand(true); + //bav.setForceCreativeId(182434863); // Landscape creative + bav.setForceCreativeId(414238306); // Portrait/vertical video // Turning this on so we always get an ad during testing. bav.setShouldServePSAs(false); @@ -62,11 +69,16 @@ public void onInitFinished(boolean success) { bav.setClickThroughAction(ANClickThroughAction.OPEN_SDK_BROWSER); // Get a 300x50 ad. - bav.setAdSize(300, 250); + bav.setAdSize(320, 250); // Resizes the container size to fit the banner ad bav.setResizeAdToFitContainer(true); + bav.setPortraitBannerVideoPlayerSize(new AdSize(300,400)); + bav.setLandscapeBannerVideoPlayerSize(new AdSize(300,250)); + bav.setSquareBannerVideoPlayerSize(new AdSize(200,200)); + + // Set up a listener on this ad view that logs events. AdListener adListener = new AdListener() { @Override @@ -81,6 +93,18 @@ public void onAdRequestFailed(AdView bav, ResultCode errorCode) { @Override public void onAdLoaded(AdView bav) { Clog.v("SIMPLEBANNER", "The Ad Loaded!"); + if((bav instanceof BannerAdView) && bav.getAdResponseInfo().getAdType()== AdType.VIDEO) { + Clog.d("SIMPLEBANNER","Banner:: Width="+ bav.getCreativeWidth()); + Clog.d("SIMPLEBANNER","Banner:: Height="+ bav.getCreativeHeight()); + Clog.d("SIMPLEBANNER","Banner:: Orientation="+ ((BannerAdView) bav).getVideoOrientation().name()); + + + //New API Option - 4 - start + // Actual Width and Height of the video creative is exposed to publisher app. + Clog.d("SIMPLEBANNER","Video Creative width::"+ ((BannerAdView) bav).getBannerVideoCreativeWidth()); + Clog.d("SIMPLEBANNER","Video Creative height::"+ ((BannerAdView) bav).getBannerVideoCreativeHeight()); + //New API Option - 4 - end + } } @Override diff --git a/sdk/assets/mobilevastplayer.js b/sdk/assets/mobilevastplayer.js index 8dcd8c02..7bbfb74c 100644 --- a/sdk/assets/mobilevastplayer.js +++ b/sdk/assets/mobilevastplayer.js @@ -1,7 +1,7 @@ /*! (c)2023 AppNexus, Inc. v1.5.1 -This code contains portions of Video.js modified by AppNexus. Video.js is Copyright Brightcove, Inc. and Licensed under the Apache License, Version 2.0 (the “License”); you may not use Video.js except in compliance with the License. You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +This code contains portions of Video.js modified by AppNexus. Video.js is Copyright Brightcove, Inc. and Licensed under the Apache License, Version 2.0 (the “License”); you may not use Video.js except in compliance with the License. You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Apache License, Version 2.0 TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. @@ -21,7 +21,7 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION a. You must give any other recipients of the Work or Derivative Works a copy of this License; and b. You must cause any modified files to carry prominent notices stating that You changed the files; and c. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and -d. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. +d. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. @@ -30,14 +30,14 @@ You may add Your own copyright statement to Your modifications and may provide a 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. -This code contains portions of videojs-vast-plugin which is licensed under the MIT License. +This code contains portions of videojs-vast-plugin which is licensed under the MIT License. The MIT License (MIT) Copyright (c) 2015 MailOnline Permission is here by granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -var APNVideo_MobileVastPlayer=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){var i=[];function r(e,t){if(!e)return null;for(var n=0;n cbWhenQuartile "+t),v(t,{})},k=function(e,n){var i=e,r=n;if("AdHandler"===i&&"video_impression"===r)try{var o=new CustomEvent("outstream-impression");t.dispatchEvent(o)}catch(e){error(e)}for(var a=[{type:"AdHandler",name:"video_start",mappedEventName:"videoStart"},{type:"AdHandler",name:"rewind",mappedEventName:"videoRewind"},{type:"AdHandler",name:"video_fullscreen_enter",mappedEventName:"video-fullscreen-enter"},{type:"AdHandler",name:"video_fullscreen_exit",mappedEventName:"video-fullscreen-exit"}],s=0;s cbWhenVideoComplete "+t),v(t,{})},S=function(t){e("VastPlayer > cbWhenSkipped "+t),v(t,{})},C=function(t){e("VastPlayer > cbWhenAudio "+t),v(t,{})},I=function(e){v(e,{})},_=function(t){e("VastPlayer > cbWhenFullScreen "+t),v(t,{})},j=function(n,r,o){e("VastPlayer > cbTerminate isError: "+n);var a="unknown";t&&(a=t.id.toString()),e("VastPlayer > cbTerminate: bTerminated = "+m+", targetElement id = "+a),y=!1,m||(m=!0,r||P(),!o&&N()&&d.overlayPlayer&&P(),t&&(A&&(A.isPlayingVideo&&(e("VastPlayer > cbTerminate: pause ad"),A.pause()),t.style.height="1px",A.resizePlayer(1,1)),setTimeout((function(){t&&(t.innerHTML="",i.removeChild(t)),t=null}),2e3)),v&&n&&v("video-error",{}))},P=function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()},x=function(n){var i,r,a,s,l;i=n&&n.options&&n.options.video&&n.options.video.url?n.options.video.url:"",r=n&&n.options&&n.options.data&&n.options.data.vastDurationMsec?n.options.data.vastDurationMsec:0,a=n&&n.options&&n.options.finalVastXml?n.options.finalVastXml:"",s=n&&n.options&&n.options.finalVastUri?n.options.finalVastUri:"",l=n&&n.getFinalAspectRatio()?n.getFinalAspectRatio():"",m||(p=!0,A=n,e("VastPlayer > cbWhenReady in "+((new Date).getTime()-o)+" msecs"),v&&v("adReady",{creativeUrl:i,duration:r,vastXML:a,vastCreativeUrl:s,aspectRatio:l}),"click"===d.initialPlayback||d.cachePlayer||(N()&&d.overlayPlayer?d.forceAdInFullscreen?(b=!0,P()):(t&&(t.style.width="1px",t.style.height="1px"),j(!1,!0,!0)):A.play()))};function V(n){n.cbNotification=function(e,t){k(e,t)},e("Build Ad Player Callback"),m||(f?g?(g.options=r.init(g.options),r.buildPlayer(g.callbacks,g.options),g={options:n,callbacks:c}):y?(g={options:n,callbacks:c},v(t,{})):(n=r.init(n),r.buildPlayer(c,n),y=!0):(g=null,e("Building single player"),n=r.init(n),r.buildPlayer(c,n)))}function M(){d={},t=null,i=null,c={},r=Object.create(s),u&&clearTimeout(u),u=null,p=!1,h=3e3,v=null,f=!1,m=!1,g=null,y=!1,o=null}function N(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement}function D(){var n,r;if(e("repositionPlayer: try reposion/resize overlay player"),d.cachePlayer||m)e("repositionPlayer: never reposition terminated or cache palyer");else if(!N()){n=i.offsetWidth,r=i.offsetHeight;var o=i.style.borderWidth;if(o&&o.length>0){var a=Number(o.substring(0,o.length-2));n-=2*a,r-=2*a}t.style.width=n+"px",t.style.height=r+"px";var s=L(i);e("repositionPlayer: targetDiv absolute posiotion ="+s.left+", "+s.top),t.style.left=s.left+"px",t.style.top=s.top+"px",e("repositionPlayer: size = "+n+", "+r),d.overlayPlayer?A.resizePlayer(n,r):A.resizeVideo(null,!1,null)}}var O=null;function R(t){switch(e("Got notification: "+t),t){case"leaveFullscreen":P();break;default:e("Unknown player notification: "+t)}}function L(e){for(var t=0,n=0;e&&"BODY"!==e.tagName&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);){var i=document.defaultView.getComputedStyle(e,null).position;if(i&&""!==i&&"static"!==i)break;t+=e.offsetLeft-e.scrollLeft+e.clientLeft,n+=e.offsetTop-e.scrollTop+e.clientTop,e=e.offsetParent}return{left:t,top:n}}function U(e,t){if(!e.children)return t;for(var n,i,r=Math.max(t,(n=e,"auto"!==(i=document.defaultView.getComputedStyle(n,null).zIndex)?i:0)),o=0;o0){var y=Number(g.substring(0,g.length-2));d.width-=2*y,d.height-=2*y}d.playerHeight=d.height,function(){var t;try{t=function(){try{var e=navigator.platform,t=navigator.userAgent,n=navigator.appVersion;if(/iP(hone|od|ad)/.test(e)&&!/CriOS/.test(t)){var i=n.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3]||0,10)]}return[0,0,0]}catch(e){return[0,0,0]}}()[0]>=8&&!0===d.enableInlineVideoForIos}catch(t){e(t)}return t}()&&(d.playerHeight-=30),N()&&(d.fullscreenMode=!0),e("offsetWidth="+n.offsetWidth+", offsetHeight="+n.offsetHeight+", borderWidth="+n.style.borderWidth);var A=document.createElement("div");A.style.width=d.width+"px",d.fitInContainer?A.style.height=d.height+"px":d.cachePlayer&&d.overlayPlayer?A.style.height="1px":A.style.height=d.height+"px",A.style.backgroundColor="black",A.id=n.id+"_overlay_"+(new Date).getTime();var b=L(n);e("targetDiv absolute posiotion ="+b.left+", "+b.top),A.style.position="absolute",A.style.left=b.left+"px",A.style.top=b.top+"px",d.fitInContainer?A.style.zIndex=Math.max(100,U(n,0)+1):(w=Math.max(100,U(n,0)+1),d.cachePlayer&&d.overlayPlayer?A.style.zIndex=0:A.style.zIndex=w),n.appendChild(A),e("player container offsetLeft = "+A.offsetLeft+", offsetTop = "+A.offsetTop),t=A,i=n,o=(new Date).getTime(),e("timeToReady = "+h+", start time = "+o),u=setTimeout((function(){p||(j(!1),v&&v("Timed-out",{}))}),h);c.cbRenderVideo=function(t,n){e("VastPlayer > cbRenderVideo called");try{e("VastPlayer > cbRenderVideo options: ",JSON.stringify(n))}catch(e){}V(n)},c.cbWhenDestroy=j,c.cbWhenReady=x,c.cbWhenQuartile=T,c.cbWhenVideoComplete=E,c.cbWhenSkipped=S,c.cbWhenFullScreen=_,c.cbWhenAudio=C,c.cbWhenClickOpenUrl=I,c.cbCoreVideoEvent=k,d.playerNotification=R,d.overlayPlayer&&(d.hasOwnProperty("allowFullscreen")||(d.allowFullscreen=!1)),e("VP >> before options.initialAudio = "+d.initialAudio),"auto"===d.initialPlayback&&"on"===d.initialAudio&&(navigator.appVersion.indexOf("Mobile")>-1||navigator.appVersion.indexOf("Android")>-1)&&navigator.userAgent.indexOf("Chrome")>-1&&function(){var e=navigator.appVersion.indexOf("Chrome/");if(e>=0){var t=navigator.appVersion.substr(e+7);return(e=t.indexOf("."))>0?Number(t.substr(0,e)):0}return 0}()>=53&&(d.showMute=!0,d.showVolume=!0),e("VP >> after options.initialAudio = "+d.initialAudio),l(t,d,c)}document.body.onresize&&(O=document.body.onresize),window.onresize=function(n){e("Resize event happend"),t&&A&&(b?(b=!1,d.fitInContainer&&(t.style.zIndex=w),setTimeout((function(){D(),"click"!==d.initialPlayback&&A.play()}),100)):D()),O&&O(n)},this.playVast=function(t,n,i,r,o){e("VP >> playVast function called playerId = "+this.vastPlayerId),j(!1,!0),M(),(d=n).vastXml=i,F(t,r,o)},this.playAdObject=function(t,n,i,r,o){e("VP >> playAdObject function called playerId = "+this.vastPlayerId+", cache mode = "+n.cachePlayer),j(!1,!0),M(),d=n,"string"==typeof i?d.vastXml=i:(d.useAdObj=!0,d.adObj=i),F(t,r,o)},this.stop=function(){u&&(clearTimeout(u),u=null),j(!1)},this.removeFromPage=function(){u&&(clearTimeout(u),u=null),m=!0,t&&(t.innerHTML="",i.removeChild(t),t=null)},this.play=function(){e("VP >> play function called playerId = "+this.vastPlayerId),A&&(d.cachePlayer=!1,N()&&d.overlayPlayer?d.forceAdInFullscreen?(b=!0,P()):j(!1,!0,!0):(t&&!1===d.fitInContainer&&(t.style.zIndex=w),D(),"click"!==d.initialPlayback&&A.play()))},this.sendPlay=function(){e("VP >> sendPlay function called playerID = "+this.vastPlayerId),A&&!A.isPlayingVideo&&A.play()},this.sendPause=function(){e("VP >> sendPause function called playerID = "+this.vastPlayerId),A&&A.isPlayingVideo&&A.pause()},this.handleFullscreen=function(e){A&&(e?i.requestFullscreen?i.requestFullscreen():i.webkitRequestFullscreen?i.webkitRequestFullscreen():i.mozRequestFullScreen?i.mozRequestFullScreen():i.msRequestFullscreen&&i.msRequestFullscreen():document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen())},this.vastPlayerId=(new Date).getTime(),this.isTerminated=function(){return m},this.getIsVideoPlaying=function(){return!(!A||!A.isPlayingVideo)},this.getCurrentPlayHeadTime=function(){var e=0;return r&&r.adVideoPlayer&&"function"==typeof r.adVideoPlayer.player&&(e=1e3*r.adVideoPlayer.player().currentTime(),e=parseInt&&"function"==typeof parseInt?parseInt(e):e),e}};e.exports={playAdObject:function(e,t,n,i,r){var a=o(t.targetElementId,t.cachePlayer);a&&a.playAdObject(e,t,n,i,r)},playVast:function(e,t,n,i,r){var a=o(t.targetElementId);a&&a.playVast(e,t,n,i,r)},loadAndPlayVast:function(e,t,i,r,a){n(88).load(i,(function(s,l){if(s||0===l.length){n(86).logDebug("Failed to load "+i,"Vast Video Player")}else{var d=o(t.targetElementId);d&&d.playVast(e,t,l,r,a)}}))},stop:function(e,t){var n=r(e.id,t);n&&n.stop()},removeFromPage:function(e){var t=r(e);t&&t.removeFromPage()},play:function(e,t){var n=function(e,t){if(!e)return null;for(var n=0;n-1,videojs_vpaid:o,overlayPlayer:!1,forceToSkip:!1,ExtendDefaultOption:a,delayEventHandler:null,pausedByViewability:!1,mutedByVisibility:!1,isReadyToExpandForMobile:!1,isAlreadyPlaingForVPAID:!1,isSideStreamActivated:!1,isExpanded:!0,isVideoCompleteInjected:!1,isFullscreenToggled:!1,toggleWindowFocus:!0,viewabilityTracking:null,isDoneFirstLoadStart:!1,startedReplay:!1,Utils:l,isAlreadyStart:!1,isEnded:!1,blockTrackingUserActivity:!1,videoId:"",divIdForVideo:"",simidIntegratorObj:null,init:function(e){var t=a(b,e);return this.options=t,!0===this.options.skippable.allowOverride&&(this.options.skippable.videoThreshold=0,this.options.skippable.enabled=!0),"boolean"==typeof this.options.disableCollapse&&(this.options.disableCollapse={enabled:this.options.disableCollapse,replay:!1}),this.delayEventHandler=new d,this.delayEventHandler.suppress(this.options.delayExpandUntilVPAIDImpression),this.delayEventHandler.start(),this.viewabilityTracking=new p,t},getValueFromPlayer:function(e){var t=0;try{"controlBar.height"===e&&this.adVideoPlayer&&this.adVideoPlayer.controlBar&&this.adVideoPlayer.controlBar.height&&"function"==typeof this.adVideoPlayer.controlBar.height&&"html5"===this.decidePlayer(this.options.requiredPlayer)&&(t=this.adVideoPlayer.controlBar.height())}catch(e){g(e)}return t},decidePlayer:function(){return"html5"},buildPlayer:function(e,t){var n=this;if(t.waterfallStepId&&m("CHECKING AUTOPLAY FOR WATERFALL STEP: "+t.waterfallStepId),"html5"===this.decidePlayer(t.requiredPlayer)&&this.autoplayHandler&&!t.overlayPlayer){var i;i=!h.isMobile()&&("on"===t.initialAudio||!0===t.audioOnMouseover),n.autoplayHandler.getAutoplayPolicy((function(i){var r=n.autoplayHandler.videoPolicy;switch(i){case r.allowAutoplay:break;case r.stopMediaWithSound:if(h.isMobile()&&"native"===t.adType&&t.vpaid&&n.isAlreadyPlaingForVPAID)break;"on"===t.initialAudio?("auto"!==t.initialPlayback&&"mouseover"!==t.initialPlayback||(t.initialAudio="off",t.audioOnMouseover=!1),!0===t.isWaterfall&&(t.adAttempt>0?(t.initialAudio="off",t.audioOnMouseover=!1):t.audioOnMouseover=!0)):"auto"!==t.initialPlayback&&"mouseover"!==t.initialPlayback||(t.audioOnMouseover=!1);break;case r.neverAutoplay:t.initialPlayback="click",t.isWaterfall&&(t.isWaterfall=!1,t.stopWaterfall=!0)}t.waterfallStepId&&m("BUILDING PLAYER FOR WATERFALL STEP: "+t.waterfallStepId),n.buildPlayerCallback(e,t)}),i)}else n.buildPlayerCallback(e,t)},buildPlayerCallback:function(e,t){this.callbackForAdUnit=e,t.hasOwnProperty("overlayPlayer")&&(this.overlayPlayer=t.overlayPlayer,t.hasOwnProperty("fullscreenMode")&&(t.allowFullscreen=!1)),this.options.targetElement&&!this.options.firstAdAttempted&&(this.options.targetElement.style.backgroundImage||(this.options.targetElement.style.visibility="hidden"));var n="APNVideo_Player_"+((new Date).getTime()+Math.floor(1e4*Math.random()));this.externalNameOfVideoPlayer=n,r(e,t,this)},getPlayerStatus:function(){},notifyPlayer:function(e,t){this.adVideoPlayer.handleAdUnitNotification({name:e,value:t})},load:function(){if("html5"===this.decidePlayer(this.options.requiredPlayer)){m("load video");try{this.adVideoPlayer&&void 0!==this.adVideoPlayer&&this.adVideoPlayer.load&&"function"==typeof this.adVideoPlayer.load&&(this.options.delayExpandUntilVPAIDImpression&&this.adVideoPlayer.player()&&this.adVideoPlayer.player().autoplay()&&this.adVideoPlayer.player().autoplay(!1),this.adVideoPlayer.load())}catch(e){g(e)}}},replay:function(){if(this.isEnded)if(!this.options.vpaid||"native"!==this.options.adType&&"preview"!==this.options.adType)this.dispatchEventToAdunit({name:"rewind"}),this.startedReplay=!0,this.isEnded=!1,this.explicitPlay(),this.adVideoPlayer.controlBar.playToggle&&this.adVideoPlayer.controlBar.playToggle.el()&&this.adVideoPlayer.controlBar.playToggle.el().style&&(this.adVideoPlayer.controlBar.playToggle.el().style["pointer-events"]=""),this.options.sideStream&&!0===this.options.sideStream.wasEnabled&&(this.options.sideStream.enabled=!0,delete this.options.sideStream.wasEnabled),this.options.endCard&&this.options.endCard.enabled&&(this.actualPlayByVideoJS(),l.isIos()||this.adVideoPlayer.bigPlayButton.show());else{this.dispatchEventToAdunit({name:"rewind"});var e=this.iframeVideoWrapper||document.getElementById(this.options.iframeVideoWrapperId);e&&e.parentNode.removeChild(e),navigator.userAgent.indexOf("Trident/7.0")>-1||l.isIos()?(this.isEnded=!1,this.dispatchEventToAdunit({name:"replay-vpaid"})):(this.dispatchEventToAdunit({name:"replay-vpaid"}),this.isEnded=!1),this.adVideoPlayer.controlBar.playToggle&&this.adVideoPlayer.controlBar.playToggle.el()&&this.adVideoPlayer.controlBar.playToggle.el().style&&(this.adVideoPlayer.controlBar.playToggle.el().style["pointer-events"]="")}},actualPlayByVideoJS:function(){this.adVideoPlayer.play(),this.options.vpaid&&this.adVideoPlayer.trigger("handleManualUserInActive")},play:function(){if(!0!==this.isEnded){var e=h.isMobile()&&h.iOSversion()[0]>=10&&!1===this.options.enableInlineVideoForIos;if(e&&!l.isIphone()&&"native"===this.options.adType&&(e=!1),e){var t=this;t.overlayPlayer?t.options.targetElement.style.overflow="":setTimeout((function(){t.options.targetElement.style.overflow=""}),t.options.expandTime)}if(this.isAlreadyPlaingForVPAID=!0,!this.isCompleted){if(m("play video"),this.isDoneInitialPlay?(this.decidePlayer(this.options.requiredPlayer),this.isPlayingVideo||this.dispatchEventToAdunit({name:"video_resume"})):this.options.vpaid||(this.dispatchEventToAdunit({name:"video_start"}),this.dispatchEventToAdunit({name:"video_impression"})),this.options.vpaid&&this.isIosInlineRequired()?this.isDoneInitialPlay?this.actualPlayByVideoJS():this.adVideoPlayer.trigger("play"):this.options.vpaid&&this.options.overlayPlayer&&h.isIOS()&&h.iOSversion()[0]<10&&!this.isDoneInitialPlay||this.options.vpaid&&this.options.overlayPlayer&&navigator.appVersion.indexOf("Android")>-1&&this.options.enableWaterfall&&!this.isDoneInitialPlay?this.adVideoPlayer.trigger("play"):this.actualPlayByVideoJS(),"native"===this.options.adType&&h.isMobile()){var n=this.adVideoPlayer.controlBar;setTimeout((function(){n.el_.style.opacity=1,n.el_.style.visibility="visible"}),500)}"html5"===this.decidePlayer(this.options.requiredPlayer)||(this.isPlayingVideo=!0),this.isDoneInitialPlay=!0,this.isEnded=!1}}else"preview"===this.options.adType&&this.options.onlyAudio&&this.replay()},resetVpaid:function(){this.dispatchEventToAdunit({name:"reset"})},pause:function(){this.isPlayingVideo&&(m("pause video"),this.adVideoPlayer.pause(),this.options.vpaid&&this.adVideoPlayer.trigger("handleManualUserActive"),this.isCompleted||this.isEnded||this.dispatchEventToAdunit({name:"video_pause"}))},explicitPause:function(){m("explicit pause video"),this.explicitPaused=!0,this.pause()},explicitPlay:function(){m("explicit play video"),this.explicitPaused=!1,this.play()},mute:function(){this.isMuted||(m("mute audio"),this.adVideoPlayer.muted(!0),this.dispatchEventToAdunit({name:"video_mute"}),this.isMuted=!0)},explicitMute:function(){m("explicit mute video"),this.isExplicitMuted=!0,this.mute()},unmute:function(){!this.isExplicitMuted&&this.isMuted&&(m("unmute audio"),!0===this.adVideoPlayer.muted()&&this.adVideoPlayer.muted(!1),(this.isMuted||"off"===this.options.initialAudio)&&this.dispatchEventToAdunit({name:"video_unmute"}),this.isMuted=!1)},explicitUnmute:function(){this.isExplicitMuted=!1,this.unmute()},resizeVideoWithDimensions:function(e,t){(this.isEnded||this.isSkipped)&&1===e&&1===t&&(this.options.macroWidth=this.options.width,this.options.macroHeight=this.options.height),this.options.width=e,this.options.height=t,this.resizeVideo(this.aspectRatio)},destroy:function(e,t){if(this.isPlayingVideo=!1,this.adVideoPlayer.pause(),!1===this.isCompleted&&(!1===this.options.vpaid||!0===this.options.vpaid&&!1===this.isSkipped)&&this.dispatchEventToAdunit({name:"video_skip"}),"function"==typeof this.callbackForAdUnit.cbWhenSkipped&&this.callbackForAdUnit.cbWhenSkipped("video-skip"),this.isSkipped=!0,this.verificationManager&&this.verificationManager.destroy(),m("destroy"),"preview"===this.options.adType)return this.adVideoPlayer.currentTime(this.adVideoPlayer.duration()),void(this.options.vpaid?this.adVideoPlayer.trigger("customDestroy"):this.adVideoPlayer.trigger("ended"));"function"==typeof this.callbackForAdUnit.cbWhenDestroy&&(this.overlayPlayer?e&&t?this.callbackForAdUnit.cbWhenDestroy({type:1,code:900,message:t},!0,this.options):this.callbackForAdUnit.cbWhenDestroy(null,!0,this.options):e&&t?this.callbackForAdUnit.cbWhenDestroy({type:1,code:900,message:t},null,this.options):this.callbackForAdUnit.cbWhenDestroy(null,null,this.options))},destroyWithoutSkip:function(e,t,n,i){try{var r=this,o=function(){if(r.isPlayingVideo=!1,"native"===r.options.adType||"preview"===r.options.adType){if(r.options.iframeVideoWrapperId===r.options.iframeVideoWrapperIdPrevious)return;r.options.iframeVideoWrapperIdPrevious=r.options.iframeVideoWrapperId}903!=i&&r.adVideoPlayer&&r.adVideoPlayer.pause&&"function"==typeof r.adVideoPlayer.pause&&r.adVideoPlayer.pause(),r.verificationManager&&r.verificationManager.destroy(),m("destroy without skip: "+r.options.iframeVideoWrapperId);var o=i||900;"function"==typeof r.callbackForAdUnit.cbWhenDestroy&&(r.overlayPlayer?e&&t?(n&&(o=402),r.callbackForAdUnit.cbWhenDestroy({type:1,code:o,message:t},!0,r.options)):r.callbackForAdUnit.cbWhenDestroy(null,!0,r.options):e&&t?(n&&(o=402),r.callbackForAdUnit.cbWhenDestroy({type:1,code:o,message:t},null,r.options)):r.callbackForAdUnit.cbWhenDestroy(null,null,r.options))};r.options.disableCollapseForDelay&&r.options.disableCollapseForDelay>0?setTimeout(o,r.options.disableCollapseForDelay):o()}catch(e){g("failed to destroy/notify by "+e)}},getVideoObject:function(){return this.adVideoPlayer},handleOverlayNotification:function(e){m("Got overlay notification from player = "+e.name);var t=this,n={leaveFullscreen:function(){t.options.hasOwnProperty("playerNotification")&&t.options.playerNotification("leaveFullscreen")}}[e.name];n&&void 0!==n&&n()},notifyVpaidEvent:function(e){var t=this;if(!(t.options.delayExpandUntilVPAIDImpression&&t.delayEventHandler.isSuppress&&y.indexOf(e)>=0)){if("AdVolumeChange"===e)if("html5"===this.decidePlayer(this.options.requiredPlayer)){var n=t.adVideoPlayer.player().muted(),i=t.adVideoPlayer.player().volume();n?n&&(m("set VPAID AdVolumeChange video_mute"),this.dispatchEventToAdunit({name:"video_mute"})):i>0&&(m("set VPAID AdVolumeChange video_unmute"),this.dispatchEventToAdunit({name:"video_unmute"}))}A.indexOf(e)>=0||A.indexOf("vpaid."+e)>=0?t.notifyVpaidEvent_internal(e):t.delayEventHandler.push((function(){t.notifyVpaidEvent_internal(e)}))}},notifyVpaidEvent_internal:function(e){this.options.cbNotification&&this.options.cbNotification("VPAID",e,this.options.targetId),this.options.cbApnVastPlayer&&this.options.cbApnVastPlayer(e)},setChromeSize:function(){this.adVideoPlayer.width="0px",this.adVideoPlayer.height="0px",this.adVideoPlayer.style.width="0px",this.adVideoPlayer.style.height="0px",this.options.targetElement.style.visibility="visible"},click:function(e,t){if(this.isDoneInitialPlay){!1===this.isIosInlineRequired()&&(this.pause(),this.toggleWindowFocus=!1);var n=!1;if(this.options.useCustomOpenForClickthrough){var i=this.options.clickUrls[0];e&&(i=e),n=!0,this.dispatchEventToAdunit({name:"video_click_open_url",url:i})}else if(e)n=!0,window.open(e);else if(this.options.clickUrls&&this.options.clickUrls.length>0){n=!0;var r=this.options.clickUrls[this.options.clickUrls.length-1];window.open(r)}void 0!==t&&!0!==t||this.dispatchEventToAdunit({name:"ad-click",trackClick:n})}else this.play()},getRapamsAndExtensions:function(){var e=this.options.extensions&&this.options.extensions.length>0?""+this.options.extensions+"":"";return{adParameters:this.options.adParameters,extensions:e}},handleViewability:function(e,t,n){var i=this.options&&this.options.viewability,r=e&&e.name?e.name:null;"fullscreenchange"!==r&&"video_fullscreen"!==r||(r=this.isFullscreen?"fullscreen":"exitFullscreen"),n||"video_duration"!==r||(this.isAlreadyStart=!0);r&&i&&(this.blockTrackingUserActivity&&("video_resume"===r||"video_pause"===r||"video_mute"===r||"video_unmute"===r)||(r===t?function(){var e;(!(e=this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player&&this.adVideoPlayer.player().duration())||void 0===e||e<=0)&&(e=-2),-2===e&&(this.options&&this.options.data&&this.options.data.vastDurationMsec?(!(e=this.options.data.vastDurationMsec/1e3)||null===e||e<=0)&&(e=-2):e=-2);var n=this.options.width,i=this.options.height;if(this.viewabilityTracking.init(this.options,e,n,i,t,function(){return this.isFullscreen}.bind(this),function(){return this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player?this.adVideoPlayer.player().volume():-1}.bind(this)),this.options.expandable)"video_start"===r&&this.viewabilityTracking.invokeEvent("expand"),!1===this.options.vpaid&&"loadstart"===r&&this.viewabilityTracking.invokeEvent("expand"),this.viewabilityTracking.invokeEvent(r);else{if(this.options.overlayPlayer&&l.isMobile()&&this.options.delayStartViewability)return;this.viewabilityTracking.invokeEvent(r)}}.apply(this):function(){this.viewabilityTracking&&this.viewabilityTracking.isReady&&("force_start_viewability"===r&&this.options.delayStartViewability?(this.options.delayStartViewability=!1,this.viewabilityTracking.invokeEvent("video_start")):this.viewabilityTracking.invokeEvent(r))}.apply(this)))},findPathForViewability:function(e){if("video_start",e&&e.name&&"video_start"===e.name){if(this.isDoneFirstLoadStart)return;this.isDoneFirstLoadStart=!0}this.handleViewability(e,"video_start",!0)},dispatchEventToAdunit:function(e,t){var n=this;if("video_start"===e.name){if(n.iframeVideoWrapper.contentDocument){var i=n.iframeVideoWrapper.contentDocument.getElementById(n.divIdForVideo),r=n.iframeVideoWrapper.contentDocument.getElementById(n.videoId);i.style.background=n.options.playerSkin.videoBackgroundColor,r.style.background=n.options.playerSkin.videoBackgroundColor,h.isIOS()&&n.isIosInlineRequired()&&(r.style.opacity=0)}navigator.appVersion.indexOf("Android")>-1&&n.options.hasOwnProperty("targetElementBackground")&&(n.options.targetElement.style.background="",delete n.options.targetElementBackground)}if(navigator.appVersion.indexOf("Android")>-1&&"expand"===e.name&&!n.options.hasOwnProperty("targetElementBackground")&&n.options.targetElement&&n.options.isWaterfall&&(n.options.targetElementBackground=n.options.targetElement.style.background,n.options.targetElement.style.background="#000000"),"video_complete"===e.name&&(void 0===e.obj&&(e.obj={}),e.obj.videoAdPending=this.options.disableCollapse.replay),this.findPathForViewability(e),"collapse"==e.name&&this.verificationManager&&n.verificationManager.dispatchEvent(e.name,e.data,"ad-collapse"),(!0===this.startedReplay||this.isEnded)&&!0===this.options.disableCollapse.replay)if(!1===this.startedReplay&&"rewind"===e.name);else{if("video_complete"===e.name&&"function"==typeof t)return void t();if("ad-click"!==e.name&&-1===e.name.indexOf("IconClick"))return void this.callbackForAdUnit.cbForHandlingDispatchedEvent(e,!0)}"video_skip"===e.name&&!1===c.pushAndCheck(this.options.targetElement.id+"_dispatchEventToAdunit",e.name)||"video_complete"===e.name&&!0===this.isVideoCompleteInjected&&!1===this.options.disableCollapse.replay||(e&&"video_time"!==e.name&&m("(push)"+e.name),this.delayEventHandler.push((function(){n.dispatchEventToAdunit_internal(e,t)})),"video_complete"===e.name&&(this.isVideoCompleteInjected=!0))},dispatchEventToAdunit_internal:function(e,t){if(!this.isCompleted||"video_complete"===e.name||"ad-click"===e.name||"video_skip"===e.name||this.startedReplay){var n=this;if(e&&"video_time"!==e.name&&m("invoke callback : "+JSON.stringify(e)),this.options.hasOwnProperty("overlayPlayer")&&this.options.hiddenControls&&(("firstplay"===e.name&&!this.options.vpaid||"video_impression"===e.name&&this.options.vpaid)&&(!l.isMobile()||"click"!==this.options.initialPlayback&&"mouseover"!==this.options.initialPlayback?h.isIOS()&&h.iOSversion()[0]<10&&"auto"===this.options.initialPlayback&&(this.adVideoPlayer.controlBar.el_.style.removeProperty("display"),delete this.options.hiddenControls):(this.adVideoPlayer.controlBar.el_.style.removeProperty("display"),delete this.options.hiddenControls)),"video_resume"===e.name&&this.options.vpaid&&l.isMobile()&&(this.adVideoPlayer.controlBar.el_.style.removeProperty("display"),delete this.options.hiddenControls)),this.callbackForAdUnit.cbForHandlingDispatchedEvent&&"video_time"!==e.name){if("video_pause"===e.name&&(this.isPlayingVideo=!1),"video_play"!==e.name&&"video_start"!==e.name&&"firstplay"!==e.name||(this.isPlayingVideo=!0,this.isDoneInitialPlay=!0),"video_fullscreen"===e.name)return void setTimeout((function(){e.fullscreenStatus=n.isFullscreen?"enter":"exit",n.callbackForAdUnit.cbForHandlingDispatchedEvent(e)}),1500);if("function"==typeof t&&t(),this.blockTrackingUserActivity&&("video_resume"===e.name||"video_pause"===e.name||"video_mute"===e.name||"video_unmute"===e.name)||(e.player=this,this.callbackForAdUnit.cbForHandlingDispatchedEvent(e)),this.verificationManager){var i=this.prepareOmidEventData(e);i.name&&(this.options.expandable&&"video_start"==e.name&&this.verificationManager.dispatchEvent(i.name,i.data,"ad-expand"),this.verificationManager.dispatchEvent(i.name,i.data,e.name))}}!0===this.options.vpaid&&"video_skip"===e.name&&(this.isSkipped=!0)}},resolveMacro:function(e){switch(e){case"MEDIAPLAYHEAD":return this.options.hasOwnProperty("mediaPlayhead")&&"number"==typeof this.options.mediaPlayhead?l.convertTimeSecondsToString(this.options.mediaPlayhead):-1;case"BREAKPOSITION":return this.options.breakPosition?this.options.breakPosition:-1;case"ADCOUNT":return 1;case"PLACEMENTTYPE":return this.options.overlayPlayer?1:this.options.expandable?3:-1;case"CLIENTUA":return this.options.clientUA&&!this.options.enforcePrivacy?this.options.clientUA:"unknown unknown";case"DEVICEIP":return-1;case"PLAYERCAPABILITIES":var t=[];return this.options.skippable&&this.options.skippable.enabled&&t.push("skip"),this.options.showMute&&t.push("mute"),"auto"===this.options.initialPlayback&&("on"===this.options.initialAudio?t.push("autoplay"):t.push("mautoplay")),this.options.allowFullscreen&&t.push("fullscreen"),t.push("icon"),t.join();case"CLICKTYPE":return this.options.clickUrls&&this.options.clickUrls[0]?1:this.options.learnMore.enabled?2:0;case"PLAYERSTATE":var n=[];return this.isMuted&&n.push("muted"),this.adVideoPlayer.isFullscreen&&"function"==typeof this.adVideoPlayer.isFullscreen&&this.adVideoPlayer.isFullscreen()&&n.push("fullscreen"),n.join();case"PLAYERSIZE":return 1===this.options.width&&1===this.options.height?this.options.macroWidth+","+this.options.macroHeight:this.options.width+","+this.options.height;case"ADPLAYHEAD":if(this.adVideoPlayer.currentTime&&"function"==typeof this.adVideoPlayer.currentTime){var i=this.adVideoPlayer.currentTime();return l.convertTimeSecondsToString(i)}return-1;case"ASSETURI":return this.options.video.url;case"PODSEQUENCE":return-1;case"LIMITADTRACKING":return 0;default:return-1}},prepareOmidEventData:function(e){var t={error:"sessionError",impression:"impression",video_impression:"impression",video_start:"start","video-first-quartile":"firstQuartile","video-mid":"midpoint","video-third-quartile":"thirdQuartile",video_complete:"complete",video_pause:"pause",video_resume:"resume","user-close":"skipped",video_skip:"skipped",video_skipped:"skipped",video_skip:"skipped","audio-mute":"volumeChange","audio-unmute":"volumeChange",video_mute:"volumeChange",video_unmute:"volumeChange",fullscreenchange:"playerStateChange",video_fullscreen:"playerStateChange","video-exit-fullscreen":"playerStateChange","ad-expand":"playerStateChange","ad-collapse":"playerStateChange","ad-click":"adUserInteraction","user-accept-invitation":"adUserInteraction"},n=t.hasOwnProperty(e.name)?t[e.name]:"",i={name:n},r=null;switch(n){case"sessionError":(r={}).errorType=e.code,r.message=e.message;break;case"start":r={},this.options.data.durationMsec?r.duration=this.options.data.durationMsec/1e3:this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player?r.duration=this.adVideoPlayer.player().duration()/1e3:r.duration=-2,this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player?r.videoPlayerVolume=this.adVideoPlayer.player().volume():r.videoPlayerVolume=-1;break;case"volumeChange":r={},"audio-mute"===e.name||"video_mute"===e.name?r.videoPlayerVolume=0:this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player?r.videoPlayerVolume=this.adVideoPlayer.player().volume():r.videoPlayerVolume=-1;break;case"playerStateChange":r={},"video-fullscreen"===e.name||"fullscreenchange"===e.name?r.state=this.isFullscreen?"fullscreen":"normal":"video-exit-fullscreen"===e.name?r.state="normal":"ad-collapse"===e.name?r.state="collapsed":r.state="normal";break;case"adUserInteraction":r={},"ad-click"===e.name?r.interactionType="click":r.interactionType="invitationAccept"}return r&&(i.data=r),i},resizeVideo:function(e,t,n){s.resizeVideo(e,t,this,n)},resizeVideoForSideStream:function(e,t,n){s.resizeVideoForSideStream(this,e,t,n)},isIosInlineRequired:function(){return this.autoplayHandler.isIosInlineRequired(this.options.enableInlineVideoForIos)},resizePlayer:function(e,t){s.resizePlayer(e,t,this)},getFinalSize:function(){return s.getFinalSize(this)},setVastAttribute:function(e){var t,n=this.options;t=e||(this.adVideoPlayer&&this.adVideoPlayer.player?this.adVideoPlayer.player().duration():0),n.data.durationMsec=null!==t?Math.round(1e3*t):0;var i=this.Utils.getMsecTime(n.data.skipOffset,n.data.durationMsec);n.data.skipOffset&&i>=0?(n.data.isVastVideoSkippable=!0,n.data.skipOffsetMsec=i):n.data.skipOffsetMsec=null;var r=n.data.vastProgressEvent;if(r&&"object"==typeof r)for(var o in r){var a=this.Utils.getMsecTime(o.replace(/progress_/g,""),n.data.durationMsec);r[o]=a}},disableTrackingUserActivity:function(e){this.blockTrackingUserActivity=e,this.adVideoPlayer&&this.adVideoPlayer.bigPlayButton&&(this.adVideoPlayer.bigPlayButton.el_.style.opacity=!0===e?0:1)},delayEventsTracking:function(e,t){this.callbackForAdUnit.cbDelayEventsTracking&&this.callbackForAdUnit.cbDelayEventsTracking(e,t)},notifyOverlayPlayerVideoPaused:function(){this.options.tmpActiveListener&&this.options.cbApnVastPlayer&&this.options.cbApnVastPlayer("apn-video-paused-by-device")},checkWhenVideoPausedByDevice:function(e){if(this.options.overlayPlayer&&this.options.cbApnVastPlayer&&this.iframeVideoWrapper&&this.iframeVideoWrapper.contentDocument){var t=null;if("string"==typeof this.videoObjectId)t=this.iframeVideoWrapper.contentDocument.getElementById(this.videoObjectId);else{var n=this.iframeVideoWrapper.contentDocument.getElementsByTagName("VIDEO");if(n&&n.length>0)for(var i=0;i0){t=n[i];break}}if(t)return e?(this.options.tmpActiveListener=!0,t.addEventListener("pause",this.notifyOverlayPlayerVideoPaused.bind(this))):(delete this.options.tmpActiveListener,t.removeEventListener("pause",this.notifyOverlayPlayerVideoPaused.bind(this))),!0}return!0},forceStartViewability:function(){this.findPathForViewability({name:"force_start_viewability"})},log:m,debug:m,test:function(e,t){var n=this.options;if(n&&n.test&&n.test[e]&&"function"==typeof n.test[e]){var i=function(e){console.debug("%c"+e,"background: red; color: white")};try{n.test[e](t,(function(t,n){var r;t?(r="Unit Test ["+e+"] : "+(n=n+" Succeeded"||"Succeeded"),console.debug("%c"+r,"background: green; color: white")):i("Unit Test ["+e+"] : "+(n=n+" failed"||"Assertion failed"))}),(function(t){console.debug("%cUnit Test Log : ["+e+"] : "+t,"background: gray; color: white")}))}catch(e){i("unit test failed due to : "+e)}}},setFinalAspectRatio:function(e){this.finalAspectRatio=e},getFinalAspectRatio:function(){return this.finalAspectRatio}};e.exports=w,window[v]=w},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(module){var global_options;document.createElement("video"),document.createElement("audio"),document.createElement("track");var vjs=function(e,t,n){var i;if(global_options=t,"string"==typeof e){if(0===e.indexOf("#")&&(e=e.slice(1)),vjs.players[e])return t&&vjs.log.warn('Player "'+e+'" is already initialised. Options will not be applied.'),n&&vjs.players[e].ready(n),vjs.players[e];i=vjs.el(e)}else i=e;if(!i||!i.nodeName)throw new TypeError("The element or ID supplied is not valid. (videojs)");return i.player||new vjs.Player(i,t,n)},videojs=window.videojs_apn=vjs;function _handleMultipleEvents(e,t,n,i){vjs.arr.forEach(n,(function(n){e(t,n,i)}))}vjs.VERSION="GENERATED_FULL_VSN",vjs.options={techOrder:["html5"],html5:{},width:300,height:150,defaultVolume:0,playbackRates:[],inactivityTimeout:500,children:{mediaLoader:{},posterImage:{},loadingSpinner:{},textTrackDisplay:{},bigPlayButton:{},controlBar:{},errorDisplay:{},textTrackSettings:{}},language:document.getElementsByTagName("html")[0].getAttribute("lang")||navigator.languages&&navigator.languages[0]||navigator.userLanguage||navigator.language||"en",languages:{},notSupportedMessage:"No compatible source was found for this video."},vjs.addLanguage=function(e,t){return void 0!==vjs.options.languages[e]?vjs.options.languages[e]=vjs.util.mergeOptions(vjs.options.languages[e],t):vjs.options.languages[e]=t,vjs.options.languages},vjs.players={}, +var APNVideo_MobileVastPlayer=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){var i=[];function r(e,t){if(!e)return null;for(var n=0;n cbWhenQuartile "+t),v(t,{})},w=function(e,n){var i=e,r=n;if("AdHandler"===i&&"video_impression"===r)try{var o=new CustomEvent("outstream-impression");t.dispatchEvent(o)}catch(e){error(e)}for(var a=[{type:"AdHandler",name:"video_start",mappedEventName:"videoStart"},{type:"AdHandler",name:"rewind",mappedEventName:"videoRewind"},{type:"AdHandler",name:"video_fullscreen_enter",mappedEventName:"video-fullscreen-enter"},{type:"AdHandler",name:"video_fullscreen_exit",mappedEventName:"video-fullscreen-exit"}],s=0;s cbWhenVideoComplete "+t),v(t,{})},S=function(t){e("VastPlayer > cbWhenSkipped "+t),v(t,{})},C=function(t){e("VastPlayer > cbWhenAudio "+t),v(t,{})},I=function(e){v(e,{})},j=function(t){e("VastPlayer > cbWhenFullScreen "+t),v(t,{})},P=function(n,r,o){e("VastPlayer > cbTerminate isError: "+n);var a="unknown";t&&(a=t.id.toString()),e("VastPlayer > cbTerminate: bTerminated = "+m+", targetElement id = "+a),y=!1,m||(m=!0,r||_(),!o&&D()&&d.overlayPlayer&&_(),t&&(A&&(A.isPlayingVideo&&(e("VastPlayer > cbTerminate: pause ad"),A.pause()),t.style.height="1px",A.resizePlayer(1,1)),setTimeout((function(){t&&(t.innerHTML="",i.removeChild(t)),t=null}),2e3)),v&&n&&v("video-error",{}))},_=function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()},x=function(n){var i,r,a,s,l,c,u;i=n&&n.options&&n.options.video&&n.options.video.url?n.options.video.url:"",r=n&&n.options&&n.options.data&&n.options.data.vastDurationMsec?n.options.data.vastDurationMsec:0,a=n&&n.options&&n.options.finalVastXml?n.options.finalVastXml:"",s=n&&n.options&&n.options.finalVastUri?n.options.finalVastUri:"",l=n&&n.getFinalAspectRatio()?n.getFinalAspectRatio():"",c=n&&n.options&&n.options.video&&n.options.video.width?n.options.video.width:"",u=n&&n.options&&n.options.video&&n.options.video.height?n.options.video.height:"",m||(p=!0,A=n,e("VastPlayer > cbWhenReady in "+((new Date).getTime()-o)+" msecs"),v&&v("adReady",{creativeUrl:i,duration:r,vastXML:a,vastCreativeUrl:s,aspectRatio:l,width:c,height:u}),"click"===d.initialPlayback||d.cachePlayer||(D()&&d.overlayPlayer?d.forceAdInFullscreen?(b=!0,_()):(t&&(t.style.width="1px",t.style.height="1px"),P(!1,!0,!0)):A.play()))};function V(n){n.cbNotification=function(e,t){w(e,t)},e("Build Ad Player Callback"),m||(f?g?(g.options=r.init(g.options),r.buildPlayer(g.callbacks,g.options),g={options:n,callbacks:c}):y?(g={options:n,callbacks:c},v(t,{})):(n=r.init(n),r.buildPlayer(c,n),y=!0):(g=null,e("Building single player"),n=r.init(n),r.buildPlayer(c,n)))}function M(){d={},t=null,i=null,c={},r=Object.create(s),u&&clearTimeout(u),u=null,p=!1,h=3e3,v=null,f=!1,m=!1,g=null,y=!1,o=null}function D(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement}function O(){var n,r;if(e("repositionPlayer: try reposion/resize overlay player"),d.cachePlayer||m)e("repositionPlayer: never reposition terminated or cache palyer");else if(!D()){n=i.offsetWidth,r=i.offsetHeight;var o=i.style.borderWidth;if(o&&o.length>0){var a=Number(o.substring(0,o.length-2));n-=2*a,r-=2*a}t.style.width=n+"px",t.style.height=r+"px";var s=U(i);e("repositionPlayer: targetDiv absolute posiotion ="+s.left+", "+s.top),t.style.left=s.left+"px",t.style.top=s.top+"px",e("repositionPlayer: size = "+n+", "+r),d.overlayPlayer?A.resizePlayer(n,r):A.resizeVideo(null,!1,null)}}var N=null;function R(t){switch(e("Got notification: "+t),t){case"leaveFullscreen":_();break;default:e("Unknown player notification: "+t)}}function U(e){for(var t=0,n=0;e&&"BODY"!==e.tagName&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);){var i=document.defaultView.getComputedStyle(e,null).position;if(i&&""!==i&&"static"!==i)break;t+=e.offsetLeft-e.scrollLeft+e.clientLeft,n+=e.offsetTop-e.scrollTop+e.clientTop,e=e.offsetParent}return{left:t,top:n}}function L(e,t){if(!e.children)return t;for(var n,i,r=Math.max(t,(n=e,"auto"!==(i=document.defaultView.getComputedStyle(n,null).zIndex)?i:0)),o=0;o0){var y=Number(g.substring(0,g.length-2));d.width-=2*y,d.height-=2*y}d.playerHeight=d.height,function(){var t;try{t=function(){try{var e=navigator.platform,t=navigator.userAgent,n=navigator.appVersion;if(/iP(hone|od|ad)/.test(e)&&!/CriOS/.test(t)){var i=n.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3]||0,10)]}return[0,0,0]}catch(e){return[0,0,0]}}()[0]>=8&&!0===d.enableInlineVideoForIos}catch(t){e(t)}return t}()&&(d.playerHeight-=30),D()&&(d.fullscreenMode=!0),e("offsetWidth="+n.offsetWidth+", offsetHeight="+n.offsetHeight+", borderWidth="+n.style.borderWidth);var A=document.createElement("div");A.style.width=d.width+"px",d.fitInContainer?A.style.height=d.height+"px":d.cachePlayer&&d.overlayPlayer?A.style.height="1px":A.style.height=d.height+"px",A.style.backgroundColor="black",A.id=n.id+"_overlay_"+(new Date).getTime();var b=U(n);e("targetDiv absolute posiotion ="+b.left+", "+b.top),A.style.position="absolute",A.style.left=b.left+"px",A.style.top=b.top+"px",d.fitInContainer?A.style.zIndex=Math.max(100,L(n,0)+1):(T=Math.max(100,L(n,0)+1),d.cachePlayer&&d.overlayPlayer?A.style.zIndex=0:A.style.zIndex=T),n.appendChild(A),e("player container offsetLeft = "+A.offsetLeft+", offsetTop = "+A.offsetTop),t=A,i=n,o=(new Date).getTime(),e("timeToReady = "+h+", start time = "+o),u=setTimeout((function(){p||(P(!1),v&&v("Timed-out",{}))}),h);c.cbRenderVideo=function(t,n){e("VastPlayer > cbRenderVideo called");try{e("VastPlayer > cbRenderVideo options: ",JSON.stringify(n))}catch(e){}V(n)},c.cbWhenDestroy=P,c.cbWhenReady=x,c.cbWhenQuartile=k,c.cbWhenVideoComplete=E,c.cbWhenSkipped=S,c.cbWhenFullScreen=j,c.cbWhenAudio=C,c.cbWhenClickOpenUrl=I,c.cbCoreVideoEvent=w,d.playerNotification=R,d.overlayPlayer&&(d.hasOwnProperty("allowFullscreen")||(d.allowFullscreen=!1)),e("VP >> before options.initialAudio = "+d.initialAudio),"auto"===d.initialPlayback&&"on"===d.initialAudio&&(navigator.appVersion.indexOf("Mobile")>-1||navigator.appVersion.indexOf("Android")>-1)&&navigator.userAgent.indexOf("Chrome")>-1&&function(){var e=navigator.appVersion.indexOf("Chrome/");if(e>=0){var t=navigator.appVersion.substr(e+7);return(e=t.indexOf("."))>0?Number(t.substr(0,e)):0}return 0}()>=53&&(d.showMute=!0,d.showVolume=!0),e("VP >> after options.initialAudio = "+d.initialAudio),l(t,d,c)}document.body.onresize&&(N=document.body.onresize),window.onresize=function(n){e("Resize event happend"),t&&A&&(b?(b=!1,d.fitInContainer&&(t.style.zIndex=T),setTimeout((function(){O(),"click"!==d.initialPlayback&&A.play()}),100)):O()),N&&N(n)},this.playVast=function(t,n,i,r,o){e("VP >> playVast function called playerId = "+this.vastPlayerId),P(!1,!0),M(),(d=n).vastXml=i,F(t,r,o)},this.playAdObject=function(t,n,i,r,o){e("VP >> playAdObject function called playerId = "+this.vastPlayerId+", cache mode = "+n.cachePlayer),P(!1,!0),M(),d=n,"string"==typeof i?d.vastXml=i:(d.useAdObj=!0,d.adObj=i),F(t,r,o)},this.stop=function(){u&&(clearTimeout(u),u=null),P(!1)},this.removeFromPage=function(){u&&(clearTimeout(u),u=null),m=!0,t&&(t.innerHTML="",i.removeChild(t),t=null)},this.play=function(){e("VP >> play function called playerId = "+this.vastPlayerId),A&&(d.cachePlayer=!1,D()&&d.overlayPlayer?d.forceAdInFullscreen?(b=!0,_()):P(!1,!0,!0):(t&&!1===d.fitInContainer&&(t.style.zIndex=T),O(),"click"!==d.initialPlayback&&A.play()))},this.sendPlay=function(){e("VP >> sendPlay function called playerID = "+this.vastPlayerId),A&&!A.isPlayingVideo&&A.play()},this.sendPause=function(){e("VP >> sendPause function called playerID = "+this.vastPlayerId),A&&A.isPlayingVideo&&A.pause()},this.handleFullscreen=function(e){A&&(e?i.requestFullscreen?i.requestFullscreen():i.webkitRequestFullscreen?i.webkitRequestFullscreen():i.mozRequestFullScreen?i.mozRequestFullScreen():i.msRequestFullscreen&&i.msRequestFullscreen():document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen())},this.vastPlayerId=(new Date).getTime(),this.isTerminated=function(){return m},this.getIsVideoPlaying=function(){return!(!A||!A.isPlayingVideo)},this.getCurrentPlayHeadTime=function(){var e=0;return r&&r.adVideoPlayer&&"function"==typeof r.adVideoPlayer.player&&(e=1e3*r.adVideoPlayer.player().currentTime(),e=parseInt&&"function"==typeof parseInt?parseInt(e):e),e}};e.exports={playAdObject:function(e,t,n,i,r){var a=o(t.targetElementId,t.cachePlayer);a&&a.playAdObject(e,t,n,i,r)},playVast:function(e,t,n,i,r){var a=o(t.targetElementId);a&&a.playVast(e,t,n,i,r)},loadAndPlayVast:function(e,t,i,r,a){n(29).load(i,(function(s,l){if(s||0===l.length){n(7).logDebug("Failed to load "+i,"Vast Video Player")}else{var d=o(t.targetElementId);d&&d.playVast(e,t,l,r,a)}}))},stop:function(e,t){var n=r(e.id,t);n&&n.stop()},removeFromPage:function(e){var t=r(e);t&&t.removeFromPage()},play:function(e,t){var n=function(e,t){if(!e)return null;for(var n=0;n-1,videojs_vpaid:o,overlayPlayer:!1,forceToSkip:!1,ExtendDefaultOption:a,delayEventHandler:null,pausedByViewability:!1,mutedByVisibility:!1,isReadyToExpandForMobile:!1,isAlreadyPlaingForVPAID:!1,isSideStreamActivated:!1,isExpanded:!0,isVideoCompleteInjected:!1,isFullscreenToggled:!1,toggleWindowFocus:!0,viewabilityTracking:null,isDoneFirstLoadStart:!1,startedReplay:!1,Utils:l,isAlreadyStart:!1,isEnded:!1,blockTrackingUserActivity:!1,videoId:"",divIdForVideo:"",simidIntegratorObj:null,init:function(e){var t=a(b,e);return this.options=t,!0===this.options.skippable.allowOverride&&(this.options.skippable.videoThreshold=0,this.options.skippable.enabled=!0),"boolean"==typeof this.options.disableCollapse&&(this.options.disableCollapse={enabled:this.options.disableCollapse,replay:!1}),this.delayEventHandler=new d,this.delayEventHandler.suppress(this.options.delayExpandUntilVPAIDImpression),this.delayEventHandler.start(),this.viewabilityTracking=new p,t},getValueFromPlayer:function(e){var t=0;try{"controlBar.height"===e&&this.adVideoPlayer&&this.adVideoPlayer.controlBar&&this.adVideoPlayer.controlBar.height&&"function"==typeof this.adVideoPlayer.controlBar.height&&"html5"===this.decidePlayer(this.options.requiredPlayer)&&(t=this.adVideoPlayer.controlBar.height())}catch(e){g(e)}return t},decidePlayer:function(){return"html5"},buildPlayer:function(e,t){var n=this;if(t.waterfallStepId&&m("CHECKING AUTOPLAY FOR WATERFALL STEP: "+t.waterfallStepId),"html5"===this.decidePlayer(t.requiredPlayer)&&this.autoplayHandler&&!t.overlayPlayer){var i;i=!h.isMobile()&&("on"===t.initialAudio||!0===t.audioOnMouseover),n.autoplayHandler.getAutoplayPolicy((function(i){var r=n.autoplayHandler.videoPolicy;switch(i){case r.allowAutoplay:break;case r.stopMediaWithSound:if(h.isMobile()&&"native"===t.adType&&t.vpaid&&n.isAlreadyPlaingForVPAID)break;"on"===t.initialAudio?("auto"!==t.initialPlayback&&"mouseover"!==t.initialPlayback||(t.initialAudio="off",t.audioOnMouseover=!1),!0===t.isWaterfall&&(t.adAttempt>0?(t.initialAudio="off",t.audioOnMouseover=!1):t.audioOnMouseover=!0)):"auto"!==t.initialPlayback&&"mouseover"!==t.initialPlayback||(t.audioOnMouseover=!1);break;case r.neverAutoplay:t.initialPlayback="click",t.isWaterfall&&(t.isWaterfall=!1,t.stopWaterfall=!0)}t.waterfallStepId&&m("BUILDING PLAYER FOR WATERFALL STEP: "+t.waterfallStepId),n.buildPlayerCallback(e,t)}),i)}else n.buildPlayerCallback(e,t)},buildPlayerCallback:function(e,t){this.callbackForAdUnit=e,t.hasOwnProperty("overlayPlayer")&&(this.overlayPlayer=t.overlayPlayer,t.hasOwnProperty("fullscreenMode")&&(t.allowFullscreen=!1)),this.options.targetElement&&!this.options.firstAdAttempted&&(this.options.targetElement.style.backgroundImage||(this.options.targetElement.style.visibility="hidden"));var n="APNVideo_Player_"+((new Date).getTime()+Math.floor(1e4*Math.random()));this.externalNameOfVideoPlayer=n,r(e,t,this)},getPlayerStatus:function(){},notifyPlayer:function(e,t){this.adVideoPlayer.handleAdUnitNotification({name:e,value:t})},load:function(){if("html5"===this.decidePlayer(this.options.requiredPlayer)){m("load video");try{this.adVideoPlayer&&void 0!==this.adVideoPlayer&&this.adVideoPlayer.load&&"function"==typeof this.adVideoPlayer.load&&(this.options.delayExpandUntilVPAIDImpression&&this.adVideoPlayer.player()&&this.adVideoPlayer.player().autoplay()&&this.adVideoPlayer.player().autoplay(!1),this.adVideoPlayer.load())}catch(e){g(e)}}},replay:function(){if(this.isEnded)if(!this.options.vpaid||"native"!==this.options.adType&&"preview"!==this.options.adType)this.dispatchEventToAdunit({name:"rewind"}),this.startedReplay=!0,this.isEnded=!1,this.explicitPlay(),this.adVideoPlayer.controlBar.playToggle&&this.adVideoPlayer.controlBar.playToggle.el()&&this.adVideoPlayer.controlBar.playToggle.el().style&&(this.adVideoPlayer.controlBar.playToggle.el().style["pointer-events"]=""),this.options.sideStream&&!0===this.options.sideStream.wasEnabled&&(this.options.sideStream.enabled=!0,delete this.options.sideStream.wasEnabled),this.options.endCard&&this.options.endCard.enabled&&(this.actualPlayByVideoJS(),l.isIos()||this.adVideoPlayer.bigPlayButton.show());else{this.dispatchEventToAdunit({name:"rewind"});var e=this.iframeVideoWrapper||document.getElementById(this.options.iframeVideoWrapperId);e&&e.parentNode.removeChild(e),navigator.userAgent.indexOf("Trident/7.0")>-1||l.isIos()?(this.isEnded=!1,this.dispatchEventToAdunit({name:"replay-vpaid"})):(this.dispatchEventToAdunit({name:"replay-vpaid"}),this.isEnded=!1),this.adVideoPlayer.controlBar.playToggle&&this.adVideoPlayer.controlBar.playToggle.el()&&this.adVideoPlayer.controlBar.playToggle.el().style&&(this.adVideoPlayer.controlBar.playToggle.el().style["pointer-events"]="")}},actualPlayByVideoJS:function(){this.adVideoPlayer.play(),this.options.vpaid&&this.adVideoPlayer.trigger("handleManualUserInActive")},play:function(){if(!0!==this.isEnded){var e=h.isMobile()&&h.iOSversion()[0]>=10&&!1===this.options.enableInlineVideoForIos;if(e&&!l.isIphone()&&"native"===this.options.adType&&(e=!1),e){var t=this;t.overlayPlayer?t.options.targetElement.style.overflow="":setTimeout((function(){t.options.targetElement.style.overflow=""}),t.options.expandTime)}if(this.isAlreadyPlaingForVPAID=!0,!this.isCompleted){if(m("play video"),this.isDoneInitialPlay?(this.decidePlayer(this.options.requiredPlayer),this.isPlayingVideo||this.dispatchEventToAdunit({name:"video_resume"})):this.options.vpaid||(this.dispatchEventToAdunit({name:"video_start"}),this.dispatchEventToAdunit({name:"video_impression"})),this.options.vpaid&&this.isIosInlineRequired()?this.isDoneInitialPlay?this.actualPlayByVideoJS():this.adVideoPlayer.trigger("play"):this.options.vpaid&&this.options.overlayPlayer&&h.isIOS()&&h.iOSversion()[0]<10&&!this.isDoneInitialPlay||this.options.vpaid&&this.options.overlayPlayer&&navigator.appVersion.indexOf("Android")>-1&&this.options.enableWaterfall&&!this.isDoneInitialPlay?this.adVideoPlayer.trigger("play"):this.actualPlayByVideoJS(),"native"===this.options.adType&&h.isMobile()){var n=this.adVideoPlayer.controlBar;setTimeout((function(){n.el_.style.opacity=1,n.el_.style.visibility="visible"}),500)}"html5"===this.decidePlayer(this.options.requiredPlayer)||(this.isPlayingVideo=!0),this.isDoneInitialPlay=!0,this.isEnded=!1}}else"preview"===this.options.adType&&this.options.onlyAudio&&this.replay()},resetVpaid:function(){this.dispatchEventToAdunit({name:"reset"})},pause:function(){this.isPlayingVideo&&(m("pause video"),this.adVideoPlayer.pause(),this.options.vpaid&&this.adVideoPlayer.trigger("handleManualUserActive"),this.isCompleted||this.isEnded||this.dispatchEventToAdunit({name:"video_pause"}))},explicitPause:function(){m("explicit pause video"),this.explicitPaused=!0,this.pause()},explicitPlay:function(){m("explicit play video"),this.explicitPaused=!1,this.play()},mute:function(){this.isMuted||(m("mute audio"),this.adVideoPlayer.muted(!0),this.dispatchEventToAdunit({name:"video_mute"}),this.isMuted=!0)},explicitMute:function(){m("explicit mute video"),this.isExplicitMuted=!0,this.mute()},unmute:function(){!this.isExplicitMuted&&this.isMuted&&(m("unmute audio"),!0===this.adVideoPlayer.muted()&&this.adVideoPlayer.muted(!1),(this.isMuted||"off"===this.options.initialAudio)&&this.dispatchEventToAdunit({name:"video_unmute"}),this.isMuted=!1)},explicitUnmute:function(){this.isExplicitMuted=!1,this.unmute()},resizeVideoWithDimensions:function(e,t){(this.isEnded||this.isSkipped)&&1===e&&1===t&&(this.options.macroWidth=this.options.width,this.options.macroHeight=this.options.height),this.options.width=e,this.options.height=t,this.resizeVideo(this.aspectRatio)},destroy:function(e,t){if(this.isPlayingVideo=!1,this.adVideoPlayer.pause(),!1===this.isCompleted&&(!1===this.options.vpaid||!0===this.options.vpaid&&!1===this.isSkipped)&&this.dispatchEventToAdunit({name:"video_skip"}),"function"==typeof this.callbackForAdUnit.cbWhenSkipped&&this.callbackForAdUnit.cbWhenSkipped("video-skip"),this.isSkipped=!0,this.verificationManager&&this.verificationManager.destroy(),m("destroy"),"preview"===this.options.adType)return this.adVideoPlayer.currentTime(this.adVideoPlayer.duration()),void(this.options.vpaid?this.adVideoPlayer.trigger("customDestroy"):this.adVideoPlayer.trigger("ended"));"function"==typeof this.callbackForAdUnit.cbWhenDestroy&&(this.overlayPlayer?e&&t?this.callbackForAdUnit.cbWhenDestroy({type:1,code:900,message:t},!0,this.options):this.callbackForAdUnit.cbWhenDestroy(null,!0,this.options):e&&t?this.callbackForAdUnit.cbWhenDestroy({type:1,code:900,message:t},null,this.options):this.callbackForAdUnit.cbWhenDestroy(null,null,this.options))},destroyWithoutSkip:function(e,t,n,i){try{var r=this,o=function(){if(r.isPlayingVideo=!1,"native"===r.options.adType||"preview"===r.options.adType){if(r.options.iframeVideoWrapperId===r.options.iframeVideoWrapperIdPrevious)return;r.options.iframeVideoWrapperIdPrevious=r.options.iframeVideoWrapperId}903!=i&&r.adVideoPlayer&&r.adVideoPlayer.pause&&"function"==typeof r.adVideoPlayer.pause&&r.adVideoPlayer.pause(),r.verificationManager&&r.verificationManager.destroy(),m("destroy without skip: "+r.options.iframeVideoWrapperId);var o=i||900;"function"==typeof r.callbackForAdUnit.cbWhenDestroy&&(r.overlayPlayer?e&&t?(n&&(o=402),r.callbackForAdUnit.cbWhenDestroy({type:1,code:o,message:t},!0,r.options)):r.callbackForAdUnit.cbWhenDestroy(null,!0,r.options):e&&t?(n&&(o=402),r.callbackForAdUnit.cbWhenDestroy({type:1,code:o,message:t},null,r.options)):r.callbackForAdUnit.cbWhenDestroy(null,null,r.options))};r.options.disableCollapseForDelay&&r.options.disableCollapseForDelay>0?setTimeout(o,r.options.disableCollapseForDelay):o()}catch(e){g("failed to destroy/notify by "+e)}},getVideoObject:function(){return this.adVideoPlayer},handleOverlayNotification:function(e){m("Got overlay notification from player = "+e.name);var t=this,n={leaveFullscreen:function(){t.options.hasOwnProperty("playerNotification")&&t.options.playerNotification("leaveFullscreen")}}[e.name];n&&void 0!==n&&n()},notifyVpaidEvent:function(e){var t=this;if(!(t.options.delayExpandUntilVPAIDImpression&&t.delayEventHandler.isSuppress&&y.indexOf(e)>=0)){if("AdVolumeChange"===e)if("html5"===this.decidePlayer(this.options.requiredPlayer)){var n=t.adVideoPlayer.player().muted(),i=t.adVideoPlayer.player().volume();n?n&&(m("set VPAID AdVolumeChange video_mute"),this.dispatchEventToAdunit({name:"video_mute"})):i>0&&(m("set VPAID AdVolumeChange video_unmute"),this.dispatchEventToAdunit({name:"video_unmute"}))}A.indexOf(e)>=0||A.indexOf("vpaid."+e)>=0?t.notifyVpaidEvent_internal(e):t.delayEventHandler.push((function(){t.notifyVpaidEvent_internal(e)}))}},notifyVpaidEvent_internal:function(e){this.options.cbNotification&&this.options.cbNotification("VPAID",e,this.options.targetId),this.options.cbApnVastPlayer&&this.options.cbApnVastPlayer(e)},setChromeSize:function(){this.adVideoPlayer.width="0px",this.adVideoPlayer.height="0px",this.adVideoPlayer.style.width="0px",this.adVideoPlayer.style.height="0px",this.options.targetElement.style.visibility="visible"},click:function(e,t){if(this.isDoneInitialPlay){!1===this.isIosInlineRequired()&&(this.pause(),this.toggleWindowFocus=!1);var n=!1;if(this.options.useCustomOpenForClickthrough){var i=this.options.clickUrls[0];e&&(i=e),n=!0,this.dispatchEventToAdunit({name:"video_click_open_url",url:i})}else if(e)n=!0,window.open(e);else if(this.options.clickUrls&&this.options.clickUrls.length>0){n=!0;var r=this.options.clickUrls[this.options.clickUrls.length-1];window.open(r)}void 0!==t&&!0!==t||this.dispatchEventToAdunit({name:"ad-click",trackClick:n})}else this.play()},getRapamsAndExtensions:function(){var e=this.options.extensions&&this.options.extensions.length>0?""+this.options.extensions+"":"";return{adParameters:this.options.adParameters,extensions:e}},handleViewability:function(e,t,n){var i=this.options&&this.options.viewability,r=e&&e.name?e.name:null;"fullscreenchange"!==r&&"video_fullscreen"!==r||(r=this.isFullscreen?"fullscreen":"exitFullscreen"),n||"video_duration"!==r||(this.isAlreadyStart=!0);r&&i&&(this.blockTrackingUserActivity&&("video_resume"===r||"video_pause"===r||"video_mute"===r||"video_unmute"===r)||(r===t?function(){var e;(!(e=this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player&&this.adVideoPlayer.player().duration())||void 0===e||e<=0)&&(e=-2),-2===e&&(this.options&&this.options.data&&this.options.data.vastDurationMsec?(!(e=this.options.data.vastDurationMsec/1e3)||null===e||e<=0)&&(e=-2):e=-2);var n=this.options.width,i=this.options.height;if(this.viewabilityTracking.init(this.options,e,n,i,t,function(){return this.isFullscreen}.bind(this),function(){return this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player?this.adVideoPlayer.player().volume():-1}.bind(this)),this.options.expandable)"video_start"===r&&this.viewabilityTracking.invokeEvent("expand"),!1===this.options.vpaid&&"loadstart"===r&&this.viewabilityTracking.invokeEvent("expand"),this.viewabilityTracking.invokeEvent(r);else{if(this.options.overlayPlayer&&l.isMobile()&&this.options.delayStartViewability)return;this.viewabilityTracking.invokeEvent(r)}}.apply(this):function(){this.viewabilityTracking&&this.viewabilityTracking.isReady&&("force_start_viewability"===r&&this.options.delayStartViewability?(this.options.delayStartViewability=!1,this.viewabilityTracking.invokeEvent("video_start")):this.viewabilityTracking.invokeEvent(r))}.apply(this)))},findPathForViewability:function(e){if("video_start",e&&e.name&&"video_start"===e.name){if(this.isDoneFirstLoadStart)return;this.isDoneFirstLoadStart=!0}this.handleViewability(e,"video_start",!0)},dispatchEventToAdunit:function(e,t){var n=this;if("video_start"===e.name){if(n.iframeVideoWrapper.contentDocument){var i=n.iframeVideoWrapper.contentDocument.getElementById(n.divIdForVideo),r=n.iframeVideoWrapper.contentDocument.getElementById(n.videoId);i.style.background=n.options.playerSkin.videoBackgroundColor,r.style.background=n.options.playerSkin.videoBackgroundColor,h.isIOS()&&n.isIosInlineRequired()&&(r.style.opacity=0)}navigator.appVersion.indexOf("Android")>-1&&n.options.hasOwnProperty("targetElementBackground")&&(n.options.targetElement.style.background="",delete n.options.targetElementBackground)}if(navigator.appVersion.indexOf("Android")>-1&&"expand"===e.name&&!n.options.hasOwnProperty("targetElementBackground")&&n.options.targetElement&&n.options.isWaterfall&&(n.options.targetElementBackground=n.options.targetElement.style.background,n.options.targetElement.style.background="#000000"),"video_complete"===e.name&&(void 0===e.obj&&(e.obj={}),e.obj.videoAdPending=this.options.disableCollapse.replay),this.findPathForViewability(e),"collapse"==e.name&&this.verificationManager&&n.verificationManager.dispatchEvent(e.name,e.data,"ad-collapse"),(!0===this.startedReplay||this.isEnded)&&!0===this.options.disableCollapse.replay)if(!1===this.startedReplay&&"rewind"===e.name);else{if("video_complete"===e.name&&"function"==typeof t)return void t();if("ad-click"!==e.name&&-1===e.name.indexOf("IconClick"))return void this.callbackForAdUnit.cbForHandlingDispatchedEvent(e,!0)}"video_skip"===e.name&&!1===c.pushAndCheck(this.options.targetElement.id+"_dispatchEventToAdunit",e.name)||"video_complete"===e.name&&!0===this.isVideoCompleteInjected&&!1===this.options.disableCollapse.replay||(e&&"video_time"!==e.name&&m("(push)"+e.name),this.delayEventHandler.push((function(){n.dispatchEventToAdunit_internal(e,t)})),"video_complete"===e.name&&(this.isVideoCompleteInjected=!0))},dispatchEventToAdunit_internal:function(e,t){if(!this.isCompleted||"video_complete"===e.name||"ad-click"===e.name||"video_skip"===e.name||this.startedReplay){var n=this;if(e&&"video_time"!==e.name&&m("invoke callback : "+JSON.stringify(e)),this.options.hasOwnProperty("overlayPlayer")&&this.options.hiddenControls&&(("firstplay"===e.name&&!this.options.vpaid||"video_impression"===e.name&&this.options.vpaid)&&(!l.isMobile()||"click"!==this.options.initialPlayback&&"mouseover"!==this.options.initialPlayback?h.isIOS()&&h.iOSversion()[0]<10&&"auto"===this.options.initialPlayback&&(this.adVideoPlayer.controlBar.el_.style.removeProperty("display"),delete this.options.hiddenControls):(this.adVideoPlayer.controlBar.el_.style.removeProperty("display"),delete this.options.hiddenControls)),"video_resume"===e.name&&this.options.vpaid&&l.isMobile()&&(this.adVideoPlayer.controlBar.el_.style.removeProperty("display"),delete this.options.hiddenControls)),this.callbackForAdUnit.cbForHandlingDispatchedEvent&&"video_time"!==e.name){if("video_pause"===e.name&&(this.isPlayingVideo=!1),"video_play"!==e.name&&"video_start"!==e.name&&"firstplay"!==e.name||(this.isPlayingVideo=!0,this.isDoneInitialPlay=!0),"video_fullscreen"===e.name)return void setTimeout((function(){e.fullscreenStatus=n.isFullscreen?"enter":"exit",n.callbackForAdUnit.cbForHandlingDispatchedEvent(e)}),1500);if("function"==typeof t&&t(),this.blockTrackingUserActivity&&("video_resume"===e.name||"video_pause"===e.name||"video_mute"===e.name||"video_unmute"===e.name)||(e.player=this,this.callbackForAdUnit.cbForHandlingDispatchedEvent(e)),this.verificationManager){var i=this.prepareOmidEventData(e);i.name&&(this.options.expandable&&"video_start"==e.name&&this.verificationManager.dispatchEvent(i.name,i.data,"ad-expand"),this.verificationManager.dispatchEvent(i.name,i.data,e.name))}}!0===this.options.vpaid&&"video_skip"===e.name&&(this.isSkipped=!0)}},resolveMacro:function(e){switch(e){case"MEDIAPLAYHEAD":return this.options.hasOwnProperty("mediaPlayhead")&&"number"==typeof this.options.mediaPlayhead?l.convertTimeSecondsToString(this.options.mediaPlayhead):-1;case"BREAKPOSITION":return this.options.breakPosition?this.options.breakPosition:-1;case"ADCOUNT":return 1;case"PLACEMENTTYPE":return this.options.overlayPlayer?1:this.options.expandable?3:-1;case"CLIENTUA":return this.options.clientUA&&!this.options.enforcePrivacy?this.options.clientUA:"unknown unknown";case"DEVICEIP":return-1;case"PLAYERCAPABILITIES":var t=[];return this.options.skippable&&this.options.skippable.enabled&&t.push("skip"),this.options.showMute&&t.push("mute"),"auto"===this.options.initialPlayback&&("on"===this.options.initialAudio?t.push("autoplay"):t.push("mautoplay")),this.options.allowFullscreen&&t.push("fullscreen"),t.push("icon"),t.join();case"CLICKTYPE":return this.options.clickUrls&&this.options.clickUrls[0]?1:this.options.learnMore.enabled?2:0;case"PLAYERSTATE":var n=[];return this.isMuted&&n.push("muted"),this.adVideoPlayer.isFullscreen&&"function"==typeof this.adVideoPlayer.isFullscreen&&this.adVideoPlayer.isFullscreen()&&n.push("fullscreen"),n.join();case"PLAYERSIZE":return 1===this.options.width&&1===this.options.height?this.options.macroWidth+","+this.options.macroHeight:this.options.width+","+this.options.height;case"ADPLAYHEAD":if(this.adVideoPlayer.currentTime&&"function"==typeof this.adVideoPlayer.currentTime){var i=this.adVideoPlayer.currentTime();return l.convertTimeSecondsToString(i)}return-1;case"ASSETURI":return this.options.video.url;case"PODSEQUENCE":return-1;case"LIMITADTRACKING":return 0;default:return-1}},prepareOmidEventData:function(e){var t={error:"sessionError",impression:"impression",video_impression:"impression",video_start:"start","video-first-quartile":"firstQuartile","video-mid":"midpoint","video-third-quartile":"thirdQuartile",video_complete:"complete",video_pause:"pause",video_resume:"resume","user-close":"skipped",video_skip:"skipped",video_skipped:"skipped",video_skip:"skipped","audio-mute":"volumeChange","audio-unmute":"volumeChange",video_mute:"volumeChange",video_unmute:"volumeChange",fullscreenchange:"playerStateChange",video_fullscreen:"playerStateChange","video-exit-fullscreen":"playerStateChange","ad-expand":"playerStateChange","ad-collapse":"playerStateChange","ad-click":"adUserInteraction","user-accept-invitation":"adUserInteraction"},n=t.hasOwnProperty(e.name)?t[e.name]:"",i={name:n},r=null;switch(n){case"sessionError":(r={}).errorType=e.code,r.message=e.message;break;case"start":r={},this.options.data.durationMsec?r.duration=this.options.data.durationMsec/1e3:this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player?r.duration=this.adVideoPlayer.player().duration()/1e3:r.duration=-2,this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player?r.videoPlayerVolume=this.adVideoPlayer.player().volume():r.videoPlayerVolume=-1;break;case"volumeChange":r={},"audio-mute"===e.name||"video_mute"===e.name?r.videoPlayerVolume=0:this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player?r.videoPlayerVolume=this.adVideoPlayer.player().volume():r.videoPlayerVolume=-1;break;case"playerStateChange":r={},"video-fullscreen"===e.name||"fullscreenchange"===e.name?r.state=this.isFullscreen?"fullscreen":"normal":"video-exit-fullscreen"===e.name?r.state="normal":"ad-collapse"===e.name?r.state="collapsed":r.state="normal";break;case"adUserInteraction":r={},"ad-click"===e.name?r.interactionType="click":r.interactionType="invitationAccept"}return r&&(i.data=r),i},resizeVideo:function(e,t,n){s.resizeVideo(e,t,this,n)},resizeVideoForSideStream:function(e,t,n){s.resizeVideoForSideStream(this,e,t,n)},isIosInlineRequired:function(){return this.autoplayHandler.isIosInlineRequired(this.options.enableInlineVideoForIos)},resizePlayer:function(e,t){s.resizePlayer(e,t,this)},getFinalSize:function(){return s.getFinalSize(this)},setVastAttribute:function(e){var t,n=this.options;t=e||(this.adVideoPlayer&&this.adVideoPlayer.player?this.adVideoPlayer.player().duration():0),n.data.durationMsec=null!==t?Math.round(1e3*t):0;var i=this.Utils.getMsecTime(n.data.skipOffset,n.data.durationMsec);n.data.skipOffset&&i>=0?(n.data.isVastVideoSkippable=!0,n.data.skipOffsetMsec=i):n.data.skipOffsetMsec=null;var r=n.data.vastProgressEvent;if(r&&"object"==typeof r)for(var o in r){var a=this.Utils.getMsecTime(o.replace(/progress_/g,""),n.data.durationMsec);r[o]=a}},disableTrackingUserActivity:function(e){this.blockTrackingUserActivity=e,this.adVideoPlayer&&this.adVideoPlayer.bigPlayButton&&(this.adVideoPlayer.bigPlayButton.el_.style.opacity=!0===e?0:1)},delayEventsTracking:function(e,t){this.callbackForAdUnit.cbDelayEventsTracking&&this.callbackForAdUnit.cbDelayEventsTracking(e,t)},notifyOverlayPlayerVideoPaused:function(){this.options.tmpActiveListener&&this.options.cbApnVastPlayer&&this.options.cbApnVastPlayer("apn-video-paused-by-device")},checkWhenVideoPausedByDevice:function(e){if(this.options.overlayPlayer&&this.options.cbApnVastPlayer&&this.iframeVideoWrapper&&this.iframeVideoWrapper.contentDocument){var t=null;if("string"==typeof this.videoObjectId)t=this.iframeVideoWrapper.contentDocument.getElementById(this.videoObjectId);else{var n=this.iframeVideoWrapper.contentDocument.getElementsByTagName("VIDEO");if(n&&n.length>0)for(var i=0;i0){t=n[i];break}}if(t)return e?(this.options.tmpActiveListener=!0,t.addEventListener("pause",this.notifyOverlayPlayerVideoPaused.bind(this))):(delete this.options.tmpActiveListener,t.removeEventListener("pause",this.notifyOverlayPlayerVideoPaused.bind(this))),!0}return!0},forceStartViewability:function(){this.findPathForViewability({name:"force_start_viewability"})},log:m,debug:m,test:function(e,t){var n=this.options;if(n&&n.test&&n.test[e]&&"function"==typeof n.test[e]){var i=function(e){console.debug("%c"+e,"background: red; color: white")};try{n.test[e](t,(function(t,n){var r;t?(r="Unit Test ["+e+"] : "+(n=n+" Succeeded"||"Succeeded"),console.debug("%c"+r,"background: green; color: white")):i("Unit Test ["+e+"] : "+(n=n+" failed"||"Assertion failed"))}),(function(t){console.debug("%cUnit Test Log : ["+e+"] : "+t,"background: gray; color: white")}))}catch(e){i("unit test failed due to : "+e)}}},setFinalAspectRatio:function(e){this.finalAspectRatio=e},getFinalAspectRatio:function(){return this.finalAspectRatio}};e.exports=T,window[v]=T},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(module){var global_options;document.createElement("video"),document.createElement("audio"),document.createElement("track");var vjs=function(e,t,n){var i;if(global_options=t,"string"==typeof e){if(0===e.indexOf("#")&&(e=e.slice(1)),vjs.players[e])return t&&vjs.log.warn('Player "'+e+'" is already initialised. Options will not be applied.'),n&&vjs.players[e].ready(n),vjs.players[e];i=vjs.el(e)}else i=e;if(!i||!i.nodeName)throw new TypeError("The element or ID supplied is not valid. (videojs)");return i.player||new vjs.Player(i,t,n)},videojs=window.videojs_apn=vjs;function _handleMultipleEvents(e,t,n,i){vjs.arr.forEach(n,(function(n){e(t,n,i)}))}vjs.VERSION="GENERATED_FULL_VSN",vjs.options={techOrder:["html5"],html5:{},width:300,height:150,defaultVolume:0,playbackRates:[],inactivityTimeout:500,children:{mediaLoader:{},posterImage:{},loadingSpinner:{},textTrackDisplay:{},bigPlayButton:{},controlBar:{},errorDisplay:{},textTrackSettings:{}},language:document.getElementsByTagName("html")[0].getAttribute("lang")||navigator.languages&&navigator.languages[0]||navigator.userLanguage||navigator.language||"en",languages:{},notSupportedMessage:"No compatible source was found for this video."},vjs.addLanguage=function(e,t){return void 0!==vjs.options.languages[e]?vjs.options.languages[e]=vjs.util.mergeOptions(vjs.options.languages[e],t):vjs.options.languages[e]=t,vjs.options.languages},vjs.players={}, /*! * Custom Universal Module Definition (UMD) * @@ -45,7 +45,7 @@ var APNVideo_MobileVastPlayer=function(e){var t={};function n(i){if(t[i])return * still support requirejs and browserify. This also needs to be closure * compiler compatible, so string keys are used. */ -__webpack_require__(5).amd?(__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return videojs}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)):module.exports=videojs,vjs.CoreObject=vjs.CoreObject=function(){},vjs.CoreObject.extend=function(e){var t,n;for(var i in t=(e=e||{}).init||e.init||this.prototype.init||this.prototype.init||function(){},((n=function(){t.apply(this,arguments)}).prototype=vjs.obj.create(this.prototype)).constructor=n,n.extend=vjs.CoreObject.extend,n.create=vjs.CoreObject.create,e)e.hasOwnProperty(i)&&(n.prototype[i]=e[i]);return n},vjs.CoreObject.create=function(){var e=vjs.obj.create(this.prototype);return this.apply(e,arguments),e},vjs.on=function(e,t,n){if(vjs.obj.isArray(t))return _handleMultipleEvents(vjs.on,e,t,n);var i=vjs.getData(e);i.handlers||(i.handlers={}),i.handlers[t]||(i.handlers[t]=[]),n.guid||(n.guid=vjs.guid++),i.handlers[t].push(n),i.dispatcher||(i.disabled=!1,i.dispatcher=function(t){if(!i.disabled){t=vjs.fixEvent(t);var n=i.handlers[t.type];if(n)for(var r=n.slice(0),o=0,a=r.length;o=0;i--)n[i]===t&&n.splice(i,1);e.className=n.join(" ")}},vjs.TEST_VID=vjs.createEl("video"),track=document.createElement("track"),track.kind="captions",track.srclang="en",track.label="English",vjs.TEST_VID.appendChild(track),vjs.USER_AGENT=navigator.userAgent,vjs.IS_IPHONE=/iPhone/i.test(vjs.USER_AGENT),vjs.IS_IPAD=/iPad/i.test(vjs.USER_AGENT),vjs.IS_IPOD=/iPod/i.test(vjs.USER_AGENT),vjs.IS_IOS=vjs.IS_IPHONE||vjs.IS_IPAD||vjs.IS_IPOD,vjs.IOS_VERSION=function(){var e=vjs.USER_AGENT.match(/OS (\d+)_/i);if(e&&e[1])return e[1]}(),vjs.IS_ANDROID=/Android/i.test(vjs.USER_AGENT),vjs.ANDROID_VERSION=(match=vjs.USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i),match?(major=match[1]&&parseFloat(match[1]),minor=match[2]&&parseFloat(match[2]),major&&minor?parseFloat(match[1]+"."+match[2]):major||null):null),vjs.IS_OLD_ANDROID=vjs.IS_ANDROID&&/webkit/i.test(vjs.USER_AGENT)&&vjs.ANDROID_VERSION<2.3,vjs.IS_FIREFOX=/Firefox/i.test(vjs.USER_AGENT),vjs.IS_CHROME=/Chrome/i.test(vjs.USER_AGENT),vjs.IS_IE8=/MSIE\s8\.0/.test(vjs.USER_AGENT),vjs.TOUCH_ENABLED=!!("ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),vjs.BACKGROUND_SIZE_SUPPORTED="backgroundSize"in vjs.TEST_VID.style,vjs.setElementAttributes=function(e,t){vjs.obj.each(t,(function(t,n){null==n||!1===n?e.removeAttribute(t):e.setAttribute(t,!0===n?"":n)}))},vjs.getElementAttributes=function(e){var t,n,i,r,o;if(t={},n=",autoplay,controls,loop,muted,default,",e&&e.attributes&&e.attributes.length>0)for(var a=(i=e.attributes).length-1;a>=0;a--)r=i[a].name,o=i[a].value,"boolean"!=typeof e[r]&&-1===n.indexOf(","+r+",")||(o=null!==o),t[r]=o;return t},vjs.getComputedDimension=function(e,t){var n="";return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,"").getPropertyValue(t):e.currentStyle&&(n=e["client"+t.substr(0,1).toUpperCase()+t.substr(1)]+"px"),n},vjs.insertFirst=function(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)},vjs.browser={},vjs.el=function(e){return 0===e.indexOf("#")&&(e=e.slice(1)),document.getElementById(e)},vjs.formatTime=function(e,t){t=t||e;var n=Math.floor(e%60),i=Math.floor(e/60%60),r=Math.floor(e/3600),o=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=i=n="-"),(r=r>0||a>0?r+":":"")+(i=((r||o>=10)&&i<10?"0"+i:i)+":")+(n=n<10?"0"+n:n)},vjs.blockTextSelection=function(){document.body.focus(),document.onselectstart=function(){return!1}},vjs.unblockTextSelection=function(){document.onselectstart=function(){return!0}},vjs.trim=function(e){return(e+"").replace(/^\s+|\s+$/g,"")},vjs.round=function(e,t){return t||(t=0),Math.round(e*Math.pow(10,t))/Math.pow(10,t)},vjs.createTimeRange=function(e,t){return void 0===e&&void 0===t?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:1,start:function(){return e},end:function(){return t}}},vjs.setVjsStorage=function(e,t){try{cacheManager.setGenericData(e,t)}catch(e){vjs.log("cacheManager Error (VideoJS)",e)}},vjs.getAbsoluteURL=function(e){return e.match(/^https?:\/\//)||(e=vjs.createEl("div",{innerHTML:'x'}).firstChild.href),e},vjs.parseUrl=function(e){var t,n,i,r,o;r=["protocol","hostname","port","pathname","search","hash","host"],(i=""===(n=vjs.createEl("a",{href:e})).host&&"file:"!==n.protocol)&&((t=vjs.createEl("div")).innerHTML='',n=t.firstChild,t.setAttribute("style","display:none; position:absolute;"),document.body.appendChild(t)),o={};for(var a=0;a=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.off(),this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),vjs.removeData(this.el_),this.el_=null},vjs.Component.prototype.player_=!0,vjs.Component.prototype.player=function(){return this.player_},vjs.Component.prototype.options_,vjs.Component.prototype.options=function(e){return void 0===e?this.options_:this.options_=vjs.util.mergeOptions(this.options_,e)},vjs.Component.prototype.el_,vjs.Component.prototype.createEl=function(e,t){return vjs.createEl(e,t)},vjs.Component.prototype.localize=function(e){var t=this.player_.language(),n=this.player_.languages();return n&&n[t]&&n[t][e]?n[t][e]:e},vjs.Component.prototype.el=function(){return this.el_},vjs.Component.prototype.contentEl_,vjs.Component.prototype.contentEl=function(){return this.contentEl_||this.el_},vjs.Component.prototype.id_,vjs.Component.prototype.id=function(){return this.id_},vjs.Component.prototype.name_,vjs.Component.prototype.name=function(){return this.name_},vjs.Component.prototype.children_,vjs.Component.prototype.children=function(){return this.children_},vjs.Component.prototype.childIndex_,vjs.Component.prototype.getChildById=function(e){return this.childIndex_[e]},vjs.Component.prototype.childNameIndex_,vjs.Component.prototype.getChild=function(e){return this.childNameIndex_[e]},vjs.Component.prototype.addChild=function(e,t){var n,i,r;return"string"==typeof e?(r=e,i=(t=t||{}).componentClass||vjs.capitalize(r),t.name=r,n=new window.videojs_apn[i](this.player_||this,t)):n=e,this.children_.push(n),"function"==typeof n.id&&(this.childIndex_[n.id()]=n),(r=r||n.name&&n.name())&&(this.childNameIndex_[r]=n),"function"==typeof n.el&&n.el()&&this.contentEl().appendChild(n.el()),n},vjs.Component.prototype.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(t){this.childIndex_[e.id()]=null,this.childNameIndex_[e.name()]=null;var i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},vjs.Component.prototype.initChildren=function(){var e,t,n,i,r,o,a;if(n=(t=(e=this).options()).children)if(a=function(n,i){void 0!==t[n]&&(i=t[n]),!1!==i&&(e[n]=e.addChild(n,i))},vjs.obj.isArray(n))for(var s=0;s0){for(var t=0,n=e.length;t1?n=!1:t&&(r=e.touches[0].pageX-t.pageX,o=e.touches[0].pageY-t.pageY,Math.sqrt(r*r+o*o)>10&&(n=!1))})),i=function(){n=!1},this.on("touchleave",i),this.on("touchcancel",i),this.on("touchend",(function(i){t=null,!0===n&&(new Date).getTime()-e<200&&(i.preventDefault(),this.trigger("tap"))}))},vjs.Component.prototype.enableTouchActivity=function(){var e,t,n;this.player().reportUserActivity&&(e=vjs.bind(this.player(),this.player().reportUserActivity),this.on("touchstart",(function(){e(),this.clearInterval(t),t=this.setInterval(e,250)})),n=function(n){e(),this.clearInterval(t)},this.on("touchmove",e),this.on("touchend",n),this.on("touchcancel",n))},vjs.Component.prototype.setTimeout=function(e,t){e=vjs.bind(this,e);var n=setTimeout(e,t),i=function(){this.clearTimeout(n)};return i.guid="vjs-timeout-"+n,this.on("dispose",i),n},vjs.Component.prototype.clearTimeout=function(e){clearTimeout(e);var t=function(){};return t.guid="vjs-timeout-"+e,this.off("dispose",t),e},vjs.Component.prototype.setInterval=function(e,t){e=vjs.bind(this,e);var n=setInterval(e,t),i=function(){this.clearInterval(n)};return i.guid="vjs-interval-"+n,this.on("dispose",i),n},vjs.Component.prototype.clearInterval=function(e){clearInterval(e);var t=function(){};return t.guid="vjs-interval-"+e,this.off("dispose",t),e},vjs.Button=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.emitTapEvents(),this.on("tap",this.onClick),this.on("click",this.onClick),this.on("focus",this.onFocus),this.on("blur",this.onBlur)}}),vjs.Button.prototype.createEl=function(e,t){var n;return t=vjs.obj.merge({className:this.buildCSSClass(),role:"button","aria-live":"polite",tabIndex:0},t),n=vjs.Component.prototype.createEl.call(this,e,t),t.innerHTML||(this.contentEl_=vjs.createEl("div",{className:"vjs-control-content"}),this.controlText_=vjs.createEl("span",{className:"vjs-control-text",innerHTML:this.localize(this.buttonText)||"Need Text"}),this.contentEl_.appendChild(this.controlText_),n.appendChild(this.contentEl_)),n},vjs.Button.prototype.buildCSSClass=function(){return"vjs-control "+vjs.Component.prototype.buildCSSClass.call(this)},vjs.Button.prototype.onClick=function(){},vjs.Button.prototype.onFocus=function(){vjs.on(document,"keydown",vjs.bind(this,this.onKeyPress))},vjs.Button.prototype.onKeyPress=function(e){32!=e.which&&13!=e.which||(e.preventDefault(),this.onClick())},vjs.Button.prototype.onBlur=function(){vjs.off(document,"keydown",vjs.bind(this,this.onKeyPress))},vjs.Slider=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.bar=this.getChild(this.options_.barName),this.handle=this.getChild(this.options_.handleName),this.on("mousedown",this.onMouseDown),this.on("touchstart",this.onMouseDown),this.on("focus",this.onFocus),this.on("blur",this.onBlur),this.on("click",this.onClick),this.on(e,"controlsvisible",this.update),this.on(e,this.playerEvent,this.update)}}),vjs.Slider.prototype.createEl=function(e,t){return(t=t||{}).className=t.className+" vjs-slider",t=vjs.obj.merge({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},t),vjs.Component.prototype.createEl.call(this,e,t)},vjs.Slider.prototype.onMouseDown=function(e){e.preventDefault(),vjs.blockTextSelection(),this.addClass("vjs-sliding"),this.on(document,"mousemove",this.onMouseMove),this.on(document,"mouseup",this.onMouseUp),this.on(document,"touchmove",this.onMouseMove),this.on(document,"touchend",this.onMouseUp),this.onMouseMove(e)},vjs.Slider.prototype.onMouseMove=function(){},vjs.Slider.prototype.onMouseUp=function(){vjs.unblockTextSelection(),this.removeClass("vjs-sliding"),this.off(document,"mousemove",this.onMouseMove),this.off(document,"mouseup",this.onMouseUp),this.off(document,"touchmove",this.onMouseMove),this.off(document,"touchend",this.onMouseUp),this.update()},vjs.Slider.prototype.update=function(){if(this.el_){var e,t=this.getPercent(),n=this.handle,i=this.bar;if(("number"!=typeof t||t!=t||t<0||t===1/0)&&(t=0),e=t,n){var r=this.el_.offsetWidth,o=n.el().offsetWidth,a=o?o/r:0,s=t*(1-a);e=s+a/2,n.el().style.left=vjs.round(100*s,2)+"%"}i&&(i.el().style.width=vjs.round(100*e,2)+"%")}},vjs.Slider.prototype.calculateDistance=function(e){var t,n,i,r,o,a,s,l,d;if(t=this.el_,n=vjs.findPosition(t),o=a=t.offsetWidth,s=this.handle,this.options().vertical){if(r=n.top,d=e.changedTouches?e.changedTouches[0].pageY:e.pageY,s){var c=s.el().offsetHeight;r+=c/2,a-=c}return Math.max(0,Math.min(1,(r-d+a)/a))}if(i=n.left,l=e.changedTouches?e.changedTouches[0].pageX:e.pageX,s){var u=s.el().offsetWidth;i+=u/2,o-=u}return Math.max(0,Math.min(1,(l-i)/o))},vjs.Slider.prototype.onFocus=function(){this.on(document,"keydown",this.onKeyPress)},vjs.Slider.prototype.onKeyPress=function(e){37==e.which||40==e.which?(e.preventDefault(),this.stepBack()):38!=e.which&&39!=e.which||(e.preventDefault(),this.stepForward())},vjs.Slider.prototype.onBlur=function(){this.off(document,"keydown",this.onKeyPress)},vjs.Slider.prototype.onClick=function(e){e.stopImmediatePropagation(),e.preventDefault()},vjs.SliderHandle=vjs.Component.extend(),vjs.SliderHandle.prototype.defaultValue=0,vjs.SliderHandle.prototype.createEl=function(e,t){return(t=t||{}).className=t.className+" vjs-slider-handle",t=vjs.obj.merge({innerHTML:''+this.defaultValue+""},t),vjs.Component.prototype.createEl.call(this,"div",t)},vjs.Menu=vjs.Component.extend(),vjs.Menu.prototype.addItem=function(e){this.addChild(e),e.on("click",vjs.bind(this,(function(){this.unlockShowing()})))},vjs.Menu.prototype.createEl=function(){var e=this.options().contentElType||"ul";this.contentEl_=vjs.createEl(e,{className:"vjs-menu-content"});var t=vjs.Component.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),vjs.on(t,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),t},vjs.MenuItem=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t),this.selected(t.selected)}}),vjs.MenuItem.prototype.createEl=function(e,t){return vjs.Button.prototype.createEl.call(this,"li",vjs.obj.merge({className:"vjs-menu-item",innerHTML:this.localize(this.options_.label)},t))},vjs.MenuItem.prototype.onClick=function(){this.selected(!0)},vjs.MenuItem.prototype.selected=function(e){e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-selected",!0)):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-selected",!1))},vjs.MenuButton=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t),this.update(),this.on("keydown",this.onKeyPress),this.el_.setAttribute("aria-haspopup",!0),this.el_.setAttribute("role","button")}}),vjs.MenuButton.prototype.update=function(){var e=this.createMenu();this.menu&&this.removeChild(this.menu),this.menu=e,this.addChild(e),this.items&&0===this.items.length?this.hide():this.items&&this.items.length>1&&this.show()},vjs.MenuButton.prototype.buttonPressed_=!1,vjs.MenuButton.prototype.createMenu=function(){var e=new vjs.Menu(this.player_);if(this.options().title&&e.contentEl().appendChild(vjs.createEl("li",{className:"vjs-menu-title",innerHTML:vjs.capitalize(this.options().title),tabindex:-1})),this.items=this.createItems(),this.items)for(var t=0;t0&&this.items[0].el().focus()},vjs.MenuButton.prototype.unpressButton=function(){this.buttonPressed_=!1,this.menu.unlockShowing(),this.el_.setAttribute("aria-pressed",!1)},vjs.MediaError=function(e){"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:"object"==typeof e&&vjs.obj.merge(this,e),this.message||(this.message="")},vjs.MediaError.prototype.code=0,vjs.MediaError.prototype.message="",vjs.MediaError.prototype.status=null,vjs.MediaError.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],vjs.MediaError.defaultMessages={1:"You aborted the video playback",2:"A network error caused the video download to fail part-way.",3:"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.",4:"The video could not be loaded, either because the server or network failed or because the format is not supported.",5:"The video is encrypted and we do not have the keys to decrypt it."};for(var errNum=0;errNum=0&&(vjs.players[t].trigger("fullscreenchange"),vjs.players[t].fsButtonClicked||(vjs.players[t].isFullscreen(!1),vjs.players[t].removeClass("vjs-fullscreen")),vjs.players[t].fsButtonClicked=!1)}))}(),vjs.Player=vjs.Component.extend({init:function(e,t,n){this.tag=e,e.id=e.id||"vjs_video_"+vjs.guid++,this.tagAttributes=e&&vjs.getElementAttributes(e),t=vjs.obj.merge(this.getTagSettings(e),t),this.language_=t.language||vjs.options.language,this.languages_=t.languages||vjs.options.languages,this.cache_={},this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,t.reportTouchActivity=!1,this.isAudio("audio"===this.tag.nodeName.toLowerCase()),vjs.Component.call(this,this,t,n),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.isAudio()&&this.addClass("vjs-audio"),this.addClass("vjs-big-play-centered"),vjs.players[this.id_]=this,t.plugins&&vjs.obj.each(t.plugins,(function(e,t){this[e](t)}),this),this.listenForUserActivity()}}),vjs.Player.prototype.language_,vjs.Player.prototype.language=function(e){return void 0===e?this.language_:(this.language_=e,this)},vjs.Player.prototype.getMuteSettingsForIOS10=function(){return vjs.IS_IOS&&this.options_.enableNativeInline&&parseInt(vjs.IOS_VERSION)>9},vjs.Player.prototype.languages_,vjs.Player.prototype.languages=function(){return this.languages_},vjs.Player.prototype.options_=vjs.options,vjs.Player.prototype.dispose=function(){this.trigger("dispose"),this.off("dispose"),vjs.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech&&this.tech.dispose(),vjs.Component.prototype.dispose.call(this)},vjs.Player.prototype.getTagSettings=function(e){var t,n,i,r,o,a,s,l={sources:[],tracks:[]};if(null!==(n=(t=vjs.getElementAttributes(e))["data-setup"])&&vjs.obj.merge(t,vjs.JSON.parse(n||"{}")),vjs.obj.merge(l,t),e.hasChildNodes())for(a=0,s=(i=e.childNodes).length;a0&&(n.startTime=this.cache_.currentTime),this.cache_.src=t.src),this.tech=new window.videojs_apn[e](this,n),this.tech.ready((function(){this.player_.triggerReady()}))},vjs.Player.prototype.unloadTech=function(){this.isReady_=!1,this.tech.dispose(),this.tech=!1},vjs.Player.prototype.onLoadStart=function(){this.removeClass("vjs-ended"),this.error(null),this.paused()?this.hasStarted(!1):this.trigger("firstplay")},vjs.Player.prototype.hasStarted_=!1,vjs.Player.prototype.hasStarted=function(e){return void 0!==e?(this.hasStarted_!==e&&(this.hasStarted_=e,e?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started")),this):this.hasStarted_},vjs.Player.prototype.onLoadedMetaData,vjs.Player.prototype.onLoadedData,vjs.Player.prototype.onLoadedAllData,vjs.Player.prototype.onPlay=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0)},vjs.Player.prototype.onWaiting=function(){this.addClass("vjs-waiting")},vjs.Player.prototype.onWaitEnd=function(){this.removeClass("vjs-waiting")},vjs.Player.prototype.onSeeking=function(){this.addClass("vjs-seeking")},vjs.Player.prototype.onSeeked=function(){this.removeClass("vjs-seeking")},vjs.Player.prototype.onFirstPlay=function(){this.options_.starttime&&this.currentTime(this.options_.starttime),this.addClass("vjs-has-started")},vjs.Player.prototype.onPause=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused")},vjs.Player.prototype.onTimeUpdate,vjs.Player.prototype.onProgress=function(){1==this.bufferedPercent()&&this.trigger("loadedalldata")},vjs.Player.prototype.onEnded=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause()},vjs.Player.prototype.onDurationChange=function(){var e=this.techGet("duration");e&&(e<0&&(e=1/0),this.duration(e),e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"))},vjs.Player.prototype.onVolumeChange,vjs.Player.prototype.onFullscreenChange=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},vjs.Player.prototype.onError,vjs.Player.prototype.cache_,vjs.Player.prototype.getCache=function(){return this.cache_},vjs.Player.prototype.techCall=function(e,t){if(this.tech&&!this.tech.isReady_)this.tech.ready((function(){this[e](t)}));else try{this.tech[e](t)}catch(e){throw vjs.log(e),e}},vjs.Player.prototype.techGet=function(e){if(this.tech&&this.tech.isReady_)try{return this.tech[e]()}catch(t){throw void 0===this.tech[e]?vjs.log("Video.js: "+e+" method not defined for "+this.techName+" playback technology.",t):"TypeError"==t.name?(vjs.log("Video.js: "+e+" unavailable on "+this.techName+" playback technology element.",t),this.tech.isReady_=!1):vjs.log(t),t}},vjs.Player.prototype.play=function(){return this.techCall("play"),this},vjs.Player.prototype.pause=function(){return this.techCall("pause"),this.trigger("apn-vpaid-pause"),this},vjs.Player.prototype.paused=function(){return!1!==this.techGet("paused")},vjs.Player.prototype.currentTime=function(e){return void 0!==e?(this.techCall("setCurrentTime",e),this):this.cache_.currentTime=this.techGet("currentTime")||0},vjs.Player.prototype.duration=function(e){return void 0!==e?(this.cache_.duration=parseFloat(e),this):(void 0===this.cache_.duration&&this.onDurationChange(),this.cache_.duration||0)},vjs.Player.prototype.remainingTime=function(){return this.duration()-this.currentTime()},vjs.Player.prototype.buffered=function(){var e=this.techGet("buffered");return e&&e.length||(e=vjs.createTimeRange(0,0)),e},vjs.Player.prototype.bufferedPercent=function(){var e,t,n=this.duration(),i=this.buffered(),r=0;if(!n)return 0;for(var o=0;on&&(t=n),r+=t-e;return r/n},vjs.Player.prototype.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),n=e.end(e.length-1);return n>t&&(n=t),n},vjs.Player.prototype.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall("setVolume",t),vjs.setVjsStorage("volume",t),this):(t=parseFloat(this.techGet("volume")),isNaN(t)?1:t)},vjs.Player.prototype.muted=function(e){return void 0!==e?(vjs.IS_IOS&&this.options_.enableInlineVideoForIos||this.techCall("setMuted",e),this):this.techGet("muted")||!1},vjs.Player.prototype.supportsFullScreen=function(){return this.techGet("supportsFullScreen")||!1},vjs.Player.prototype.isFullscreen_=!1,vjs.Player.prototype.isFullscreen=function(e){return void 0!==e?(this.isFullscreen_=!!e,this):this.isFullscreen_},vjs.Player.prototype.isFullScreen=function(e){return vjs.log.warn('player.isFullScreen() has been deprecated, use player.isFullscreen() with a lowercase "s")'),this.isFullscreen(e)},vjs.Player.prototype.requestFullscreen=function(){var e=vjs.browser.fullscreenAPI;return this.isFullscreen(!0),e?(vjs.on(document,e.fullscreenchange,vjs.bind(this,(function(t){this.isFullscreen(document[e.fullscreenElement]),!1===this.isFullscreen()&&vjs.off(document,e.fullscreenchange,arguments.callee)}))),this.el_[e.requestFullscreen]()):(this.tech.supportsFullScreen(),this.enterFullWindow(),this.trigger("fullscreenchange")),this},vjs.Player.prototype.requestFullScreen=function(){return vjs.log.warn('player.requestFullScreen() has been deprecated, use player.requestFullscreen() with a lowercase "s")'),this.requestFullscreen()},vjs.Player.prototype.exitFullscreen=function(){var e=vjs.browser.fullscreenAPI;return this.isFullscreen(!1),e?document[e.exitFullscreen]():this.tech.supportsFullScreen()?(this.exitFullWindow(),this.trigger("fullscreenchange")):(this.exitFullWindow(),this.push("fullscreenchange")),this},vjs.Player.prototype.cancelFullScreen=function(){return vjs.log.warn("player.cancelFullScreen() has been deprecated, use player.exitFullscreen()"),this.exitFullscreen()},vjs.Player.prototype.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=document.documentElement.style.overflow,vjs.on(document,"keydown",vjs.bind(this,this.fullWindowOnEscKey)),document.documentElement.style.overflow="hidden",vjs.addClass(document.body,"vjs-full-window"),this.trigger("enterFullWindow")},vjs.Player.prototype.fullWindowOnEscKey=function(e){27===e.keyCode&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},vjs.Player.prototype.exitFullWindow=function(){this.isFullWindow=!1,vjs.off(document,"keydown",this.fullWindowOnEscKey),document.documentElement.style.overflow=this.docOrigOverflow,vjs.removeClass(document.body,"vjs-full-window"),this.trigger("exitFullWindow")},vjs.Player.prototype.selectSource=function(e){for(var t=0,n=this.options_.techOrder;t=0||(console.log("active:onmouseout:initialize"),a=void 0,s=void 0)},n=function(){e(),this.clearInterval(i),i=this.setInterval(e,250)},r=function(t){e(),this.clearInterval(i)},this.on("mousedown",n),this.on("mousemove",t),this.on("mouseup",r),this.on("mouseover",l),this.on("mouseout",d),this.on("keydown",e),this.on("keyup",e),this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(o);var e=this.options().inactivityTimeout;e>0&&(o=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}}),250)},vjs.Player.prototype.playbackRate=function(e){return void 0!==e?(this.techCall("setPlaybackRate",e),this):this.tech&&this.tech.featuresPlaybackRate?this.techGet("playbackRate"):1},vjs.Player.prototype.isAudio_=!1,vjs.Player.prototype.isAudio=function(e){return void 0!==e?(this.isAudio_=!!e,this):this.isAudio_},vjs.Player.prototype.networkState=function(){return this.techGet("networkState")},vjs.Player.prototype.readyState=function(){return this.techGet("readyState")},vjs.Player.prototype.textTracks=function(){return this.tech&&this.tech.textTracks()},vjs.Player.prototype.remoteTextTracks=function(){return this.tech&&this.tech.remoteTextTracks()},vjs.Player.prototype.addTextTrack=function(e,t,n){return this.tech&&this.tech.addTextTrack(e,t,n)},vjs.Player.prototype.addRemoteTextTrack=function(e){return this.tech&&this.tech.addRemoteTextTrack(e)},vjs.Player.prototype.removeRemoteTextTrack=function(e){this.tech&&this.tech.removeRemoteTextTrack(e)},vjs.ControlBar=vjs.Component.extend(),vjs.ControlBar.prototype.options_={loadEvent:"play",children:{playToggle:{},currentTimeDisplay:{},timeDivider:{},durationDisplay:{},remainingTimeDisplay:{},progressControl:{},fullscreenToggle:{},volumeControl:{},muteToggle:{},playbackRateMenuButton:{}}},vjs.ControlBar.prototype.createEl=function(){return vjs.createEl("div",{className:"vjs-control-bar"})},vjs.LiveDisplay=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.LiveDisplay.prototype.createEl=function(){var e=vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-live-controls vjs-control"});return this.contentEl_=vjs.createEl("div",{className:"vjs-live-display",innerHTML:''+this.localize("Stream Type")+""+this.localize("LIVE"),"aria-live":"off"}),e.appendChild(this.contentEl_),e},vjs.PlayToggle=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t),this.on(e,"play",this.onPlay),this.on(e,"pause",this.onPause)}}),vjs.PlayToggle.prototype.buttonText="Play",vjs.PlayToggle.prototype.buildCSSClass=function(){return"vjs-play-control "+vjs.Button.prototype.buildCSSClass.call(this)},vjs.PlayToggle.prototype.onClick=function(){},vjs.PlayToggle.prototype.onPlay=function(){this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.el_.children[0].children[0].innerHTML=this.localize("Pause")},vjs.PlayToggle.prototype.onPause=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.el_.children[0].children[0].innerHTML=this.localize("Play")},vjs.CurrentTimeDisplay=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.on(e,"timeupdate",this.updateContent)}}),vjs.CurrentTimeDisplay.prototype.createEl=function(){var e=vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-current-time vjs-time-controls vjs-control"});return this.contentEl_=vjs.createEl("div",{className:"vjs-current-time-display",innerHTML:'Current Time 0:00',"aria-live":"off"}),e.appendChild(this.contentEl_),e},vjs.CurrentTimeDisplay.prototype.updateContent=function(){var e=this.player_.scrubbing?this.player_.getCache().currentTime:this.player_.currentTime();this.contentEl_.innerHTML=''+this.localize("Current Time")+" "+vjs.formatTime(e,this.player_.duration())},vjs.DurationDisplay=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.on(e,"timeupdate",this.updateContent),this.on(e,"loadedmetadata",this.updateContent)}}),vjs.DurationDisplay.prototype.createEl=function(){var e=vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-duration vjs-time-controls vjs-control"});return this.contentEl_=vjs.createEl("div",{className:"vjs-duration-display",innerHTML:''+this.localize("Duration Time")+" 0:00","aria-live":"off"}),e.appendChild(this.contentEl_),e},vjs.DurationDisplay.prototype.updateContent=function(){var e=this.player_.duration();e&&(this.contentEl_.innerHTML=''+this.localize("Duration Time")+" "+vjs.formatTime(e))},vjs.TimeDivider=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.TimeDivider.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-time-divider",innerHTML:"
/
"})},vjs.RemainingTimeDisplay=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.on(e,"timeupdate",this.updateContent)}}),vjs.RemainingTimeDisplay.prototype.createEl=function(){var e=vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-remaining-time vjs-time-controls vjs-control"});return this.contentEl_=vjs.createEl("div",{className:"vjs-remaining-time-display",innerHTML:''+this.localize("Remaining Time")+" -0:00","aria-live":"off"}),e.appendChild(this.contentEl_),e},vjs.RemainingTimeDisplay.prototype.updateContent=function(){this.player_.duration()&&(this.contentEl_.innerHTML=''+this.localize("Remaining Time")+" -"+vjs.formatTime(this.player_.remainingTime()))},vjs.FullscreenToggle=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t)}}),vjs.FullscreenToggle.prototype.buttonText="Fullscreen",vjs.FullscreenToggle.prototype.buildCSSClass=function(){return"vjs-fullscreen-control "+vjs.Button.prototype.buildCSSClass.call(this)},vjs.FullscreenToggle.prototype.onClick=function(){this.player_.fsButtonClicked=!0,this.player_.isFullscreen()?(this.player_.exitFullscreen(),this.controlText_.innerHTML=this.localize("Fullscreen")):(this.player_.requestFullscreen(),this.controlText_.innerHTML=this.localize("Non-Fullscreen"))},vjs.ProgressControl=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.ProgressControl.prototype.options_={children:{seekBar:{}}},vjs.ProgressControl.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},vjs.SeekBar=vjs.Slider.extend({init:function(e,t){vjs.Slider.call(this,e,t),this.on(e,"timeupdate",this.updateARIAAttributes),e.ready(vjs.bind(this,this.updateARIAAttributes))}}),vjs.SeekBar.prototype.options_={children:{loadProgressBar:{},playProgressBar:{},seekHandle:{}},barName:"playProgressBar",handleName:"seekHandle"},vjs.SeekBar.prototype.playerEvent="timeupdate",vjs.SeekBar.prototype.createEl=function(){return vjs.Slider.prototype.createEl.call(this,"div",{className:"vjs-progress-holder","aria-label":"video progress bar"})},vjs.SeekBar.prototype.updateARIAAttributes=function(){var e=this.player_.scrubbing?this.player_.getCache().currentTime:this.player_.currentTime();this.el_.setAttribute("aria-valuenow",vjs.round(100*this.getPercent(),2)),this.el_.setAttribute("aria-valuetext",vjs.formatTime(e,this.player_.duration()))},vjs.SeekBar.prototype.getPercent=function(){return this.player_.currentTime()/this.player_.duration()},vjs.LoadProgressBar=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.on(e,"progress",this.update)}}),vjs.LoadProgressBar.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:''+this.localize("Loaded")+": 0%"})},vjs.LoadProgressBar.prototype.update=function(){var e,t,n,i,r=this.player_.buffered(),o=this.player_.duration(),a=this.player_.bufferedEnd(),s=this.el_.children,l=function(e,t){return 100*(e/t||0)+"%"};for(this.el_.style.width=l(a,o),e=0;er.length;e--)this.el_.removeChild(s[e-1])},vjs.PlayProgressBar=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.PlayProgressBar.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-play-progress",innerHTML:''+this.localize("Progress")+": 0%"})},vjs.SeekHandle=vjs.SliderHandle.extend({init:function(e,t){vjs.SliderHandle.call(this,e,t),this.on(e,"timeupdate",this.updateContent)}}),vjs.SeekHandle.prototype.defaultValue="00:00",vjs.SeekHandle.prototype.createEl=function(){return vjs.SliderHandle.prototype.createEl.call(this,"div",{className:"vjs-seek-handle","aria-live":"off"})},vjs.SeekHandle.prototype.updateContent=function(){var e=this.player_.scrubbing?this.player_.getCache().currentTime:this.player_.currentTime();this.el_.innerHTML=''+vjs.formatTime(e,this.player_.duration())+""},vjs.VolumeControl=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),e.tech&&!1===e.tech.featuresVolumeControl&&this.addClass("vjs-hidden"),this.on(e,"loadstart",(function(){!1===e.tech.featuresVolumeControl?this.addClass("vjs-hidden"):this.removeClass("vjs-hidden")}))}}),vjs.VolumeControl.prototype.options_={children:{volumeBar:{}}},vjs.VolumeControl.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control"})},vjs.VolumeBar=vjs.Slider.extend({init:function(e,t){vjs.Slider.call(this,e,t),this.on(e,"volumechange",this.updateARIAAttributes),e.ready(vjs.bind(this,this.updateARIAAttributes))}}),vjs.VolumeBar.prototype.updateARIAAttributes=function(){this.el_.setAttribute("aria-valuenow",vjs.round(100*this.player_.volume(),2)),this.el_.setAttribute("aria-valuetext",vjs.round(100*this.player_.volume(),2)+"%")},vjs.VolumeBar.prototype.options_={children:{volumeLevel:{},volumeHandle:{}},barName:"volumeLevel",handleName:"volumeHandle"},vjs.VolumeBar.prototype.playerEvent="volumechange",vjs.VolumeBar.prototype.createEl=function(){return vjs.Slider.prototype.createEl.call(this,"div",{className:"vjs-volume-bar","aria-label":"volume level"})},vjs.VolumeBar.prototype.onMouseMove=function(e){if(this.player_.muted(),global_options.hasOwnProperty("overlayPlayer"))e.srcElement&&"VIDEO"!=e.srcElement.tagName&&e.srcElement.className.indexOf("vjs")>=0?"VIDEO"!=e.srcElement.tagName&&e.srcElement.className&&e.srcElement.className.indexOf("vjs")>=0&&this.player_.volume(this.calculateDistance(e)):e.currentTarget&&"VIDEO"!=e.currentTarget.tagName&&e.currentTarget.className&&e.currentTarget.className.indexOf("vjs")>=0&&this.player_.volume(this.calculateDistance(e));else{var t=global_options.wcElement&&global_options.wcElement instanceof Element?global_options.wcElement.querySelector("#"+String(global_options.iframeVideoWrapperId)):document.getElementById(global_options.iframeVideoWrapperId),n=t&&t.contentWindow.document,i=n&&n.elementFromPoint(e.clientX,e.clientY);i&&"VIDEO"!=i.tagName&&i.className.indexOf("vjs")>=0&&this.player_.volume(this.calculateDistance(e))}},vjs.VolumeBar.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},vjs.VolumeBar.prototype.stepForward=function(){this.player_.volume(this.player_.volume()+.1)},vjs.VolumeBar.prototype.stepBack=function(){this.player_.volume(this.player_.volume()-.1)},vjs.VolumeLevel=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.VolumeLevel.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:''})},vjs.VolumeHandle=vjs.SliderHandle.extend(),vjs.VolumeHandle.prototype.defaultValue="00:00",vjs.VolumeHandle.prototype.createEl=function(){return vjs.SliderHandle.prototype.createEl.call(this,"div",{className:"vjs-volume-handle"})},vjs.MuteToggle=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t),this.on(e,"volumechange",this.update);var n=e.getMuteSettingsForIOS10();e.tech&&!1===e.tech.featuresVolumeControl&&!n&&this.addClass("vjs-hidden"),this.on(e,"loadstart",(function(){!1!==e.tech.featuresVolumeControl||n?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}))}}),vjs.MuteToggle.prototype.createEl=function(){return vjs.Button.prototype.createEl.call(this,"div",{className:"vjs-mute-control vjs-control",innerHTML:'
'+this.localize("Mute")+"
"})},vjs.MuteToggle.prototype.onClick=function(){if(this.player_.muted()){var e=this.player_.volume();0===e&&(e=.5,this.player_.volume(e))}this.player_.muted(!this.player_.muted())},vjs.MuteToggle.prototype.update=function(){var e=this.player_.volume(),t=3;if(0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2),this.el_){this.player_.muted()?this.el_.children[0].children[0].innerHTML!=this.localize("Unmute")&&(this.el_.children[0].children[0].innerHTML=this.localize("Unmute")):this.el_.children[0].children[0].innerHTML!=this.localize("Mute")&&(this.el_.children[0].children[0].innerHTML=this.localize("Mute"));for(var n=0;n<4;n++)vjs.removeClass(this.el_,"vjs-vol-"+n);vjs.addClass(this.el_,"vjs-vol-"+t)}},vjs.VolumeMenuButton=vjs.MenuButton.extend({init:function(e,t){vjs.MenuButton.call(this,e,t),this.on(e,"volumechange",this.volumeUpdate),e.tech&&!1===e.tech.featuresVolumeControl&&this.addClass("vjs-hidden"),this.on(e,"loadstart",(function(){!1===e.tech.featuresVolumeControl?this.addClass("vjs-hidden"):this.removeClass("vjs-hidden")})),this.addClass("vjs-menu-button")}}),vjs.VolumeMenuButton.prototype.createMenu=function(){var e=new vjs.Menu(this.player_,{contentElType:"div"}),t=new vjs.VolumeBar(this.player_,this.options_.volumeBar);return t.on("focus",(function(){e.lockShowing()})),t.on("blur",(function(){e.unlockShowing()})),e.addChild(t),e},vjs.VolumeMenuButton.prototype.onClick=function(){vjs.MuteToggle.prototype.onClick.call(this),vjs.MenuButton.prototype.onClick.call(this)},vjs.VolumeMenuButton.prototype.createEl=function(){return vjs.Button.prototype.createEl.call(this,"div",{className:"vjs-volume-menu-button vjs-menu-button vjs-control",innerHTML:'
'+this.localize("Mute")+"
"})},vjs.VolumeMenuButton.prototype.volumeUpdate=vjs.MuteToggle.prototype.update,vjs.PlaybackRateMenuButton=vjs.MenuButton.extend({init:function(e,t){vjs.MenuButton.call(this,e,t),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",this.updateVisibility),this.on(e,"ratechange",this.updateLabel)}}),vjs.PlaybackRateMenuButton.prototype.buttonText="Playback Rate",vjs.PlaybackRateMenuButton.prototype.className="vjs-playback-rate",vjs.PlaybackRateMenuButton.prototype.createEl=function(){var e=vjs.MenuButton.prototype.createEl.call(this);return this.labelEl_=vjs.createEl("div",{className:"vjs-playback-rate-value",innerHTML:1}),e.appendChild(this.labelEl_),e},vjs.PlaybackRateMenuButton.prototype.createMenu=function(){var e=new vjs.Menu(this.player()),t=this.player().options().playbackRates;if(t)for(var n=t.length-1;n>=0;n--)e.addChild(new vjs.PlaybackRateMenuItem(this.player(),{rate:t[n]+"x"}));return e},vjs.PlaybackRateMenuButton.prototype.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},vjs.PlaybackRateMenuButton.prototype.onClick=function(){for(var e=this.player().playbackRate(),t=this.player().options().playbackRates,n=t[0],i=0;ie){n=t[i];break}this.player().playbackRate(n)},vjs.PlaybackRateMenuButton.prototype.playbackRateSupported=function(){return this.player().tech&&this.player().tech.featuresPlaybackRate&&this.player().options().playbackRates&&this.player().options().playbackRates.length>0},vjs.PlaybackRateMenuButton.prototype.updateVisibility=function(){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},vjs.PlaybackRateMenuButton.prototype.updateLabel=function(){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},vjs.PlaybackRateMenuItem=vjs.MenuItem.extend({contentElType:"button",init:function(e,t){var n=this.label=t.rate,i=this.rate=parseFloat(n,10);t.label=n,t.selected=1===i,vjs.MenuItem.call(this,e,t),this.on(e,"ratechange",this.update)}}),vjs.PlaybackRateMenuItem.prototype.onClick=function(){vjs.MenuItem.prototype.onClick.call(this),this.player().playbackRate(this.rate)},vjs.PlaybackRateMenuItem.prototype.update=function(){this.selected(this.player().playbackRate()==this.rate)},vjs.PosterImage=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t),this.update(),e.on("posterchange",vjs.bind(this,this.update))}}),vjs.PosterImage.prototype.dispose=function(){this.player().off("posterchange",this.update),vjs.Button.prototype.dispose.call(this)},vjs.PosterImage.prototype.createEl=function(){var e=vjs.createEl("div",{className:"vjs-poster",tabIndex:-1});return vjs.BACKGROUND_SIZE_SUPPORTED||(this.fallbackImg_=vjs.createEl("img"),e.appendChild(this.fallbackImg_)),e},vjs.PosterImage.prototype.update=function(){var e=this.player().poster();this.setSrc(e),e?this.show():this.hide()},vjs.PosterImage.prototype.setSrc=function(e){var t;this.fallbackImg_?this.fallbackImg_.src=e:(t="",e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t)},vjs.PosterImage.prototype.onClick=function(){this.player_.play()},vjs.LoadingSpinner=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.LoadingSpinner.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner"})},vjs.BigPlayButton=vjs.Button.extend(),vjs.BigPlayButton.prototype.createEl=function(){return vjs.Button.prototype.createEl.call(this,"div",{className:"vjs-big-play-button",innerHTML:'',"aria-label":"play video"})},vjs.BigPlayButton.prototype.onClick=function(){},vjs.ErrorDisplay=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.update(),this.on(e,"error",this.update)}}),vjs.ErrorDisplay.prototype.createEl=function(){var e=vjs.Component.prototype.createEl.call(this,"div",{});return this.contentEl_=vjs.createEl("div"),e.appendChild(this.contentEl_),e},vjs.ErrorDisplay.prototype.update=function(){this.player().error()&&(this.contentEl_.innerHTML=this.localize(this.player().error().message))},vjs.MediaTechController=vjs.Component.extend({init:function(e,t,n){(t=t||{}).reportTouchActivity=!1,vjs.Component.call(this,e,t,n),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),this.initControlsListeners(),this.initTextTrackListeners()}}),vjs.MediaTechController.prototype.initControlsListeners=function(){var e,t;e=this.player(),t=function(){e.controls()&&!e.usingNativeControls()&&this.addControlsListeners()},this.ready(t),this.on(e,"controlsenabled",t),this.on(e,"controlsdisabled",this.removeControlsListeners),this.ready((function(){this.networkState&&this.networkState()>0&&this.player().trigger("loadstart")}))},vjs.MediaTechController.prototype.addControlsListeners=function(){var e;this.on("mousedown",this.onClick),this.on("touchstart",(function(t){e=this.player_.userActive()})),this.on("touchmove",(function(t){e&&this.player().reportUserActivity()})),this.on("touchend",(function(e){e.preventDefault()})),this.emitTapEvents(),this.on("tap",this.onTap)},vjs.MediaTechController.prototype.removeControlsListeners=function(){this.off("tap"),this.off("touchstart"),this.off("touchmove"),this.off("touchleave"),this.off("touchcancel"),this.off("touchend"),this.off("click"),this.off("mousedown")},vjs.MediaTechController.prototype.onClick=function(e){0===e.button&&this.player().controls()&&(this.player().paused()?this.player().play():this.player().pause())},vjs.MediaTechController.prototype.onTap=function(){this.player().userActive(!this.player().userActive())},vjs.MediaTechController.prototype.manualProgressOn=function(){this.manualProgress=!0,this.trackProgress()},vjs.MediaTechController.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress()},vjs.MediaTechController.prototype.trackProgress=function(){this.progressInterval=this.setInterval((function(){var e=this.player().bufferedPercent();this.bufferedPercent_!=e&&this.player().trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()}),500)},vjs.MediaTechController.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)}, +__webpack_require__(5).amd?(__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return videojs}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)):module.exports=videojs,vjs.CoreObject=vjs.CoreObject=function(){},vjs.CoreObject.extend=function(e){var t,n;for(var i in t=(e=e||{}).init||e.init||this.prototype.init||this.prototype.init||function(){},((n=function(){t.apply(this,arguments)}).prototype=vjs.obj.create(this.prototype)).constructor=n,n.extend=vjs.CoreObject.extend,n.create=vjs.CoreObject.create,e)e.hasOwnProperty(i)&&(n.prototype[i]=e[i]);return n},vjs.CoreObject.create=function(){var e=vjs.obj.create(this.prototype);return this.apply(e,arguments),e},vjs.on=function(e,t,n){if(vjs.obj.isArray(t))return _handleMultipleEvents(vjs.on,e,t,n);var i=vjs.getData(e);i.handlers||(i.handlers={}),i.handlers[t]||(i.handlers[t]=[]),n.guid||(n.guid=vjs.guid++),i.handlers[t].push(n),i.dispatcher||(i.disabled=!1,i.dispatcher=function(t){if(!i.disabled){t=vjs.fixEvent(t);var n=i.handlers[t.type];if(n)for(var r=n.slice(0),o=0,a=r.length;o=0;i--)n[i]===t&&n.splice(i,1);e.className=n.join(" ")}},vjs.TEST_VID=vjs.createEl("video"),track=document.createElement("track"),track.kind="captions",track.srclang="en",track.label="English",vjs.TEST_VID.appendChild(track),vjs.USER_AGENT=navigator.userAgent,vjs.IS_IPHONE=/iPhone/i.test(vjs.USER_AGENT),vjs.IS_IPAD=/iPad/i.test(vjs.USER_AGENT),vjs.IS_IPOD=/iPod/i.test(vjs.USER_AGENT),vjs.IS_IOS=vjs.IS_IPHONE||vjs.IS_IPAD||vjs.IS_IPOD,vjs.IOS_VERSION=function(){var e=vjs.USER_AGENT.match(/OS (\d+)_/i);if(e&&e[1])return e[1]}(),vjs.IS_ANDROID=/Android/i.test(vjs.USER_AGENT),vjs.ANDROID_VERSION=(match=vjs.USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i),match?(major=match[1]&&parseFloat(match[1]),minor=match[2]&&parseFloat(match[2]),major&&minor?parseFloat(match[1]+"."+match[2]):major||null):null),vjs.IS_OLD_ANDROID=vjs.IS_ANDROID&&/webkit/i.test(vjs.USER_AGENT)&&vjs.ANDROID_VERSION<2.3,vjs.IS_FIREFOX=/Firefox/i.test(vjs.USER_AGENT),vjs.IS_CHROME=/Chrome/i.test(vjs.USER_AGENT),vjs.IS_IE8=/MSIE\s8\.0/.test(vjs.USER_AGENT),vjs.TOUCH_ENABLED=!!("ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),vjs.BACKGROUND_SIZE_SUPPORTED="backgroundSize"in vjs.TEST_VID.style,vjs.setElementAttributes=function(e,t){vjs.obj.each(t,(function(t,n){null==n||!1===n?e.removeAttribute(t):e.setAttribute(t,!0===n?"":n)}))},vjs.getElementAttributes=function(e){var t,n,i,r,o;if(t={},n=",autoplay,controls,loop,muted,default,",e&&e.attributes&&e.attributes.length>0)for(var a=(i=e.attributes).length-1;a>=0;a--)r=i[a].name,o=i[a].value,"boolean"!=typeof e[r]&&-1===n.indexOf(","+r+",")||(o=null!==o),t[r]=o;return t},vjs.getComputedDimension=function(e,t){var n="";return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,"").getPropertyValue(t):e.currentStyle&&(n=e["client"+t.substr(0,1).toUpperCase()+t.substr(1)]+"px"),n},vjs.insertFirst=function(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)},vjs.browser={},vjs.el=function(e){return 0===e.indexOf("#")&&(e=e.slice(1)),document.getElementById(e)},vjs.formatTime=function(e,t){t=t||e;var n=Math.floor(e%60),i=Math.floor(e/60%60),r=Math.floor(e/3600),o=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=i=n="-"),(r=r>0||a>0?r+":":"")+(i=((r||o>=10)&&i<10?"0"+i:i)+":")+(n=n<10?"0"+n:n)},vjs.blockTextSelection=function(){document.body.focus(),document.onselectstart=function(){return!1}},vjs.unblockTextSelection=function(){document.onselectstart=function(){return!0}},vjs.trim=function(e){return(e+"").replace(/^\s+|\s+$/g,"")},vjs.round=function(e,t){return t||(t=0),Math.round(e*Math.pow(10,t))/Math.pow(10,t)},vjs.createTimeRange=function(e,t){return void 0===e&&void 0===t?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:1,start:function(){return e},end:function(){return t}}},vjs.setVjsStorage=function(e,t){try{cacheManager.setGenericData(e,t)}catch(e){vjs.log("cacheManager Error (VideoJS)",e)}},vjs.getAbsoluteURL=function(e){return e.match(/^https?:\/\//)||(e=vjs.createEl("div",{innerHTML:'x'}).firstChild.href),e},vjs.parseUrl=function(e){var t,n,i,r,o;r=["protocol","hostname","port","pathname","search","hash","host"],(i=""===(n=vjs.createEl("a",{href:e})).host&&"file:"!==n.protocol)&&((t=vjs.createEl("div")).innerHTML='',n=t.firstChild,t.setAttribute("style","display:none; position:absolute;"),document.body.appendChild(t)),o={};for(var a=0;a=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.off(),this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),vjs.removeData(this.el_),this.el_=null},vjs.Component.prototype.player_=!0,vjs.Component.prototype.player=function(){return this.player_},vjs.Component.prototype.options_,vjs.Component.prototype.options=function(e){return void 0===e?this.options_:this.options_=vjs.util.mergeOptions(this.options_,e)},vjs.Component.prototype.el_,vjs.Component.prototype.createEl=function(e,t){return vjs.createEl(e,t)},vjs.Component.prototype.localize=function(e){var t=this.player_.language(),n=this.player_.languages();return n&&n[t]&&n[t][e]?n[t][e]:e},vjs.Component.prototype.el=function(){return this.el_},vjs.Component.prototype.contentEl_,vjs.Component.prototype.contentEl=function(){return this.contentEl_||this.el_},vjs.Component.prototype.id_,vjs.Component.prototype.id=function(){return this.id_},vjs.Component.prototype.name_,vjs.Component.prototype.name=function(){return this.name_},vjs.Component.prototype.children_,vjs.Component.prototype.children=function(){return this.children_},vjs.Component.prototype.childIndex_,vjs.Component.prototype.getChildById=function(e){return this.childIndex_[e]},vjs.Component.prototype.childNameIndex_,vjs.Component.prototype.getChild=function(e){return this.childNameIndex_[e]},vjs.Component.prototype.addChild=function(e,t){var n,i,r;return"string"==typeof e?(r=e,i=(t=t||{}).componentClass||vjs.capitalize(r),t.name=r,n=new window.videojs_apn[i](this.player_||this,t)):n=e,this.children_.push(n),"function"==typeof n.id&&(this.childIndex_[n.id()]=n),(r=r||n.name&&n.name())&&(this.childNameIndex_[r]=n),"function"==typeof n.el&&n.el()&&this.contentEl().appendChild(n.el()),n},vjs.Component.prototype.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(t){this.childIndex_[e.id()]=null,this.childNameIndex_[e.name()]=null;var i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},vjs.Component.prototype.initChildren=function(){var e,t,n,i,r,o,a;if(n=(t=(e=this).options()).children)if(a=function(n,i){void 0!==t[n]&&(i=t[n]),!1!==i&&(e[n]=e.addChild(n,i))},vjs.obj.isArray(n))for(var s=0;s0){for(var t=0,n=e.length;t1?n=!1:t&&(r=e.touches[0].pageX-t.pageX,o=e.touches[0].pageY-t.pageY,Math.sqrt(r*r+o*o)>10&&(n=!1))})),i=function(){n=!1},this.on("touchleave",i),this.on("touchcancel",i),this.on("touchend",(function(i){t=null,!0===n&&(new Date).getTime()-e<200&&(i.preventDefault(),this.trigger("tap"))}))},vjs.Component.prototype.enableTouchActivity=function(){var e,t,n;this.player().reportUserActivity&&(e=vjs.bind(this.player(),this.player().reportUserActivity),this.on("touchstart",(function(){e(),this.clearInterval(t),t=this.setInterval(e,250)})),n=function(n){e(),this.clearInterval(t)},this.on("touchmove",e),this.on("touchend",n),this.on("touchcancel",n))},vjs.Component.prototype.setTimeout=function(e,t){e=vjs.bind(this,e);var n=setTimeout(e,t),i=function(){this.clearTimeout(n)};return i.guid="vjs-timeout-"+n,this.on("dispose",i),n},vjs.Component.prototype.clearTimeout=function(e){clearTimeout(e);var t=function(){};return t.guid="vjs-timeout-"+e,this.off("dispose",t),e},vjs.Component.prototype.setInterval=function(e,t){e=vjs.bind(this,e);var n=setInterval(e,t),i=function(){this.clearInterval(n)};return i.guid="vjs-interval-"+n,this.on("dispose",i),n},vjs.Component.prototype.clearInterval=function(e){clearInterval(e);var t=function(){};return t.guid="vjs-interval-"+e,this.off("dispose",t),e},vjs.Button=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.emitTapEvents(),this.on("tap",this.onClick),this.on("click",this.onClick),this.on("focus",this.onFocus),this.on("blur",this.onBlur)}}),vjs.Button.prototype.createEl=function(e,t){var n;return t=vjs.obj.merge({className:this.buildCSSClass(),role:"button","aria-live":"polite",tabIndex:0},t),n=vjs.Component.prototype.createEl.call(this,e,t),t.innerHTML||(this.contentEl_=vjs.createEl("div",{className:"vjs-control-content"}),this.controlText_=vjs.createEl("span",{className:"vjs-control-text",innerHTML:this.localize(this.buttonText)||"Need Text"}),this.contentEl_.appendChild(this.controlText_),n.appendChild(this.contentEl_)),n},vjs.Button.prototype.buildCSSClass=function(){return"vjs-control "+vjs.Component.prototype.buildCSSClass.call(this)},vjs.Button.prototype.onClick=function(){},vjs.Button.prototype.onFocus=function(){vjs.on(document,"keydown",vjs.bind(this,this.onKeyPress))},vjs.Button.prototype.onKeyPress=function(e){32!=e.which&&13!=e.which||(e.preventDefault(),this.onClick())},vjs.Button.prototype.onBlur=function(){vjs.off(document,"keydown",vjs.bind(this,this.onKeyPress))},vjs.Slider=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.bar=this.getChild(this.options_.barName),this.handle=this.getChild(this.options_.handleName),this.on("mousedown",this.onMouseDown),this.on("touchstart",this.onMouseDown),this.on("focus",this.onFocus),this.on("blur",this.onBlur),this.on("click",this.onClick),this.on(e,"controlsvisible",this.update),this.on(e,this.playerEvent,this.update)}}),vjs.Slider.prototype.createEl=function(e,t){return(t=t||{}).className=t.className+" vjs-slider",t=vjs.obj.merge({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},t),vjs.Component.prototype.createEl.call(this,e,t)},vjs.Slider.prototype.onMouseDown=function(e){e.preventDefault(),vjs.blockTextSelection(),this.addClass("vjs-sliding"),this.on(document,"mousemove",this.onMouseMove),this.on(document,"mouseup",this.onMouseUp),this.on(document,"touchmove",this.onMouseMove),this.on(document,"touchend",this.onMouseUp),this.onMouseMove(e)},vjs.Slider.prototype.onMouseMove=function(){},vjs.Slider.prototype.onMouseUp=function(){vjs.unblockTextSelection(),this.removeClass("vjs-sliding"),this.off(document,"mousemove",this.onMouseMove),this.off(document,"mouseup",this.onMouseUp),this.off(document,"touchmove",this.onMouseMove),this.off(document,"touchend",this.onMouseUp),this.update()},vjs.Slider.prototype.update=function(){if(this.el_){var e,t=this.getPercent(),n=this.handle,i=this.bar;if(("number"!=typeof t||t!=t||t<0||t===1/0)&&(t=0),e=t,n){var r=this.el_.offsetWidth,o=n.el().offsetWidth,a=o?o/r:0,s=t*(1-a);e=s+a/2,n.el().style.left=vjs.round(100*s,2)+"%"}i&&(i.el().style.width=vjs.round(100*e,2)+"%")}},vjs.Slider.prototype.calculateDistance=function(e){var t,n,i,r,o,a,s,l,d;if(t=this.el_,n=vjs.findPosition(t),o=a=t.offsetWidth,s=this.handle,this.options().vertical){if(r=n.top,d=e.changedTouches?e.changedTouches[0].pageY:e.pageY,s){var c=s.el().offsetHeight;r+=c/2,a-=c}return Math.max(0,Math.min(1,(r-d+a)/a))}if(i=n.left,l=e.changedTouches?e.changedTouches[0].pageX:e.pageX,s){var u=s.el().offsetWidth;i+=u/2,o-=u}return Math.max(0,Math.min(1,(l-i)/o))},vjs.Slider.prototype.onFocus=function(){this.on(document,"keydown",this.onKeyPress)},vjs.Slider.prototype.onKeyPress=function(e){37==e.which||40==e.which?(e.preventDefault(),this.stepBack()):38!=e.which&&39!=e.which||(e.preventDefault(),this.stepForward())},vjs.Slider.prototype.onBlur=function(){this.off(document,"keydown",this.onKeyPress)},vjs.Slider.prototype.onClick=function(e){e.stopImmediatePropagation(),e.preventDefault()},vjs.SliderHandle=vjs.Component.extend(),vjs.SliderHandle.prototype.defaultValue=0,vjs.SliderHandle.prototype.createEl=function(e,t){return(t=t||{}).className=t.className+" vjs-slider-handle",t=vjs.obj.merge({innerHTML:''+this.defaultValue+""},t),vjs.Component.prototype.createEl.call(this,"div",t)},vjs.Menu=vjs.Component.extend(),vjs.Menu.prototype.addItem=function(e){this.addChild(e),e.on("click",vjs.bind(this,(function(){this.unlockShowing()})))},vjs.Menu.prototype.createEl=function(){var e=this.options().contentElType||"ul";this.contentEl_=vjs.createEl(e,{className:"vjs-menu-content"});var t=vjs.Component.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),vjs.on(t,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),t},vjs.MenuItem=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t),this.selected(t.selected)}}),vjs.MenuItem.prototype.createEl=function(e,t){return vjs.Button.prototype.createEl.call(this,"li",vjs.obj.merge({className:"vjs-menu-item",innerHTML:this.localize(this.options_.label)},t))},vjs.MenuItem.prototype.onClick=function(){this.selected(!0)},vjs.MenuItem.prototype.selected=function(e){e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-selected",!0)):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-selected",!1))},vjs.MenuButton=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t),this.update(),this.on("keydown",this.onKeyPress),this.el_.setAttribute("aria-haspopup",!0),this.el_.setAttribute("role","button")}}),vjs.MenuButton.prototype.update=function(){var e=this.createMenu();this.menu&&this.removeChild(this.menu),this.menu=e,this.addChild(e),this.items&&0===this.items.length?this.hide():this.items&&this.items.length>1&&this.show()},vjs.MenuButton.prototype.buttonPressed_=!1,vjs.MenuButton.prototype.createMenu=function(){var e=new vjs.Menu(this.player_);if(this.options().title&&e.contentEl().appendChild(vjs.createEl("li",{className:"vjs-menu-title",innerHTML:vjs.capitalize(this.options().title),tabindex:-1})),this.items=this.createItems(),this.items)for(var t=0;t0&&this.items[0].el().focus()},vjs.MenuButton.prototype.unpressButton=function(){this.buttonPressed_=!1,this.menu.unlockShowing(),this.el_.setAttribute("aria-pressed",!1)},vjs.MediaError=function(e){"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:"object"==typeof e&&vjs.obj.merge(this,e),this.message||(this.message="")},vjs.MediaError.prototype.code=0,vjs.MediaError.prototype.message="",vjs.MediaError.prototype.status=null,vjs.MediaError.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],vjs.MediaError.defaultMessages={1:"You aborted the video playback",2:"A network error caused the video download to fail part-way.",3:"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.",4:"The video could not be loaded, either because the server or network failed or because the format is not supported.",5:"The video is encrypted and we do not have the keys to decrypt it."};for(var errNum=0;errNum=0&&(vjs.players[t].trigger("fullscreenchange"),vjs.players[t].fsButtonClicked||(vjs.players[t].isFullscreen(!1),vjs.players[t].removeClass("vjs-fullscreen")),vjs.players[t].fsButtonClicked=!1)}))}(),vjs.Player=vjs.Component.extend({init:function(e,t,n){this.tag=e,e.id=e.id||"vjs_video_"+vjs.guid++,this.tagAttributes=e&&vjs.getElementAttributes(e),t=vjs.obj.merge(this.getTagSettings(e),t),this.language_=t.language||vjs.options.language,this.languages_=t.languages||vjs.options.languages,this.cache_={},this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,t.reportTouchActivity=!1,this.isAudio("audio"===this.tag.nodeName.toLowerCase()),vjs.Component.call(this,this,t,n),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.isAudio()&&this.addClass("vjs-audio"),this.addClass("vjs-big-play-centered"),vjs.players[this.id_]=this,t.plugins&&vjs.obj.each(t.plugins,(function(e,t){this[e](t)}),this),this.listenForUserActivity()}}),vjs.Player.prototype.language_,vjs.Player.prototype.language=function(e){return void 0===e?this.language_:(this.language_=e,this)},vjs.Player.prototype.getMuteSettingsForIOS10=function(){return vjs.IS_IOS&&this.options_.enableNativeInline&&parseInt(vjs.IOS_VERSION)>9},vjs.Player.prototype.languages_,vjs.Player.prototype.languages=function(){return this.languages_},vjs.Player.prototype.options_=vjs.options,vjs.Player.prototype.dispose=function(){this.trigger("dispose"),this.off("dispose"),vjs.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech&&this.tech.dispose(),vjs.Component.prototype.dispose.call(this)},vjs.Player.prototype.getTagSettings=function(e){var t,n,i,r,o,a,s,l={sources:[],tracks:[]};if(null!==(n=(t=vjs.getElementAttributes(e))["data-setup"])&&vjs.obj.merge(t,vjs.JSON.parse(n||"{}")),vjs.obj.merge(l,t),e.hasChildNodes())for(a=0,s=(i=e.childNodes).length;a0&&(n.startTime=this.cache_.currentTime),this.cache_.src=t.src),this.tech=new window.videojs_apn[e](this,n),this.tech.ready((function(){this.player_.triggerReady()}))},vjs.Player.prototype.unloadTech=function(){this.isReady_=!1,this.tech.dispose(),this.tech=!1},vjs.Player.prototype.onLoadStart=function(){this.removeClass("vjs-ended"),this.error(null),this.paused()?this.hasStarted(!1):this.trigger("firstplay")},vjs.Player.prototype.hasStarted_=!1,vjs.Player.prototype.hasStarted=function(e){return void 0!==e?(this.hasStarted_!==e&&(this.hasStarted_=e,e?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started")),this):this.hasStarted_},vjs.Player.prototype.onLoadedMetaData,vjs.Player.prototype.onLoadedData,vjs.Player.prototype.onLoadedAllData,vjs.Player.prototype.onPlay=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0)},vjs.Player.prototype.onWaiting=function(){this.addClass("vjs-waiting")},vjs.Player.prototype.onWaitEnd=function(){this.removeClass("vjs-waiting")},vjs.Player.prototype.onSeeking=function(){this.addClass("vjs-seeking")},vjs.Player.prototype.onSeeked=function(){this.removeClass("vjs-seeking")},vjs.Player.prototype.onFirstPlay=function(){this.options_.starttime&&this.currentTime(this.options_.starttime),this.addClass("vjs-has-started")},vjs.Player.prototype.onPause=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused")},vjs.Player.prototype.onTimeUpdate,vjs.Player.prototype.onProgress=function(){1==this.bufferedPercent()&&this.trigger("loadedalldata")},vjs.Player.prototype.onEnded=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause()},vjs.Player.prototype.onDurationChange=function(){var e=this.techGet("duration");e&&(e<0&&(e=1/0),this.duration(e),e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"))},vjs.Player.prototype.onVolumeChange,vjs.Player.prototype.onFullscreenChange=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},vjs.Player.prototype.onError,vjs.Player.prototype.cache_,vjs.Player.prototype.getCache=function(){return this.cache_},vjs.Player.prototype.techCall=function(e,t){if(this.tech&&!this.tech.isReady_)this.tech.ready((function(){this[e](t)}));else try{this.tech[e](t)}catch(e){throw vjs.log(e),e}},vjs.Player.prototype.techGet=function(e){if(this.tech&&this.tech.isReady_)try{return this.tech[e]()}catch(t){throw void 0===this.tech[e]?vjs.log("Video.js: "+e+" method not defined for "+this.techName+" playback technology.",t):"TypeError"==t.name?(vjs.log("Video.js: "+e+" unavailable on "+this.techName+" playback technology element.",t),this.tech.isReady_=!1):vjs.log(t),t}},vjs.Player.prototype.play=function(){return this.techCall("play"),this},vjs.Player.prototype.pause=function(){return this.techCall("pause"),this.trigger("apn-vpaid-pause"),this},vjs.Player.prototype.paused=function(){return!1!==this.techGet("paused")},vjs.Player.prototype.currentTime=function(e){return void 0!==e?(this.techCall("setCurrentTime",e),this):this.cache_.currentTime=this.techGet("currentTime")||0},vjs.Player.prototype.duration=function(e){return void 0!==e?(this.cache_.duration=parseFloat(e),this):(void 0===this.cache_.duration&&this.onDurationChange(),this.cache_.duration||0)},vjs.Player.prototype.remainingTime=function(){return this.duration()-this.currentTime()},vjs.Player.prototype.buffered=function(){var e=this.techGet("buffered");return e&&e.length||(e=vjs.createTimeRange(0,0)),e},vjs.Player.prototype.bufferedPercent=function(){var e,t,n=this.duration(),i=this.buffered(),r=0;if(!n)return 0;for(var o=0;on&&(t=n),r+=t-e;return r/n},vjs.Player.prototype.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),n=e.end(e.length-1);return n>t&&(n=t),n},vjs.Player.prototype.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall("setVolume",t),vjs.setVjsStorage("volume",t),this):(t=parseFloat(this.techGet("volume")),isNaN(t)?1:t)},vjs.Player.prototype.muted=function(e){return void 0!==e?(vjs.IS_IOS&&this.options_.enableInlineVideoForIos||this.techCall("setMuted",e),this):this.techGet("muted")||!1},vjs.Player.prototype.supportsFullScreen=function(){return this.techGet("supportsFullScreen")||!1},vjs.Player.prototype.isFullscreen_=!1,vjs.Player.prototype.isFullscreen=function(e){return void 0!==e?(this.isFullscreen_=!!e,this):this.isFullscreen_},vjs.Player.prototype.isFullScreen=function(e){return vjs.log.warn('player.isFullScreen() has been deprecated, use player.isFullscreen() with a lowercase "s")'),this.isFullscreen(e)},vjs.Player.prototype.requestFullscreen=function(){var e=vjs.browser.fullscreenAPI;return this.isFullscreen(!0),e?(vjs.on(document,e.fullscreenchange,vjs.bind(this,(function(t){this.isFullscreen(document[e.fullscreenElement]),!1===this.isFullscreen()&&vjs.off(document,e.fullscreenchange,arguments.callee)}))),this.el_[e.requestFullscreen](),this.trigger("fullscreenchange")):(this.tech.supportsFullScreen(),this.enterFullWindow(),this.trigger("fullscreenchange")),this},vjs.Player.prototype.requestFullScreen=function(){return vjs.log.warn('player.requestFullScreen() has been deprecated, use player.requestFullscreen() with a lowercase "s")'),this.requestFullscreen()},vjs.Player.prototype.exitFullscreen=function(){var e=vjs.browser.fullscreenAPI;return this.isFullscreen(!1),e?(document[e.exitFullscreen](),this.trigger("fullscreenchange")):this.tech.supportsFullScreen()?(this.exitFullWindow(),this.trigger("fullscreenchange")):(this.exitFullWindow(),this.push("fullscreenchange")),this},vjs.Player.prototype.cancelFullScreen=function(){return vjs.log.warn("player.cancelFullScreen() has been deprecated, use player.exitFullscreen()"),this.exitFullscreen()},vjs.Player.prototype.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=document.documentElement.style.overflow,vjs.on(document,"keydown",vjs.bind(this,this.fullWindowOnEscKey)),document.documentElement.style.overflow="hidden",vjs.addClass(document.body,"vjs-full-window"),this.trigger("enterFullWindow")},vjs.Player.prototype.fullWindowOnEscKey=function(e){27===e.keyCode&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},vjs.Player.prototype.exitFullWindow=function(){this.isFullWindow=!1,vjs.off(document,"keydown",this.fullWindowOnEscKey),document.documentElement.style.overflow=this.docOrigOverflow,vjs.removeClass(document.body,"vjs-full-window"),this.trigger("exitFullWindow")},vjs.Player.prototype.selectSource=function(e){for(var t=0,n=this.options_.techOrder;t=0||(console.log("active:onmouseout:initialize"),a=void 0,s=void 0)},n=function(){e(),this.clearInterval(i),i=this.setInterval(e,250)},r=function(t){e(),this.clearInterval(i)},this.on("mousedown",n),this.on("mousemove",t),this.on("mouseup",r),this.on("mouseover",l),this.on("mouseout",d),this.on("keydown",e),this.on("keyup",e),this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(o);var e=this.options().inactivityTimeout;e>0&&(o=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}}),250)},vjs.Player.prototype.playbackRate=function(e){return void 0!==e?(this.techCall("setPlaybackRate",e),this):this.tech&&this.tech.featuresPlaybackRate?this.techGet("playbackRate"):1},vjs.Player.prototype.isAudio_=!1,vjs.Player.prototype.isAudio=function(e){return void 0!==e?(this.isAudio_=!!e,this):this.isAudio_},vjs.Player.prototype.networkState=function(){return this.techGet("networkState")},vjs.Player.prototype.readyState=function(){return this.techGet("readyState")},vjs.Player.prototype.textTracks=function(){return this.tech&&this.tech.textTracks()},vjs.Player.prototype.remoteTextTracks=function(){return this.tech&&this.tech.remoteTextTracks()},vjs.Player.prototype.addTextTrack=function(e,t,n){return this.tech&&this.tech.addTextTrack(e,t,n)},vjs.Player.prototype.addRemoteTextTrack=function(e){return this.tech&&this.tech.addRemoteTextTrack(e)},vjs.Player.prototype.removeRemoteTextTrack=function(e){this.tech&&this.tech.removeRemoteTextTrack(e)},vjs.ControlBar=vjs.Component.extend(),vjs.ControlBar.prototype.options_={loadEvent:"play",children:{playToggle:{},currentTimeDisplay:{},timeDivider:{},durationDisplay:{},remainingTimeDisplay:{},progressControl:{},fullscreenToggle:{},volumeControl:{},muteToggle:{},playbackRateMenuButton:{}}},vjs.ControlBar.prototype.createEl=function(){return vjs.createEl("div",{className:"vjs-control-bar"})},vjs.LiveDisplay=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.LiveDisplay.prototype.createEl=function(){var e=vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-live-controls vjs-control"});return this.contentEl_=vjs.createEl("div",{className:"vjs-live-display",innerHTML:''+this.localize("Stream Type")+""+this.localize("LIVE"),"aria-live":"off"}),e.appendChild(this.contentEl_),e},vjs.PlayToggle=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t),this.on(e,"play",this.onPlay),this.on(e,"pause",this.onPause)}}),vjs.PlayToggle.prototype.buttonText="Play",vjs.PlayToggle.prototype.buildCSSClass=function(){return"vjs-play-control "+vjs.Button.prototype.buildCSSClass.call(this)},vjs.PlayToggle.prototype.onClick=function(){},vjs.PlayToggle.prototype.onPlay=function(){this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.el_.children[0].children[0].innerHTML=this.localize("Pause")},vjs.PlayToggle.prototype.onPause=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.el_.children[0].children[0].innerHTML=this.localize("Play")},vjs.CurrentTimeDisplay=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.on(e,"timeupdate",this.updateContent)}}),vjs.CurrentTimeDisplay.prototype.createEl=function(){var e=vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-current-time vjs-time-controls vjs-control"});return this.contentEl_=vjs.createEl("div",{className:"vjs-current-time-display",innerHTML:'Current Time 0:00',"aria-live":"off"}),e.appendChild(this.contentEl_),e},vjs.CurrentTimeDisplay.prototype.updateContent=function(){var e=this.player_.scrubbing?this.player_.getCache().currentTime:this.player_.currentTime();this.contentEl_.innerHTML=''+this.localize("Current Time")+" "+vjs.formatTime(e,this.player_.duration())},vjs.DurationDisplay=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.on(e,"timeupdate",this.updateContent),this.on(e,"loadedmetadata",this.updateContent)}}),vjs.DurationDisplay.prototype.createEl=function(){var e=vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-duration vjs-time-controls vjs-control"});return this.contentEl_=vjs.createEl("div",{className:"vjs-duration-display",innerHTML:''+this.localize("Duration Time")+" 0:00","aria-live":"off"}),e.appendChild(this.contentEl_),e},vjs.DurationDisplay.prototype.updateContent=function(){var e=this.player_.duration();e&&(this.contentEl_.innerHTML=''+this.localize("Duration Time")+" "+vjs.formatTime(e))},vjs.TimeDivider=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.TimeDivider.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-time-divider",innerHTML:"
/
"})},vjs.RemainingTimeDisplay=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.on(e,"timeupdate",this.updateContent)}}),vjs.RemainingTimeDisplay.prototype.createEl=function(){var e=vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-remaining-time vjs-time-controls vjs-control"});return this.contentEl_=vjs.createEl("div",{className:"vjs-remaining-time-display",innerHTML:''+this.localize("Remaining Time")+" -0:00","aria-live":"off"}),e.appendChild(this.contentEl_),e},vjs.RemainingTimeDisplay.prototype.updateContent=function(){this.player_.duration()&&(this.contentEl_.innerHTML=''+this.localize("Remaining Time")+" -"+vjs.formatTime(this.player_.remainingTime()))},vjs.FullscreenToggle=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t)}}),vjs.FullscreenToggle.prototype.buttonText="Fullscreen",vjs.FullscreenToggle.prototype.buildCSSClass=function(){return"vjs-fullscreen-control "+vjs.Button.prototype.buildCSSClass.call(this)},vjs.FullscreenToggle.prototype.onClick=function(){this.player_.fsButtonClicked=!0,this.player_.isFullscreen()?(this.player_.exitFullscreen(),this.controlText_.innerHTML=this.localize("Fullscreen")):(this.player_.requestFullscreen(),this.controlText_.innerHTML=this.localize("Non-Fullscreen"))},vjs.ProgressControl=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.ProgressControl.prototype.options_={children:{seekBar:{}}},vjs.ProgressControl.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},vjs.SeekBar=vjs.Slider.extend({init:function(e,t){vjs.Slider.call(this,e,t),this.on(e,"timeupdate",this.updateARIAAttributes),e.ready(vjs.bind(this,this.updateARIAAttributes))}}),vjs.SeekBar.prototype.options_={children:{loadProgressBar:{},playProgressBar:{},seekHandle:{}},barName:"playProgressBar",handleName:"seekHandle"},vjs.SeekBar.prototype.playerEvent="timeupdate",vjs.SeekBar.prototype.createEl=function(){return vjs.Slider.prototype.createEl.call(this,"div",{className:"vjs-progress-holder","aria-label":"video progress bar"})},vjs.SeekBar.prototype.updateARIAAttributes=function(){var e=this.player_.scrubbing?this.player_.getCache().currentTime:this.player_.currentTime();this.el_.setAttribute("aria-valuenow",vjs.round(100*this.getPercent(),2)),this.el_.setAttribute("aria-valuetext",vjs.formatTime(e,this.player_.duration()))},vjs.SeekBar.prototype.getPercent=function(){return this.player_.currentTime()/this.player_.duration()},vjs.LoadProgressBar=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.on(e,"progress",this.update)}}),vjs.LoadProgressBar.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:''+this.localize("Loaded")+": 0%"})},vjs.LoadProgressBar.prototype.update=function(){var e,t,n,i,r=this.player_.buffered(),o=this.player_.duration(),a=this.player_.bufferedEnd(),s=this.el_.children,l=function(e,t){return 100*(e/t||0)+"%"};for(this.el_.style.width=l(a,o),e=0;er.length;e--)this.el_.removeChild(s[e-1])},vjs.PlayProgressBar=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.PlayProgressBar.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-play-progress",innerHTML:''+this.localize("Progress")+": 0%"})},vjs.SeekHandle=vjs.SliderHandle.extend({init:function(e,t){vjs.SliderHandle.call(this,e,t),this.on(e,"timeupdate",this.updateContent)}}),vjs.SeekHandle.prototype.defaultValue="00:00",vjs.SeekHandle.prototype.createEl=function(){return vjs.SliderHandle.prototype.createEl.call(this,"div",{className:"vjs-seek-handle","aria-live":"off"})},vjs.SeekHandle.prototype.updateContent=function(){var e=this.player_.scrubbing?this.player_.getCache().currentTime:this.player_.currentTime();this.el_.innerHTML=''+vjs.formatTime(e,this.player_.duration())+""},vjs.VolumeControl=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),e.tech&&!1===e.tech.featuresVolumeControl&&this.addClass("vjs-hidden"),this.on(e,"loadstart",(function(){!1===e.tech.featuresVolumeControl?this.addClass("vjs-hidden"):this.removeClass("vjs-hidden")}))}}),vjs.VolumeControl.prototype.options_={children:{volumeBar:{}}},vjs.VolumeControl.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control"})},vjs.VolumeBar=vjs.Slider.extend({init:function(e,t){vjs.Slider.call(this,e,t),this.on(e,"volumechange",this.updateARIAAttributes),e.ready(vjs.bind(this,this.updateARIAAttributes))}}),vjs.VolumeBar.prototype.updateARIAAttributes=function(){this.el_.setAttribute("aria-valuenow",vjs.round(100*this.player_.volume(),2)),this.el_.setAttribute("aria-valuetext",vjs.round(100*this.player_.volume(),2)+"%")},vjs.VolumeBar.prototype.options_={children:{volumeLevel:{},volumeHandle:{}},barName:"volumeLevel",handleName:"volumeHandle"},vjs.VolumeBar.prototype.playerEvent="volumechange",vjs.VolumeBar.prototype.createEl=function(){return vjs.Slider.prototype.createEl.call(this,"div",{className:"vjs-volume-bar","aria-label":"volume level"})},vjs.VolumeBar.prototype.onMouseMove=function(e){if(this.player_.muted(),global_options.hasOwnProperty("overlayPlayer"))e.srcElement&&"VIDEO"!=e.srcElement.tagName&&e.srcElement.className.indexOf("vjs")>=0?"VIDEO"!=e.srcElement.tagName&&e.srcElement.className&&e.srcElement.className.indexOf("vjs")>=0&&this.player_.volume(this.calculateDistance(e)):e.currentTarget&&"VIDEO"!=e.currentTarget.tagName&&e.currentTarget.className&&e.currentTarget.className.indexOf("vjs")>=0&&this.player_.volume(this.calculateDistance(e));else{var t=global_options.wcElement&&global_options.wcElement instanceof Element?global_options.wcElement.querySelector("#"+String(global_options.iframeVideoWrapperId)):document.getElementById(global_options.iframeVideoWrapperId),n=t&&t.contentWindow.document,i=n&&n.elementFromPoint(e.clientX,e.clientY);i&&"VIDEO"!=i.tagName&&i.className.indexOf("vjs")>=0&&this.player_.volume(this.calculateDistance(e))}},vjs.VolumeBar.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},vjs.VolumeBar.prototype.stepForward=function(){this.player_.volume(this.player_.volume()+.1)},vjs.VolumeBar.prototype.stepBack=function(){this.player_.volume(this.player_.volume()-.1)},vjs.VolumeLevel=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.VolumeLevel.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:''})},vjs.VolumeHandle=vjs.SliderHandle.extend(),vjs.VolumeHandle.prototype.defaultValue="00:00",vjs.VolumeHandle.prototype.createEl=function(){return vjs.SliderHandle.prototype.createEl.call(this,"div",{className:"vjs-volume-handle"})},vjs.MuteToggle=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t),this.on(e,"volumechange",this.update);var n=e.getMuteSettingsForIOS10();e.tech&&!1===e.tech.featuresVolumeControl&&!n&&this.addClass("vjs-hidden"),this.on(e,"loadstart",(function(){!1!==e.tech.featuresVolumeControl||n?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}))}}),vjs.MuteToggle.prototype.createEl=function(){return vjs.Button.prototype.createEl.call(this,"div",{className:"vjs-mute-control vjs-control",innerHTML:'
'+this.localize("Mute")+"
"})},vjs.MuteToggle.prototype.onClick=function(){if(this.player_.muted()){var e=this.player_.volume();0===e&&(e=.5,this.player_.volume(e))}this.player_.muted(!this.player_.muted())},vjs.MuteToggle.prototype.update=function(){var e=this.player_.volume(),t=3;if(0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2),this.el_){this.player_.muted()?this.el_.children[0].children[0].innerHTML!=this.localize("Unmute")&&(this.el_.children[0].children[0].innerHTML=this.localize("Unmute")):this.el_.children[0].children[0].innerHTML!=this.localize("Mute")&&(this.el_.children[0].children[0].innerHTML=this.localize("Mute"));for(var n=0;n<4;n++)vjs.removeClass(this.el_,"vjs-vol-"+n);vjs.addClass(this.el_,"vjs-vol-"+t)}},vjs.VolumeMenuButton=vjs.MenuButton.extend({init:function(e,t){vjs.MenuButton.call(this,e,t),this.on(e,"volumechange",this.volumeUpdate),e.tech&&!1===e.tech.featuresVolumeControl&&this.addClass("vjs-hidden"),this.on(e,"loadstart",(function(){!1===e.tech.featuresVolumeControl?this.addClass("vjs-hidden"):this.removeClass("vjs-hidden")})),this.addClass("vjs-menu-button")}}),vjs.VolumeMenuButton.prototype.createMenu=function(){var e=new vjs.Menu(this.player_,{contentElType:"div"}),t=new vjs.VolumeBar(this.player_,this.options_.volumeBar);return t.on("focus",(function(){e.lockShowing()})),t.on("blur",(function(){e.unlockShowing()})),e.addChild(t),e},vjs.VolumeMenuButton.prototype.onClick=function(){vjs.MuteToggle.prototype.onClick.call(this),vjs.MenuButton.prototype.onClick.call(this)},vjs.VolumeMenuButton.prototype.createEl=function(){return vjs.Button.prototype.createEl.call(this,"div",{className:"vjs-volume-menu-button vjs-menu-button vjs-control",innerHTML:'
'+this.localize("Mute")+"
"})},vjs.VolumeMenuButton.prototype.volumeUpdate=vjs.MuteToggle.prototype.update,vjs.PlaybackRateMenuButton=vjs.MenuButton.extend({init:function(e,t){vjs.MenuButton.call(this,e,t),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",this.updateVisibility),this.on(e,"ratechange",this.updateLabel)}}),vjs.PlaybackRateMenuButton.prototype.buttonText="Playback Rate",vjs.PlaybackRateMenuButton.prototype.className="vjs-playback-rate",vjs.PlaybackRateMenuButton.prototype.createEl=function(){var e=vjs.MenuButton.prototype.createEl.call(this);return this.labelEl_=vjs.createEl("div",{className:"vjs-playback-rate-value",innerHTML:1}),e.appendChild(this.labelEl_),e},vjs.PlaybackRateMenuButton.prototype.createMenu=function(){var e=new vjs.Menu(this.player()),t=this.player().options().playbackRates;if(t)for(var n=t.length-1;n>=0;n--)e.addChild(new vjs.PlaybackRateMenuItem(this.player(),{rate:t[n]+"x"}));return e},vjs.PlaybackRateMenuButton.prototype.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},vjs.PlaybackRateMenuButton.prototype.onClick=function(){for(var e=this.player().playbackRate(),t=this.player().options().playbackRates,n=t[0],i=0;ie){n=t[i];break}this.player().playbackRate(n)},vjs.PlaybackRateMenuButton.prototype.playbackRateSupported=function(){return this.player().tech&&this.player().tech.featuresPlaybackRate&&this.player().options().playbackRates&&this.player().options().playbackRates.length>0},vjs.PlaybackRateMenuButton.prototype.updateVisibility=function(){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},vjs.PlaybackRateMenuButton.prototype.updateLabel=function(){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},vjs.PlaybackRateMenuItem=vjs.MenuItem.extend({contentElType:"button",init:function(e,t){var n=this.label=t.rate,i=this.rate=parseFloat(n,10);t.label=n,t.selected=1===i,vjs.MenuItem.call(this,e,t),this.on(e,"ratechange",this.update)}}),vjs.PlaybackRateMenuItem.prototype.onClick=function(){vjs.MenuItem.prototype.onClick.call(this),this.player().playbackRate(this.rate)},vjs.PlaybackRateMenuItem.prototype.update=function(){this.selected(this.player().playbackRate()==this.rate)},vjs.PosterImage=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t),this.update(),e.on("posterchange",vjs.bind(this,this.update))}}),vjs.PosterImage.prototype.dispose=function(){this.player().off("posterchange",this.update),vjs.Button.prototype.dispose.call(this)},vjs.PosterImage.prototype.createEl=function(){var e=vjs.createEl("div",{className:"vjs-poster",tabIndex:-1});return vjs.BACKGROUND_SIZE_SUPPORTED||(this.fallbackImg_=vjs.createEl("img"),e.appendChild(this.fallbackImg_)),e},vjs.PosterImage.prototype.update=function(){var e=this.player().poster();this.setSrc(e),e?this.show():this.hide()},vjs.PosterImage.prototype.setSrc=function(e){var t;this.fallbackImg_?this.fallbackImg_.src=e:(t="",e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t)},vjs.PosterImage.prototype.onClick=function(){this.player_.play()},vjs.LoadingSpinner=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.LoadingSpinner.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner"})},vjs.BigPlayButton=vjs.Button.extend(),vjs.BigPlayButton.prototype.createEl=function(){return vjs.Button.prototype.createEl.call(this,"div",{className:"vjs-big-play-button",innerHTML:'',"aria-label":"play video"})},vjs.BigPlayButton.prototype.onClick=function(){},vjs.ErrorDisplay=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.update(),this.on(e,"error",this.update)}}),vjs.ErrorDisplay.prototype.createEl=function(){var e=vjs.Component.prototype.createEl.call(this,"div",{});return this.contentEl_=vjs.createEl("div"),e.appendChild(this.contentEl_),e},vjs.ErrorDisplay.prototype.update=function(){this.player().error()&&(this.contentEl_.innerHTML=this.localize(this.player().error().message))},vjs.MediaTechController=vjs.Component.extend({init:function(e,t,n){(t=t||{}).reportTouchActivity=!1,vjs.Component.call(this,e,t,n),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),this.initControlsListeners(),this.initTextTrackListeners()}}),vjs.MediaTechController.prototype.initControlsListeners=function(){var e,t;e=this.player(),t=function(){e.controls()&&!e.usingNativeControls()&&this.addControlsListeners()},this.ready(t),this.on(e,"controlsenabled",t),this.on(e,"controlsdisabled",this.removeControlsListeners),this.ready((function(){this.networkState&&this.networkState()>0&&this.player().trigger("loadstart")}))},vjs.MediaTechController.prototype.addControlsListeners=function(){var e;this.on("mousedown",this.onClick),this.on("touchstart",(function(t){e=this.player_.userActive()})),this.on("touchmove",(function(t){e&&this.player().reportUserActivity()})),this.on("touchend",(function(e){e.preventDefault()})),this.emitTapEvents(),this.on("tap",this.onTap)},vjs.MediaTechController.prototype.removeControlsListeners=function(){this.off("tap"),this.off("touchstart"),this.off("touchmove"),this.off("touchleave"),this.off("touchcancel"),this.off("touchend"),this.off("click"),this.off("mousedown")},vjs.MediaTechController.prototype.onClick=function(e){0===e.button&&this.player().controls()&&(this.player().paused()?this.player().play():this.player().pause())},vjs.MediaTechController.prototype.onTap=function(){this.player().userActive(!this.player().userActive())},vjs.MediaTechController.prototype.manualProgressOn=function(){this.manualProgress=!0,this.trackProgress()},vjs.MediaTechController.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress()},vjs.MediaTechController.prototype.trackProgress=function(){this.progressInterval=this.setInterval((function(){var e=this.player().bufferedPercent();this.bufferedPercent_!=e&&this.player().trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()}),500)},vjs.MediaTechController.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)}, /*! Time Tracking -------------------------------------------------------------- */ -vjs.MediaTechController.prototype.manualTimeUpdatesOn=function(){var e=this.player_;this.manualTimeUpdates=!0,this.on(e,"play",this.trackCurrentTime),this.on(e,"pause",this.stopTrackingCurrentTime),this.one("timeupdate",(function(){this.featuresTimeupdateEvents=!0,this.manualTimeUpdatesOff()}))},vjs.MediaTechController.prototype.manualTimeUpdatesOff=function(){var e=this.player_;this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off(e,"play",this.trackCurrentTime),this.off(e,"pause",this.stopTrackingCurrentTime)},vjs.MediaTechController.prototype.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.player().trigger("timeupdate")}),250)},vjs.MediaTechController.prototype.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.player().trigger("timeupdate")},vjs.MediaTechController.prototype.dispose=function(){this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),vjs.Component.prototype.dispose.call(this)},vjs.MediaTechController.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.player().trigger("timeupdate")},vjs.MediaTechController.prototype.initTextTrackListeners=function(){var e,t=this.player_,n=function(){var e=t.getChild("textTrackDisplay");e&&e.updateDisplay()};(e=this.textTracks())&&(e.addEventListener("removetrack",n),e.addEventListener("addtrack",n),this.on("dispose",vjs.bind(this,(function(){e.removeEventListener("removetrack",n),e.removeEventListener("addtrack",n)}))))},vjs.MediaTechController.prototype.emulateTextTracks=function(){var e,t,n=this.player_;window.WebVTT,(t=this.textTracks())&&(e=function(){var e,t,i;for((i=n.getChild("textTrackDisplay")).updateDisplay(),e=0;e=0;n--){var l=s[n],d={};void 0!==o.options_[l]&&(d[l]=o.options_[l]),vjs.setElementAttributes(a,d)}return o.options_.enableNativeInline&&(a.setAttribute("playsinline",""),a.setAttribute("webkit-playsinline","")),a},vjs.Html5.prototype.hideCaptions=function(){for(var e,t=this.el_.querySelectorAll("track"),n=t.length,i={captions:1,subtitles:1};n--;)(e=t[n].track)&&e.kind in i&&!t[n].default&&(e.mode="disabled")},vjs.Html5.prototype.setupTriggers=function(){for(var e=vjs.Html5.Events.length-1;e>=0;e--)this.on(vjs.Html5.Events[e],this.eventHandler)},vjs.Html5.prototype.eventHandler=function(e){"error"==e.type&&this.error()?this.player().error(this.error().code):(e.bubbles=!1,this.player().trigger(e))},vjs.Html5.prototype.useNativeControls=function(){var e,t,n,i,r;e=this,t=this.player(),e.setControls(t.controls()),n=function(){e.setControls(!0)},i=function(){e.setControls(!1)},t.on("controlsenabled",n),t.on("controlsdisabled",i),r=function(){t.off("controlsenabled",n),t.off("controlsdisabled",i)},e.on("dispose",r),t.on("usingcustomcontrols",r),t.usingNativeControls(!0)},vjs.Html5.prototype.play=function(){this.el_.play()},vjs.Html5.prototype.pause=function(){this.el_.pause()},vjs.Html5.prototype.paused=function(){return this.el_.paused},vjs.Html5.prototype.currentTime=function(){return this.el_.currentTime||this.el_.currentTimeForOutstream||0},vjs.Html5.prototype.setCurrentTime=function(e){try{this.el_.currentTimeForOutstream=e,this.el_.currentTime=e}catch(e){vjs.log(e,"Video is not ready. (Video.js)")}},vjs.Html5.prototype.duration=function(){return this.el_.duration||0},vjs.Html5.prototype.buffered=function(){return this.el_.buffered},vjs.Html5.prototype.volume=function(){return this.el_.volume},vjs.Html5.prototype.setVolume=function(e){this.el_.volume=e},vjs.Html5.prototype.muted=function(){return this.el_.muted},vjs.Html5.prototype.setMuted=function(e){this.el_.muted=e},vjs.Html5.prototype.width=function(){return this.el_.offsetWidth},vjs.Html5.prototype.height=function(){return this.el_.offsetHeight},vjs.Html5.prototype.supportsFullScreen=function(){return!("function"!=typeof this.el_.webkitEnterFullScreen||!/Android/.test(vjs.USER_AGENT)&&/Chrome|Mac OS X 10.5/.test(vjs.USER_AGENT))},vjs.Html5.prototype.enterFullScreen=function(){var e=this.el_;"webkitDisplayingFullscreen"in e&&this.one("webkitbeginfullscreen",(function(){this.player_.isFullscreen(!0),this.one("webkitendfullscreen",(function(){this.player_.isFullscreen(!1),this.player_.trigger("fullscreenchange")})),this.player_.trigger("fullscreenchange")})),e.paused&&e.networkState<=e.HAVE_METADATA?(this.el_.play(),this.setTimeout((function(){e.pause(),e.webkitEnterFullScreen()}),0)):e.webkitEnterFullScreen()},vjs.Html5.prototype.exitFullScreen=function(){this.el_.webkitExitFullScreen()},vjs.Html5.prototype.returnOriginalIfBlobURI_=function(e,t){return t&&e&&/^blob\:/i.test(e)?t:e},vjs.Html5.prototype.src=function(e){var t=this.el_.src;if(void 0===e)return this.returnOriginalIfBlobURI_(t,this.source_);this.setSrc(e)},vjs.Html5.prototype.setSrc=function(e){this.el_.src=e},vjs.Html5.prototype.load=function(){this.el_.load()},vjs.Html5.prototype.currentSrc=function(){var e=this.el_.currentSrc;return this.currentSource_?this.returnOriginalIfBlobURI_(e,this.currentSource_.src):e},vjs.Html5.prototype.poster=function(){return this.el_.poster},vjs.Html5.prototype.setPoster=function(e){this.el_.poster=e},vjs.Html5.prototype.preload=function(){return this.el_.preload},vjs.Html5.prototype.setPreload=function(e){this.el_.preload=e},vjs.Html5.prototype.autoplay=function(){return this.el_.autoplay},vjs.Html5.prototype.setAutoplay=function(e){this.el_.autoplay=e},vjs.Html5.prototype.controls=function(){return this.el_.controls},vjs.Html5.prototype.setControls=function(e){this.el_.controls=!!e},vjs.Html5.prototype.loop=function(){return this.el_.loop},vjs.Html5.prototype.setLoop=function(e){this.el_.loop=e},vjs.Html5.prototype.error=function(){return this.el_.error},vjs.Html5.prototype.seeking=function(){return this.el_.seeking},vjs.Html5.prototype.seekable=function(){return this.el_.seekable},vjs.Html5.prototype.ended=function(){return this.el_.ended},vjs.Html5.prototype.defaultMuted=function(){return this.el_.defaultMuted},vjs.Html5.prototype.playbackRate=function(){return this.el_.playbackRate},vjs.Html5.prototype.setPlaybackRate=function(e){this.el_.playbackRate=e},vjs.Html5.prototype.networkState=function(){return this.el_.networkState},vjs.Html5.prototype.readyState=function(){return this.el_.readyState},vjs.Html5.prototype.textTracks=function(){return this.featuresNativeTextTracks?this.el_.textTracks:vjs.MediaTechController.prototype.textTracks.call(this)},vjs.Html5.prototype.addTextTrack=function(e,t,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,n):vjs.MediaTechController.prototype.addTextTrack.call(this,e,t,n)},vjs.Html5.prototype.addRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return vjs.MediaTechController.prototype.addRemoteTextTrack.call(this,e);var t=document.createElement("track");return(e=e||{}).kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),this.el().appendChild(t),"metadata"===t.track.kind?t.track.mode="hidden":t.track.mode="disabled",t.onload=function(){var e=t.track;t.readyState>=2&&("metadata"===e.kind&&"hidden"!==e.mode?e.mode="hidden":"metadata"!==e.kind&&"disabled"!==e.mode&&(e.mode="disabled"),t.onload=null)},this.remoteTextTracks().addTrack_(t.track),t},vjs.Html5.prototype.removeRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return vjs.MediaTechController.prototype.removeRemoteTextTrack.call(this,e);var t,n;for(this.remoteTextTracks().removeTrack_(e),t=this.el().querySelectorAll("track"),n=0;n0&&(e="number"!=typeof vjs.TEST_VID.textTracks[0].mode),e&&vjs.IS_FIREFOX&&(e=!1),e},vjs.Html5.prototype.featuresVolumeControl=vjs.Html5.canControlVolume(),vjs.Html5.prototype.featuresPlaybackRate=vjs.Html5.canControlPlaybackRate(),vjs.Html5.prototype.movingMediaElementInDOM=!vjs.IS_IOS,vjs.Html5.prototype.featuresFullscreenResize=!0,vjs.Html5.prototype.featuresProgressEvents=!0,vjs.Html5.prototype.featuresNativeTextTracks=vjs.Html5.supportsNativeTextTracks(),mpegurlRE=/^application\/(?:x-|vnd\.apple\.)mpegurl/i,mp4RE=/^video\/mp4/i,vjs.Html5.patchCanPlayType=function(){vjs.ANDROID_VERSION>=4&&(canPlayType||(canPlayType=vjs.TEST_VID.constructor.prototype.canPlayType),vjs.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&mpegurlRE.test(e)?"maybe":canPlayType.call(this,e)}),vjs.IS_OLD_ANDROID&&(canPlayType||(canPlayType=vjs.TEST_VID.constructor.prototype.canPlayType),vjs.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&mp4RE.test(e)?"maybe":canPlayType.call(this,e)})},vjs.Html5.unpatchCanPlayType=function(){var e=vjs.TEST_VID.constructor.prototype.canPlayType;return vjs.TEST_VID.constructor.prototype.canPlayType=canPlayType,canPlayType=null,e},vjs.Html5.patchCanPlayType(),vjs.Html5.Events="loadstart,suspend,abort,error,emptied,stalled,loadedmetadata,loadeddata,canplay,canplaythrough,playing,waiting,seeking,seeked,ended,durationchange,timeupdate,progress,play,pause,ratechange,volumechange".split(","),vjs.Html5.disposeMediaElement=function(e){if(e){for(e.player=null,e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},vjs.MediaLoader=vjs.Component.extend({init:function(e,t,n){if(vjs.Component.call(this,e,t,n),e.options_.sources&&0!==e.options_.sources.length)e.src(e.options_.sources);else for(var i=0,r=e.options_.techOrder;i=i||r.startTime===r.endTime&&r.startTime<=i&&r.startTime+.5>=i)&&n.push(r);if(c=!1,n.length!==this.activeCues_.length)c=!0;else for(e=0;e>>0;if(0===r)return-1;var o=+t||0;if(Math.abs(o)===1/0&&(o=0),o>=r)return-1;for(n=Math.max(o>=0?o:r-Math.abs(o),0);ne?this.show():this.hide()},vjs.SubtitlesButton=vjs.TextTrackButton.extend({init:function(e,t,n){vjs.TextTrackButton.call(this,e,t,n),this.el_.setAttribute("aria-label","Subtitles Menu")}}),vjs.SubtitlesButton.prototype.kind_="subtitles",vjs.SubtitlesButton.prototype.buttonText="Subtitles",vjs.SubtitlesButton.prototype.className="vjs-subtitles-button",vjs.ChaptersButton=vjs.TextTrackButton.extend({init:function(e,t,n){vjs.TextTrackButton.call(this,e,t,n),this.el_.setAttribute("aria-label","Chapters Menu")}}),vjs.ChaptersButton.prototype.kind_="chapters",vjs.ChaptersButton.prototype.buttonText="Chapters",vjs.ChaptersButton.prototype.className="vjs-chapters-button",vjs.ChaptersButton.prototype.createItems=function(){var e,t,n=[];if(!(t=this.player_.textTracks()))return n;for(var i=0;i0&&this.show(),a},vjs.ChaptersTrackMenuItem=vjs.MenuItem.extend({init:function(e,t){var n=this.track=t.track,i=this.cue=t.cue,r=e.currentTime();t.label=i.text,t.selected=i.startTime<=r&&r select").selectedIndex=0,this.el().querySelector(".vjs-bg-color > select").selectedIndex=0,this.el().querySelector(".window-color > select").selectedIndex=0,this.el().querySelector(".vjs-text-opacity > select").selectedIndex=0,this.el().querySelector(".vjs-bg-opacity > select").selectedIndex=0,this.el().querySelector(".vjs-window-opacity > select").selectedIndex=0,this.el().querySelector(".vjs-edge-style select").selectedIndex=0,this.el().querySelector(".vjs-font-family select").selectedIndex=0,this.el().querySelector(".vjs-font-percent select").selectedIndex=2,this.updateDisplay()}))),vjs.on(this.el().querySelector(".vjs-fg-color > select"),"change",vjs.bind(this,this.updateDisplay)),vjs.on(this.el().querySelector(".vjs-bg-color > select"),"change",vjs.bind(this,this.updateDisplay)),vjs.on(this.el().querySelector(".window-color > select"),"change",vjs.bind(this,this.updateDisplay)),vjs.on(this.el().querySelector(".vjs-text-opacity > select"),"change",vjs.bind(this,this.updateDisplay)),vjs.on(this.el().querySelector(".vjs-bg-opacity > select"),"change",vjs.bind(this,this.updateDisplay)),vjs.on(this.el().querySelector(".vjs-window-opacity > select"),"change",vjs.bind(this,this.updateDisplay)),vjs.on(this.el().querySelector(".vjs-font-percent select"),"change",vjs.bind(this,this.updateDisplay)),vjs.on(this.el().querySelector(".vjs-edge-style select"),"change",vjs.bind(this,this.updateDisplay)),vjs.on(this.el().querySelector(".vjs-font-family select"),"change",vjs.bind(this,this.updateDisplay)),e.options().persistTextTrackSettings&&this.restoreSettings()}}),vjs.TextTrackSettings.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-caption-settings vjs-modal-overlay",innerHTML:'
'})},vjs.TextTrackSettings.prototype.getValues=function(){var t,n,i,r,o,a,s,l,d,c;for(c in r=e((t=this.el()).querySelector(".vjs-edge-style select")),o=e(t.querySelector(".vjs-font-family select")),a=e(t.querySelector(".vjs-fg-color > select")),i=e(t.querySelector(".vjs-text-opacity > select")),s=e(t.querySelector(".vjs-bg-color > select")),n=e(t.querySelector(".vjs-bg-opacity > select")),l=e(t.querySelector(".window-color > select")),d={backgroundOpacity:n,textOpacity:i,windowOpacity:e(t.querySelector(".vjs-window-opacity > select")),edgeStyle:r,fontFamily:o,color:a,backgroundColor:s,windowColor:l,fontPercent:window.parseFloat(e(t.querySelector(".vjs-font-percent > select")))})(""===d[c]||"none"===d[c]||"fontPercent"===c&&1===d[c])&&delete d[c];return d},vjs.TextTrackSettings.prototype.setValues=function(e){var n,i=this.el();t(i.querySelector(".vjs-edge-style select"),e.edgeStyle),t(i.querySelector(".vjs-font-family select"),e.fontFamily),t(i.querySelector(".vjs-fg-color > select"),e.color),t(i.querySelector(".vjs-text-opacity > select"),e.textOpacity),t(i.querySelector(".vjs-bg-color > select"),e.backgroundColor),t(i.querySelector(".vjs-bg-opacity > select"),e.backgroundOpacity),t(i.querySelector(".window-color > select"),e.windowColor),t(i.querySelector(".vjs-window-opacity > select"),e.windowOpacity),(n=e.fontPercent)&&(n=n.toFixed(2)),t(i.querySelector(".vjs-font-percent > select"),n)},vjs.TextTrackSettings.prototype.restoreSettings=function(){var e;try{e=JSON.parse(cacheManager.getGenericData("vjs-text-track-settings"))}catch(e){}e&&this.setValues(e)},vjs.TextTrackSettings.prototype.saveSettings=function(){var e;if(this.player_.options().persistTextTrackSettings){e=this.getValues();try{vjs.isEmpty(e)?cacheManager.deleteGenericData("vjs-text-track-settings"):cacheManager.setGenericData("vjs-text-track-settings",JSON.stringify(e))}catch(e){}}},vjs.TextTrackSettings.prototype.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}}(),vjs.JSON,void 0!==window.JSON&&"function"==typeof window.JSON.parse)vjs.JSON=window.JSON;else{vjs.JSON={};var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;vjs.JSON.parse=function(text,reviver){var j;function walk(e,t){var n,i,r=e[t];if(r&&"object"==typeof r)for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(void 0!==(i=walk(r,n))?r[n]=i:delete r[n]);return reviver.call(e,t,r)}if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,(function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse(): invalid or malformed JSON data")}}vjs.autoSetup=function(){var e,t,n,i=document.getElementsByTagName("video"),r=document.getElementsByTagName("audio"),o=[];if(i&&i.length>0)for(t=0,n=i.length;t0)for(t=0,n=r.length;t0)for(t=0,n=o.length;t0&&n-t.timestamp<=r?t.ad:null}(c(e))},clearAd:function(e){!function(e){try{d(e)}catch(e){}}(c(e))},setTimeToLive:function(e){r=6e4*e},getNextAdToken:function(){return e=(t=l("___appnexus_video_cachemanager_ad_token___"))?parseInt(t):0,s("___appnexus_video_cachemanager_ad_token___",e+=1),e;var e,t}}},function(e,t,n){var i=n(8);function r(e){if(e)return e.responseXML?e.responseXML:e.responseText}e.exports={debug:function(){i.handleLogDebugLegacySupport.apply(this,arguments)},logDebug:function(){i.handleLogDebugLegacySupport.apply(this,arguments)},setDebugLevel:function(e){i.setDebugLevel(e)},isNotEmpty:function(e){var t=!1;return null!==e&&e&&(t=e.length>0),t},objectToString:function(e,t){var n="null";if(t=void 0!==t?t:0,null!==e){n="OBJ[";var i="";for(var r in e){var o=e[r];if("object"==typeof o)if(++t<9)try{o=this.objectToString(o)}catch(e){o="err:"+e}else o="err: max recursion hit";i.length>0&&(i+=","),i+=r+"="+o}n+=i,n+="]"}return n},getRandomString:function(){return Math.random().toString(36).substring(2)},traceVastFromXhr:function(e,t){try{if(e)if(Array.isArray(e)){if(e.length>0){var n=[];for(var o in e)n.push(e[o].responseURL);var a=e[e.length-1];if(a){var s=r(a),l=a.responseURL;i.info(t,"Tag load chain:",n,"\n","Final Tag URL: ",l,"\n","Final Tag: ",s)}}}else{var d=r(e);i.info(t,"Tag URL:",e.responseURL,"\n","Tag:",d)}}catch(e){}}}},function(e,t){var n=0,i=0,r=0;function o(e,t){try{if(void 0!==e&&s(e)&&console){var n="[APN",i=function(e){switch(e){case 0:break;case 1:return"always";case 2:return"error";case 3:return"warn";case 4:return"info";case 5:return"log";case 6:return"debug";case 7:return"verbose"}}(e);if(console[i]||(n+="-"+i,i="log"),n+="]",n+="["+function(){var e="";try{var t=new Date;e=t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()+"."+t.getMilliseconds()}catch(e){}return e}()+"]",t.splice(0,0,n),console[i].apply)console[i].apply(console,t);else{var r=Array.prototype.slice.apply(t).join("");console[i](r)}}}catch(e){}}function a(e){var t=0;try{if(void 0!==e){var n=parseInt(e);isNaN(n)?"boolean"==typeof e?t=e?6:0:"TRUE"===(e=e.toUpperCase())?t=6:"FALSE"===e&&(t=0):t=n}}catch(e){}return t}function s(e){return e<=n}e.exports={traceAtLevel:function(){try{if(arguments.length>0){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);o.call(this,e,t)}}catch(e){}},always:function(){try{o.call(this,1,Array.prototype.slice.call(arguments))}catch(e){}},error:function(){try{o.call(this,2,Array.prototype.slice.call(arguments))}catch(e){}},log:function(){try{o.call(this,5,Array.prototype.slice.call(arguments))}catch(e){}},warn:function(){try{o.call(this,3,Array.prototype.slice.call(arguments))}catch(e){}},info:function(){try{o.call(this,4,Array.prototype.slice.call(arguments))}catch(e){}},debug:function(){try{o.call(this,6,Array.prototype.slice.call(arguments))}catch(e){}},verbose:function(){try{o.call(this,6,Array.prototype.slice.call(arguments))}catch(e){}},handleLogDebugLegacySupport:function(e,t){try{!function(e,t,n){try{var i="[APN-"+e+"-"+(new Date).toISOString()+"] ";null!==n&&n&&n.length>0&&(i+=n+">"),i+=t,s(e)&&console.log(i)}catch(t){s(e)&&console.log(t)}}(5,e,t)}catch(e){}},setDebugLevel:function(e){try{!function(e){try{r=a(e),n=Math.max(Math.max(i,r),n)}catch(e){}}(e)}catch(e){}},isTraceLevelActive:function(e){try{return s(e)}catch(e){return!1}},TRACE_LEVEL_ALWAYS:1,TRACE_LEVEL_ERROR:2,TRACE_LEVEL_WARN:3,TRACE_LEVEL_INFO:4,TRACE_LEVEL_LOG:5,TRACE_LEVEL_DEBUG:6,TRACE_LEVEL_VERBOSE:6},function(){try{i=a(function(e){try{var t="";try{t=window.top.location.search}catch(e){try{t=window.location.search}catch(e){}}var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))}catch(e){return""}}("ast_debug").toUpperCase()),n=Math.max(i,n)}catch(e){}}()},function(e,t,n){var i=n(10),r=n(46),o=n(53),a=n(54),s=n(11),l=n(12),d=function(e){l.verbose(e,"PlayerManager_BuildPlayer")};e.exports=function(e,t,n){d("buildPlayer");var l=t,c=n.isIosInlineRequired.bind(n),u=function(){return/iPad|iPhone|iPod/.test(navigator.appVersion)},p=function(e){return!!e.isFullscreen||!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)&&(!window.screenTop&&!window.screenY)};"off"===(l=function(e){switch(e.nativeControlsForTouch=!1,e.controls=!0,e.preload="auto",e.extensions||(e.extensions=""),a.setSizeForInitialRender(e),u()&&e.sideStream&&!1===e.sideStream.enabled&&(e.nonViewableBehavior="pause"),e.initialPlayback){case"auto":case"click":case"mouseover":e.autoplay=!1}e.hasOwnProperty("disableTopBar")||(e.disableTopBar=!1),(s.isAndroid()||c())&&(e.controlBarPosition="below");var t=e.endCard;if(t&&t.enabled&&!t.buttons&&(t.buttons=[],t.showDefaultButtons=!0,t.buttons.indexOf("replay")<0&&e.disableCollapse&&e.disableCollapse.replay&&t.buttons.push({type:"replay"}),t.buttons.indexOf("learnMore")<0&&e.learnMore&&e.learnMore.enabled)){var n={type:"learnMore"};e.learnMore.text&&(n.text=e.learnMore.text),t.buttons.push(n)}return e}(l)).initialAudio&&(n.isMuted=!0),n.options=l;var h=function(e,t){if(!0===l.playOnMouseover){e.addEventListener("mouseenter",(function(){!0===n.isDoneInitialPlay&&!n.explicitPaused&&n.isViewable&&!1===n.isPlayingVideo&&n.play()})),e.addEventListener("mouseleave",(function(){n.pause()}))}if(!1!==l.audioOnMouseover){var i,r=0;"number"==typeof l.audioOnMouseover&&(r=l.audioOnMouseover);var o=function(){!n.isFullscreen&&n.isDoneInitialPlay&&(clearTimeout(i),n.mute(),e.removeEventListener("mouseleave",o))};c()||(setInterval((function(){n&&n.isFullscreen&&o&&e&&e.removeEventListener("mouseleave",o)}),500),e.addEventListener("mouseenter",(function(){n.isFullscreen||!n.isDoneInitialPlay||n.mutedByViewability||(i=setTimeout((function(){n.unmute(),d("unmute by mouseover")}),r)),e.addEventListener("mouseleave",o,!1)}),!1))}var a,s;if(!l.autoInitialSize||(a=navigator.appVersion.indexOf("Mobile"),s=navigator.appVersion.indexOf("Android"),a>-1||s>-1)||window.addEventListener("resize",(function(){!0!==p(n)&&(!(!n.options.sideStreamObject||"function"!=typeof n.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated)&&n.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated()||l.targetElement&&l.targetElement.style&&l.targetElement.style.height&&0===Number(l.targetElement.style.height.replace("px",""))||setTimeout((function(){if(!0!==p(n)&&(l.disableCollapse.enabled||!n.isSkipped&&!n.isCompleted)){l.width=l.targetElement.offsetWidth||l.width;var e=/android/i.test(navigator.userAgent.toLowerCase());e?l.targetElement.style.webkitTransition="height 0s ease":l.targetElement.style.transition="height 0s ease",n.resizeVideo(-1),l.targetElement.style.height=l.height+"px";var t=document.getElementById(n.videoObjectId);t&&void 0!==typeof t&&(t.style.width=l.width,t.style.height=l.height),setTimeout((function(){var t,n=(t=l.expandTime)<0?0:t/1e3;n=n<=0?.001:n,e?l.targetElement.style.webkitTransition="height "+n+"s ease":l.targetElement.style.transition="height "+n+"s ease"}),500)}}),0))})),e.style.cursor="pointer",t&&void 0!==t){if(u()){var h=!1;t.ontouchmove=function(){h=!0},t.ontouchend=function(e){h?h=!1:v(e)}}else t.onclick=function(e){v(e)};var v=function(){"html5"!==n.decidePlayer(l.requiredPlayer)||l.vpaid||(!0===l.learnMore.enabled?!0===l.learnMore.clickToPause&&(n.isPlayingVideo?n.explicitPause():n.explicitPlay()):n.click())}}var f=n.options&&n.options.playerSkin&&n.options.playerSkin.customPlayerSkin;u()&&n.overlayPlayer&&n.options&&!1===n.options.enableInlineVideoForIos&&f&&(n.adVideoPlayer.controlBar.fullscreenToggle.dispose(),n.adVideoPlayer.one("playing",(function(){n.adVideoPlayer.controlBar.el().style.display="none",setTimeout((function(){n.adVideoPlayer.controlBar.el().style.display="block"}),7e3)})))};switch(n.decidePlayer(l.requiredPlayer)){case"html5":c()?new r(n,h).start():new i(n,h).start()}o.sharedInstance().run(t)}},function(e,t,n){var i=n(11),r=n(12);e.exports=function(e,t){var o=this;this.options=e.options,this.an_video_ad_player_id="",this.an_video_ad_player_html5_api_id="",this.targetElement="",this.videojsOrigin=e.videoPlayerObj,this.dispatchEventToAdunit=e.dispatchEventToAdunit.bind(e),this.callbackForAdUnit=e.callbackForAdUnit,this.topChromeHeight=24,this.pendingFullscreenExit=!1,this.bigbuttonUnmuteTimeout=250,this.CONST_MESSAGE_GENERAL_ERROR="General error reported from HTML5 video player",this.adIndicatorTextContent=this.options.adText,this.readyForSkip=!1,this.floatingSkipButton=null,this.floatingAdSkipText=null,this.isIos=i.isIos,this.isAndroid=i.isAndroid,this.isMobile=i.isMobile,this.refreshVideoLookAndFeel=i.refreshVideoLookAndFeel,this.initializeIframeAndVideo=n(13)(o,e).init,this.UIController=n(19)(o,e,t).init,this.displayVolumeControls=n(45)(o).displayVolumeControls,this.start=function(){var t;t="WE ARE USING HTML5 PLAYER",r.info("Video Player: "+t);var n=(new Date).getTime()+Math.floor(1e4*Math.random());o.options.techOrder=["html5"],o.options.iframeVideoWrapperId="iframeVideoWrapper_"+n;var i="an_video_ad_player_"+n,a="an_video_ad_player_"+n+"_html5_api";o.an_video_ad_player_id=i,o.an_video_ad_player_html5_api_id=a,e.divIdForVideo=i,e.videoId=a,o.targetElement=o.options.targetElement,o.initializeIframeAndVideo(o.UIController)}}},function(e,t,n){var i=n(12),r=function(e){i.verbose(e,"PlayerManager_Utils")},o=function(){return/iphone/i.test(navigator.userAgent.toLowerCase())},a=function(){return o()||/ipad/i.test(navigator.userAgent.toLowerCase())},s=function(){return navigator.appVersion.indexOf("Mobile")>-1||navigator.appVersion.indexOf("Android")>-1},l=function(e){var t=!1;try{t=!isNaN(parseFloat(e))&&isFinite(e)}catch(e){r(e)}return t};e.exports={isPortrait:function(){return window.innerHeight>window.innerWidth},isIphone:o,isIos:a,isIpad:function(){return navigator.userAgent.toLowerCase().match(/mac/)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>2},isAndroid:function(){return/android/i.test(navigator.userAgent.toLowerCase())},isMobile:s,getIOSVersion:function(){var e=navigator.userAgent.match(/OS (\d+)_/i);if(e&&e[1])return e[1]},refreshVideoLookAndFeel:function(e,t){!t.isSkipped&&t.isExpanded&&(e.autoInitialSize&&!e.shouldResizeVideoToFillMobileWebview&&(e.width=e.targetElement.offsetWidth),t.resizeVideo(-1,s()),e.targetElement.style.height=e.height+"px")},fireEvent:function(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),n.eventName=t,e.dispatchEvent(n)},DelayEventHandler:function(){this.queue=[],this.id="",this.isSuppress=!1,this.isPaused=!1,this.isCompleted=!1;var e=!1;this.push=function(t){!1!==this.isSuppress||"function"!=typeof t?e?e=!1:!1===this.isPaused&&this.queue.push(t):t()},this.start=function(){r("delay event starts");var e=this,t=function(){if(!1===e.isSuppress){var n=e.queue.shift();n&&"function"==typeof n&&n()}setTimeout((function(){!1===e.isCompleted&&t()}),100)};t()},this.ImmediateStop=function(){this.isCompleted=!0},this.lazyTerminate=function(){var e=this;this.queue.push((function(){e.ImmediateStop()}))},this.suppress=function(e){this.isSuppress=e},this.clearQueue=function(){this.queue=[]},this.ignoreNextQueue=function(){e=!0}},isEmpty:function(e){return void 0===e||""===e||!1===e||null===e},unique:function(){var e={};return{pushAndCheck:function(t,n){var i=t+"_"+n;return!e[i]&&(e[i]=!0,!0)}}},getMsecTime:function(e,t){try{var n=e.indexOf("%");if(n>0){if(t&&t>0){var i=Number(e.substring(0,n));return i>=0&&i<=100?Math.round(t*(i/100)):-1}return-1}var o=(n=e.indexOf("."))>0?Number(e.substring(n+1).substr(0,3)):0;n>0&&(e=e.substring(0,n));var a=e.split(":");if(3===a.length){for(var s=0;s0)return!1;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},elementsOverlap:function(e,t){if(!(e&&t&&e.getBoundingClientRect&&t.getBoundingClientRect))return n="Utils.elementsOverlap expects two html elements",i.info(n,"PlayerManager_Utils"),!1;var n,r=e.getBoundingClientRect(),o=t.getBoundingClientRect();return!(r.righto.right||r.bottomo.bottom)},convertTimeSecondsToString:function(e){var t=1e3*e,n=parseInt(t%1e3),i=parseInt(t/1e3%60),r=parseInt(t/6e4%60),o=parseInt(t/36e5%24);return(o=o<10?"0"+o:o)+":"+(r=r<10?"0"+r:r)+":"+(i=i<10?"0"+i:i)+"."+(n=n<10?"00"+n:n<100?"0"+n:n)}}},function(e,t){var n=0,i=0,r=0;function o(e,t){try{if(void 0!==e&&s(e)&&console){var n="[APN",i=function(e){switch(e){case 0:break;case 1:return"always";case 2:return"error";case 3:return"warn";case 4:return"info";case 5:return"log";case 6:return"debug";case 7:return"verbose"}}(e);if(console[i]||(n+="-"+i,i="log"),n+="]",n+="["+function(){var e="";try{var t=new Date;e=t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()+"."+t.getMilliseconds()}catch(e){}return e}()+"]",t.splice(0,0,n),console[i].apply)console[i].apply(console,t);else{var r=Array.prototype.slice.apply(t).join("");console[i](r)}}}catch(e){}}function a(e){var t=0;try{if(void 0!==e){var n=parseInt(e);isNaN(n)?"boolean"==typeof e?t=e?6:0:"TRUE"===(e=e.toUpperCase())?t=6:"FALSE"===e&&(t=0):t=n}}catch(e){}return t}function s(e){return e<=n}e.exports={traceAtLevel:function(){try{if(arguments.length>0){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);o.call(this,e,t)}}catch(e){}},always:function(){try{o.call(this,1,Array.prototype.slice.call(arguments))}catch(e){}},error:function(){try{o.call(this,2,Array.prototype.slice.call(arguments))}catch(e){}},log:function(){try{o.call(this,5,Array.prototype.slice.call(arguments))}catch(e){}},warn:function(){try{o.call(this,3,Array.prototype.slice.call(arguments))}catch(e){}},info:function(){try{o.call(this,4,Array.prototype.slice.call(arguments))}catch(e){}},debug:function(){try{o.call(this,6,Array.prototype.slice.call(arguments))}catch(e){}},verbose:function(){try{o.call(this,6,Array.prototype.slice.call(arguments))}catch(e){}},handleLogDebugLegacySupport:function(e,t){try{!function(e,t,n){try{var i="[APN-"+e+"-"+(new Date).toISOString()+"] ";null!==n&&n&&n.length>0&&(i+=n+">"),i+=t,s(e)&&console.log(i)}catch(t){s(e)&&console.log(t)}}(5,e,t)}catch(e){}},setDebugLevel:function(e){try{!function(e){try{r=a(e),n=Math.max(Math.max(i,r),n)}catch(e){}}(e)}catch(e){}},isTraceLevelActive:function(e){try{return s(e)}catch(e){return!1}},TRACE_LEVEL_ALWAYS:1,TRACE_LEVEL_ERROR:2,TRACE_LEVEL_WARN:3,TRACE_LEVEL_INFO:4,TRACE_LEVEL_LOG:5,TRACE_LEVEL_DEBUG:6,TRACE_LEVEL_VERBOSE:6},function(){try{i=a(function(e){try{var t="";try{t=window.top.location.search}catch(e){try{t=window.location.search}catch(e){}}var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))}catch(e){return""}}("ast_debug").toUpperCase()),n=Math.max(i,n)}catch(e){}}()},function(e,t,n){var i="[PlayerManager_InitializeElements]",r=n(12),o=n(14),a=function(e){r.verbose(i,e)},s=function(e){r.debug(i,e)},l=function(e){r.log(i,e)};e.exports=function(e,t){return{init:function(n){var i;l("init");var r=!1;if(t.autoplayHandler.isRequiredFakeAndroidAutoStart(e.options.initialPlayback,e.options.initialAudio,e.options.automatedTestingOnlyAndroidSkipTouchStart,!0)){a("Setting correct iframe for androids 'fake' autostart");for(var d=e.options.targetElement.getElementsByTagName("iframe"),c=0;c0)for(var v=0;v"),i.contentWindow.document.close()}if(i){i.id=e.options.iframeVideoWrapperId,i.style.width=e.options.width+"px",i.style.height=e.options.height+"px",i.style.display="",r||s("Html5Player created new iframe: "+e.options.iframeVideoWrapperId),i.setAttribute("allowfullscreen","true"),i.setAttribute("webkitallowfullscreen","true"),i.setAttribute("mozallowfullscreen","true"),e.options.playerSkin&&e.options.playerSkin.controlBarColor&&i.contentWindow&&i.contentWindow.document&&i.contentWindow.document.body&&i.contentWindow.document.body.style&&(i.contentWindow.document.body.style.background=t.options.playerSkin.controlBarColor);var f=function(){var r=i.contentWindow.document,a=i.contentWindow.window;s("Creating and styling top chrome bar");var d,c=r.createElement("div");c.id="top_chrome",c.style.height=e.options.playerSkin&&"number"==typeof e.options.playerSkin.dividerHeight?e.topChromeHeight-e.options.playerSkin.dividerHeight+"px":e.topChromeHeight-1+"px",c.style.width=e.options.width+"px",c.style.marginRight="auto",c.style.marginLeft="auto",c.className="video-js vjs-default-skin",s("Generating and styling video object");var u=!1;if(t.autoplayHandler.isRequiredFakeAndroidAutoStart(e.options.initialPlayback,e.options.initialAudio,e.options.automatedTestingOnlyAndroidSkipTouchStart,!0)){var p=i.contentWindow[t.autoplayHandler.APN_MOBILE_VIDEO_PLACEMENT_ID];p&&(u=!0,d=p)}if(u||(d=r.createElement("video")),d.id=e.an_video_ad_player_id,d.className="video-js vjs-default-skin",d.style.marginRight="auto",d.style.marginLeft="auto",c.style["z-index"]=d.style["z-index"]+1,a.ReportingObserver&&function(e,t){function n(e){for(var n=0;n-1&&!1===t.overlayPlayer?(i.onload=function(){f(),m=!0},setTimeout((function(){!1===m&&(a("destroying due to an error in firefox"),t.destroyWithoutSkip(!0,e.CONST_MESSAGE_GENERAL_ERROR,null,900))}),e.options.vpaidTimeout)):f()}else s("iframeVideoWrapper Doesn't exist.")}}}},function(e,t,n){n(15);var i=n(17),r=n(18),o=r.OmidSessionClient.AdSession,a=r.OmidSessionClient.Partner,s=r.OmidSessionClient.Context,l=r.OmidSessionClient.VerificationScriptResource,d=r.OmidSessionClient.AdEvents,c=r.OmidSessionClient.MediaEvents,u=r.OmidSessionClient.VastProperties,p="[PlayerManager_Verifications]",h=n(12);e.exports=function(e,t){var n,r,v,f=e,m=t,g=[],y=new i(e,t.player),A=function(e){h.debug(p,"OMID sessionObserver");try{if("sessionStart"===e.type){h.debug(p,"OMID sessionStart");const t="video",i="beginToRender";if("definedByJavaScript"===e.data.creativeType&&n.setCreativeType(t),"definedByJavaScript"===e.data.impressionType&&n.setImpressionType(i),""!==OMIDVideoEvents().position){const e=OMIDVideoEvents().isSkippable,t=0,n=OMIDVideoEvents().isAutoPlay,i=OMIDVideoEvents().position,o=new u(e,t,n,i);r.loaded(o)}r.impressionOccurred()}else"sessionError"===event.type?h.debug(p,"OMID sessionError"):"sessionFinish"===event.type&&h.debug(p,"OMID sessionFinish")}catch(e){h.debug(p,"Failed OMID sessionStart "+e)}};return{init:function(){h.debug(p,"init verifications");for(var e=0;e0)try{if(""!==getOMIDPartner().name&&""!==getOMIDPartner().version){var k=new a(getOMIDPartner().name,getOMIDPartner().version),E=new s(k,g);h.debug(p,"BuildTest::"+m.videoElement),n=new o(E),r=new d(n),v=new c(n),n.registerSessionObserver(A),E.setVideoElement(m.videoElement),h.debug(p,"OMID _adSession"),h.debug(p,n),h.debug(p,v)}}catch(e){h.debug(p,"Failed OMID registerSessionObserver "+e)}},start:function(){h.debug(p,"start verifications")},dispatchEvent:function(e,t){h.debug(p,"try to dispatch OMID event: "+e+", data: ",t);try{"start"===e?v.start(t.duration,t.videoPlayerVolume):"firstQuartile"===e?v.firstQuartile():"thirdQuartile"===e?v.thirdQuartile():"midpoint"===e?v.midpoint():"complete"===e?v.complete():"volumeChange"===e?v.volumeChange(t.videoPlayerVolume):"adUserInteraction"===e?v.adUserInteraction(t.interactionType):"resume"===e?v.resume():"pause"===e?v.pause():"playerStateChange"===e?v.playerStateChange(t.state):"skipped"===e&&v.skipped()}catch(e){h.debug(p,"Failed OMID Video Events "+e)}},destroy:function(){h.debug(p,"destroy verifications")}}}},function(e,t,n){var i=n(16),r="[PlayerManager_Verification_OMID]",o=n(12);e.exports=function(e,t){var n,a,s,l=e,d=t,c=!1,u=(s=(new Date).getTime(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=(s+16*Math.random())%16|0;return s=Math.floor(s/16),("x"===e?t:3&t|8).toString(16)}))),p=null,h=[];function v(e,t){n=e,a=t,c&&m()}function f(e,t){p&&p.addListener(e,t)}function m(){o.debug(r,"start OMID session");var e,t={adSessionId:u,type:"sessionStart",timestamp:Date.now(),data:{context:(e={apiVersion:"1.0",environment:"web",accessMode:"full",videElement:d.videoElement,adSessionType:"html",adCount:1,omidJsInfo:{omidImplementer:"videoads-ad-video-player-manager",serviceVersion:"3.5.19"}},l.adServingId&&(e.adServingId=l.adServingId),e)}},s=a===l.vendor?l.verificationParams:null;s&&(t.data.verificationParameters=s),p=new i(u,n),n(t)}return{init:function(){o.debug(r,"expose OMID interface"),d.frameWin.omid3p={registerSessionObserver:v,addEventListener:f}},start:function(){c=!0,n&&m()},dispatchEvent:function(e,t){p?(h.length>0&&(h.forEach((function(t){var n;n="dispatch from cache OMID event "+e,o.debug(r,n),p.fireEvent(t.eventName,t.data)})),h=[]),o.debug(r,"dispatch OMID event "+e),p.fireEvent(e,t)):(o.debug(r,"save in cache OMID event "+e),h.push({event:e,data:t}))},destroy:function(){if(o.debug(r,"terminate OMID session"),n&&c){var e={adSessionId:u,type:"sessionFinish",timestamp:Date.now()};n(e)}}}}},function(e,t){e.exports=function(e,t){var n=e,i=t,r={},o=["sessionStart","sessionError","sessionFinish"],a=["impression"],s=["loaded","start","firstQuartile","midpoint","thirdQuartile","complete","pause","resume","bufferStart","bufferFinish","skipped","volumeChange","playerStateChange","adUserInteraction"],l=["geometryChange"],d=["video"];function c(e,t){return!!e.find((function(e){return t===e}))}function u(e,t){var i={adSessionId:n,type:e,timestamp:Date.now()},r=function(e,t){var n=null;switch(e){case"sessionError":n={},t&&t.type&&(n.errorType=t.type),t&&t.message&&(n.message=t.message);break;case"impression":(n={}).mediaType="video";break;case"loaded":(n={}).skippable=t.skippable,n.skippable&&(n.skipOffset=parseInt(t.skipOffset/1e3+.5)),n.autoPlay=t.autoPlay,n.position=t.position;break;case"start":(n={}).duration=t.duration,n.videoPlayerVolume=t.volume;break;case"volumeChange":(n={}).videoPlayerVolume=t.volume;break;case"playerStateChange":(n={}).state=t.state;break;case"adUsetInteraction":(n={}).interactionType=t.interactionType}return n}(e,t);return r&&(i.data=r),i}function p(e,t){r.hasOwnProperty(e)||(r[e]=[]),r[e].push(t)}return{addListener:function(e,t){(function(e){return c(o,e)||c(a,e)||c(s,e)||c(l,e)||c(d,e)})(e)&&(c(d,e)?s.forEach((function(e){p(e,t)})):p(e,t))},fireEvent:function(e,t){if(r.hasOwnProperty(e)){var n=u(e,t);"sessionError"===e?i(n):r[e].forEach((function(e){e(n)}))}}}}},function(e,t,n){var i=n(12);e.exports=function(e,t){for(var n={},r=0;r=0){var i=l[n];null===i&&(i=t?t.resolveMacro(n):-1),e=e.split("["+n+"]").join(encodeURIComponent(i))}return e}(i)}var s,l={TIMESTAMP:(new Date).toISOString(),MEDIAPLAYHEAD:null,BREAKPOSITION:null,ADCOUNT:null,TRANSACTIONID:(s=(new Date).getTime(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=(s+16*Math.random())%16|0;return s=Math.floor(s/16),("x"===e?t:3&t|8).toString(16)}))),PLACEMENTTYPE:null,IFA:-1,IFATYPE:-1,CLIENTUA:null,DEVICEIP:null,LATLONG:-1,PAGEURL:function(){try{return top&&top.location&&top.location.href?top.location.href:-1}catch(e){return-1}}(),APPNAME:-1,APIFRAMEWORKS:"2,7",EXTENSIONS:-1,PLAYERCAPABILITIES:null,CLICKTYPE:null,PLAYERSTATE:null,PLAYERSIZE:null,ADPLAYHEAD:null,ASSETURI:null,PODSEQUENCE:null,CLICKPOS:-1,LIMITADTRACKING:null};return{trackEvent:function(e,t,r){(i.debug("[PlayerManager_Verification_Tracking]","track verification event: "+t),n&&n[e]&&n[e].hasOwnProperty(t))&&n[e][t].forEach((function(e){var t=a(e,r);(new Image).src=t}))}}}},function(e,t,n){(function(e){!function(e,t,n){if("object"==typeof n&&"string"!=typeof n.nodeName)t(e,n);else{n={};var i=["1.4.2-iab3703"];function r(e){for(var t in e)e.hasOwnProperty(t)&&(e[t]=r(e[t]));return Object.freeze(e)}for(var o in i.push("default"),t(e,n),n)n.hasOwnProperty(o)&&(null==Object.getOwnPropertyDescriptor(e,o)&&Object.defineProperty(e,o,{value:{}}),i.forEach((function(t){if(null==Object.getOwnPropertyDescriptor(e[o],t)){var i=r(n[o]);Object.defineProperty(e[o],t,{get:function(){return i},enumerable:!0})}})))}}(void 0===e?this:e,(function(t,n){"use strict";var i,r=r||{};r.scope={},r.arrayIteratorImpl=function(e){var t=0;return function(){return ti)throw Error("Value for "+e+" is outside the range ["+n+","+i+"]")}l.assertTruthyString=d,l.assertNotNullObject=c,l.assertNumber=u,l.assertNumberBetween=p,l.assertFunction=function(e,t){if(!t)throw Error(e+" must not be truthy.")},l.assertPositiveNumber=function(e,t){if(u(e,t),0>t)throw Error(e+" must be a positive number.")};function h(e,t){return e&&(e[t]||(e[t]={}))}function v(e,t,i){(i=void 0===i?void 0===n?null:n:i)&&((e=e.split(".")).slice(0,e.length-1).reduce(h,i)[e[e.length-1]]=t)}v("OmidSessionClient.Partner",(function(e,t){d("Partner.name",e),d("Partner.version",t),this.name=e,this.version=t}));var f=function(e,t,n,i){i=void 0===i?o.AccessMode.FULL:i,d("VerificationScriptResource.resourceUrl",e),this.resourceUrl=e,this.vendorKey=t,this.verificationParameters=n,this.accessMode=i};f.prototype.toJSON=function(){return{accessMode:this.accessMode,resourceUrl:this.resourceUrl,vendorKey:this.vendorKey,verificationParameters:this.verificationParameters}},v("OmidSessionClient.VerificationScriptResource",f);var m=function(e,t,n,i){n=void 0===n?null:n,i=void 0===i?null:i,c("Context.partner",e),this.partner=e,this.verificationScriptResources=t,this.videoElement=this.slotElement=null,this.contentUrl=n,this.customReferenceData=i,this.underEvaluation=!1,this.serviceWindow=null};m.prototype.setVideoElement=function(e){c("Context.videoElement",e),this.videoElement=e},m.prototype.setSlotElement=function(e){c("Context.slotElement",e),this.slotElement=e},m.prototype.setServiceWindow=function(e){c("Context.serviceWindow",e),this.serviceWindow=e},v("OmidSessionClient.Context",m);var g={};g.omidGlobal=function(){if(void 0!==t&&t)return t;if(void 0!==e&&e)return e;if("undefined"!=typeof window&&window)return window;if("undefined"!=typeof globalThis&&globalThis)return globalThis;var n=Function("return this")();if(n)return n;throw Error("Could not determine global object context.")}();var y="omidSessionInterface",A="adEvents",b="mediaEvents",w={sessionError:"reportError"},T=Object.keys(o.MediaEventType).map((function(e){return o.MediaEventType[e]})),k=["impressionOccurred"],E=function(e){e=void 0===e?g.omidGlobal:e,this.interfaceRoot_=e[y]};E.prototype.isSupported=function(){return null!=this.interfaceRoot_},E.prototype.sendMessage=function(e,t,n){if("registerSessionObserver"==e&&(n=[t]),w[e]&&(e=w[e]),t=this.interfaceRoot_,0<=k.indexOf(e)&&(t=t[A]),0<=T.indexOf(e)&&(t=t[b]),!(t=t[e]))throw Error("Unrecognized method name: "+e+".");t.apply(null,r.arrayFromIterable(n))};var S={};function C(e){for(var t=[],n=0;nr)break;if(i