diff --git a/.gitignore b/.gitignore index be2473fa4..45d95e94e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ **/Products **/out_device **/out_simulator +**/xcshareddata ######################################################################################## # macOS.gitignore # https://github.com/github/gitignore/blob/master/Global/macOS.gitignore diff --git a/AppNexusSDK.podspec b/AppNexusSDK.podspec index 4cfd4fc2a..b6933aa4c 100644 --- a/AppNexusSDK.podspec +++ b/AppNexusSDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "AppNexusSDK" - s.version = "6.0" + s.version = "6.1" s.platform = :ios, "9.0" s.summary = "AppNexus iOS Mobile Advertising SDK" @@ -23,13 +23,13 @@ DESC subspec.source_files = "sdk/sourcefiles/**/*.{h,m}" subspec.public_header_files = "sdk/sourcefiles/*.h","sdk/sourcefiles/native/*.h" subspec.resources = "sdk/sourcefiles/**/*.{png,bundle,xib,nib,js,html,strings}" - subspec.vendored_libraries = "sdk/sourcefiles/Viewability/**/*.a" + subspec.vendored_frameworks = "sdk/sourcefiles/Viewability/OMSDK_Appnexus.framework" subspec.frameworks = 'WebKit' end s.subspec 'GoogleAdapter' do |subspec| subspec.dependency 'AppNexusSDK/AppNexusSDK', "#{s.version}" - subspec.dependency 'Google-Mobile-Ads-SDK', '7.48.0' + subspec.dependency 'Google-Mobile-Ads-SDK', '7.50.0' subspec.source_files = "mediation/mediatedviews/GoogleAdMob/*.{h,m}" subspec.public_header_files = "mediation/mediatedviews/GoogleAdMob/ANAdAdapterNativeAdMob.h" subspec.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '${PODS_ROOT}/Google-Mobile-Ads-SDK/**' } @@ -45,7 +45,7 @@ DESC s.subspec 'FacebookAdapter' do |subspec| subspec.dependency 'AppNexusSDK/AppNexusSDK', "#{s.version}" - subspec.dependency 'FBAudienceNetwork', '4.28.1' + subspec.dependency 'FBAudienceNetwork', '5.5.1' subspec.source_files = "mediation/mediatedviews/Facebook/*.{h,m}" subspec.public_header_files = "mediation/mediatedviews/Facebook/ANAdAdapterNativeFacebook.h" subspec.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '${PODS_ROOT}/FBAudienceNetwork/**' } @@ -79,7 +79,7 @@ DESC subspec.dependency 'AppNexusSDK/AppNexusSDK', "#{s.version}" subspec.source_files = "mediation/mediatedviews/SmartAd/*.{h,m}" subspec.public_header_files = "mediation/mediatedviews/SmartAd/ANAdAdapterSmartAdBase.h" - subspec.dependency 'Smart-Display-SDK', '7.1.1' + subspec.dependency 'Smart-Display-SDK', '7.2' subspec.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '${PODS_ROOT}/Smart-Display-SDK/**' } end @@ -92,7 +92,7 @@ DESC s.subspec 'AdMobCustomEventAdapter' do |subspec| subspec.dependency 'AppNexusSDK/AppNexusSDK', "#{s.version}" - subspec.dependency 'Google-Mobile-Ads-SDK', '7.48.0' + subspec.dependency 'Google-Mobile-Ads-SDK', '7.50.0' subspec.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '${PODS_ROOT}/Google-Mobile-Ads-SDK/**' } subspec.source_files = "mediation/mediating/GoogleAdMob/*.{h,m}" subspec.private_header_files = "mediation/mediating/GoogleAdMob/*.h" diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index e97caa6a3..0e9456f7c 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,3 +1,24 @@ +## 6.1 + +### New Features ++ MS-3983: Added new API to Pause/Resume(https://wiki.xandr.com/display/sdk/Show+an+Instream+Video+Ads+on+iOS) VideoAd ++ MS-4057: Official release for iOS 13 support + +### Mediation partner upgrades ++ Smart Server SDK v7.2 ++ FacebookAd SDK v5.5.1(has breaking changes, please look at Mediation Docs(https://wiki.xandr.com/display/sdk/Mediate+with+iOS) for updated integration instruction) ++ Google AdMob SDK v7.50 + +### Improvements/Bug Fixes ++ MS-3915,MS-3916: Improved Banner Ad performance ++ MS-3948: Removed AppNexusSDKResources.Bundle ++ MS-3951: Fixed open measurement geometry change events for VideoAd ++ MS-3976: Fixed escape character breaking VideoAd load ++ MS-3987: Upgraded to OMSDK v1.2.19 ++ MS-4004: Fixed VideoAd's pause issue when application state changes ++ MS-4023: Removed usage of UIWebView ++ MS-4036: Fixed interstitial crash on orientation change if orientation not supported by host application (Github #47) + ## 6.0 At Xandr we listen to our users' feedback to help us develop the products that provide the best solutions for their needs. Based on that feedback, we are proud to announce the release of v6.0, a major upgrade to our iOS Mobile SDK. diff --git a/mediation/mediatedviews/Facebook/ANAdAdapterNativeFacebook.m b/mediation/mediatedviews/Facebook/ANAdAdapterNativeFacebook.m index 98ee67659..877694816 100644 --- a/mediation/mediatedviews/Facebook/ANAdAdapterNativeFacebook.m +++ b/mediation/mediatedviews/Facebook/ANAdAdapterNativeFacebook.m @@ -18,6 +18,8 @@ @interface ANAdAdapterNativeFacebook () @property (nonatomic) FBNativeAd *fbNativeAd; +@property (nonatomic) FBMediaView *fbMediaView; +@property (nonatomic) FBMediaView *fbAdIcon; @end @@ -37,16 +39,55 @@ - (void)requestNativeAdWithServerParameter:(nullable NSString *)parameterString [self.fbNativeAd loadAd]; } +-(BOOL) getMediaViewsForRegisterView:(nonnull UIView *)view{ + + for (UIView *subview in [view subviews]){ + if([subview isKindOfClass:[FBMediaView class]]){ + FBMediaView *fbAdView = (FBMediaView *)subview; + switch (fbAdView.nativeAdViewTag) { + case FBNativeAdViewTagIcon: + self.fbAdIcon = fbAdView; + break; + default: + self.fbMediaView = fbAdView; + break; + } + }else if([subview isKindOfClass:[UIView class]]) + { + [self getMediaViewsForRegisterView:subview]; + } + if(self.fbMediaView && self.fbAdIcon){ + break; + } + } + if(self.fbMediaView) { + return YES; + } + + return NO; +} + - (void)registerViewForImpressionTrackingAndClickHandling:(nonnull UIView *)view withRootViewController:(nonnull UIViewController *)rvc clickableViews:(nullable NSArray *)clickableViews { - if (clickableViews.count) { - [self.fbNativeAd registerViewForInteraction:view - withViewController:rvc - withClickableViews:clickableViews]; - } else { - [self.fbNativeAd registerViewForInteraction:view - withViewController:rvc]; + + if([self getMediaViewsForRegisterView:view]){ + if(clickableViews.count != 0) { + [self.fbNativeAd registerViewForInteraction:view + mediaView:self.fbMediaView + iconView:self.fbAdIcon + viewController:rvc + clickableViews:clickableViews]; + + }else { + [self.fbNativeAd registerViewForInteraction:view + mediaView:self.fbMediaView + iconView:self.fbAdIcon + viewController:rvc]; + } + } + else{ + ANLogDebug(@"View does not contain mediaView for registerViewForImpressionTracking."); } } @@ -76,11 +117,9 @@ - (void)nativeAd:(FBNativeAd *)nativeAd didFailWithError:(NSError *)error { - (void)nativeAdDidLoad:(FBNativeAd *)nativeAd { ANNativeMediatedAdResponse *response = [[ANNativeMediatedAdResponse alloc] initWithCustomAdapter:self - networkCode:ANNativeAdNetworkCodeFacebook]; - response.title = nativeAd.title; - response.body = nativeAd.body; - response.iconImageURL = nativeAd.icon.url; - response.mainImageURL = nativeAd.coverImage.url; + networkCode:ANNativeAdNetworkCodeFacebook]; + response.title = nativeAd.headline; + response.body = nativeAd.bodyText; response.callToAction = nativeAd.callToAction; response.customElements = @{ kANNativeElementObject : nativeAd}; diff --git a/mediation/mediatedviews/GoogleAdMob/ANAdAdapterBannerAdMob.m b/mediation/mediatedviews/GoogleAdMob/ANAdAdapterBannerAdMob.m index 8b73b52ef..be6011464 100644 --- a/mediation/mediatedviews/GoogleAdMob/ANAdAdapterBannerAdMob.m +++ b/mediation/mediatedviews/GoogleAdMob/ANAdAdapterBannerAdMob.m @@ -134,9 +134,6 @@ - (void)adView:(GADBannerView *)view didFailToReceiveAdWithError:(GADRequestErro case kGADErrorMediationAdapterError: code = ANAdResponseInternalError; break; - case kGADErrorMediationNoFill: - code = ANAdResponseUnableToFill; - break; case kGADErrorMediationInvalidAdSize: code = ANAdResponseInvalidRequest; break; diff --git a/mediation/mediatedviews/GoogleAdMob/ANAdAdapterBannerDFP.m b/mediation/mediatedviews/GoogleAdMob/ANAdAdapterBannerDFP.m index fbb0c7587..dce3d7210 100644 --- a/mediation/mediatedviews/GoogleAdMob/ANAdAdapterBannerDFP.m +++ b/mediation/mediatedviews/GoogleAdMob/ANAdAdapterBannerDFP.m @@ -187,9 +187,6 @@ - (void)adView:(GADBannerView *)view didFailToReceiveAdWithError:(GADRequestErro case kGADErrorMediationAdapterError: code = ANAdResponseInternalError; break; - case kGADErrorMediationNoFill: - code = ANAdResponseUnableToFill; - break; case kGADErrorMediationInvalidAdSize: code = ANAdResponseInvalidRequest; break; diff --git a/mediation/mediatedviews/GoogleAdMob/ANAdAdapterBaseDFP.m b/mediation/mediatedviews/GoogleAdMob/ANAdAdapterBaseDFP.m index 250ef5cc6..28c9759d9 100644 --- a/mediation/mediatedviews/GoogleAdMob/ANAdAdapterBaseDFP.m +++ b/mediation/mediatedviews/GoogleAdMob/ANAdAdapterBaseDFP.m @@ -98,9 +98,6 @@ + (ANAdResponseCode)responseCodeFromRequestError:(GADRequestError *)error { case kGADErrorMediationAdapterError: code = ANAdResponseInternalError; break; - case kGADErrorMediationNoFill: - code = ANAdResponseUnableToFill; - break; case kGADErrorMediationInvalidAdSize: code = ANAdResponseInvalidRequest; break; diff --git a/mediation/mediatedviews/GoogleAdMob/ANAdAdapterInterstitialAdMob.m b/mediation/mediatedviews/GoogleAdMob/ANAdAdapterInterstitialAdMob.m index b522bbd0e..88f2cdc10 100644 --- a/mediation/mediatedviews/GoogleAdMob/ANAdAdapterInterstitialAdMob.m +++ b/mediation/mediatedviews/GoogleAdMob/ANAdAdapterInterstitialAdMob.m @@ -99,9 +99,6 @@ - (void)interstitial:(GADInterstitial *)ad didFailToReceiveAdWithError:(GADReque case kGADErrorMediationAdapterError: code = ANAdResponseInternalError; break; - case kGADErrorMediationNoFill: - code = ANAdResponseUnableToFill; - break; case kGADErrorMediationInvalidAdSize: code = ANAdResponseInvalidRequest; break; diff --git a/mediation/mediatedviews/GoogleAdMob/ANAdAdapterInterstitialDFP.m b/mediation/mediatedviews/GoogleAdMob/ANAdAdapterInterstitialDFP.m index f8c2e0beb..254008585 100644 --- a/mediation/mediatedviews/GoogleAdMob/ANAdAdapterInterstitialDFP.m +++ b/mediation/mediatedviews/GoogleAdMob/ANAdAdapterInterstitialDFP.m @@ -99,9 +99,6 @@ - (void)interstitial:(GADInterstitial *)ad didFailToReceiveAdWithError:(GADReque case kGADErrorMediationAdapterError: code = ANAdResponseInternalError; break; - case kGADErrorMediationNoFill: - code = ANAdResponseUnableToFill; - break; case kGADErrorMediationInvalidAdSize: code = ANAdResponseInvalidRequest; break; diff --git a/sdk/AppNexusNativeSDK/Info.plist b/sdk/AppNexusNativeSDK/Info.plist index 164b86a03..c675902f1 100644 --- a/sdk/AppNexusNativeSDK/Info.plist +++ b/sdk/AppNexusNativeSDK/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 6.0 + 6.1 CFBundleVersion $(CURRENT_PROJECT_VERSION) diff --git a/sdk/AppNexusSDK.xcodeproj/project.pbxproj b/sdk/AppNexusSDK.xcodeproj/project.pbxproj index 0e2945279..5643f46f5 100644 --- a/sdk/AppNexusSDK.xcodeproj/project.pbxproj +++ b/sdk/AppNexusSDK.xcodeproj/project.pbxproj @@ -7,17 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 0030D6EF20E5414D003B7C1D /* OMIDAdSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 0030D6E320E5414D003B7C1D /* OMIDAdSession.h */; }; - 0030D6F020E5414D003B7C1D /* OMIDSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = 0030D6E420E5414D003B7C1D /* OMIDSDK.h */; }; - 0030D6F120E5414D003B7C1D /* OMIDVASTProperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 0030D6E520E5414D003B7C1D /* OMIDVASTProperties.h */; }; - 0030D6F220E5414D003B7C1D /* OMIDVideoEvents.h in Headers */ = {isa = PBXBuildFile; fileRef = 0030D6E620E5414D003B7C1D /* OMIDVideoEvents.h */; }; - 0030D6F320E5414D003B7C1D /* OMIDAdSessionConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 0030D6E720E5414D003B7C1D /* OMIDAdSessionConfiguration.h */; }; - 0030D6F420E5414D003B7C1D /* OMIDImports.h in Headers */ = {isa = PBXBuildFile; fileRef = 0030D6E820E5414D003B7C1D /* OMIDImports.h */; }; - 0030D6F520E5414D003B7C1D /* OMIDAdSessionContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 0030D6E920E5414D003B7C1D /* OMIDAdSessionContext.h */; }; - 0030D6F620E5414D003B7C1D /* OMIDScriptInjector.h in Headers */ = {isa = PBXBuildFile; fileRef = 0030D6EA20E5414D003B7C1D /* OMIDScriptInjector.h */; }; - 0030D6F920E5414D003B7C1D /* OMIDAdEvents.h in Headers */ = {isa = PBXBuildFile; fileRef = 0030D6EC20E5414D003B7C1D /* OMIDAdEvents.h */; }; - 0030D6FA20E5414D003B7C1D /* OMIDVerificationScriptResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 0030D6ED20E5414D003B7C1D /* OMIDVerificationScriptResource.h */; }; - 0030D6FB20E5414D003B7C1D /* OMIDPartner.h in Headers */ = {isa = PBXBuildFile; fileRef = 0030D6EE20E5414D003B7C1D /* OMIDPartner.h */; }; 0035C5AE1F4496FD00915E97 /* ANSSMMediationAdViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0035C5AD1F4496FD00915E97 /* ANSSMMediationAdViewController.h */; }; 0035C5B11F44971100915E97 /* ANSSMMediationAdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0035C5AF1F44971100915E97 /* ANSSMMediationAdViewController.m */; }; 006F6B9B2295F70E003D2DF0 /* ANAdFetcherBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 006F6B992295F70E003D2DF0 /* ANAdFetcherBase.m */; }; @@ -32,19 +21,65 @@ 0099B486228CA191004E80AB /* NSTimer+ANCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = ECE4EA99194B768A0069D934 /* NSTimer+ANCategory.m */; }; 00D6B04820D1BC9B007A3439 /* ANOMIDImplementation.h in Headers */ = {isa = PBXBuildFile; fileRef = 00D6B04720D1BC9B007A3439 /* ANOMIDImplementation.h */; }; 00D6B04B20D1BCAF007A3439 /* ANOMIDImplementation.m in Sources */ = {isa = PBXBuildFile; fileRef = 00D6B04920D1BCAF007A3439 /* ANOMIDImplementation.m */; }; + 0E1421E922F99AC9006C597A /* an_arrow_left.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3A61A2F8AFE0000E4CC /* an_arrow_left.png */; }; + 0E1421EA22F99AC9006C597A /* an_arrow_left@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3A51A2F8AFE0000E4CC /* an_arrow_left@2x.png */; }; + 0E1421EB22F99AC9006C597A /* an_arrow_left@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3A31A2F8ACC0000E4CC /* an_arrow_left@3x.png */; }; + 0E1421EC22F99AC9006C597A /* an_arrow_right.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3AC1A2F8CE50000E4CC /* an_arrow_right.png */; }; + 0E1421ED22F99AC9006C597A /* an_arrow_right@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3AB1A2F8CE50000E4CC /* an_arrow_right@2x.png */; }; + 0E1421EE22F99AC9006C597A /* an_arrow_right@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3A91A2F8CC10000E4CC /* an_arrow_right@3x.png */; }; + 0E1421EF22F99AC9006C597A /* appnexus_logo_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 8AD618991981C10700AC0780 /* appnexus_logo_icon.png */; }; + 0E1421F022F99AC9006C597A /* appnexus_logo_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8AD6189A1981C10700AC0780 /* appnexus_logo_icon@2x.png */; }; + 0E1421F122F99AC9006C597A /* compass.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A2F483C1A2E33B000B0EA05 /* compass.png */; }; + 0E1421F222F99AC9006C597A /* compass@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3A01A2F72D00000E4CC /* compass@2x.png */; }; + 0E1421F322F99AC9006C597A /* compass@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A6CD9261A96B2FD0060BCF4 /* compass@3x.png */; }; + 0E1421F422F99AC9006C597A /* interstitial_closebox.png in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EAD2194B768A0069D934 /* interstitial_closebox.png */; }; + 0E1421F522F99AC9006C597A /* interstitial_closebox@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EAD3194B768A0069D934 /* interstitial_closebox@2x.png */; }; + 0E1421F622F99AC9006C597A /* interstitial_flat_closebox.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A6D2E881A44A62A003CE77A /* interstitial_flat_closebox.png */; }; + 0E1421F722F99AC9006C597A /* interstitial_flat_closebox@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A6D2E871A44A62A003CE77A /* interstitial_flat_closebox@2x.png */; }; + 0E1421F822F99AC9006C597A /* interstitial_flat_closebox@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A6D2E841A44A5D3003CE77A /* interstitial_flat_closebox@3x.png */; }; + 0E1421F922F99AC9006C597A /* UIButtonBarArrowLeft.png in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EAD4194B768A0069D934 /* UIButtonBarArrowLeft.png */; }; + 0E1421FA22F99AC9006C597A /* UIButtonBarArrowLeft@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EAD5194B768A0069D934 /* UIButtonBarArrowLeft@2x.png */; }; + 0E1421FB22F99AC9006C597A /* UIButtonBarArrowRight.png in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EAD6194B768A0069D934 /* UIButtonBarArrowRight.png */; }; + 0E1421FC22F99AC9006C597A /* UIButtonBarArrowRight@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EAD7194B768A0069D934 /* UIButtonBarArrowRight@2x.png */; }; + 0E1421FD22F99ACA006C597A /* an_arrow_left.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3A61A2F8AFE0000E4CC /* an_arrow_left.png */; }; + 0E1421FE22F99ACA006C597A /* an_arrow_left@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3A51A2F8AFE0000E4CC /* an_arrow_left@2x.png */; }; + 0E1421FF22F99ACA006C597A /* an_arrow_left@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3A31A2F8ACC0000E4CC /* an_arrow_left@3x.png */; }; + 0E14220022F99ACA006C597A /* an_arrow_right.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3AC1A2F8CE50000E4CC /* an_arrow_right.png */; }; + 0E14220122F99ACA006C597A /* an_arrow_right@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3AB1A2F8CE50000E4CC /* an_arrow_right@2x.png */; }; + 0E14220222F99ACA006C597A /* an_arrow_right@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3A91A2F8CC10000E4CC /* an_arrow_right@3x.png */; }; + 0E14220322F99ACA006C597A /* appnexus_logo_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 8AD618991981C10700AC0780 /* appnexus_logo_icon.png */; }; + 0E14220422F99ACA006C597A /* appnexus_logo_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8AD6189A1981C10700AC0780 /* appnexus_logo_icon@2x.png */; }; + 0E14220522F99ACA006C597A /* compass.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A2F483C1A2E33B000B0EA05 /* compass.png */; }; + 0E14220622F99ACA006C597A /* compass@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3A01A2F72D00000E4CC /* compass@2x.png */; }; + 0E14220722F99ACA006C597A /* compass@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A6CD9261A96B2FD0060BCF4 /* compass@3x.png */; }; + 0E14220D22F99ACA006C597A /* UIButtonBarArrowLeft.png in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EAD4194B768A0069D934 /* UIButtonBarArrowLeft.png */; }; + 0E14220E22F99ACA006C597A /* UIButtonBarArrowLeft@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EAD5194B768A0069D934 /* UIButtonBarArrowLeft@2x.png */; }; + 0E14220F22F99ACA006C597A /* UIButtonBarArrowRight.png in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EAD6194B768A0069D934 /* UIButtonBarArrowRight.png */; }; + 0E14221022F99ACA006C597A /* UIButtonBarArrowRight@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EAD7194B768A0069D934 /* UIButtonBarArrowRight@2x.png */; }; + 0E14221122F99AD4006C597A /* ANBrowserViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = FC210A302007D529002A9F0E /* ANBrowserViewController.xib */; }; + 0E14221222F99AD6006C597A /* ANBrowserViewController_SizeClasses.xib in Resources */ = {isa = PBXBuildFile; fileRef = FC210A332007D52C002A9F0E /* ANBrowserViewController_SizeClasses.xib */; }; + 0E14221322F99AE2006C597A /* ANInterstitialAdViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EACC194B768A0069D934 /* ANInterstitialAdViewController.xib */; }; + 0E14221422F99AE7006C597A /* anjam.js in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EACD194B768A0069D934 /* anjam.js */; }; + 0E14221522F99AE9006C597A /* ANMRAID.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 8A3EC16F19B8FDC70049CD29 /* ANMRAID.bundle */; }; + 0E14221622F99AEC006C597A /* ASTMediationManager.js in Resources */ = {isa = PBXBuildFile; fileRef = 609733001E42EAFF0061EC0A /* ASTMediationManager.js */; }; + 0E14221722F99AEE006C597A /* errors.strings in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EACE194B768A0069D934 /* errors.strings */; }; + 0E14221822F99AF3006C597A /* MobileVastPlayer.js in Resources */ = {isa = PBXBuildFile; fileRef = 60AB32891E521FE500429ED7 /* MobileVastPlayer.js */; }; + 0E14221922F99AFB006C597A /* omsdk.js in Resources */ = {isa = PBXBuildFile; fileRef = 0EEE97DA21764ACD007DADE6 /* omsdk.js */; }; + 0E14221A22F99AFD006C597A /* sdkjs.js in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EAD9194B768A0069D934 /* sdkjs.js */; }; + 0E14221B22F99AFF006C597A /* optionsparser.js in Resources */ = {isa = PBXBuildFile; fileRef = 60D39E0F2256EE420029F741 /* optionsparser.js */; }; + 0E14221C22F99B02006C597A /* vastVideo.html in Resources */ = {isa = PBXBuildFile; fileRef = 4F403A6D2043C8CF00EF75A2 /* vastVideo.html */; }; + 0E14221D22F99B04006C597A /* nativeRenderer.html in Resources */ = {isa = PBXBuildFile; fileRef = 0E291F3622A075A300C9A851 /* nativeRenderer.html */; }; 0E290E4422844DEC00468327 /* ANRTBNativeAdResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E290E4122844DEC00468327 /* ANRTBNativeAdResponse.m */; }; 0E290E4522844DEC00468327 /* ANRTBNativeAdResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E290E4222844DEC00468327 /* ANRTBNativeAdResponse.h */; }; - 0E291F3722A075A300C9A851 /* nativeRenderer.html in Resources */ = {isa = PBXBuildFile; fileRef = 0E291F3622A075A300C9A851 /* nativeRenderer.html */; }; 0E7BC1CC229FC727002F41FF /* ANNativeRenderingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E7BC1C9229FC71D002F41FF /* ANNativeRenderingViewController.m */; }; 0E9F613620FFDCD7009AECD8 /* ANNativeMediatedAdResponse+PrivateMethods.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E9F613420FFDC3B009AECD8 /* ANNativeMediatedAdResponse+PrivateMethods.h */; }; + 0EA0790B2328E05200FB5764 /* OMSDK_Appnexus.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0EA0790A2328E05200FB5764 /* OMSDK_Appnexus.framework */; }; + 0EA0790C2328E05200FB5764 /* OMSDK_Appnexus.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0EA0790A2328E05200FB5764 /* OMSDK_Appnexus.framework */; }; 0EBE633A208F765E0008F4CC /* ANGDPRSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E35D4A92088F652000A6C27 /* ANGDPRSettings.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0ECF336322D79A62007DB185 /* AppNexusNativeSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = 0ECF335D22D79A61007DB185 /* AppNexusNativeSDK.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0ECF336622D79A62007DB185 /* AppNexusSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = 0ECF336022D79A62007DB185 /* AppNexusSDK.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0ED85345208A94F200A5FFA0 /* ANGDPRSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E35D4AC2088F67E000A6C27 /* ANGDPRSettings.m */; }; - 0EEE97DB21764ACD007DADE6 /* omsdk.js in Resources */ = {isa = PBXBuildFile; fileRef = 0EEE97DA21764ACD007DADE6 /* omsdk.js */; }; - 0EEE97F521768358007DADE6 /* libOMSDKAppnexus.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0EEE97F321768358007DADE6 /* libOMSDKAppnexus.a */; }; 0EF636D322D7726000D3320F /* ANProxyViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 8ABC03D21C5AD3E100D7C789 /* ANProxyViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4F403A6E2043C91100EF75A2 /* vastVideo.html in Resources */ = {isa = PBXBuildFile; fileRef = 4F403A6D2043C8CF00EF75A2 /* vastVideo.html */; }; 4F7332821FC35BBD00A206A2 /* AVKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F5B80571FBBAA3E0026F8B3 /* AVKit.framework */; }; 4F7332861FC35D5A00A206A2 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F7332851FC35D5A00A206A2 /* AVFoundation.framework */; }; 60183FD52293482700CFDE33 /* ANWebView.h in Headers */ = {isa = PBXBuildFile; fileRef = 60183FD222933E9500CFDE33 /* ANWebView.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -79,9 +114,6 @@ 609733061E42EAFF0061EC0A /* ANInstreamVideoAd.m in Sources */ = {isa = PBXBuildFile; fileRef = 609732FC1E42EAFF0061EC0A /* ANInstreamVideoAd.m */; }; 609733071E42EAFF0061EC0A /* ANVideoAdPlayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 609732FD1E42EAFF0061EC0A /* ANVideoAdPlayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; 609733091E42EAFF0061EC0A /* ANVideoAdPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 609732FE1E42EAFF0061EC0A /* ANVideoAdPlayer.m */; }; - 609733141E42EB0B0061EC0A /* ASTMediationManager.js in Resources */ = {isa = PBXBuildFile; fileRef = 609733001E42EAFF0061EC0A /* ASTMediationManager.js */; }; - 60AB328B1E521FE500429ED7 /* MobileVastPlayer.js in Resources */ = {isa = PBXBuildFile; fileRef = 60AB32891E521FE500429ED7 /* MobileVastPlayer.js */; }; - 60D39E112256EE430029F741 /* optionsparser.js in Resources */ = {isa = PBXBuildFile; fileRef = 60D39E0F2256EE420029F741 /* optionsparser.js */; }; 60D39E1522570FE20029F741 /* ANVideoPlayerSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = 60D39E1322570FE20029F741 /* ANVideoPlayerSettings.h */; settings = {ATTRIBUTES = (Public, ); }; }; 60D39E1722570FE20029F741 /* ANVideoPlayerSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = 60D39E1422570FE20029F741 /* ANVideoPlayerSettings.m */; }; 60D39E2922679E480029F741 /* ANVideoPlayerSettings+ANCategory.h in Headers */ = {isa = PBXBuildFile; fileRef = 60D39E26226798D50029F741 /* ANVideoPlayerSettings+ANCategory.h */; }; @@ -91,21 +123,8 @@ 8A02D7091D6CE946006831A3 /* ANSDKSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A02D6FF1D6CE946006831A3 /* ANSDKSettings.m */; }; 8A2F48241A2E255600B0EA05 /* ANOpenInExternalBrowserActivity.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A2F48211A2E255600B0EA05 /* ANOpenInExternalBrowserActivity.h */; settings = {ATTRIBUTES = (Private, ); }; }; 8A2F48261A2E255600B0EA05 /* ANOpenInExternalBrowserActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A2F48221A2E255600B0EA05 /* ANOpenInExternalBrowserActivity.m */; }; - 8A2F483D1A2E33B000B0EA05 /* compass.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A2F483C1A2E33B000B0EA05 /* compass.png */; }; - 8A3EC17019B8FDCA0049CD29 /* ANMRAID.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 8A3EC16F19B8FDC70049CD29 /* ANMRAID.bundle */; }; - 8A4FF3A11A2F72D00000E4CC /* compass@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3A01A2F72D00000E4CC /* compass@2x.png */; }; - 8A4FF3A41A2F8ACC0000E4CC /* an_arrow_left@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3A31A2F8ACC0000E4CC /* an_arrow_left@3x.png */; }; - 8A4FF3A71A2F8AFE0000E4CC /* an_arrow_left@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3A51A2F8AFE0000E4CC /* an_arrow_left@2x.png */; }; - 8A4FF3A81A2F8AFE0000E4CC /* an_arrow_left.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3A61A2F8AFE0000E4CC /* an_arrow_left.png */; }; - 8A4FF3AA1A2F8CC10000E4CC /* an_arrow_right@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3A91A2F8CC10000E4CC /* an_arrow_right@3x.png */; }; - 8A4FF3AD1A2F8CE50000E4CC /* an_arrow_right@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3AB1A2F8CE50000E4CC /* an_arrow_right@2x.png */; }; - 8A4FF3AE1A2F8CE50000E4CC /* an_arrow_right.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A4FF3AC1A2F8CE50000E4CC /* an_arrow_right.png */; }; 8A598F8B1A1EA061009BA879 /* ANNativeStandardAdResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A598F881A1EA061009BA879 /* ANNativeStandardAdResponse.h */; settings = {ATTRIBUTES = (Private, ); }; }; 8A598F8D1A1EA061009BA879 /* ANNativeStandardAdResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A598F891A1EA061009BA879 /* ANNativeStandardAdResponse.m */; }; - 8A6CD9271A96B2FD0060BCF4 /* compass@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A6CD9261A96B2FD0060BCF4 /* compass@3x.png */; }; - 8A6D2E8D1A44A751003CE77A /* interstitial_flat_closebox@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A6D2E841A44A5D3003CE77A /* interstitial_flat_closebox@3x.png */; }; - 8A6D2E8E1A44A751003CE77A /* interstitial_flat_closebox@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A6D2E871A44A62A003CE77A /* interstitial_flat_closebox@2x.png */; }; - 8A6D2E8F1A44A751003CE77A /* interstitial_flat_closebox.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A6D2E881A44A62A003CE77A /* interstitial_flat_closebox.png */; }; 8A84E42E1A25350800C60EAB /* ANNativeAdResponse+PrivateMethods.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A84E42A1A2534F300C60EAB /* ANNativeAdResponse+PrivateMethods.h */; settings = {ATTRIBUTES = (Private, ); }; }; 8A92F9EB1D05E1B500F689C7 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8A92F9EA1D05E1B500F689C7 /* WebKit.framework */; }; 8A9AEDB11A1BE8C200C58BDA /* ANAdConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 8ABB76691A00385C00FEAD9D /* ANAdConstants.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -189,9 +208,6 @@ 8AC65F701A40DE74006BCF39 /* ANMRAIDResizeViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 8AC65F481A40DE63006BCF39 /* ANMRAIDResizeViewManager.m */; }; 8AC65F711A40DE74006BCF39 /* ANMRAIDUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AC65F491A40DE63006BCF39 /* ANMRAIDUtil.h */; settings = {ATTRIBUTES = (Private, ); }; }; 8AC65F721A40DE74006BCF39 /* ANMRAIDUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 8AC65F4A1A40DE63006BCF39 /* ANMRAIDUtil.m */; }; - 8AD618E31981C19100AC0780 /* appnexus_logo_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 8AD618991981C10700AC0780 /* appnexus_logo_icon.png */; }; - 8AD618E41981C19500AC0780 /* appnexus_logo_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8AD6189A1981C10700AC0780 /* appnexus_logo_icon@2x.png */; }; - 8ADA36201A82A8D700AF65AA /* AppNexusSDKResources.bundle in Resources */ = {isa = PBXBuildFile; fileRef = EC48177B1845046A0066BBFE /* AppNexusSDKResources.bundle */; }; 8AE5E11E1A2FDC7700FDE858 /* ANAdView+PrivateMethods.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AE5E11C1A2FDC7700FDE858 /* ANAdView+PrivateMethods.h */; settings = {ATTRIBUTES = (Private, ); }; }; 8AE7AD9F1A7AC4F6009E2F2F /* ANAdWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8AC7C5371A3B5CEF00AA5548 /* ANAdWebViewController.m */; }; 8AF5A8851ACC60D50089C529 /* ANStandardAd.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AF5A87D1ACC60D50089C529 /* ANStandardAd.h */; }; @@ -209,16 +225,6 @@ 97EC51EF2229782B00B740DF /* ANVerificationScriptResource.m in Sources */ = {isa = PBXBuildFile; fileRef = 97EC51EC2229782B00B740DF /* ANVerificationScriptResource.m */; }; 9EEE4E50214FD2100056C5DD /* ANCarrierObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 9EEE4E4E214FD2100056C5DD /* ANCarrierObserver.h */; }; 9EEE4E52214FD2100056C5DD /* ANCarrierObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 9EEE4E4F214FD2100056C5DD /* ANCarrierObserver.m */; }; - ECE4EB04194B76960069D934 /* ANInterstitialAdViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EACC194B768A0069D934 /* ANInterstitialAdViewController.xib */; }; - ECE4EB05194B76960069D934 /* anjam.js in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EACD194B768A0069D934 /* anjam.js */; }; - ECE4EB06194B76960069D934 /* errors.strings in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EACE194B768A0069D934 /* errors.strings */; }; - ECE4EB09194B76960069D934 /* interstitial_closebox.png in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EAD2194B768A0069D934 /* interstitial_closebox.png */; }; - ECE4EB0A194B76960069D934 /* interstitial_closebox@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EAD3194B768A0069D934 /* interstitial_closebox@2x.png */; }; - ECE4EB0B194B76960069D934 /* UIButtonBarArrowLeft.png in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EAD4194B768A0069D934 /* UIButtonBarArrowLeft.png */; }; - ECE4EB0C194B76960069D934 /* UIButtonBarArrowLeft@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EAD5194B768A0069D934 /* UIButtonBarArrowLeft@2x.png */; }; - ECE4EB0D194B76960069D934 /* UIButtonBarArrowRight.png in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EAD6194B768A0069D934 /* UIButtonBarArrowRight.png */; }; - ECE4EB0E194B76960069D934 /* UIButtonBarArrowRight@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EAD7194B768A0069D934 /* UIButtonBarArrowRight@2x.png */; }; - ECE4EB10194B76960069D934 /* sdkjs.js in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EAD9194B768A0069D934 /* sdkjs.js */; }; F52B044122AECD6B00985B62 /* NSObject+ANCategory.h in Headers */ = {isa = PBXBuildFile; fileRef = 608E477B1F8EAB84009BB148 /* NSObject+ANCategory.h */; }; F52B044222AECD6F00985B62 /* NSObject+ANCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = 608E477C1F8EAB84009BB148 /* NSObject+ANCategory.m */; }; F52F82EB2293362600F4578C /* NSObject+ANCategory.h in Headers */ = {isa = PBXBuildFile; fileRef = 608E477B1F8EAB84009BB148 /* NSObject+ANCategory.h */; }; @@ -231,7 +237,6 @@ F52F83152295DCA500F4578C /* ANBrowserViewController_SizeClasses.xib in Resources */ = {isa = PBXBuildFile; fileRef = FC210A332007D52C002A9F0E /* ANBrowserViewController_SizeClasses.xib */; }; F52F83162295DCA500F4578C /* errors.strings in Resources */ = {isa = PBXBuildFile; fileRef = ECE4EACE194B768A0069D934 /* errors.strings */; }; F52F83172295DCA500F4578C /* omsdk.js in Resources */ = {isa = PBXBuildFile; fileRef = 0EEE97DA21764ACD007DADE6 /* omsdk.js */; }; - F5731B0B228B57590012B134 /* libOMSDKAppnexus.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0EEE97F321768358007DADE6 /* libOMSDKAppnexus.a */; }; F5731B3F228C8CA80012B134 /* ANNativeAdImageCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AB876201A0994310022D9A5 /* ANNativeAdImageCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; F5731B40228C8CB40012B134 /* ANNativeAdImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 8AB876211A0994310022D9A5 /* ANNativeAdImageCache.m */; }; F5731B41228C8CBB0012B134 /* ANNativeAdRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 8AB876231A0994310022D9A5 /* ANNativeAdRequest.m */; }; @@ -310,34 +315,23 @@ F5731BCD228DD90B0012B134 /* ANNativeAdFetcher.h in Headers */ = {isa = PBXBuildFile; fileRef = F5731BCC228DD90B0012B134 /* ANNativeAdFetcher.h */; }; F5731BCE228F07F30012B134 /* ANNativeAdFetcher.h in Headers */ = {isa = PBXBuildFile; fileRef = F5731BCC228DD90B0012B134 /* ANNativeAdFetcher.h */; }; F5731BCF228F07FC0012B134 /* ANNativeAdFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = F5731BCA228DD8E60012B134 /* ANNativeAdFetcher.m */; }; - FC210A2E2007D529002A9F0E /* ANBrowserViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = FC210A302007D529002A9F0E /* ANBrowserViewController.xib */; }; - FC210A312007D52C002A9F0E /* ANBrowserViewController_SizeClasses.xib in Resources */ = {isa = PBXBuildFile; fileRef = FC210A332007D52C002A9F0E /* ANBrowserViewController_SizeClasses.xib */; }; FCC5DA5F2034AD35003DC7B2 /* ANBaseAdObject.m in Sources */ = {isa = PBXBuildFile; fileRef = FCC5DA5C2034ABFB003DC7B2 /* ANBaseAdObject.m */; }; FCC5DA612034AD3E003DC7B2 /* ANBaseAdObject.h in Headers */ = {isa = PBXBuildFile; fileRef = FCC5DA5D2034ABFC003DC7B2 /* ANBaseAdObject.h */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 8A9AEDAD1A1BE8AA00C58BDA /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = EC3E5CD41843C6D50070315E /* Project object */; - proxyType = 1; - remoteGlobalIDString = EC48177A1845046A0066BBFE; - remoteInfo = ANSDKResources; +/* Begin PBXCopyFilesBuildPhase section */ + 0E19A3CE23210B7D00E83276 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; }; -/* End PBXContainerItemProxy section */ +/* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0030D6E320E5414D003B7C1D /* OMIDAdSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OMIDAdSession.h; sourceTree = ""; }; - 0030D6E420E5414D003B7C1D /* OMIDSDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OMIDSDK.h; sourceTree = ""; }; - 0030D6E520E5414D003B7C1D /* OMIDVASTProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OMIDVASTProperties.h; sourceTree = ""; }; - 0030D6E620E5414D003B7C1D /* OMIDVideoEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OMIDVideoEvents.h; sourceTree = ""; }; - 0030D6E720E5414D003B7C1D /* OMIDAdSessionConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OMIDAdSessionConfiguration.h; sourceTree = ""; }; - 0030D6E820E5414D003B7C1D /* OMIDImports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OMIDImports.h; sourceTree = ""; }; - 0030D6E920E5414D003B7C1D /* OMIDAdSessionContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OMIDAdSessionContext.h; sourceTree = ""; }; - 0030D6EA20E5414D003B7C1D /* OMIDScriptInjector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OMIDScriptInjector.h; sourceTree = ""; }; - 0030D6EC20E5414D003B7C1D /* OMIDAdEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OMIDAdEvents.h; sourceTree = ""; }; - 0030D6ED20E5414D003B7C1D /* OMIDVerificationScriptResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OMIDVerificationScriptResource.h; sourceTree = ""; }; - 0030D6EE20E5414D003B7C1D /* OMIDPartner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OMIDPartner.h; sourceTree = ""; }; 0035C5AD1F4496FD00915E97 /* ANSSMMediationAdViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANSSMMediationAdViewController.h; sourceTree = ""; }; 0035C5AF1F44971100915E97 /* ANSSMMediationAdViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANSSMMediationAdViewController.m; sourceTree = ""; }; 006F6B992295F70E003D2DF0 /* ANAdFetcherBase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANAdFetcherBase.m; sourceTree = ""; }; @@ -355,12 +349,12 @@ 0E7BC1C9229FC71D002F41FF /* ANNativeRenderingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ANNativeRenderingViewController.m; path = ../native/internal/NativeRendering/ANNativeRenderingViewController.m; sourceTree = ""; }; 0E7BC1CA229FC71D002F41FF /* ANNativeRenderingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ANNativeRenderingViewController.h; path = ../native/internal/NativeRendering/ANNativeRenderingViewController.h; sourceTree = ""; }; 0E9F613420FFDC3B009AECD8 /* ANNativeMediatedAdResponse+PrivateMethods.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ANNativeMediatedAdResponse+PrivateMethods.h"; sourceTree = ""; }; + 0EA0790A2328E05200FB5764 /* OMSDK_Appnexus.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = OMSDK_Appnexus.framework; sourceTree = ""; }; 0ECF335D22D79A61007DB185 /* AppNexusNativeSDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppNexusNativeSDK.h; sourceTree = ""; }; 0ECF335E22D79A61007DB185 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 0ECF336022D79A62007DB185 /* AppNexusSDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppNexusSDK.h; sourceTree = ""; }; 0ECF336122D79A62007DB185 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 0EEE97DA21764ACD007DADE6 /* omsdk.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = omsdk.js; sourceTree = ""; }; - 0EEE97F321768358007DADE6 /* libOMSDKAppnexus.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libOMSDKAppnexus.a; sourceTree = ""; }; 4F131E8A1F71CCE50019FDAC /* ANAdFetcherResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANAdFetcherResponse.h; sourceTree = ""; }; 4F131E8B1F71CCE50019FDAC /* ANAdFetcherResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANAdFetcherResponse.m; sourceTree = ""; }; 4F403A6D2043C8CF00EF75A2 /* vastVideo.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = vastVideo.html; sourceTree = ""; }; @@ -525,7 +519,6 @@ 97EC51EC2229782B00B740DF /* ANVerificationScriptResource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ANVerificationScriptResource.m; sourceTree = ""; }; 9EEE4E4E214FD2100056C5DD /* ANCarrierObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ANCarrierObserver.h; sourceTree = ""; }; 9EEE4E4F214FD2100056C5DD /* ANCarrierObserver.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ANCarrierObserver.m; sourceTree = ""; }; - EC48177B1845046A0066BBFE /* AppNexusSDKResources.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AppNexusSDKResources.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; ECE4EA8D194B768A0069D934 /* ANAdProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANAdProtocol.h; sourceTree = ""; }; ECE4EA8E194B768A0069D934 /* ANAdView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANAdView.h; sourceTree = ""; }; ECE4EA8F194B768A0069D934 /* ANBannerAdView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANBannerAdView.h; sourceTree = ""; }; @@ -567,8 +560,8 @@ 4F7332861FC35D5A00A206A2 /* AVFoundation.framework in Frameworks */, 4F7332821FC35BBD00A206A2 /* AVKit.framework in Frameworks */, 8AFC04611A2E74C800BEA485 /* CoreGraphics.framework in Frameworks */, + 0EA0790B2328E05200FB5764 /* OMSDK_Appnexus.framework in Frameworks */, 8AFC04651A2E751200BEA485 /* CoreTelephony.framework in Frameworks */, - 0EEE97F521768358007DADE6 /* libOMSDKAppnexus.a in Frameworks */, 8AFC046D1A2E75A300BEA485 /* MediaPlayer.framework in Frameworks */, 8AFC04711A2E760800BEA485 /* MessageUI.framework in Frameworks */, 8AFC046B1A2E757900BEA485 /* QuartzCore.framework in Frameworks */, @@ -579,47 +572,21 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - EC4817781845046A0066BBFE /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; F5731AFA228B43570012B134 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F5731B0B228B57590012B134 /* libOMSDKAppnexus.a in Frameworks */, + 0EA0790C2328E05200FB5764 /* OMSDK_Appnexus.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 0030D6E220E5414D003B7C1D /* OMAppnexusSDK */ = { - isa = PBXGroup; - children = ( - 0EEE97F321768358007DADE6 /* libOMSDKAppnexus.a */, - 0030D6E320E5414D003B7C1D /* OMIDAdSession.h */, - 0030D6E720E5414D003B7C1D /* OMIDAdSessionConfiguration.h */, - 0030D6EC20E5414D003B7C1D /* OMIDAdEvents.h */, - 0030D6E920E5414D003B7C1D /* OMIDAdSessionContext.h */, - 0030D6E820E5414D003B7C1D /* OMIDImports.h */, - 0030D6EE20E5414D003B7C1D /* OMIDPartner.h */, - 0030D6EA20E5414D003B7C1D /* OMIDScriptInjector.h */, - 0030D6E420E5414D003B7C1D /* OMIDSDK.h */, - 0030D6E520E5414D003B7C1D /* OMIDVASTProperties.h */, - 0030D6ED20E5414D003B7C1D /* OMIDVerificationScriptResource.h */, - 0030D6E620E5414D003B7C1D /* OMIDVideoEvents.h */, - ); - path = OMAppnexusSDK; - sourceTree = ""; - }; 00D6B04320D1BAB9007A3439 /* Viewability */ = { isa = PBXGroup; children = ( - 0030D6E220E5414D003B7C1D /* OMAppnexusSDK */, + 0EA0790A2328E05200FB5764 /* OMSDK_Appnexus.framework */, 00D6B04720D1BC9B007A3439 /* ANOMIDImplementation.h */, 00D6B04920D1BCAF007A3439 /* ANOMIDImplementation.m */, ); @@ -905,7 +872,6 @@ EC3E5CDD1843C6D50070315E /* Products */ = { isa = PBXGroup; children = ( - EC48177B1845046A0066BBFE /* AppNexusSDKResources.bundle */, 8A9AED8C1A1BE84F00C58BDA /* AppNexusSDK.framework */, F5731AFD228B43570012B134 /* AppNexusNativeSDK.framework */, ); @@ -1067,17 +1033,6 @@ 609732B01E42E73D0061EC0A /* NSDictionary+ANCategory.h in Headers */, 8A9AEDC71A1BF88200C58BDA /* NSString+ANCategory.h in Headers */, 8A9AEDC81A1BF88200C58BDA /* NSTimer+ANCategory.h in Headers */, - 0030D6F920E5414D003B7C1D /* OMIDAdEvents.h in Headers */, - 0030D6EF20E5414D003B7C1D /* OMIDAdSession.h in Headers */, - 0030D6F320E5414D003B7C1D /* OMIDAdSessionConfiguration.h in Headers */, - 0030D6F520E5414D003B7C1D /* OMIDAdSessionContext.h in Headers */, - 0030D6F420E5414D003B7C1D /* OMIDImports.h in Headers */, - 0030D6FB20E5414D003B7C1D /* OMIDPartner.h in Headers */, - 0030D6F620E5414D003B7C1D /* OMIDScriptInjector.h in Headers */, - 0030D6F020E5414D003B7C1D /* OMIDSDK.h in Headers */, - 0030D6F120E5414D003B7C1D /* OMIDVASTProperties.h in Headers */, - 0030D6FA20E5414D003B7C1D /* OMIDVerificationScriptResource.h in Headers */, - 0030D6F220E5414D003B7C1D /* OMIDVideoEvents.h in Headers */, 006F6B9E2295F72A003D2DF0 /* ANAdFetcherBase.h in Headers */, 8A9AEDC91A1BF88200C58BDA /* UIView+ANCategory.h in Headers */, 0EF636D322D7726000D3320F /* ANProxyViewController.h in Headers */, @@ -1153,34 +1108,17 @@ 8A9AEDE71A1BF98600C58BDA /* Sources */, 8A9AED8A1A1BE84F00C58BDA /* Resources */, 8AFC045D1A2E745C00BEA485 /* Frameworks */, + 0E19A3CE23210B7D00E83276 /* CopyFiles */, ); buildRules = ( ); dependencies = ( - 8A9AEDAE1A1BE8AA00C58BDA /* PBXTargetDependency */, ); name = AppNexusSDK; productName = AppNexusSDK; productReference = 8A9AED8C1A1BE84F00C58BDA /* AppNexusSDK.framework */; productType = "com.apple.product-type.framework"; }; - EC48177A1845046A0066BBFE /* AppNexusSDKResources */ = { - isa = PBXNativeTarget; - buildConfigurationList = EC4817851845046A0066BBFE /* Build configuration list for PBXNativeTarget "AppNexusSDKResources" */; - buildPhases = ( - EC4817771845046A0066BBFE /* Sources */, - EC4817781845046A0066BBFE /* Frameworks */, - EC4817791845046A0066BBFE /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = AppNexusSDKResources; - productName = ANSDKResources; - productReference = EC48177B1845046A0066BBFE /* AppNexusSDKResources.bundle */; - productType = "com.apple.product-type.bundle"; - }; F5731AFC228B43570012B134 /* AppNexusNativeSDK */ = { isa = PBXNativeTarget; buildConfigurationList = F5731B04228B43570012B134 /* Build configuration list for PBXNativeTarget "AppNexusNativeSDK" */; @@ -1232,7 +1170,6 @@ projectDirPath = ""; projectRoot = ""; targets = ( - EC48177A1845046A0066BBFE /* AppNexusSDKResources */, 8A9AED8B1A1BE84F00C58BDA /* AppNexusSDK */, F5731AFC228B43570012B134 /* AppNexusNativeSDK */, ); @@ -1244,47 +1181,39 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8ADA36201A82A8D700AF65AA /* AppNexusSDKResources.bundle in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - EC4817791845046A0066BBFE /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8A4FF3A81A2F8AFE0000E4CC /* an_arrow_left.png in Resources */, - 8A4FF3A71A2F8AFE0000E4CC /* an_arrow_left@2x.png in Resources */, - 8A4FF3A41A2F8ACC0000E4CC /* an_arrow_left@3x.png in Resources */, - 8A4FF3AE1A2F8CE50000E4CC /* an_arrow_right.png in Resources */, - 8A4FF3AD1A2F8CE50000E4CC /* an_arrow_right@2x.png in Resources */, - 8A4FF3AA1A2F8CC10000E4CC /* an_arrow_right@3x.png in Resources */, - FC210A2E2007D529002A9F0E /* ANBrowserViewController.xib in Resources */, - FC210A312007D52C002A9F0E /* ANBrowserViewController_SizeClasses.xib in Resources */, - ECE4EB04194B76960069D934 /* ANInterstitialAdViewController.xib in Resources */, - ECE4EB05194B76960069D934 /* anjam.js in Resources */, - 8A3EC17019B8FDCA0049CD29 /* ANMRAID.bundle in Resources */, - 8AD618E31981C19100AC0780 /* appnexus_logo_icon.png in Resources */, - 8AD618E41981C19500AC0780 /* appnexus_logo_icon@2x.png in Resources */, - 609733141E42EB0B0061EC0A /* ASTMediationManager.js in Resources */, - 8A2F483D1A2E33B000B0EA05 /* compass.png in Resources */, - 8A4FF3A11A2F72D00000E4CC /* compass@2x.png in Resources */, - 8A6CD9271A96B2FD0060BCF4 /* compass@3x.png in Resources */, - ECE4EB06194B76960069D934 /* errors.strings in Resources */, - ECE4EB09194B76960069D934 /* interstitial_closebox.png in Resources */, - ECE4EB0A194B76960069D934 /* interstitial_closebox@2x.png in Resources */, - 60D39E112256EE430029F741 /* optionsparser.js in Resources */, - 8A6D2E8F1A44A751003CE77A /* interstitial_flat_closebox.png in Resources */, - 0E291F3722A075A300C9A851 /* nativeRenderer.html in Resources */, - 8A6D2E8E1A44A751003CE77A /* interstitial_flat_closebox@2x.png in Resources */, - 8A6D2E8D1A44A751003CE77A /* interstitial_flat_closebox@3x.png in Resources */, - 60AB328B1E521FE500429ED7 /* MobileVastPlayer.js in Resources */, - 0EEE97DB21764ACD007DADE6 /* omsdk.js in Resources */, - ECE4EB10194B76960069D934 /* sdkjs.js in Resources */, - ECE4EB0B194B76960069D934 /* UIButtonBarArrowLeft.png in Resources */, - ECE4EB0C194B76960069D934 /* UIButtonBarArrowLeft@2x.png in Resources */, - ECE4EB0D194B76960069D934 /* UIButtonBarArrowRight.png in Resources */, - ECE4EB0E194B76960069D934 /* UIButtonBarArrowRight@2x.png in Resources */, - 4F403A6E2043C91100EF75A2 /* vastVideo.html in Resources */, + 0E1421EA22F99AC9006C597A /* an_arrow_left@2x.png in Resources */, + 0E1421FC22F99AC9006C597A /* UIButtonBarArrowRight@2x.png in Resources */, + 0E1421FB22F99AC9006C597A /* UIButtonBarArrowRight.png in Resources */, + 0E14221922F99AFB006C597A /* omsdk.js in Resources */, + 0E14221522F99AE9006C597A /* ANMRAID.bundle in Resources */, + 0E1421F522F99AC9006C597A /* interstitial_closebox@2x.png in Resources */, + 0E14221C22F99B02006C597A /* vastVideo.html in Resources */, + 0E1421E922F99AC9006C597A /* an_arrow_left.png in Resources */, + 0E1421F922F99AC9006C597A /* UIButtonBarArrowLeft.png in Resources */, + 0E1421F022F99AC9006C597A /* appnexus_logo_icon@2x.png in Resources */, + 0E1421F322F99AC9006C597A /* compass@3x.png in Resources */, + 0E14221A22F99AFD006C597A /* sdkjs.js in Resources */, + 0E14221822F99AF3006C597A /* MobileVastPlayer.js in Resources */, + 0E14221222F99AD6006C597A /* ANBrowserViewController_SizeClasses.xib in Resources */, + 0E1421EB22F99AC9006C597A /* an_arrow_left@3x.png in Resources */, + 0E14221422F99AE7006C597A /* anjam.js in Resources */, + 0E1421EE22F99AC9006C597A /* an_arrow_right@3x.png in Resources */, + 0E1421EF22F99AC9006C597A /* appnexus_logo_icon.png in Resources */, + 0E1421ED22F99AC9006C597A /* an_arrow_right@2x.png in Resources */, + 0E14221722F99AEE006C597A /* errors.strings in Resources */, + 0E1421F122F99AC9006C597A /* compass.png in Resources */, + 0E14221D22F99B04006C597A /* nativeRenderer.html in Resources */, + 0E14221622F99AEC006C597A /* ASTMediationManager.js in Resources */, + 0E1421EC22F99AC9006C597A /* an_arrow_right.png in Resources */, + 0E14221B22F99AFF006C597A /* optionsparser.js in Resources */, + 0E14221322F99AE2006C597A /* ANInterstitialAdViewController.xib in Resources */, + 0E1421F622F99AC9006C597A /* interstitial_flat_closebox.png in Resources */, + 0E1421FA22F99AC9006C597A /* UIButtonBarArrowLeft@2x.png in Resources */, + 0E14221122F99AD4006C597A /* ANBrowserViewController.xib in Resources */, + 0E1421F722F99AC9006C597A /* interstitial_flat_closebox@2x.png in Resources */, + 0E1421F822F99AC9006C597A /* interstitial_flat_closebox@3x.png in Resources */, + 0E1421F422F99AC9006C597A /* interstitial_closebox.png in Resources */, + 0E1421F222F99AC9006C597A /* compass@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1293,9 +1222,24 @@ buildActionMask = 2147483647; files = ( F52F83142295DCA500F4578C /* ANBrowserViewController.xib in Resources */, + 0E1421FD22F99ACA006C597A /* an_arrow_left.png in Resources */, + 0E14220422F99ACA006C597A /* appnexus_logo_icon@2x.png in Resources */, + 0E14220622F99ACA006C597A /* compass@2x.png in Resources */, + 0E14220322F99ACA006C597A /* appnexus_logo_icon.png in Resources */, + 0E14220E22F99ACA006C597A /* UIButtonBarArrowLeft@2x.png in Resources */, + 0E1421FE22F99ACA006C597A /* an_arrow_left@2x.png in Resources */, + 0E14220222F99ACA006C597A /* an_arrow_right@3x.png in Resources */, + 0E14220022F99ACA006C597A /* an_arrow_right.png in Resources */, + 0E14220D22F99ACA006C597A /* UIButtonBarArrowLeft.png in Resources */, + 0E14220F22F99ACA006C597A /* UIButtonBarArrowRight.png in Resources */, F52F83152295DCA500F4578C /* ANBrowserViewController_SizeClasses.xib in Resources */, + 0E14220722F99ACA006C597A /* compass@3x.png in Resources */, + 0E14221022F99ACA006C597A /* UIButtonBarArrowRight@2x.png in Resources */, F52F83162295DCA500F4578C /* errors.strings in Resources */, + 0E14220122F99ACA006C597A /* an_arrow_right@2x.png in Resources */, F52F83172295DCA500F4578C /* omsdk.js in Resources */, + 0E1421FF22F99ACA006C597A /* an_arrow_left@3x.png in Resources */, + 0E14220522F99ACA006C597A /* compass.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1381,13 +1325,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - EC4817771845046A0066BBFE /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; F5731AF9228B43570012B134 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1439,14 +1376,6 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 8A9AEDAE1A1BE8AA00C58BDA /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = EC48177A1845046A0066BBFE /* AppNexusSDKResources */; - targetProxy = 8A9AEDAD1A1BE8AA00C58BDA /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin PBXVariantGroup section */ FC210A302007D529002A9F0E /* ANBrowserViewController.xib */ = { isa = PBXVariantGroup; @@ -1479,6 +1408,10 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = ( + "\"$(SRCROOT)/sourcefiles/Viewability\"/**", + "$(PROJECT_DIR)/sourcefiles/Viewability", + ); GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", @@ -1493,6 +1426,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/sourcefiles/Viewability/OMAppnexusSDK"; + MARKETING_VERSION = 6.1; MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = "corp.appnexus.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1516,6 +1450,10 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = ( + "\"$(SRCROOT)/sourcefiles/Viewability\"/**", + "$(PROJECT_DIR)/sourcefiles/Viewability", + ); GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; HEADER_SEARCH_PATHS = ( "$(PROJECT_DIR)/../sdk/Viewability/OMAppnexusSDK", @@ -1526,6 +1464,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/sourcefiles/Viewability/OMAppnexusSDK"; + MARKETING_VERSION = 6.1; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "corp.appnexus.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1644,43 +1583,6 @@ }; name = Release; }; - EC4817861845046A0066BBFE /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = NO; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = "$(PROJECT_DIR)/sourcefiles/Resources/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; - MACOSX_DEPLOYMENT_TARGET = 10.8; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - WRAPPER_EXTENSION = bundle; - }; - name = Debug; - }; - EC4817871845046A0066BBFE /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = NO; - GCC_PREFIX_HEADER = ""; - INFOPLIST_FILE = "$(PROJECT_DIR)/sourcefiles/Resources/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; - MACOSX_DEPLOYMENT_TARGET = 10.8; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - WRAPPER_EXTENSION = bundle; - }; - name = Release; - }; F5731B02228B43570012B134 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1702,6 +1604,10 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "\"$(SRCROOT)/sourcefiles/Viewability\"/**", + "$(PROJECT_DIR)/sourcefiles/Viewability", + ); GCC_C_LANGUAGE_STANDARD = gnu11; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../sdk/Viewability/OMAppnexusSDK"; @@ -1710,6 +1616,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/sourcefiles/Viewability/OMAppnexusSDK"; + MARKETING_VERSION = 6.1; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.appnexus.AppNexusNativeSDK; @@ -1742,6 +1649,10 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "\"$(SRCROOT)/sourcefiles/Viewability\"/**", + "$(PROJECT_DIR)/sourcefiles/Viewability", + ); GCC_C_LANGUAGE_STANDARD = gnu11; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../sdk/Viewability/OMAppnexusSDK"; @@ -1750,6 +1661,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/sourcefiles/Viewability/OMAppnexusSDK"; + MARKETING_VERSION = 6.1; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.appnexus.AppNexusNativeSDK; @@ -1782,15 +1694,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - EC4817851845046A0066BBFE /* Build configuration list for PBXNativeTarget "AppNexusSDKResources" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - EC4817861845046A0066BBFE /* Debug */, - EC4817871845046A0066BBFE /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; F5731B04228B43570012B134 /* Build configuration list for PBXNativeTarget "AppNexusNativeSDK" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/sdk/AppNexusSDK.xcodeproj/xcshareddata/xcschemes/AppNexusSDKResources.xcscheme b/sdk/AppNexusSDK.xcodeproj/xcshareddata/xcschemes/AppNexusSDKResources.xcscheme deleted file mode 100644 index f94ae436b..000000000 --- a/sdk/AppNexusSDK.xcodeproj/xcshareddata/xcschemes/AppNexusSDKResources.xcscheme +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sdk/AppNexusSDK/Info.plist b/sdk/AppNexusSDK/Info.plist index 3d33271b6..a051efed5 100644 --- a/sdk/AppNexusSDK/Info.plist +++ b/sdk/AppNexusSDK/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 6.0 + 6.1 CFBundleSignature ???? CFBundleVersion diff --git a/sdk/sourcefiles/ANInstreamVideoAd.h b/sdk/sourcefiles/ANInstreamVideoAd.h index 1d0f4cbff..106a19bcd 100644 --- a/sdk/sourcefiles/ANInstreamVideoAd.h +++ b/sdk/sourcefiles/ANInstreamVideoAd.h @@ -109,6 +109,10 @@ typedef NS_ENUM(NSInteger, ANInstreamVideoPlaybackStateType) - (void) playAdWithContainer: (nonnull UIView *)adContainer withDelegate: (nullable id)playDelegate; + + - (void) pauseAd; + + - (void) resumeAd; - (void) removeAd; diff --git a/sdk/sourcefiles/Resources/ANMRAID.bundle/mraid.js b/sdk/sourcefiles/Resources/ANMRAID.bundle/mraid.js index 6e680bbe1..fb0fb1af2 100644 --- a/sdk/sourcefiles/Resources/ANMRAID.bundle/mraid.js +++ b/sdk/sourcefiles/Resources/ANMRAID.bundle/mraid.js @@ -53,6 +53,12 @@ allowOrientationChange: true, forceOrientation: "none" }; + + var currentAppOrientation = { + orientation: "none", + locked: false + }; + var resize_properties = { customClosePosition: 'top-right', allowOffscreen: true @@ -81,6 +87,7 @@ var MRAID_MAX_SIZE = "maxSize"; var MRAID_DEFAULT_POSITION = "defaultPosition"; var MRAID_CURRENT_POSITION = "currentPosition"; + var MRAID_CURRENT_APP_ORIENTATION = "currentAppOrientation"; // ----- MRAID AD API FUNCTIONS ----- @@ -274,24 +281,34 @@ return orientation_properties; } + mraid.getCurrentAppOrientation = function() { + return currentAppOrientation; + } + // Takes an object... {allowOrientationChange:true, forceOrientation:"none"}; mraid.setOrientationProperties = function(properties) { + if (mraid.getState() == "loading") { + mraid.util.errorEvent("Method 'mraid.setOrientationProperties()' called during loading state.", "mraid.setOrientationProperties()"); + return; + } + if (typeof properties === "undefined") { mraid.util.errorEvent("Invalid orientationProperties.", "mraid.setOrientationProperties()"); return; - } else { - + } + + if (!mraid.getCurrentAppOrientation().locked) { if (properties.forceOrientation === 'portrait' || properties.forceOrientation === 'landscape' || properties.forceOrientation === 'none') { orientation_properties.forceOrientation = properties.forceOrientation; } else { mraid.util.errorEvent("Invalid orientationProperties forceOrientation property", "mraid.setOrientationProperties()"); } + } - if (typeof properties.allowOrientationChange === "boolean") { - orientation_properties.allowOrientationChange = properties.allowOrientationChange; - } else { - mraid.util.errorEvent("Invalid orientationProperties allowOrientationChange property", "mraid.setOrientationProperties()"); - } + if (typeof properties.allowOrientationChange === "boolean") { + orientation_properties.allowOrientationChange = properties.allowOrientationChange; + } else { + mraid.util.errorEvent("Invalid orientationProperties allowOrientationChange property", "mraid.setOrientationProperties()"); } if ((typeof window.sdkjs) !== "undefined") { @@ -339,6 +356,7 @@ return supports[feature]; } + // Gets the screen size of the device mraid.getScreenSize = function() { if (mraid.getState() == "loading") { @@ -543,5 +561,12 @@ window.sdkjs.mraidUpdateProperty(MRAID_CURRENT_POSITION, current_position); } } - + + mraid.util.setCurrentAppOrientation = function(orientation,locked) { + currentAppOrientation.orientation = orientation; + currentAppOrientation.locked = locked; + if ((typeof window.sdkjs) !== "undefined") { + window.sdkjs.mraidUpdateProperty(MRAID_CURRENT_APP_ORIENTATION, currentAppOrientation); + } + } }()); diff --git a/sdk/sourcefiles/Resources/MobileVastPlayer.js b/sdk/sourcefiles/Resources/MobileVastPlayer.js index fa43f4478..259090001 100644 --- a/sdk/sourcefiles/Resources/MobileVastPlayer.js +++ b/sdk/sourcefiles/Resources/MobileVastPlayer.js @@ -37,19 +37,19 @@ Permission is here by granted, free of charge, to any person obtaining a copy of 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){function t(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return e[i].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){function i(e,t){if(!e)return null;for(var n=0;n0){var r=Number(i.substring(0,i.length-2));t-=2*r,n-=2*r}k.style.width=t+"px",k.style.height=n+"px";var a=u(T);e("repositionPlayer: targetDiv absolute posiotion ="+a.left+", "+a.top),k.style.left=a.left+"px",k.style.top=a.top+"px",e("repositionPlayer: size = "+t+", "+n),S.overlayPlayer?N.resizePlayer(t,n):N.resizeVideo(null,!1,null)}}function a(t){e("Resize event happend"),k&&N&&(O?(O=!1,S.fitInContainer&&(k.style.zIndex=R),setTimeout(function(){r(),"click"!==S.initialPlayback&&N.play()},100)):r()),G&&G(t)}function c(t){switch(e("Got notification: "+t),t){case"leaveFullscreen":q();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 p(){var t,n=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(o){return[0,0,0]}};try{t=n()[0]>=8&&S.enableInlineVideoForIos===!0}catch(i){e(i)}return t}function h(e){var t=document.defaultView.getComputedStyle(e,null).zIndex;return"auto"!==t?t:0}function m(e,t){if(!e.children)return t;for(var n=Math.max(t,h(e)),i=0;i-1||navigator.appVersion.indexOf("Android")>-1}function y(){return navigator.userAgent.indexOf("Chrome")>-1}function A(){var e=navigator.appVersion.indexOf("Chrome/");if(e>=0){var t=navigator.appVersion.substr(e+7);return e=t.indexOf("."),e>0?Number(t.substr(0,e)):0}return 0}function b(n,i,r){e("play function called"),P=!1,j=3e3,S.vpaidTimeout&&(j=S.vpaidTimeout),x=null,_=!1,V=!1,r&&(_=r),i&&(x=function(e,t){t=t?t:{};var n={event:e,params:t};i(n)}),v()&&(S.showFullScreenButton===!0?S.allowFullscreen=!0:S.allowFullscreen=!1),f()&&(S.enableInlineVideoForIos=!1),e("options before PlayerDefaultOption: ",JSON.stringify(S)),S=s(S),e("options after PlayerDefaultOption: ",JSON.stringify(S)),S.width=n.offsetWidth,S.height=n.offsetHeight;var a=n.style.borderWidth;if(a&&a.length>0){var l=Number(a.substring(0,a.length-2));S.width-=2*l,S.height-=2*l}S.playerHeight=S.height,p()&&(S.playerHeight-=30),o()&&(S.fullscreenMode=!0),e("offsetWidth="+n.offsetWidth+", offsetHeight="+n.offsetHeight+", borderWidth="+n.style.borderWidth);var h=document.createElement("div");h.style.width=S.width+"px",S.fitInContainer?h.style.height=S.height+"px":S.cachePlayer&&S.overlayPlayer?h.style.height="1px":h.style.height=S.height+"px",h.style.backgroundColor="black",h.id=n.id+"_overlay_"+(new Date).getTime();var b=u(n);e("targetDiv absolute posiotion ="+b.left+", "+b.top),h.style.position="absolute",h.style.left=b.left+"px",h.style.top=b.top+"px",S.fitInContainer?h.style.zIndex=Math.max(100,m(n,0)+1):(R=Math.max(100,m(n,0)+1),S.cachePlayer&&S.overlayPlayer?h.style.zIndex=0:h.style.zIndex=R),n.appendChild(h),e("player container offsetLeft = "+h.offsetLeft+", offsetTop = "+h.offsetTop),k=h,T=n,E=(new Date).getTime(),e("timeToReady = "+j+", start time = "+E),C=setTimeout(function(){P||(z(!1),x&&x("Timed-out",{}))},j);var w=function(n,i){e("VastPlayer > cbRenderVideo called");try{e("VastPlayer > cbRenderVideo options: ",JSON.stringify(i))}catch(o){}t(i)};I.cbRenderVideo=w,I.cbWhenDestroy=z,I.cbWhenReady=J,I.cbWhenQuartile=U,I.cbWhenVideoComplete=F,I.cbWhenSkipped=B,I.cbWhenFullScreen=W,I.cbWhenAudio=$,I.cbWhenClickOpenUrl=H,I.cbCoreVideoEvent=L,S.playerNotification=c,S.overlayPlayer&&(S.hasOwnProperty("allowFullscreen")||(S.allowFullscreen=!1)),e("VP >> before options.initialAudio = "+S.initialAudio),"auto"===S.initialPlayback&&"on"===S.initialAudio&&g()&&y()&&A()>=53&&(S.showMute=!0,S.showVolume=!0),e("VP >> after options.initialAudio = "+S.initialAudio),d(k,S,I)}e("VERSION 1.4.15");var k,T,w,E,S={},I={},C=null,P=!1,j=3e3,x=null,_=!1,V=!1,D=null,M=!1,N=null,O=!1,R=0,U=function(t){e("VastPlayer > cbWhenQuartile "+t),x(t,{})},L=function(e,t){var n={type:e,name:t};if("AdHandler"===n.type&&"video_impression"===n.name)try{var i=new CustomEvent("outstream-impression");k.dispatchEvent(i)}catch(o){error(o)}for(var r=[{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"}],a=0;a cbWhenVideoComplete "+t),x(t,{})},B=function(t){e("VastPlayer > cbWhenSkipped "+t),x(t,{})},$=function(t){e("VastPlayer > cbWhenAudio "+t),x(t,{})},H=function(e){x(e,{})},W=function(t){e("VastPlayer > cbWhenFullScreen "+t),x(t,{})},z=function(t,n,i){e("VastPlayer > cbTerminate isError: "+t);var r="unknown";k&&(r=k.id.toString()),e("VastPlayer > cbTerminate: bTerminated = "+V+", targetElement id = "+r),M=!1,V||(V=!0,n||q(),!i&&o()&&S.overlayPlayer&&q(),k&&(N&&(N.isPlayingVideo&&(e("VastPlayer > cbTerminate: pause ad"),N.pause()),k.style.height="1px",N.resizePlayer(1,1)),setTimeout(function(){k&&(k.innerHTML="",T.removeChild(k)),k=null},2e3)),x&&t&&x("video-error",{}))},q=function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()},J=function(t){var n,i,r,a,s;n=t&&t.options&&t.options.video&&t.options.video.url?t.options.video.url:"",i=t&&t.options&&t.options.data&&t.options.data.vastDurationMsec?t.options.data.vastDurationMsec:0,r=t&&t.options&&t.options.finalVastXml?t.options.finalVastXml:"",a=t&&t.options&&t.options.finalVastUri?t.options.finalVastUri:"",s=t&&t.getFinalAspectRatio()?t.getFinalAspectRatio():"",V||(P=!0,N=t,e("VastPlayer > cbWhenReady in "+((new Date).getTime()-E)+" msecs"),x&&x("adReady",{creativeUrl:n,duration:i,vastXML:r,vastCreativeUrl:a,aspectRatio:s}),"click"===S.initialPlayback||S.cachePlayer||(o()&&S.overlayPlayer?S.forceAdInFullscreen?(O=!0,q()):(k&&(k.style.width="1px",k.style.height="1px"),z(!1,!0,!0)):N.play()))},G=null;document.body.onresize&&(G=document.body.onresize),window.onresize=a,this.playVast=function(t,n,o,r,a){e("VP >> playVast function called playerId = "+this.vastPlayerId),z(!1,!0),i(),S=n,S.vastXml=o,b(t,r,a)},this.playAdObject=function(t,n,o,r,a){e("VP >> playAdObject function called playerId = "+this.vastPlayerId+", cache mode = "+n.cachePlayer),z(!1,!0),i(),S=n,"string"==typeof o?S.vastXml=o:(S.useAdObj=!0,S.adObj=o),b(t,r,a)},this.stop=function(){C&&(clearTimeout(C),C=null),z(!1)},this.removeFromPage=function(){C&&(clearTimeout(C),C=null),V=!0,k&&(k.innerHTML="",T.removeChild(k),k=null)},this.play=function(){e("VP >> play function called playerId = "+this.vastPlayerId),N&&(S.cachePlayer=!1,o()&&S.overlayPlayer?S.forceAdInFullscreen?(O=!0,q()):z(!1,!0,!0):(k&&S.fitInContainer===!1&&(k.style.zIndex=R),r(),"click"!==S.initialPlayback&&N.play()))},this.sendPlay=function(){e("VP >> sendPlay function called playerID = "+this.vastPlayerId),N&&!N.isPlayingVideo&&N.play()},this.sendPause=function(){e("VP >> sendPause function called playerID = "+this.vastPlayerId),N&&N.isPlayingVideo&&N.pause()},this.handleFullscreen=function(e){N&&(e?T.requestFullscreen?T.requestFullscreen():T.webkitRequestFullscreen?T.webkitRequestFullscreen():T.mozRequestFullScreen?T.mozRequestFullScreen():T.msRequestFullscreen&&T.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 V},this.getIsVideoPlaying=function(){var e=!(!N||!N.isPlayingVideo);return e},this.getCurrentPlayHeadTime=function(){var e=0;return w&&w.adVideoPlayer&&"function"==typeof w.adVideoPlayer.player&&(e=1e3*w.adVideoPlayer.player().currentTime(),e=parseInt&&"function"==typeof parseInt?parseInt(e):e),e}};e.exports={playAdObject:function(e,t,n,i,o){var a=r(t.targetElementId,t.cachePlayer);a&&a.playAdObject(e,t,n,i,o)},playVast:function(e,t,n,i,o){var a=r(t.targetElementId);a&&a.playVast(e,t,n,i,o)},loadAndPlayVast:function(e,t,i,o,a){var s=n(29);s.load(i,function(s,l){if(s||0===l.length){var d=n(28);d.logDebug("Failed to load "+i,"Vast Video Player")}else{var c=r(t.targetElementId);c&&c.playVast(e,t,l,o,a)}})},stop:function(e,t){var n=o(e.id,t);n&&n.stop()},removeFromPage:function(e){var t=o(e);t&&t.removeFromPage()},play:function(e,t){var n=i(e,t);n&&n.play()},sendPlay:function(e){var t=o(e);t&&t.sendPlay()},sendPause:function(e){var t=o(e);t&&t.sendPause()},handleFullscreen:function(e,t){var n=o(e);n&&n.handleFullscreen(t)},getCurrentPlayHeadTime:function(e){var t=o(e);if(t)return t.getCurrentPlayHeadTime()},getIsVideoPlaying:function(e){var t=o(e);if(t)return t.getIsVideoPlaying()}}},function(e,t){var n=function(e){function t(e){return"object"==typeof e}function n(e){return null===e}function i(e){var o,r,a;for(r=1;r-1},T=["AdPaused","AdVolumeChange"],w=["AdLoaded","AdStopped","AdSkippableStateChange","AdLinearChange","AdDurationChange","AdRemainingTimeChange","AdLog","AdError"],E=1,S=402,I=900,C=405,P={initialPlayback:"auto",initialAudio:"off",skippable:{enabled:!0,allowOverride:!1,videoThreshold:15,videoOffset:5,skipLocation:"top-left",skipText:"Video can be skipped in %%TIME%% seconds",skipButtonText:"SKIP"},adText:"Ad",showMute:!0,showVolume:!0,showProgressBar:!0,showPlayToggle:!0,showBigPlayButton:!0,allowFullscreen:!0,playerSkin:{customPlayerSkin:"",controlBarHeight:30,topDividerColor:"#606060",bottomDividerColor:"#606060",topDividerWidth:1,bottomDividerWidth:1,videoBackgroundColor:"#000000"},disableCollapse:{enabled:!1,replay:!1},endCard:{enabled:!1,clickable:!0,color:"",imageUrl:"",imageWidth:"",imageHeight:"",showCompanion:!0},enableInlineVideoForIos:!0,delayExpandUntilVPAIDInit:!1,delayExpandUntilVPAIDImpression:!1,flash:{swf:"http://acdn.adnxs.com/video/player/vastPlayer/AppnexusFlashPlayer.swf"},vpaidTimeout:5e3,waterfallTimeout:3e4,waterfallSteps:-1,fixedSizePlayer:!0,disableTopBar:!1,sideStream:{enabled:!1,position:"bottom-right",xOffset:0,yOffset:0,space:"empty",dynamicBigPlayButtonOnSideStream:!0},sideStreamObject:{},preloadInlineAudioForIos:!1,controlBarPosition:"over",customPlayerSkinCss:"",customButton:{enabled:!1,url:"",altText:"",imageSrc:"",imgWidth:50,imgHeight:30},enableNativeInline:!1,androidDSOverride:!1,cbNotification:function(){},parentIframeIsModal:!1,learnMore:{enabled:!1,clickToPause:!0,text:"Learn More",separator:"-"},playerContextId:"anadvideoplayer",data:{skipOffset:"",durationMsec:null,skipOffsetMsec:null,isVastVideoSkippable:!1,vastProgressEvent:{},vastDurationMsec:null,adIcons:null},test:function(){}},j={externalNameOfVideoPlayer:f,videoPlayerObj:i,autoplayHandler:h,mobileSupport:h,customSkinning:u,options:{},adVideoPlayer:{},callbackForAdUnit:{},vpaidData:{},iframeVideoWrapper:{},isPlayingVideo:!1,isDoneInitialPlay:!1,isFullscreen:!1,heightOffset:0,explicitPaused:!1,aspectRatio:0,finalAspectRatio:0,videoObjectId:{},isViewable:!1,isSkipped:!1,isCompleted:!1,isMuted:!1,isExplicitMuted:!1,hasBeenUnmuted:!1,isChrome:navigator.userAgent.indexOf("Chrome")>-1,videojs_vpaid:r,overlayPlayer:!1,forceToSkip:!1,ExtendDefaultOption:a,delayEventHandler:null,pausedByViewability:!1,mutedByVisibility:!1,gotAdImpressionForFlash:!1,gotAdStartedForFlash:!1,isReadyToExpandForMobile:!1,isAlreadyPlaingForVPAID:!1,isSideStreamActivated:!1,isExpanded:!0,isVideoCompleteInjected:!1,isFullscreenToggled:!1,toggleWindowFocus:!0,viewabilityTracking:null,isDoneFirstLoadStart:!1,flashBlockerTimeout:null,startedReplay:!1,Utils:l,isAlreadyStart:!1,isEnded:!1,blockTrackingUserActivity:!1,videoId:"",divIdForVideo:"",init:function(e){var t=a(P,e);return this.options=t,"boolean"==typeof this.options.disableCollapse&&(this.options.disableCollapse={enabled:this.options.disableCollapse,replay:!1}),this.options.skippable.allowOverride===!0&&(this.options.skippable.videoThreshold=0,this.options.skippable.enabled=!0),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(n){b(n)}return t},decidePlayer:function(e){var t="",n="flash",i="html5",o=function(){var e=navigator.appVersion.indexOf("Mobile"),t=navigator.appVersion.indexOf("Android");return e>-1||t>-1},r=this.options.playerTechnology;if(r&&r.length&&1===r.length)switch(e){case 1:t=i;break;case 2:t=n;break;case 0:t=r[0]===i?i:n}if(r&&r.length&&2===r.length)switch(e){case 1:t=i;break;case 2:t=n;break;case 0:t=i}return o()&&(t=i),t},buildPlayer:function(e,t){var n=this;if(t.waterfallStepId&&A("CHECKING AUTOPLAY FOR WATERFALL STEP: "+t.waterfallStepId),"html5"===this.decidePlayer(t.requiredPlayer)&&this.autoplayHandler&&!t.overlayPlayer){var i,o=function(i){var o=n.autoplayHandler.videoPolicy;switch(i){case o.allowAutoplay:break;case o.stopMediaWithSound:"on"===t.initialAudio?("auto"!==t.initialPlayback&&"mouseover"!==t.initialPlayback||(t.initialAudio="off",t.audioOnMouseover=!1),t.isWaterfall===!0&&(t.adAttempt>0?(t.initialAudio="off",t.audioOnMouseover=!1):t.audioOnMouseover=!0)):"auto"!==t.initialPlayback&&"mouseover"!==t.initialPlayback||(t.audioOnMouseover=!1);break;case o.neverAutoplay:t.initialPlayback="click",t.isWaterfall&&(t.isWaterfall=!1,t.stopWaterfall=!0)}t.waterfallStepId&&A("BUILDING PLAYER FOR WATERFALL STEP: "+t.waterfallStepId),n.buildPlayerCallback(e,t)};i=!h.isMobile()&&("on"===t.initialAudio||t.audioOnMouseover===!0),n.autoplayHandler.getAutoplayPolicy(o,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)),k()&&"flash"===this.decidePlayer(this.options.requiredPlayer)||this.options.targetElement&&!this.options.firstAdAttempted&&(this.options.targetElement.style.visibility="hidden"),"flash"===this.decidePlayer(this.options.requiredPlayer)&&(this.options.disableCollapse.replay=!1);var n=(new Date).getTime()+Math.floor(1e4*Math.random()),i="APNVideo_Player_"+n;this.externalNameOfVideoPlayer=i,o(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)){A("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){b(e)}}},replay:function(){this.isEnded&&(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&&this.options.sideStream.wasEnabled===!0&&(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()))},actualPlayByVideoJS:function(){this.adVideoPlayer.play(),this.options.vpaid&&this.adVideoPlayer.trigger("handleManualUserInActive")},play:function(){if(this.isEnded!==!0){var e=h.isMobile()&&h.iOSversion()[0]>=10&&this.options.enableInlineVideoForIos===!1;if(e){var t=this;t.overlayPlayer?t.options.targetElement.style.overflow="":setTimeout(function(){t.options.targetElement.style.overflow=""},t.options.expandTime)}this.isAlreadyPlaingForVPAID=!0,this.isCompleted||(A("play video"),this.isDoneInitialPlay?"html5"===this.decidePlayer(this.options.requiredPlayer)?this.isPlayingVideo||this.dispatchEventToAdunit({name:"video_resume"}):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.adVideoPlayer.trigger("play"):this.options.vpaid&&this.options.overlayPlayer&&navigator.appVersion.indexOf("Android")>-1&&this.options.enableWaterfall&&!this.isDoneInitialPlay?this.adVideoPlayer.trigger("play"):this.actualPlayByVideoJS(),"html5"===this.decidePlayer(this.options.requiredPlayer)||(this.isPlayingVideo=!0),this.isDoneInitialPlay=!0,this.isEnded=!1)}},resetVpaid:function(){this.dispatchEventToAdunit({name:"reset"})},pause:function(){this.isPlayingVideo&&(A("pause video"),this.adVideoPlayer.pause(),this.options.vpaid&&this.adVideoPlayer.trigger("handleManualUserActive"),this.isCompleted||this.isEnded||this.dispatchEventToAdunit({name:"video_pause"}))},explicitPause:function(){A("explicit pause video"),this.explicitPaused=!0,this.pause()},explicitPlay:function(){A("explicit play video"),this.explicitPaused=!1,this.play()},mute:function(){this.isMuted||(A("mute audio"),"html5"===this.decidePlayer(this.options.requiredPlayer)?(this.adVideoPlayer.muted(!0),this.dispatchEventToAdunit({name:"video_mute"})):this.adVideoPlayer.mute(),this.isMuted=!0)},explicitMute:function(){A("explicit mute video"),this.isExplicitMuted=!0,this.mute()},unmute:function(){!this.isExplicitMuted&&this.isMuted&&(A("unmute audio"),"html5"===this.decidePlayer(this.options.requiredPlayer)?(this.adVideoPlayer.muted()===!0&&this.adVideoPlayer.muted(!1),(this.isMuted||"off"===this.options.initialAudio)&&this.dispatchEventToAdunit({name:"video_unmute"})):(this.adVideoPlayer.unmute(),this.hasBeenUnmuted=!0),this.isMuted=!1)},explicitUnmute:function(){this.isExplicitMuted=!1,this.unmute()},resizeVideoWithDimensions:function(e,t){var n=this;this.options.width=e,this.options.height=t,n.resizeVideo(n.aspectRatio)},mouseIn:function(){this.adVideoPlayer.mouseIn()},mouseOut:function(){this.adVideoPlayer.mouseOut()},destroy:function(e,t){this.isPlayingVideo=!1,this.adVideoPlayer.pause(),this.isCompleted===!1&&(this.options.vpaid===!1?this.dispatchEventToAdunit({name:"video_skip"}):this.options.vpaid===!0&&this.isSkipped===!1&&this.dispatchEventToAdunit({name:"video_skip"})),"function"==typeof this.callbackForAdUnit.cbWhenSkipped&&this.callbackForAdUnit.cbWhenSkipped("video-skip"),this.isSkipped=!0,this.verificationManager&&this.verificationManager.destroy(),A("destroy");var n=I;"function"==typeof this.callbackForAdUnit.cbWhenDestroy&&(this.overlayPlayer?e&&t?this.callbackForAdUnit.cbWhenDestroy({type:E,code:n,message:t},!0,this.options):this.callbackForAdUnit.cbWhenDestroy(null,!0,this.options):e&&t?this.callbackForAdUnit.cbWhenDestroy({type:E,code:n,message:t},null,this.options):this.callbackForAdUnit.cbWhenDestroy(null,null,this.options))},destroyWithoutSkip:function(e,t,n,i){try{var o=this,r=function(){o.isPlayingVideo=!1,o.adVideoPlayer&&o.adVideoPlayer.pause&&"function"==typeof o.adVideoPlayer.pause&&o.adVideoPlayer.pause(),o.verificationManager&&o.verificationManager.destroy(),A("destroy without skip: "+o.options.iframeVideoWrapperId);var r=i||I;"function"==typeof o.callbackForAdUnit.cbWhenDestroy&&(o.overlayPlayer?e&&t?(n&&(r=S),o.callbackForAdUnit.cbWhenDestroy({type:E,code:r,message:t},!0,o.options)):o.callbackForAdUnit.cbWhenDestroy(null,!0,o.options):e&&t?(n&&(r=S),o.callbackForAdUnit.cbWhenDestroy({type:E,code:r,message:t},null,o.options)):o.callbackForAdUnit.cbWhenDestroy(null,null,o.options))};o.options.disableCollapseForDelay&&o.options.disableCollapseForDelay>0?setTimeout(r,o.options.disableCollapseForDelay):r()}catch(a){b("failed to destroy/notify by "+a)}},getVideoObject:function(){return this.adVideoPlayer},handleFlashPlay:function(){var e=this,t=function(){e.resizeVideo(e.aspectRatio),A("flash player is ready to play"),e.callbackForAdUnit.cbWhenReady&&e.callbackForAdUnit.cbWhenReady(e)};e.isChrome?(e.setChromeSize(),setTimeout(t,100)):t()},handlePlayerNotification:function(e){"video_time"!==e.name&&A("Got notification from player = "+e.name);var t=this,n={flash_is_respondble:function(){t.flashBlockerTimeout&&(clearTimeout(t.flashBlockerTimeout),t.flashBlockerTimeout=null),A("Flash is respondble")},canplay:function(){if(t.flashBlockerTimeout&&(clearTimeout(t.flashBlockerTimeout),t.flashBlockerTimeout=null,A("Flash is respondble")),t.options.hasOwnProperty("overlayPlayer"))try{t.adVideoPlayer.setDOMPlayerIdAndSize(t.adVideoPlayer.id,t.options.width,t.options.height)}catch(n){A("Failed to execute setDOMPlayerIdAndSize(...) on Flash Player")}if(t.options.vpaid)try{var i=t.adVideoPlayer.getCompanionsXml();i&&i.length>0&&(e.companionAds=i)}catch(o){}t.options.vpaid&&t.options.delayExpandUntilVPAIDImpression?t.actualPlayByVideoJS():t.handleFlashPlay()},video_failed:function(){t.flashBlockerTimeout&&(clearTimeout(t.flashBlockerTimeout),t.flashBlockerTimeout=null,A("Flash is respondble")),t.destroyWithoutSkip(!0,m,null,C)},video_timeout:function(){t.destroyWithoutSkip(!0,m,!0,S)},video_bitrate:function(){var t=e.bandwidth;A("bandwidth from flash : "+t)},video_impression:function(){},video_mute:function(){e.hasOwnProperty("value")&&!e.value&&(e.name="video_unmute"),e.hasOwnProperty("value")&&(t.isMuted=e.value)},video_click:function(){e.hasOwnProperty("playerHandles")?e.playerHandles?e.hasOwnProperty("url")&&e.url.length>0?t.click(e.url):t.click():t.dispatchEventToAdunit({name:"ad-click",trackClick:!0}):t.click()},video_complete:function(){t.isCompleted=!0,t.options.disableCollapse.enabled||t.destroyWithoutSkip()},video_fullscreen:function(){t.isFullscreen?setTimeout(function(){t.isFullscreen=!t.isFullscreen},1e3):t.isFullscreen=!t.isFullscreen},quartile_event:function(){},video_pause:function(){},video_start:function(){t.isDoneInitialPlay||"auto"===t.options.initialPlayback||t.play()},video_time:function(){},video_resume:function(){},video_stopped:function(){t.destroyWithoutSkip()},video_skipped:function(){t.destroy()},video_ratio:function(){},video_heightOffset:function(){t.heightOffset=e.heightOffset},video_paused_by_user:function(){t.explicitPause()},video_resumed_by_user:function(){A("received video_resumed_by_user from Flash"),t.requiredForFlashVpaid()?t.isVpaidFlashVideoPlaying===!1?(A("call explicitPlay by video_Resumed_by_user event"),t.explicitPlay()):A("do nothing because of isVpaidFlashVideoPlaying:true"):t.explicitPlay()},video_progress:function(){if(e&&e.offset)return void t.dispatchEventToAdunit({name:e.offset},function(){A("handle video_progress by flash : "+e.offset)})}};if(t.isDoneInitialPlay||"video_mute"!==e.name){var i=n[e.name];i&&void 0!==i&&i(),"video_pause"!==e.name&&"video_resume"!==e.name&&"video_impression"!==e.name&&"video_start"!==e.name&&"video_failed"!==e.name&&"video_timeout"!==e.name&&this.dispatchEventToAdunit(e),"video_impression"!==e.name&&"video_start"!==e.name||!t.options.vpaid||this.dispatchEventToAdunit(e)}},handleOverlayNotification:function(e){A("Got overlay notification from player = "+e.name);var t=this,n={leaveFullscreen:function(){t.options.hasOwnProperty("playerNotification")&&t.options.playerNotification("leaveFullscreen")}},i=n[e.name];i&&void 0!==i&&i()},requiredForFlashVpaid:function(){return"flash"===this.decidePlayer(this.options.requiredPlayer)&&this.options.vpaid===!0},notifyVpaidEvent:function(e){var t=this;if(t.requiredForFlashVpaid()&&("AdPaused"===e&&(A("received VPAID AdPaused from Flash"),t.isVpaidFlashVideoPlaying=!1,t.isPlayingVideo=!1,A("set isVpaidFlashVideoPlaying = false"),A("set isPlayingVideo = false")),"AdPlaying"===e&&(A("received VPAID AdPlaying from Flash"),t.isVpaidFlashVideoPlaying=!0,t.isPlayingVideo=!0,A("set isVpaidFlashVideoPlaying = true"),A("set isPlayingVideo = true"))),"flash"===t.decidePlayer(t.options.requiredPlayer)&&t.options.delayExpandUntilVPAIDImpression&&("AdVideoStart"===e&&t.adVideoPlayer.pause(),"AdImpression"===e&&(t.gotAdImpressionForFlash=!0),"AdStarted"===e&&(t.gotAdStartedForFlash=!0),t.gotAdImpressionForFlash&&t.gotAdStartedForFlash&&(t.handleFlashPlay(),t.gotAdImpressionForFlash=!1,t.gotAdStartedForFlash=!1)),!(t.options.delayExpandUntilVPAIDImpression&&t.delayEventHandler.isSuppress&&T.indexOf(e)>=0)){if("AdVolumeChange"===e){var n="html5"===this.decidePlayer(this.options.requiredPlayer);if(n){var i=t.adVideoPlayer.player().muted(),o=t.adVideoPlayer.player().volume();i?i&&(A("set VPAID AdVolumeChange video_mute"),this.dispatchEventToAdunit({name:"video_mute"})):o>0&&(A("set VPAID AdVolumeChange video_unmute"),this.dispatchEventToAdunit({name:"video_unmute"}))}}w.indexOf(e)>=0||w.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)return void this.play();this.isIosInlineRequired()===!1&&(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[0]){n=!0;var o=this.options.clickUrls[0];window.open(o)}"undefined"!=typeof t&&t!==!0||this.dispatchEventToAdunit({name:"ad-click",trackClick:n})},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&&this.options.viewability.config,o=e&&e.name?e.name:null;"fullscreenchange"!==o&&"video_fullscreen"!==o||(o=this.isFullscreen?"fullscreen":"exitFullscreen"),n||"video_duration"!==o||(this.isAlreadyStart=!0);var r=function(){var i;i=n?this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player&&this.adVideoPlayer.player().duration():e.duration,(!i||void 0===i||i<=0)&&(i=-2),i===-2&&(this.options&&this.options.data&&this.options.data.vastDurationMsec?(i=this.options.data.vastDurationMsec/1e3,(!i||null===i||i<=0)&&(i=-2)):i=-2);var r=this.options.width,a=this.options.height;if(this.viewabilityTracking.init(this.options,i,r,a,t),n)if(this.options.expandable)this.options.vpaid===!0&&"video_start"===o&&this.viewabilityTracking.invokeEvent("expand"),this.options.vpaid===!1&&"loadstart"===o&&this.viewabilityTracking.invokeEvent("expand"),this.viewabilityTracking.invokeEvent(o);else{if(this.options.overlayPlayer&&l.isMobile()&&this.options.delayStartViewability)return;this.viewabilityTracking.invokeEvent(o)}else this.isAlreadyStart&&(this.options.expandable&&this.viewabilityTracking.invokeEvent("expand"),this.viewabilityTracking.invokeEvent("video_start"))},a=function(){if(this.viewabilityTracking&&this.viewabilityTracking.isReady){ -if(n===!1&&"expand"===o&&this.options.expandable)return;"force_start_viewability"===o&&this.options.delayStartViewability?(this.options.delayStartViewability=!1,this.viewabilityTracking.invokeEvent("video_start")):this.viewabilityTracking.invokeEvent(o)}};if(o&&i){var s=this.blockTrackingUserActivity&&("video_resume"===o||"video_pause"===o||"video_mute"===o||"video_unmute"===o);s||(o===t?r.apply(this):a.apply(this))}},findPathForViewability:function(e){var t,n="html5"===this.decidePlayer(this.options.requiredPlayer);if(n){if(t=!this.options.expandable||"undefined"!=typeof this.options.isExpanded&&this.options.isExpanded!==!1?"video_start":"expand",e&&e.name&&e.name===t){if(this.isDoneFirstLoadStart)return;this.isDoneFirstLoadStart=!0}this.handleViewability(e,t,n)}else{if(t="video_duration",e&&"video_start"===e.name)return;e&&e.name&&e.name===t?this.isDoneFirstLoadStart||(this.isDoneFirstLoadStart=!0,this.handleViewability(e,t,n)):this.handleViewability(e,t,n)}},dispatchEventToAdunit:function(e,t){var n=this;if("video_start"===e.name&&n.iframeVideoWrapper.contentDocument){var i=n.iframeVideoWrapper.contentDocument.getElementById(n.divIdForVideo),o=n.iframeVideoWrapper.contentDocument.getElementById(n.videoId);i.style.background=n.options.playerSkin.videoBackgroundColor,o.style.background=n.options.playerSkin.videoBackgroundColor,h.isIOS()&&n.isIosInlineRequired()&&(o.style.opacity=0)}if("video_complete"===e.name&&(void 0===e.obj&&(e.obj={}),e.obj.videoAdPending=this.options.disableCollapse.replay),"video_fullscreen"===e.name&&"flash"===this.decidePlayer(this.options.requiredPlayer)?setTimeout(function(){var t={name:e.name,user:e.user,value:e.value};n.findPathForViewability(t)},1500):this.findPathForViewability(e),(this.startedReplay===!0||this.isEnded)&&this.options.disableCollapse.replay===!0)if(this.startedReplay===!1&&"rewind"===e.name);else{if("video_complete"===e.name&&"function"==typeof t)return void t();if("ad-click"!==e.name&&e.name.indexOf("IconClick")===-1)return void this.callbackForAdUnit.cbForHandlingDispatchedEvent(e,!0)}"video_skip"===e.name&&c.pushAndCheck(this.options.targetElement.id+"_dispatchEventToAdunit",e.name)===!1||"video_complete"===e.name&&this.isVideoCompleteInjected===!0&&this.options.disableCollapse.replay===!1||(e&&"video_time"!==e.name&&A("(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&&A("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);"function"==typeof t&&t();var i=this.blockTrackingUserActivity&&("video_resume"===e.name||"video_pause"===e.name||"video_mute"===e.name||"video_unmute"===e.name);if(i||(e.player=this,this.callbackForAdUnit.cbForHandlingDispatchedEvent(e)),this.verificationManager){var o=this.prepareOmidEventData(e);o.name&&this.verificationManager.dispatchEvent(o.name,o.data)}}this.options.vpaid===!0&&"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.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.isSkipped&&n.push("skipped"),this.isMuted&&n.push("muted"),"auto"===this.options.initialPlayback&&("on"===this.options.initialAudio?n.push("autoplayed"):n.push("mautoplayed")),this.adVideoPlayer.isFullscreen&&"function"==typeof this.adVideoPlayer.isFullscreen&&this.adVideoPlayer.isFullscreen()&&n.push("fullscreen"),n.join();case"PLAYERSIZE":return 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","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},o=null;switch(n){case"sessionError":o={},o.errorType=e.code,o.message=e.message;break;case"start":o={},this.options.data.durationMsec?o.duration=this.options.data.durationMsec/1e3:this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player?o.duration=this.adVideoPlayer.player().duration()/1e3:o.duration=-2,this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player?o.videoPlayerVolume=this.adVideoPlayer.player().volume():o.videoPlayerVolume=-1;break;case"volumeChange":o={},"audio-mute"===e.name||"video_mute"===e.name?o.videoPlayerVolume=0:this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player?o.videoPlayerVolume=this.adVideoPlayer.player().volume():o.videoPlayerVolume=-1;break;case"playerStateChange":o={},"video-fullscreen"===e.name||"fullscreenchange"===e.name&&"enter"===e.fullscreenStatus?o.state=this.adVideoPlayer.isFullscreen?"fullscreen":"normal":"video-exit-fullscreen"===e.name||"fullscreenchange"===e.name&&"exit"===e.fullscreenStatus?o.state="normal":"ad-collapse"===e.name?o.state="collapsed":o.state="normal";break;case"adUserInteraction":o={},"ad-click"===e.name?o.interactionType="click":o.interactionType="invitationAccept"}return o&&(i.data=o),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?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 o=n.data.vastProgressEvent;if(o&&"object"==typeof o)for(var r in o){var a=this.Utils.getMsecTime(r.replace(/progress_/g,""),n.data.durationMsec);o[r]=a}},disableTrackingUserActivity:function(e){this.blockTrackingUserActivity=e,this.adVideoPlayer&&this.adVideoPlayer.bigPlayButton&&(this.adVideoPlayer.bigPlayButton.el_.style.opacity=e===!0?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:A,debug:A,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")},o=function(e){console.debug("%c"+e,"background: green; color: white")};try{var r=function(t,n){t?(n=n+" Succeeded"||"Succeeded",o("Unit Test ["+e+"] : "+n)):(n=n+" failed"||"Assertion failed",i("Unit Test ["+e+"] : "+n))},a=function(t){console.debug("%cUnit Test Log : ["+e+"] : "+t,"background: gray; color: white")};n.test[e](t,r,a)}catch(s){i("unit test failed due to : "+s)}}},setFinalAspectRatio:function(e){this.finalAspectRatio=e},getFinalAspectRatio:function(){return this.finalAspectRatio}};e.exports=j,window[f]=j},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(module){function _handleMultipleEvents(e,t,n,i){vjs.arr.forEach(n,function(n){e(t,n,i)})}function _logType(e,t){return}document.createElement("video"),document.createElement("audio"),document.createElement("track");var global_options,vjs=function(e,t,n){global_options=t;var i;if("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;vjs.CDN_VERSION="GENERATED_CDN_VSN",vjs.ACCESS_PROTOCOL="https:"==document.location.protocol?"https://":"http://",vjs.VERSION="GENERATED_FULL_VSN",vjs.options={techOrder:["html5","flash"],html5:{},flash:{},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."},"GENERATED_CDN_VSN"!==vjs.CDN_VERSION&&(videojs.options.flash.swf=vjs.ACCESS_PROTOCOL+"vjs.zencdn.net/"+vjs.CDN_VERSION+"/video-js.swf"),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={},__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;e=e||{},t=e.init||e.init||this.prototype.init||this.prototype.init||function(){},n=function(){t.apply(this,arguments)},n.prototype=vjs.obj.create(this.prototype),n.prototype.constructor=n,n.extend=vjs.CoreObject.extend,n.create=vjs.CoreObject.create;for(var i in 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 o=n.slice(0),r=0,a=o.length;r=0;i--)n[i]===t&&n.splice(i,1);e.className=n.join(" ")}},vjs.TEST_VID=vjs.createEl("video"),function(){var e=document.createElement("track");e.kind="captions",e.srclang="en",e.label="English",vjs.TEST_VID.appendChild(e)}(),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=function(){var e,t,n=vjs.USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);return n?(e=n[1]&&parseFloat(n[1]),t=n[2]&&parseFloat(n[2]),e&&t?parseFloat(n[1]+"."+n[2]):e?e: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||"undefined"==typeof n||n===!1?e.removeAttribute(t):e.setAttribute(t,n===!0?"":n)})},vjs.getElementAttributes=function(e){var t,n,i,o,r;if(t={},n=",autoplay,controls,loop,muted,default,",e&&e.attributes&&e.attributes.length>0){i=e.attributes;for(var a=i.length-1;a>=0;a--)o=i[a].name,r=i[a].value,"boolean"!=typeof e[o]&&n.indexOf(","+o+",")===-1||(r=null!==r),t[o]=r}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),o=Math.floor(e/3600),r=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(o=i=n="-"),o=o>0||a>0?o+":":"",i=((o||r>=10)&&i<10?"0"+i:i)+":",n=n<10?"0"+n:n,o+i+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.setLocalStorage=function(e,t){try{var n=window.localStorage||!1;if(!n)return;n[e]=t}catch(i){22==i.code||1014==i.code?vjs.log("LocalStorage Full (VideoJS)",i):18==i.code?vjs.log("LocalStorage not allowed (VideoJS)",i):vjs.log("LocalStorage Error (VideoJS)",i)}},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,o,r;o=["protocol","hostname","port","pathname","search","hash","host"],n=vjs.createEl("a",{href:e}),i=""===n.host&&"file:"!==n.protocol,i&&(t=vjs.createEl("div"),t.innerHTML='',n=t.firstChild,t.setAttribute("style","display:none; position:absolute;"),document.body.appendChild(t)),r={};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,o;return"string"==typeof e?(o=e,t=t||{},i=t.componentClass||vjs.capitalize(o),t.name=o,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),o=o||n.name&&n.name(),o&&(this.childNameIndex_[o]=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,o,r,a;if(e=this,t=e.options(),n=t.children)if(a=function(n,i){void 0!==t[n]&&(i=t[n]),i!==!1&&(e[n]=e.addChild(n,i))},vjs.obj.isArray(n))for(var s=0;s0){for(var t=0,n=e.length;t1?i=!1:t&&(r=e.touches[0].pageX-t.pageX,a=e.touches[0].pageY-t.pageY,s=Math.sqrt(r*r+a*a),s>l&&(i=!1))}),o=function(){i=!1},this.on("touchleave",o),this.on("touchcancel",o),this.on("touchend",function(o){t=null,i===!0&&(n=(new Date).getTime()-e,n0){var r=Number(i.substring(0,i.length-2));t-=2*r,n-=2*r}k.style.width=t+"px",k.style.height=n+"px";var a=u(T);e("repositionPlayer: targetDiv absolute posiotion ="+a.left+", "+a.top),k.style.left=a.left+"px",k.style.top=a.top+"px",e("repositionPlayer: size = "+t+", "+n),S.overlayPlayer?N.resizePlayer(t,n):N.resizeVideo(null,!1,null)}}function a(t){e("Resize event happend"),k&&N&&(O?(O=!1,S.fitInContainer&&(k.style.zIndex=R),setTimeout(function(){r(),"click"!==S.initialPlayback&&N.play()},100)):r()),G&&G(t)}function c(t){switch(e("Got notification: "+t),t){case"leaveFullscreen":q();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 p(){var t,n=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(o){return[0,0,0]}};try{t=n()[0]>=8&&S.enableInlineVideoForIos===!0}catch(i){e(i)}return t}function h(e){var t=document.defaultView.getComputedStyle(e,null).zIndex;return"auto"!==t?t:0}function m(e,t){if(!e.children)return t;for(var n=Math.max(t,h(e)),i=0;i-1||navigator.appVersion.indexOf("Android")>-1}function y(){return navigator.userAgent.indexOf("Chrome")>-1}function A(){var e=navigator.appVersion.indexOf("Chrome/");if(e>=0){var t=navigator.appVersion.substr(e+7);return e=t.indexOf("."),e>0?Number(t.substr(0,e)):0}return 0}function b(n,i,r){e("play function called"),P=!1,j=3e3,S.vpaidTimeout&&(j=S.vpaidTimeout),x=null,_=!1,V=!1,r&&(_=r),i&&(x=function(e,t){t=t?t:{};var n={event:e,params:t};i(n)}),f()&&(S.showFullScreenButton===!0?S.allowFullscreen=!0:S.allowFullscreen=!1),v()&&(S.enableInlineVideoForIos=!1),e("options before PlayerDefaultOption: ",JSON.stringify(S)),S=s(S),e("options after PlayerDefaultOption: ",JSON.stringify(S)),S.width=n.offsetWidth,S.height=n.offsetHeight;var a=n.style.borderWidth;if(a&&a.length>0){var l=Number(a.substring(0,a.length-2));S.width-=2*l,S.height-=2*l}S.playerHeight=S.height,p()&&(S.playerHeight-=30),o()&&(S.fullscreenMode=!0),e("offsetWidth="+n.offsetWidth+", offsetHeight="+n.offsetHeight+", borderWidth="+n.style.borderWidth);var h=document.createElement("div");h.style.width=S.width+"px",S.fitInContainer?h.style.height=S.height+"px":S.cachePlayer&&S.overlayPlayer?h.style.height="1px":h.style.height=S.height+"px",h.style.backgroundColor="black",h.id=n.id+"_overlay_"+(new Date).getTime();var b=u(n);e("targetDiv absolute posiotion ="+b.left+", "+b.top),h.style.position="absolute",h.style.left=b.left+"px",h.style.top=b.top+"px",S.fitInContainer?h.style.zIndex=Math.max(100,m(n,0)+1):(R=Math.max(100,m(n,0)+1),S.cachePlayer&&S.overlayPlayer?h.style.zIndex=0:h.style.zIndex=R),n.appendChild(h),e("player container offsetLeft = "+h.offsetLeft+", offsetTop = "+h.offsetTop),k=h,T=n,E=(new Date).getTime(),e("timeToReady = "+j+", start time = "+E),C=setTimeout(function(){P||(z(!1),x&&x("Timed-out",{}))},j);var w=function(n,i){e("VastPlayer > cbRenderVideo called");try{e("VastPlayer > cbRenderVideo options: ",JSON.stringify(i))}catch(o){}t(i)};I.cbRenderVideo=w,I.cbWhenDestroy=z,I.cbWhenReady=J,I.cbWhenQuartile=U,I.cbWhenVideoComplete=F,I.cbWhenSkipped=B,I.cbWhenFullScreen=W,I.cbWhenAudio=$,I.cbWhenClickOpenUrl=H,I.cbCoreVideoEvent=L,S.playerNotification=c,S.overlayPlayer&&(S.hasOwnProperty("allowFullscreen")||(S.allowFullscreen=!1)),e("VP >> before options.initialAudio = "+S.initialAudio),"auto"===S.initialPlayback&&"on"===S.initialAudio&&g()&&y()&&A()>=53&&(S.showMute=!0,S.showVolume=!0),e("VP >> after options.initialAudio = "+S.initialAudio),d(k,S,I)}e("VERSION 1.4.15");var k,T,w,E,S={},I={},C=null,P=!1,j=3e3,x=null,_=!1,V=!1,D=null,M=!1,N=null,O=!1,R=0,U=function(t){e("VastPlayer > cbWhenQuartile "+t),x(t,{})},L=function(e,t){var n={type:e,name:t};if("AdHandler"===n.type&&"video_impression"===n.name)try{var i=new CustomEvent("outstream-impression");k.dispatchEvent(i)}catch(o){error(o)}for(var r=[{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"}],a=0;a cbWhenVideoComplete "+t),x(t,{})},B=function(t){e("VastPlayer > cbWhenSkipped "+t),x(t,{})},$=function(t){e("VastPlayer > cbWhenAudio "+t),x(t,{})},H=function(e){x(e,{})},W=function(t){e("VastPlayer > cbWhenFullScreen "+t),x(t,{})},z=function(t,n,i){e("VastPlayer > cbTerminate isError: "+t);var r="unknown";k&&(r=k.id.toString()),e("VastPlayer > cbTerminate: bTerminated = "+V+", targetElement id = "+r),M=!1,V||(V=!0,n||q(),!i&&o()&&S.overlayPlayer&&q(),k&&(N&&(N.isPlayingVideo&&(e("VastPlayer > cbTerminate: pause ad"),N.pause()),k.style.height="1px",N.resizePlayer(1,1)),setTimeout(function(){k&&(k.innerHTML="",T.removeChild(k)),k=null},2e3)),x&&t&&x("video-error",{}))},q=function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()},J=function(t){var n,i,r,a,s;n=t&&t.options&&t.options.video&&t.options.video.url?t.options.video.url:"",i=t&&t.options&&t.options.data&&t.options.data.vastDurationMsec?t.options.data.vastDurationMsec:0,r=t&&t.options&&t.options.finalVastXml?t.options.finalVastXml:"",a=t&&t.options&&t.options.finalVastUri?t.options.finalVastUri:"",s=t&&t.getFinalAspectRatio()?t.getFinalAspectRatio():"",V||(P=!0,N=t,e("VastPlayer > cbWhenReady in "+((new Date).getTime()-E)+" msecs"),x&&x("adReady",{creativeUrl:n,duration:i,vastXML:r,vastCreativeUrl:a,aspectRatio:s}),"click"===S.initialPlayback||S.cachePlayer||(o()&&S.overlayPlayer?S.forceAdInFullscreen?(O=!0,q()):(k&&(k.style.width="1px",k.style.height="1px"),z(!1,!0,!0)):N.play()))},G=null;document.body.onresize&&(G=document.body.onresize),window.onresize=a,this.playVast=function(t,n,o,r,a){e("VP >> playVast function called playerId = "+this.vastPlayerId),z(!1,!0),i(),S=n,S.vastXml=o,b(t,r,a)},this.playAdObject=function(t,n,o,r,a){e("VP >> playAdObject function called playerId = "+this.vastPlayerId+", cache mode = "+n.cachePlayer),z(!1,!0),i(),S=n,"string"==typeof o?S.vastXml=o:(S.useAdObj=!0,S.adObj=o),b(t,r,a)},this.stop=function(){C&&(clearTimeout(C),C=null),z(!1)},this.removeFromPage=function(){C&&(clearTimeout(C),C=null),V=!0,k&&(k.innerHTML="",T.removeChild(k),k=null)},this.play=function(){e("VP >> play function called playerId = "+this.vastPlayerId),N&&(S.cachePlayer=!1,o()&&S.overlayPlayer?S.forceAdInFullscreen?(O=!0,q()):z(!1,!0,!0):(k&&S.fitInContainer===!1&&(k.style.zIndex=R),r(),"click"!==S.initialPlayback&&N.play()))},this.sendPlay=function(){e("VP >> sendPlay function called playerID = "+this.vastPlayerId),N&&!N.isPlayingVideo&&N.play()},this.sendPause=function(){e("VP >> sendPause function called playerID = "+this.vastPlayerId),N&&N.isPlayingVideo&&N.pause()},this.handleFullscreen=function(e){N&&(e?T.requestFullscreen?T.requestFullscreen():T.webkitRequestFullscreen?T.webkitRequestFullscreen():T.mozRequestFullScreen?T.mozRequestFullScreen():T.msRequestFullscreen&&T.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 V},this.getIsVideoPlaying=function(){var e=!(!N||!N.isPlayingVideo);return e},this.getCurrentPlayHeadTime=function(){var e=0;return w&&w.adVideoPlayer&&"function"==typeof w.adVideoPlayer.player&&(e=1e3*w.adVideoPlayer.player().currentTime(),e=parseInt&&"function"==typeof parseInt?parseInt(e):e),e}};e.exports={playAdObject:function(e,t,n,i,o){var a=r(t.targetElementId,t.cachePlayer);a&&a.playAdObject(e,t,n,i,o)},playVast:function(e,t,n,i,o){var a=r(t.targetElementId);a&&a.playVast(e,t,n,i,o)},loadAndPlayVast:function(e,t,i,o,a){var s=n(29);s.load(i,function(s,l){if(s||0===l.length){var d=n(28);d.logDebug("Failed to load "+i,"Vast Video Player")}else{var c=r(t.targetElementId);c&&c.playVast(e,t,l,o,a)}})},stop:function(e,t){var n=o(e.id,t);n&&n.stop()},removeFromPage:function(e){var t=o(e);t&&t.removeFromPage()},play:function(e,t){var n=i(e,t);n&&n.play()},sendPlay:function(e){var t=o(e);t&&t.sendPlay()},sendPause:function(e){var t=o(e);t&&t.sendPause()},handleFullscreen:function(e,t){var n=o(e);n&&n.handleFullscreen(t)},getCurrentPlayHeadTime:function(e){var t=o(e);if(t)return t.getCurrentPlayHeadTime()},getIsVideoPlaying:function(e){var t=o(e);if(t)return t.getIsVideoPlaying()}}},function(e,t){var n=function(e){function t(e){return"object"==typeof e}function n(e){return null===e}function i(e){var o,r,a;for(r=1;r-1},T=["AdPaused","AdVolumeChange"],w=["AdLoaded","AdStopped","AdSkippableStateChange","AdLinearChange","AdDurationChange","AdRemainingTimeChange","AdLog","AdError"],E=1,S=402,I=900,C=405,P={initialPlayback:"auto",initialAudio:"off",skippable:{enabled:!0,allowOverride:!1,videoThreshold:15,videoOffset:5,skipLocation:"top-left",skipText:"Video can be skipped in %%TIME%% seconds",skipButtonText:"SKIP"},adText:"Ad",showMute:!0,showVolume:!0,showProgressBar:!0,showPlayToggle:!0,showBigPlayButton:!0,allowFullscreen:!0,playerSkin:{customPlayerSkin:"",controlBarHeight:30,topDividerColor:"#606060",bottomDividerColor:"#606060",topDividerWidth:1,bottomDividerWidth:1,videoBackgroundColor:"#000000"},disableCollapse:{enabled:!1,replay:!1},endCard:{enabled:!1,clickable:!0,color:"",imageUrl:"",imageWidth:"",imageHeight:"",showCompanion:!0},enableInlineVideoForIos:!0,delayExpandUntilVPAIDInit:!1,delayExpandUntilVPAIDImpression:!1,flash:{swf:"http://acdn.adnxs.com/video/player/vastPlayer/AppnexusFlashPlayer.swf"},vpaidTimeout:5e3,waterfallTimeout:3e4,waterfallSteps:-1,fixedSizePlayer:!0,disableTopBar:!1,sideStream:{enabled:!1,position:"bottom-right",xOffset:0,yOffset:0,space:"empty",dynamicBigPlayButtonOnSideStream:!0},sideStreamObject:{},preloadInlineAudioForIos:!1,controlBarPosition:"over",customPlayerSkinCss:"",customButton:{enabled:!1,url:"",altText:"",imageSrc:"",imgWidth:50,imgHeight:30},enableNativeInline:!1,androidDSOverride:!1,cbNotification:function(){},parentIframeIsModal:!1,learnMore:{enabled:!1,clickToPause:!0,text:"Learn More",separator:"-"},playerContextId:"anadvideoplayer",data:{skipOffset:"",durationMsec:null,skipOffsetMsec:null,isVastVideoSkippable:!1,vastProgressEvent:{},vastDurationMsec:null,adIcons:null},test:function(){}},j={externalNameOfVideoPlayer:v,videoPlayerObj:i,autoplayHandler:h,mobileSupport:h,customSkinning:u,options:{},adVideoPlayer:{},callbackForAdUnit:{},vpaidData:{},iframeVideoWrapper:{},isPlayingVideo:!1,isDoneInitialPlay:!1,isFullscreen:!1,heightOffset:0,explicitPaused:!1,aspectRatio:0,finalAspectRatio:0,videoObjectId:{},isViewable:!1,isSkipped:!1,isCompleted:!1,isMuted:!1,isExplicitMuted:!1,hasBeenUnmuted:!1,isChrome:navigator.userAgent.indexOf("Chrome")>-1,videojs_vpaid:r,overlayPlayer:!1,forceToSkip:!1,ExtendDefaultOption:a,delayEventHandler:null,pausedByViewability:!1,mutedByVisibility:!1,gotAdImpressionForFlash:!1,gotAdStartedForFlash:!1,isReadyToExpandForMobile:!1,isAlreadyPlaingForVPAID:!1,isSideStreamActivated:!1,isExpanded:!0,isVideoCompleteInjected:!1,isFullscreenToggled:!1,toggleWindowFocus:!0,viewabilityTracking:null,isDoneFirstLoadStart:!1,flashBlockerTimeout:null,startedReplay:!1,Utils:l,isAlreadyStart:!1,isEnded:!1,blockTrackingUserActivity:!1,videoId:"",divIdForVideo:"",init:function(e){var t=a(P,e);return this.options=t,"boolean"==typeof this.options.disableCollapse&&(this.options.disableCollapse={enabled:this.options.disableCollapse,replay:!1}),this.options.skippable.allowOverride===!0&&(this.options.skippable.videoThreshold=0,this.options.skippable.enabled=!0),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(n){b(n)}return t},decidePlayer:function(e){var t="",n="flash",i="html5",o=function(){var e=navigator.appVersion.indexOf("Mobile"),t=navigator.appVersion.indexOf("Android");return e>-1||t>-1},r=this.options.playerTechnology;if(r&&r.length&&1===r.length)switch(e){case 1:t=i;break;case 2:t=n;break;case 0:t=r[0]===i?i:n}if(r&&r.length&&2===r.length)switch(e){case 1:t=i;break;case 2:t=n;break;case 0:t=i}return o()&&(t=i),t},buildPlayer:function(e,t){var n=this;if(t.waterfallStepId&&A("CHECKING AUTOPLAY FOR WATERFALL STEP: "+t.waterfallStepId),"html5"===this.decidePlayer(t.requiredPlayer)&&this.autoplayHandler&&!t.overlayPlayer){var i,o=function(i){var o=n.autoplayHandler.videoPolicy;switch(i){case o.allowAutoplay:break;case o.stopMediaWithSound:"on"===t.initialAudio?("auto"!==t.initialPlayback&&"mouseover"!==t.initialPlayback||(t.initialAudio="off",t.audioOnMouseover=!1),t.isWaterfall===!0&&(t.adAttempt>0?(t.initialAudio="off",t.audioOnMouseover=!1):t.audioOnMouseover=!0)):"auto"!==t.initialPlayback&&"mouseover"!==t.initialPlayback||(t.audioOnMouseover=!1);break;case o.neverAutoplay:t.initialPlayback="click",t.isWaterfall&&(t.isWaterfall=!1,t.stopWaterfall=!0)}t.waterfallStepId&&A("BUILDING PLAYER FOR WATERFALL STEP: "+t.waterfallStepId),n.buildPlayerCallback(e,t)};i=!h.isMobile()&&("on"===t.initialAudio||t.audioOnMouseover===!0),n.autoplayHandler.getAutoplayPolicy(o,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)),k()&&"flash"===this.decidePlayer(this.options.requiredPlayer)||this.options.targetElement&&!this.options.firstAdAttempted&&(this.options.targetElement.style.visibility="hidden"),"flash"===this.decidePlayer(this.options.requiredPlayer)&&(this.options.disableCollapse.replay=!1);var n=(new Date).getTime()+Math.floor(1e4*Math.random()),i="APNVideo_Player_"+n;this.externalNameOfVideoPlayer=i,o(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)){A("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){b(e)}}},replay:function(){this.isEnded&&(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&&this.options.sideStream.wasEnabled===!0&&(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()))},actualPlayByVideoJS:function(){this.adVideoPlayer.play(),this.options.vpaid&&this.adVideoPlayer.trigger("handleManualUserInActive")},play:function(){if(this.isEnded!==!0){var e=h.isMobile()&&h.iOSversion()[0]>=10&&this.options.enableInlineVideoForIos===!1;if(e){var t=this;t.overlayPlayer?t.options.targetElement.style.overflow="":setTimeout(function(){t.options.targetElement.style.overflow=""},t.options.expandTime)}this.isAlreadyPlaingForVPAID=!0,this.isCompleted||(A("play video"),this.isDoneInitialPlay?"html5"===this.decidePlayer(this.options.requiredPlayer)?this.isPlayingVideo||this.dispatchEventToAdunit({name:"video_resume"}):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.adVideoPlayer.trigger("play"):this.options.vpaid&&this.options.overlayPlayer&&navigator.appVersion.indexOf("Android")>-1&&this.options.enableWaterfall&&!this.isDoneInitialPlay?this.adVideoPlayer.trigger("play"):this.actualPlayByVideoJS(),"html5"===this.decidePlayer(this.options.requiredPlayer)||(this.isPlayingVideo=!0),this.isDoneInitialPlay=!0,this.isEnded=!1)}},resetVpaid:function(){this.dispatchEventToAdunit({name:"reset"})},pause:function(){this.isPlayingVideo&&(A("pause video"),this.adVideoPlayer.pause(),this.options.vpaid&&this.adVideoPlayer.trigger("handleManualUserActive"),this.isCompleted||this.isEnded||this.dispatchEventToAdunit({name:"video_pause"}))},explicitPause:function(){A("explicit pause video"),this.explicitPaused=!0,this.pause()},explicitPlay:function(){A("explicit play video"),this.explicitPaused=!1,this.play()},mute:function(){this.isMuted||(A("mute audio"),"html5"===this.decidePlayer(this.options.requiredPlayer)?(this.adVideoPlayer.muted(!0),this.dispatchEventToAdunit({name:"video_mute"})):this.adVideoPlayer.mute(),this.isMuted=!0)},explicitMute:function(){A("explicit mute video"),this.isExplicitMuted=!0,this.mute()},unmute:function(){!this.isExplicitMuted&&this.isMuted&&(A("unmute audio"),"html5"===this.decidePlayer(this.options.requiredPlayer)?(this.adVideoPlayer.muted()===!0&&this.adVideoPlayer.muted(!1),(this.isMuted||"off"===this.options.initialAudio)&&this.dispatchEventToAdunit({name:"video_unmute"})):(this.adVideoPlayer.unmute(),this.hasBeenUnmuted=!0),this.isMuted=!1)},explicitUnmute:function(){this.isExplicitMuted=!1,this.unmute()},resizeVideoWithDimensions:function(e,t){var n=this;this.options.width=e,this.options.height=t,n.resizeVideo(n.aspectRatio)},mouseIn:function(){this.adVideoPlayer.mouseIn()},mouseOut:function(){this.adVideoPlayer.mouseOut()},destroy:function(e,t){this.isPlayingVideo=!1,this.adVideoPlayer.pause(),this.isCompleted===!1&&(this.options.vpaid===!1?this.dispatchEventToAdunit({name:"video_skip"}):this.options.vpaid===!0&&this.isSkipped===!1&&this.dispatchEventToAdunit({name:"video_skip"})),"function"==typeof this.callbackForAdUnit.cbWhenSkipped&&this.callbackForAdUnit.cbWhenSkipped("video-skip"),this.isSkipped=!0,this.verificationManager&&this.verificationManager.destroy(),A("destroy");var n=I;"function"==typeof this.callbackForAdUnit.cbWhenDestroy&&(this.overlayPlayer?e&&t?this.callbackForAdUnit.cbWhenDestroy({type:E,code:n,message:t},!0,this.options):this.callbackForAdUnit.cbWhenDestroy(null,!0,this.options):e&&t?this.callbackForAdUnit.cbWhenDestroy({type:E,code:n,message:t},null,this.options):this.callbackForAdUnit.cbWhenDestroy(null,null,this.options))},destroyWithoutSkip:function(e,t,n,i){try{var o=this,r=function(){o.isPlayingVideo=!1,o.adVideoPlayer&&o.adVideoPlayer.pause&&"function"==typeof o.adVideoPlayer.pause&&o.adVideoPlayer.pause(),o.verificationManager&&o.verificationManager.destroy(),A("destroy without skip: "+o.options.iframeVideoWrapperId);var r=i||I;"function"==typeof o.callbackForAdUnit.cbWhenDestroy&&(o.overlayPlayer?e&&t?(n&&(r=S),o.callbackForAdUnit.cbWhenDestroy({type:E,code:r,message:t},!0,o.options)):o.callbackForAdUnit.cbWhenDestroy(null,!0,o.options):e&&t?(n&&(r=S),o.callbackForAdUnit.cbWhenDestroy({type:E,code:r,message:t},null,o.options)):o.callbackForAdUnit.cbWhenDestroy(null,null,o.options))};o.options.disableCollapseForDelay&&o.options.disableCollapseForDelay>0?setTimeout(r,o.options.disableCollapseForDelay):r()}catch(a){b("failed to destroy/notify by "+a)}},getVideoObject:function(){return this.adVideoPlayer},handleFlashPlay:function(){var e=this,t=function(){e.resizeVideo(e.aspectRatio),A("flash player is ready to play"),e.callbackForAdUnit.cbWhenReady&&e.callbackForAdUnit.cbWhenReady(e)};e.isChrome?(e.setChromeSize(),setTimeout(t,100)):t()},handlePlayerNotification:function(e){"video_time"!==e.name&&A("Got notification from player = "+e.name);var t=this,n={flash_is_respondble:function(){t.flashBlockerTimeout&&(clearTimeout(t.flashBlockerTimeout),t.flashBlockerTimeout=null),A("Flash is respondble")},canplay:function(){if(t.flashBlockerTimeout&&(clearTimeout(t.flashBlockerTimeout),t.flashBlockerTimeout=null,A("Flash is respondble")),t.options.hasOwnProperty("overlayPlayer"))try{t.adVideoPlayer.setDOMPlayerIdAndSize(t.adVideoPlayer.id,t.options.width,t.options.height)}catch(n){A("Failed to execute setDOMPlayerIdAndSize(...) on Flash Player")}if(t.options.vpaid)try{var i=t.adVideoPlayer.getCompanionsXml();i&&i.length>0&&(e.companionAds=i)}catch(o){}t.options.vpaid&&t.options.delayExpandUntilVPAIDImpression?t.actualPlayByVideoJS():t.handleFlashPlay()},video_failed:function(){t.flashBlockerTimeout&&(clearTimeout(t.flashBlockerTimeout),t.flashBlockerTimeout=null,A("Flash is respondble")),t.destroyWithoutSkip(!0,m,null,C)},video_timeout:function(){t.destroyWithoutSkip(!0,m,!0,S)},video_bitrate:function(){var t=e.bandwidth;A("bandwidth from flash : "+t)},video_impression:function(){},video_mute:function(){e.hasOwnProperty("value")&&!e.value&&(e.name="video_unmute"),e.hasOwnProperty("value")&&(t.isMuted=e.value)},video_click:function(){e.hasOwnProperty("playerHandles")?e.playerHandles?e.hasOwnProperty("url")&&e.url.length>0?t.click(e.url):t.click():t.dispatchEventToAdunit({name:"ad-click",trackClick:!0}):t.click()},video_complete:function(){t.isCompleted=!0,t.options.disableCollapse.enabled||t.destroyWithoutSkip()},video_fullscreen:function(){t.isFullscreen?setTimeout(function(){t.isFullscreen=!t.isFullscreen},1e3):t.isFullscreen=!t.isFullscreen},quartile_event:function(){},video_pause:function(){},video_start:function(){t.isDoneInitialPlay||"auto"===t.options.initialPlayback||t.play()},video_time:function(){},video_resume:function(){},video_stopped:function(){t.destroyWithoutSkip()},video_skipped:function(){t.destroy()},video_ratio:function(){},video_heightOffset:function(){t.heightOffset=e.heightOffset},video_paused_by_user:function(){t.explicitPause()},video_resumed_by_user:function(){A("received video_resumed_by_user from Flash"),t.requiredForFlashVpaid()?t.isVpaidFlashVideoPlaying===!1?(A("call explicitPlay by video_Resumed_by_user event"),t.explicitPlay()):A("do nothing because of isVpaidFlashVideoPlaying:true"):t.explicitPlay()},video_progress:function(){if(e&&e.offset)return void t.dispatchEventToAdunit({name:e.offset},function(){A("handle video_progress by flash : "+e.offset)})}};if(t.isDoneInitialPlay||"video_mute"!==e.name){var i=n[e.name];i&&void 0!==i&&i(),"video_pause"!==e.name&&"video_resume"!==e.name&&"video_impression"!==e.name&&"video_start"!==e.name&&"video_failed"!==e.name&&"video_timeout"!==e.name&&this.dispatchEventToAdunit(e),"video_impression"!==e.name&&"video_start"!==e.name||!t.options.vpaid||this.dispatchEventToAdunit(e)}},handleOverlayNotification:function(e){A("Got overlay notification from player = "+e.name);var t=this,n={leaveFullscreen:function(){t.options.hasOwnProperty("playerNotification")&&t.options.playerNotification("leaveFullscreen")}},i=n[e.name];i&&void 0!==i&&i()},requiredForFlashVpaid:function(){return"flash"===this.decidePlayer(this.options.requiredPlayer)&&this.options.vpaid===!0},notifyVpaidEvent:function(e){var t=this;if(t.requiredForFlashVpaid()&&("AdPaused"===e&&(A("received VPAID AdPaused from Flash"),t.isVpaidFlashVideoPlaying=!1,t.isPlayingVideo=!1,A("set isVpaidFlashVideoPlaying = false"),A("set isPlayingVideo = false")),"AdPlaying"===e&&(A("received VPAID AdPlaying from Flash"),t.isVpaidFlashVideoPlaying=!0,t.isPlayingVideo=!0,A("set isVpaidFlashVideoPlaying = true"),A("set isPlayingVideo = true"))),"flash"===t.decidePlayer(t.options.requiredPlayer)&&t.options.delayExpandUntilVPAIDImpression&&("AdVideoStart"===e&&t.adVideoPlayer.pause(),"AdImpression"===e&&(t.gotAdImpressionForFlash=!0),"AdStarted"===e&&(t.gotAdStartedForFlash=!0),t.gotAdImpressionForFlash&&t.gotAdStartedForFlash&&(t.handleFlashPlay(),t.gotAdImpressionForFlash=!1,t.gotAdStartedForFlash=!1)),!(t.options.delayExpandUntilVPAIDImpression&&t.delayEventHandler.isSuppress&&T.indexOf(e)>=0)){if("AdVolumeChange"===e){var n="html5"===this.decidePlayer(this.options.requiredPlayer);if(n){var i=t.adVideoPlayer.player().muted(),o=t.adVideoPlayer.player().volume();i?i&&(A("set VPAID AdVolumeChange video_mute"),this.dispatchEventToAdunit({name:"video_mute"})):o>0&&(A("set VPAID AdVolumeChange video_unmute"),this.dispatchEventToAdunit({name:"video_unmute"}))}}w.indexOf(e)>=0||w.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)return void this.play();this.isIosInlineRequired()===!1&&(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[0]){n=!0;var o=this.options.clickUrls[0];window.open(o)}"undefined"!=typeof t&&t!==!0||this.dispatchEventToAdunit({name:"ad-click",trackClick:n})},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&&this.options.viewability.config,o=e&&e.name?e.name:null;"fullscreenchange"!==o&&"video_fullscreen"!==o||(o=this.isFullscreen?"fullscreen":"exitFullscreen"),n||"video_duration"!==o||(this.isAlreadyStart=!0);var r=function(){var i;i=n?this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player&&this.adVideoPlayer.player().duration():e.duration,(!i||void 0===i||i<=0)&&(i=-2),i===-2&&(this.options&&this.options.data&&this.options.data.vastDurationMsec?(i=this.options.data.vastDurationMsec/1e3,(!i||null===i||i<=0)&&(i=-2)):i=-2);var r=this.options.width,a=this.options.height;if(this.viewabilityTracking.init(this.options,i,r,a,t),n)if(this.options.expandable)this.options.vpaid===!0&&"video_start"===o&&this.viewabilityTracking.invokeEvent("expand"),this.options.vpaid===!1&&"loadstart"===o&&this.viewabilityTracking.invokeEvent("expand"),this.viewabilityTracking.invokeEvent(o);else{if(this.options.overlayPlayer&&l.isMobile()&&this.options.delayStartViewability)return;this.viewabilityTracking.invokeEvent(o)}else this.isAlreadyStart&&(this.options.expandable&&this.viewabilityTracking.invokeEvent("expand"),this.viewabilityTracking.invokeEvent("video_start"))},a=function(){if(this.viewabilityTracking&&this.viewabilityTracking.isReady){ +if(n===!1&&"expand"===o&&this.options.expandable)return;"force_start_viewability"===o&&this.options.delayStartViewability?(this.options.delayStartViewability=!1,this.viewabilityTracking.invokeEvent("video_start")):this.viewabilityTracking.invokeEvent(o)}};if(o&&i){var s=this.blockTrackingUserActivity&&("video_resume"===o||"video_pause"===o||"video_mute"===o||"video_unmute"===o);s||(o===t?r.apply(this):a.apply(this))}},findPathForViewability:function(e){var t,n="html5"===this.decidePlayer(this.options.requiredPlayer);if(n){if(t=!this.options.expandable||"undefined"!=typeof this.options.isExpanded&&this.options.isExpanded!==!1?"video_start":"expand",e&&e.name&&e.name===t){if(this.isDoneFirstLoadStart)return;this.isDoneFirstLoadStart=!0}this.handleViewability(e,t,n)}else{if(t="video_duration",e&&"video_start"===e.name)return;e&&e.name&&e.name===t?this.isDoneFirstLoadStart||(this.isDoneFirstLoadStart=!0,this.handleViewability(e,t,n)):this.handleViewability(e,t,n)}},dispatchEventToAdunit:function(e,t){var n=this;if("video_start"===e.name&&n.iframeVideoWrapper.contentDocument){var i=n.iframeVideoWrapper.contentDocument.getElementById(n.divIdForVideo),o=n.iframeVideoWrapper.contentDocument.getElementById(n.videoId);i.style.background=n.options.playerSkin.videoBackgroundColor,o.style.background=n.options.playerSkin.videoBackgroundColor,h.isIOS()&&n.isIosInlineRequired()&&(o.style.opacity=0)}if("video_complete"===e.name&&(void 0===e.obj&&(e.obj={}),e.obj.videoAdPending=this.options.disableCollapse.replay),"video_fullscreen"===e.name&&"flash"===this.decidePlayer(this.options.requiredPlayer)?setTimeout(function(){var t={name:e.name,user:e.user,value:e.value};n.findPathForViewability(t)},1500):this.findPathForViewability(e),(this.startedReplay===!0||this.isEnded)&&this.options.disableCollapse.replay===!0)if(this.startedReplay===!1&&"rewind"===e.name);else{if("video_complete"===e.name&&"function"==typeof t)return void t();if("ad-click"!==e.name&&e.name.indexOf("IconClick")===-1)return void this.callbackForAdUnit.cbForHandlingDispatchedEvent(e,!0)}"video_skip"===e.name&&c.pushAndCheck(this.options.targetElement.id+"_dispatchEventToAdunit",e.name)===!1||"video_complete"===e.name&&this.isVideoCompleteInjected===!0&&this.options.disableCollapse.replay===!1||(e&&"video_time"!==e.name&&A("(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&&A("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);"function"==typeof t&&t();var i=this.blockTrackingUserActivity&&("video_resume"===e.name||"video_pause"===e.name||"video_mute"===e.name||"video_unmute"===e.name);if(i||(e.player=this,this.callbackForAdUnit.cbForHandlingDispatchedEvent(e)),this.verificationManager){var o=this.prepareOmidEventData(e);o.name&&this.verificationManager.dispatchEvent(o.name,o.data)}}this.options.vpaid===!0&&"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.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.isSkipped&&n.push("skipped"),this.isMuted&&n.push("muted"),"auto"===this.options.initialPlayback&&("on"===this.options.initialAudio?n.push("autoplayed"):n.push("mautoplayed")),this.adVideoPlayer.isFullscreen&&"function"==typeof this.adVideoPlayer.isFullscreen&&this.adVideoPlayer.isFullscreen()&&n.push("fullscreen"),n.join();case"PLAYERSIZE":return 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","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},o=null;switch(n){case"sessionError":o={},o.errorType=e.code,o.message=e.message;break;case"start":o={},this.options.data.durationMsec?o.duration=this.options.data.durationMsec/1e3:this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player?o.duration=this.adVideoPlayer.player().duration()/1e3:o.duration=-2,this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player?o.videoPlayerVolume=this.adVideoPlayer.player().volume():o.videoPlayerVolume=-1;break;case"volumeChange":o={},"audio-mute"===e.name||"video_mute"===e.name?o.videoPlayerVolume=0:this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player?o.videoPlayerVolume=this.adVideoPlayer.player().volume():o.videoPlayerVolume=-1;break;case"playerStateChange":o={},"video-fullscreen"===e.name||"fullscreenchange"===e.name&&"enter"===e.fullscreenStatus?o.state=this.adVideoPlayer.isFullscreen?"fullscreen":"normal":"video-exit-fullscreen"===e.name||"fullscreenchange"===e.name&&"exit"===e.fullscreenStatus?o.state="normal":"ad-collapse"===e.name?o.state="collapsed":o.state="normal";break;case"adUserInteraction":o={},"ad-click"===e.name?o.interactionType="click":o.interactionType="invitationAccept"}return o&&(i.data=o),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?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 o=n.data.vastProgressEvent;if(o&&"object"==typeof o)for(var r in o){var a=this.Utils.getMsecTime(r.replace(/progress_/g,""),n.data.durationMsec);o[r]=a}},disableTrackingUserActivity:function(e){this.blockTrackingUserActivity=e,this.adVideoPlayer&&this.adVideoPlayer.bigPlayButton&&(this.adVideoPlayer.bigPlayButton.el_.style.opacity=e===!0?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:A,debug:A,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")},o=function(e){console.debug("%c"+e,"background: green; color: white")};try{var r=function(t,n){t?(n=n+" Succeeded"||"Succeeded",o("Unit Test ["+e+"] : "+n)):(n=n+" failed"||"Assertion failed",i("Unit Test ["+e+"] : "+n))},a=function(t){console.debug("%cUnit Test Log : ["+e+"] : "+t,"background: gray; color: white")};n.test[e](t,r,a)}catch(s){i("unit test failed due to : "+s)}}},setFinalAspectRatio:function(e){this.finalAspectRatio=e},getFinalAspectRatio:function(){return this.finalAspectRatio}};e.exports=j,window[v]=j},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(module){function _handleMultipleEvents(e,t,n,i){vjs.arr.forEach(n,function(n){e(t,n,i)})}function _logType(e,t){return}document.createElement("video"),document.createElement("audio"),document.createElement("track");var global_options,vjs=function(e,t,n){global_options=t;var i;if("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;vjs.CDN_VERSION="GENERATED_CDN_VSN",vjs.ACCESS_PROTOCOL="https:"==document.location.protocol?"https://":"http://",vjs.VERSION="GENERATED_FULL_VSN",vjs.options={techOrder:["html5","flash"],html5:{},flash:{},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."},"GENERATED_CDN_VSN"!==vjs.CDN_VERSION&&(videojs.options.flash.swf=vjs.ACCESS_PROTOCOL+"vjs.zencdn.net/"+vjs.CDN_VERSION+"/video-js.swf"),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={},__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;e=e||{},t=e.init||e.init||this.prototype.init||this.prototype.init||function(){},n=function(){t.apply(this,arguments)},n.prototype=vjs.obj.create(this.prototype),n.prototype.constructor=n,n.extend=vjs.CoreObject.extend,n.create=vjs.CoreObject.create;for(var i in 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 o=n.slice(0),r=0,a=o.length;r=0;i--)n[i]===t&&n.splice(i,1);e.className=n.join(" ")}},vjs.TEST_VID=vjs.createEl("video"),function(){var e=document.createElement("track");e.kind="captions",e.srclang="en",e.label="English",vjs.TEST_VID.appendChild(e)}(),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=function(){var e,t,n=vjs.USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);return n?(e=n[1]&&parseFloat(n[1]),t=n[2]&&parseFloat(n[2]),e&&t?parseFloat(n[1]+"."+n[2]):e?e: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||"undefined"==typeof n||n===!1?e.removeAttribute(t):e.setAttribute(t,n===!0?"":n)})},vjs.getElementAttributes=function(e){var t,n,i,o,r;if(t={},n=",autoplay,controls,loop,muted,default,",e&&e.attributes&&e.attributes.length>0){i=e.attributes;for(var a=i.length-1;a>=0;a--)o=i[a].name,r=i[a].value,"boolean"!=typeof e[o]&&n.indexOf(","+o+",")===-1||(r=null!==r),t[o]=r}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),o=Math.floor(e/3600),r=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(o=i=n="-"),o=o>0||a>0?o+":":"",i=((o||r>=10)&&i<10?"0"+i:i)+":",n=n<10?"0"+n:n,o+i+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.setLocalStorage=function(e,t){try{var n=window.localStorage||!1;if(!n)return;n[e]=t}catch(i){22==i.code||1014==i.code?vjs.log("LocalStorage Full (VideoJS)",i):18==i.code?vjs.log("LocalStorage not allowed (VideoJS)",i):vjs.log("LocalStorage Error (VideoJS)",i)}},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,o,r;o=["protocol","hostname","port","pathname","search","hash","host"],n=vjs.createEl("a",{href:e}),i=""===n.host&&"file:"!==n.protocol,i&&(t=vjs.createEl("div"),t.innerHTML='',n=t.firstChild,t.setAttribute("style","display:none; position:absolute;"),document.body.appendChild(t)),r={};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,o;return"string"==typeof e?(o=e,t=t||{},i=t.componentClass||vjs.capitalize(o),t.name=o,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),o=o||n.name&&n.name(),o&&(this.childNameIndex_[o]=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,o,r,a;if(e=this,t=e.options(),n=t.children)if(a=function(n,i){void 0!==t[n]&&(i=t[n]),i!==!1&&(e[n]=e.addChild(n,i))},vjs.obj.isArray(n))for(var s=0;s0){for(var t=0,n=e.length;t1?i=!1:t&&(r=e.touches[0].pageX-t.pageX,a=e.touches[0].pageY-t.pageY,s=Math.sqrt(r*r+a*a),s>l&&(i=!1))}),o=function(){i=!1},this.on("touchleave",o),this.on("touchcancel",o),this.on("touchend",function(o){t=null,i===!0&&(n=(new Date).getTime()-e,n'+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;errNum9},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={sources:[],tracks:[]};if(t=vjs.getElementAttributes(e),n=t["data-setup"],null!==n&&vjs.obj.merge(t,vjs.JSON.parse(n||"{}")),vjs.obj.merge(i,t),e.hasChildNodes()){var o,r,a,s,l;for(o=e.childNodes,s=0,l=o.length;s0&&(i.startTime=this.cache_.currentTime),this.cache_.src=t.src),this.tech=new window.videojs_apn[e](this,i),this.tech.ready(n)},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(n){throw vjs.log(n),n}},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 this.techGet("paused")!==!1},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(),o=0;if(!n)return 0;for(var r=0;rn&&(t=n),o+=t-e;return o/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.setLocalStorage("volume",t),this):(t=parseFloat(this.techGet("volume")),isNaN(t)?1:t)},vjs.Player.prototype.muted=function(e){if(void 0!==e){var t=vjs.IS_IOS&&this.options_.enableInlineVideoForIos;return t||this.techCall("setMuted",e),this}return 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]),this.isFullscreen()===!1&&vjs.off(document,e.fullscreenchange,arguments.callee)})),this.el_[e.requestFullscreen](),this.trigger("fullscreenchange")):this.tech.supportsFullScreen()?(this.enterFullWindow(),this.trigger("fullscreenchange")):(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&&(this.isFullscreen()===!0?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"),s=void 0,l=void 0)},n=function(){e(),this.clearInterval(i),i=this.setInterval(e,250)},o=function(t){e(),this.clearInterval(i)},this.on("mousedown",n),this.on("mousemove",t),this.on("mouseup",o),this.on("mouseover",d),this.on("mouseout",c),this.on("keydown",e),this.on("keyup",e),r=this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a);var e=this.options().inactivityTimeout;e>0&&(a=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_.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,o=this.player_.buffered(),r=this.player_.duration(),a=this.player_.bufferedEnd(),s=this.el_.children,l=function(e,t){var n=e/t||0;return 100*n+"%"};for(this.el_.style.width=l(a,r),e=0;eo.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&&e.tech.featuresVolumeControl===!1&&this.addClass("vjs-hidden"),this.on(e,"loadstart",function(){e.tech.featuresVolumeControl===!1?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=document.getElementById(global_options.iframeVideoWrapperId).contentWindow.document,n=t.elementFromPoint(e.clientX,e.clientY);n&&"VIDEO"!=n.tagName&&n.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&&e.tech.featuresVolumeControl===!1&&!n&&this.addClass("vjs-hidden"),this.on(e,"loadstart",function(){e.tech.featuresVolumeControl!==!1||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&&e.tech.featuresVolumeControl===!1&&this.addClass("vjs-hidden"),this.on(e,"loadstart",function(){e.tech.featuresVolumeControl===!1?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))},function(){var e;vjs.MediaTechController=vjs.Component.extend({init:function(e,t,n){t=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)},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&&(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(),t&&(e=function(){var e,t,i;for(i=n.getChild("textTrackDisplay"),i.updateDisplay(),e=0;e=0;n--){var l=s[n],d={};"undefined"!=typeof r.options_[l]&&(d[l]=r.options_[l]),vjs.setElementAttributes(a,d)}return r.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&&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,o;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),o=function(){t.off("controlsenabled",n),t.off("controlsdisabled",i)},e.on("dispose",o),t.on("usingcustomcontrols",o),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(t){vjs.log(t,"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){var n=/^blob\:/i;return t&&e&&n.test(e)?t:e},vjs.Html5.prototype.src=function(e){var t=this.el_.src;return void 0===e?this.returnOriginalIfBlobURI_(t,this.source_):void 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||{},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(),function(){var e,t=/^application\/(?:x-|vnd\.apple\.)mpegurl/i,n=/^video\/mp4/i;vjs.Html5.patchCanPlayType=function(){vjs.ANDROID_VERSION>=4&&(e||(e=vjs.TEST_VID.constructor.prototype.canPlayType),vjs.TEST_VID.constructor.prototype.canPlayType=function(n){return n&&t.test(n)?"maybe":e.call(this,n)}),vjs.IS_OLD_ANDROID&&(e||(e=vjs.TEST_VID.constructor.prototype.canPlayType),vjs.TEST_VID.constructor.prototype.canPlayType=function(t){return t&&n.test(t)?"maybe":e.call(this,t)})},vjs.Html5.unpatchCanPlayType=function(){var t=vjs.TEST_VID.constructor.prototype.canPlayType;return vjs.TEST_VID.constructor.prototype.canPlayType=e,e=null,t},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(t){}}()}},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,o=e.options_.techOrder;i=o?i.push(r):r.startTime===r.endTime&&r.startTime<=o&&r.startTime+.5>=o&&i.push(r);if(p=!1,i.length!==this.activeCues_.length)p=!0;else for(e=0;e>>0;if(0===o)return-1;var r=+t||0;if(Math.abs(r)===1/0&&(r=0),r>=o)return-1;for(n=Math.max(r>=0?r:o-Math.abs(r),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(),!t)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,o=e.currentTime();t.label=i.text,t.selected=i.startTime<=o&&oForeground---WhiteBlackRedGreenBlueYellowMagentaCyan---OpaqueSemi-OpaqueBackground---WhiteBlackRedGreenBlueYellowMagentaCyan---OpaqueSemi-TransparentTransparentWindow---WhiteBlackRedGreenBlueYellowMagentaCyan---OpaqueSemi-TransparentTransparentFont Size50%75%100%125%150%175%200%300%400%Text Edge StyleNoneRaisedDepressedUniformDropshadowFont FamilyDefaultMonospace SerifProportional SerifMonospace Sans-SerifProportional Sans-SerifCasualScriptSmall CapsDefaultsDone'}vjs.TextTrackSettings=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.hide(),vjs.on(this.el().querySelector(".vjs-done-button"),"click",vjs.bind(this,function(){this.saveSettings(),this.hide()})),vjs.on(this.el().querySelector(".vjs-default-button"),"click",vjs.bind(this,function(){this.el().querySelector(".vjs-fg-color > 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:n()})},vjs.TextTrackSettings.prototype.getValues=function(){var t,n,i,o,r,a,s,l,d,c,u,p;t=this.el(),r=e(t.querySelector(".vjs-edge-style select")),a=e(t.querySelector(".vjs-font-family select")),s=e(t.querySelector(".vjs-fg-color > select")),i=e(t.querySelector(".vjs-text-opacity > select")),l=e(t.querySelector(".vjs-bg-color > select")),n=e(t.querySelector(".vjs-bg-opacity > select")),d=e(t.querySelector(".window-color > select")),o=e(t.querySelector(".vjs-window-opacity > select")),p=window.parseFloat(e(t.querySelector(".vjs-font-percent > select"))),c={backgroundOpacity:n,textOpacity:i,windowOpacity:o,edgeStyle:r,fontFamily:a,color:s,backgroundColor:l,windowColor:d,fontPercent:p};for(u in c)(""===c[u]||"none"===c[u]||"fontPercent"===u&&1===c[u])&&delete c[u];return c},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=n.toFixed(2)),t(i.querySelector(".vjs-font-percent > select"),n)},vjs.TextTrackSettings.prototype.restoreSettings=function(){var e;try{e=JSON.parse(window.localStorage.getItem("vjs-text-track-settings"))}catch(t){}e&&this.setValues(e)},vjs.TextTrackSettings.prototype.saveSettings=function(){var e;if(this.player_.options().persistTextTrackSettings){e=this.getValues();try{vjs.isEmpty(e)?window.localStorage.removeItem("vjs-text-track-settings"):window.localStorage.setItem("vjs-text-track-settings",JSON.stringify(e))}catch(t){}}},vjs.TextTrackSettings.prototype.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}}(),vjs.JSON,"undefined"!=typeof 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){function walk(e,t){var n,i,o=e[t];if(o&&"object"==typeof o)for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(i=walk(o,n),void 0!==i?o[n]=i:delete o[n]);return reviver.call(e,t,o)}var j;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,o,r=document.getElementsByTagName("video"),a=document.getElementsByTagName("audio"),s=[];if(r&&r.length>0)for(i=0,o=r.length;i0)for(i=0,o=a.length;i0)for(i=0,o=s.length;i-1||t>-1},m=function(){var e=/iPad|iPhone|iPod/.test(navigator.appVersion);return e},v=function(e){return!!e.isFullscreen||!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)&&(!window.screenTop&&!window.screenY)},f=function(e){switch(e.nativeControlsForTouch=!1,e.controls=!0,e.preload="auto",e.extensions||(e.extensions=""),s.setSizeForInitialRender(e),m()&&e.sideStream&&e.sideStream.enabled===!1&&(e.nonViewableBehavior="pause"),e.initialPlayback){case"auto":e.autoplay=!1;break;case"click":e.autoplay=!1;break;case"mouseover":e.autoplay=!1}e.hasOwnProperty("disableTopBar")||(e.disableTopBar=!1),e.communicator=n.externalNameOfVideoPlayer,(l.isAndroid()||p())&&(e.controlBarPosition="below"),"flash"===n.decidePlayer(e.requiredPlayer)&&(e.controlBarPosition="over");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 i={type:"learnMore"};e.learnMore.text&&(i.text=e.learnMore.text),t.buttons.push(i)}return e};c=f(c),"off"===c.initialAudio&&(n.isMuted=!0),c.flash=c.flash?c.flash:{swf:"http://video.devnxs.net/players/flash/AppnexusFlashPlayer.swf"},n.options=c;var g=function(e,t){if(c.playOnMouseover===!0){var i=function(){n.isDoneInitialPlay===!0&&!n.explicitPaused&&n.isViewable&&n.isPlayingVideo===!1&&n.play()},o=function(){n.pause()};e.addEventListener("mouseenter",i),e.addEventListener("mouseleave",o)}if(c.audioOnMouseover!==!1){var r,a=0;"number"==typeof c.audioOnMouseover&&(a=c.audioOnMouseover);var s=function(){!n.isFullscreen&&n.isDoneInitialPlay&&(clearTimeout(r),n.mute(),e.removeEventListener("mouseleave",s))},l=function(){n.isFullscreen||!n.isDoneInitialPlay||n.mutedByViewability||(r=setTimeout(function(){n.unmute(),u("unmute by mouseover")},a)),e.addEventListener("mouseleave",s,!1)};p()||(d=setInterval(function(){n&&n.isFullscreen&&s&&e&&e.removeEventListener("mouseleave",s)},500),e.addEventListener("mouseenter",l,!1))}if(c.autoInitialSize&&!h()&&window.addEventListener("resize",function(){if(v(n)!==!0){var e=!(!n.options.sideStreamObject||"function"!=typeof n.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated)&&n.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated();e||c.targetElement&&c.targetElement.style&&c.targetElement.style.height&&0===Number(c.targetElement.style.height.replace("px",""))||setTimeout(function(){if(c.disableCollapse.enabled||!n.isSkipped&&!n.isCompleted){c.width=c.targetElement.offsetWidth;var e=/android/i.test(navigator.userAgent.toLowerCase());e?c.targetElement.style.webkitTransition="height 0s ease":c.targetElement.style.transition="height 0s ease",n.resizeVideo(-1),c.targetElement.style.height=c.height+"px";var t=document.getElementById(n.videoObjectId);t&&void 0!==typeof t&&(t.style.width=c.width,t.style.height=c.height),setTimeout(function(){var t=function(e){return e<0?0:e/1e3},n=t(c.expandTime);n=n<=0?.001:n,e?c.targetElement.style.webkitTransition="height "+n+"s ease":c.targetElement.style.transition="height "+n+"s ease"},500)}},0)}}),"flash"===n.decidePlayer(c.requiredPlayer)&&(e.addEventListener("mouseenter",function(){n.mouseIn()}),e.addEventListener("mouseleave",function(){n.mouseOut()})),e.style.cursor="pointer",t&&void 0!==t){if(m()){var f=!1;t.ontouchmove=function(){f=!0},t.ontouchend=function(e){return f?void(f=!1):void g(e)}}else t.onclick=function(e){g(e)};var g=function(){"html5"!==n.decidePlayer(c.requiredPlayer)||c.vpaid||(c.learnMore.enabled===!0?c.learnMore.clickToPause===!0&&(n.isPlayingVideo?n.explicitPause():n.explicitPlay()):n.click())}}var y=n.options&&n.options.playerSkin&&n.options.playerSkin.customPlayerSkin;m()&&n.overlayPlayer&&n.options&&n.options.enableInlineVideoForIos===!1&&y&&(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(c.requiredPlayer)){case"html5":p()?new o(n,g).start():new i(n,g).start();break;case"flash":r(n,g)}a.sharedInstance().run(t)};e.exports=p},function(e,t,n){var i=n(8),o=n(9),r=function(e){o.info("Video Player: "+e)};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(10)(o,e).init,this.UIController=n(16)(o,e,t).init,this.displayVolumeControls=n(42)(o).displayVolumeControls,this.start=function(){r("WE ARE USING HTML5 PLAYER");var t=(new Date).getTime()+Math.floor(1e4*Math.random());o.options.techOrder=["html5"],o.options.iframeVideoWrapperId="iframeVideoWrapper_"+t;var n="an_video_ad_player_"+t,i="an_video_ad_player_"+t+"_html5_api";o.an_video_ad_player_id=n,o.an_video_ad_player_html5_api_id=i,e.divIdForVideo=n,e.videoId=i,o.targetElement=o.options.targetElement,o.initializeIframeAndVideo(o.UIController)}}},function(e,t,n){function i(e,t){if(!(e&&t&&e.getBoundingClientRect&&t.getBoundingClientRect))return s("Utils.elementsOverlap expects two html elements"),!1;var n=e.getBoundingClientRect(),i=t.getBoundingClientRect();return!(n.righti.right||n.bottomi.bottom)}var o="PlayerManager_Utils",r=n(9),a=function(e){r.verbose(e,o)},s=function(e){r.info(e,o)},l=function(){var e=/iphone/i.test(navigator.userAgent.toLowerCase());return e},d=function(){var e=l()||/ipad/i.test(navigator.userAgent.toLowerCase());return e},c=function(){return/android/i.test(navigator.userAgent.toLowerCase())},u=function(){return navigator.appVersion.indexOf("Mobile")>-1||navigator.appVersion.indexOf("Android")>-1},p=function(){var e=navigator.userAgent.match(/OS (\d+)_/i);if(e&&e[1])return e[1]},h=function(e,t){!t.isSkipped&&t.isExpanded&&(e.autoInitialSize&&!e.shouldResizeVideoToFillMobileWebview&&(e.width=e.targetElement.offsetWidth),t.resizeVideo(-1,u()),e.targetElement.style.height=e.height+"px")},m=function(e){d()&&e.options.enableInlineVideoForIos&&setTimeout(function(){var t=document.getElementById(e.options.iframeVideoWrapperId);t.style.width="",t.style.height=""},0)},v=function(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),n.eventName=t,e.dispatchEvent(n)},f=function(){this.queue=[],this.id="",this.isSuppress=!1,this.isPaused=!1,this.isCompleted=!1;var e=100,t=!1;this.push=function(e){return this.isSuppress===!1&&"function"==typeof e?void e():t?void(t=!1):void(this.isPaused===!1&&this.queue.push(e))},this.start=function(){a("delay event starts");var t=this,n=function(){if(t.isSuppress===!1){var i=t.queue.shift();i&&"function"==typeof i&&i()}setTimeout(function(){t.isCompleted===!1&&n()},e)};n()},this.ImmediateStop=function(){this.isCompleted=!0},this.lazyTerminate=function(){var e=this,t=function(){e.ImmediateStop()};this.queue.push(t)},this.suppress=function(e){this.isSuppress=e},this.clearQueue=function(){this.queue=[]},this.ignoreNextQueue=function(){t=!0}},g=function(e){return"undefined"==typeof e||""===e||e===!1||null===e},y=function(e){if(null===e||void 0===e)return!0;if(0===e.length)return!0;if(""===e)return!0;if("object"!=typeof e)return!1;if(e.length>0)return!1;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},A=function(){var e={};return{pushAndCheck:function(t,n){var i=t+"_"+n;return!e[i]&&(e[i]=!0,!0)}}},b=function(e){var t=!1;try{t=!isNaN(parseFloat(e))&&isFinite(e)}catch(n){a(n)}return t},k=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}n=e.indexOf(".");var o=n>0?Number(e.substring(n+1).substr(0,3)):0;n>0&&(e=e.substring(0,n));var r=e.split(":");if(3===r.length){for(var s=0;s0&&(i+=n+">"),i+=t,c(e)&&console.log(i)}catch(o){c(e)&&console.log(o)}}var p=0,h=1,m=2,v=3,f=4,g=5,y=6,A=6,b="AppNexus_Page_Debug_Log_Level",k=y,T=p,w=T,E=T,S=T,I=T;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(n){}},always:function(){try{o.call(this,h,Array.prototype.slice.call(arguments))}catch(e){}},error:function(){try{o.call(this,m,Array.prototype.slice.call(arguments))}catch(e){}},log:function(){try{o.call(this,g,Array.prototype.slice.call(arguments))}catch(e){}},warn:function(){try{o.call(this,v,Array.prototype.slice.call(arguments))}catch(e){}},info:function(){try{o.call(this,f,Array.prototype.slice.call(arguments))}catch(e){}},debug:function(){try{o.call(this,y,Array.prototype.slice.call(arguments))}catch(e){}},verbose:function(){try{o.call(this,A,Array.prototype.slice.call(arguments))}catch(e){}},handleLogDebugLegacySupport:function(e,t){try{u(g,e,t)}catch(n){}},setDebugLevel:function(e){try{d(e)}catch(t){}},isTraceLevelActive:function(e){try{return c(e)}catch(t){return!1}},TRACE_LEVEL_ALWAYS:h,TRACE_LEVEL_ERROR:m,TRACE_LEVEL_WARN:v,TRACE_LEVEL_INFO:f,TRACE_LEVEL_LOG:g,TRACE_LEVEL_DEBUG:y,TRACE_LEVEL_VERBOSE:A},l()},function(e,t,n){var i="[PlayerManager_InitializeElements]",o=n(9),r=n(11),a=function(e){o.verbose(i,e)},s=function(e){o.debug(i,e)},l=function(e){o.log(i,e)};e.exports=function(e,t){return{init:function(n){l("init");var i,o=!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;c-1;f&&t.overlayPlayer===!1?(i.onload=function(){m(),v=!0},setTimeout(function(){v===!1&&(a("destroying due to an error in firefox"),t.destroyWithoutSkip(!0,e.CONST_MESSAGE_GENERAL_ERROR,null,900))},e.options.vpaidTimeout)):m()}}}},function(e,t,n){var i=(n(12),n(14)),o=n(15),r=o.OmidSessionClient.AdSession,a=o.OmidSessionClient.Partner,s=o.OmidSessionClient.Context,l=o.OmidSessionClient.VerificationScriptResource,d=o.OmidSessionClient.AdEvents,c=o.OmidSessionClient.VideoEvents,u="[PlayerManager_Verifications]",p=n(9);e.exports=function(e,t){var n,o,h,m=e,v=t,f=[],g=new i(e,t.player),y=function(e){p.debug(u,"OMID sessionObserver");try{"sessionStart"===e.type?(p.debug(u,"OMID sessionStart"),""!==OMIDVideoEvents().position&&h.loaded({isSkippable:OMIDVideoEvents().isSkippable,isAutoPlay:OMIDVideoEvents().isAutoPlay,position:OMIDVideoEvents().position}),o.impressionOccurred()):"sessionError"===event.type?p.debug(u,"OMID sessionError"):"sessionFinish"===event.type&&p.debug(u,"OMID sessionFinish")}catch(t){p.debug(u,"Failed OMID sessionStart "+t)}};return{init:function(){p.debug(u,"init verifications");for(var e=0;e0)try{if(""!==getOMIDPartner().name&&""!==getOMIDPartner().version){var E=new a(getOMIDPartner().name,getOMIDPartner().version),S=new s(E,f);p.debug(u,"BuildTest::"+v.videoElement),S.setVideoElement(v.videoElement),n=new r(S),o=new d(n),h=new c(n),n.registerSessionObserver(y),p.debug(u,"OMID _adSession"),p.debug(u,n),p.debug(u,h)}}catch(w){p.debug(u,"Failed OMID registerSessionObserver "+w)}},start:function(){p.debug(u,"start verifications")},dispatchEvent:function(e,t){p.debug(u,"try to dispatch OMID event: "+e+", data: ",t);try{"start"===e?h.start(t.duration,t.videoPlayerVolume):"firstQuartile"===e?h.firstQuartile():"thirdQuartile"===e?h.thirdQuartile():"midpoint"===e?h.midpoint():"complete"===e?h.complete():"volumeChange"===e?h.volumeChange(t.videoPlayerVolume):"adUserInteraction"===e?h.adUserInteraction(t.interactionType):"resume"===e?h.resume():"pause"===e?h.pause():"playerStateChange"===e?h.playerStateChange(t.state):"skipped"===e&&h.skipped()}catch(n){p.debug(u,"Failed OMID Video Events "+n)}},destroy:function(){p.debug(u,"destroy verifications")}}}},function(e,t,n){var i=n(13),o="[PlayerManager_Verification_OMID]",r=n(9),a=function(e){r.debug(o,e)};e.exports=function(e,t){function n(){var e=(new Date).getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)});return t}function s(e,t){p=e,h=t,f&&u()}function l(e,t){y&&y.addListener(e,t)}function d(){var e={apiVersion:"1.0",environment:"web",accessMode:"full",videElement:v.videoElement,adSessionType:"html",adCount:1,omidJsInfo:{omidImplementer:"videoads-ad-video-player-manager",serviceVersion:"3.5.19"}};return m.adServingId&&(e.adServingId=m.adServingId),e}function c(e){return e===m.vendor?m.verificationParams:null}function u(){r.debug(o,"start OMID session");var e={adSessionId:g,type:"sessionStart",timestamp:Date.now(),data:{context:d()}},t=c(h);t&&(e.data.verificationParameters=t),y=new i(g,p),p(e)}var p,h,m=e,v=t,f=!1,g=n(),y=null,A=[];return{init:function(){r.debug(o,"expose OMID interface"),v.frameWin.omid3p={registerSessionObserver:s,addEventListener:l}},start:function(){f=!0,p&&u()},dispatchEvent:function(e,t){y?(A.length>0&&(A.forEach(function(t){a("dispatch from cache OMID event "+e),y.fireEvent(t.eventName,t.data)}),A=[]),r.debug(o,"dispatch OMID event "+e),y.fireEvent(e,t)):(r.debug(o,"save in cache OMID event "+e),A.push({event:e,data:t}))},destroy:function(){if(r.debug(o,"terminate OMID session"),p&&f){var e={adSessionId:g,type:"sessionFinish",timestamp:Date.now()};p(e)}}}}},function(e,t){e.exports=function(e,t){function n(e,t){return!!e.find(function(e){return t===e})}function i(e){return n(u,e)||n(p,e)||n(h,e)||n(m,e)||n(v,e)}function o(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={},n.mediaType="video";break;case"loaded":n={},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={},n.duration=t.duration,n.videoPlayerVolume=t.volume;break;case"volumeChange":n={},n.videoPlayerVolume=t.volume;break;case"playerStateChange":n={},n.state=t.state;break;case"adUsetInteraction":n={},n.interactionType=t.interactionType}return n}function r(e,t){var n={adSessionId:l,type:e,timestamp:Date.now()},i=o(e,t);return i&&(n.data=i),n}function a(e){return"sessionError"===e}function s(e,t){c.hasOwnProperty(e)||(c[e]=[]),c[e].push(t)}var l=e,d=t,c={},u=["sessionStart","sessionError","sessionFinish"],p=["impression"],h=["loaded","start","firstQuartile","midpoint","thirdQuartile","complete","pause","resume","bufferStart","bufferFinish","skipped","volumeChange","playerStateChange","adUserInteraction"],m=["geometryChange"],v=["video"];return{addListener:function(e,t){i(e)&&(n(v,e)?h.forEach(function(e){s(e,t)}):s(e,t))},fireEvent:function(e,t){if(c.hasOwnProperty(e)){var n=r(e,t);a(e)?d(n):c[e].forEach(function(e){e(n)})}}}}},function(e,t,n){var i="[PlayerManager_Verification_Tracking]",o=n(9);e.exports=function(e,t){function n(e,t){var n=e;if(t)for(var i in t)n=n.split("["+i.toUpperCase()+"]").join(encodeURIComponent(t[i]));return n=a(n)}function r(){var e=(new Date).getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)});return t}function a(e){for(var n in c)if(e.indexOf("["+n+"]")>=0){var i=c[n];null===i&&(i=t?t.resolveMacro(n):-1),e=e.split("["+n+"]").join(encodeURIComponent(i))}return e}for(var s={},l=0;li)throw Error("Value for "+e+" is outside the range ["+n+","+i+"]")},assertFunction:function(e,t){if(!t)throw Error(e+" must not be truthy.")},assertPositiveNumber:function(e,t){if((0,module$exports$omid$common$argsChecker.assertNumber)(e,t),0>t)throw Error(e+" must be a positive number.")}},module$exports$omid$common$exporter={};module$exports$omid$common$exporter.packageExport=function(e,t,n){(n=void 0===n?module$contents$omid$common$exporter_getOmidExports():n)&&(e=e.split("."),e.slice(0,e.length-1).reduce(module$contents$omid$common$exporter_getOrCreateName,n)[e[e.length-1]]=t)};var module$exports$omid$sessionClient$Partner=function(e,t){module$exports$omid$common$argsChecker.assertTruthyString("Partner.name",e),module$exports$omid$common$argsChecker.assertTruthyString("Partner.version",t),this.name=e,this.version=t};(0,module$exports$omid$common$exporter.packageExport)("OmidSessionClient.Partner",module$exports$omid$sessionClient$Partner);var module$exports$omid$sessionClient$VerificationScriptResource=function(e,t,n){module$exports$omid$common$argsChecker.assertTruthyString("VerificationScriptResource.resourceUrl",e),this.resourceUrl=e,this.vendorKey=t,this.verificationParameters=n};(0,module$exports$omid$common$exporter.packageExport)("OmidSessionClient.VerificationScriptResource",module$exports$omid$sessionClient$VerificationScriptResource);var module$exports$omid$sessionClient$Context=function(e,t){module$exports$omid$common$argsChecker.assertNotNullObject("Context.partner",e),this.partner=e,this.verificationScriptResources=t,this.videoElement=this.slotElement=null};module$exports$omid$sessionClient$Context.prototype.setVideoElement=function(e){module$exports$omid$common$argsChecker.assertNotNullObject("Context.videoElement",e),this.videoElement=e},module$exports$omid$sessionClient$Context.prototype.setSlotElement=function(e){module$exports$omid$common$argsChecker.assertNotNullObject("Context.slotElement",e),this.slotElement=e},(0,module$exports$omid$common$exporter.packageExport)("OmidSessionClient.Context",module$exports$omid$sessionClient$Context);var module$exports$omid$common$constants={AdEventType:{IMPRESSION:"impression",STATE_CHANGE:"stateChange",GEOMETRY_CHANGE:"geometryChange",SESSION_START:"sessionStart",SESSION_ERROR:"sessionError",SESSION_FINISH:"sessionFinish",VIDEO:"video",LOADED:"loaded",START:"start",FIRST_QUARTILE:"firstQuartile",MIDPOINT:"midpoint",THIRD_QUARTILE:"thirdQuartile",COMPLETE:"complete",PAUSE:"pause",RESUME:"resume",BUFFER_START:"bufferStart",BUFFER_FINISH:"bufferFinish",SKIPPED:"skipped",VOLUME_CHANGE:"volumeChange",PLAYER_STATE_CHANGE:"playerStateChange",AD_USER_INTERACTION:"adUserInteraction"},VideoEventType:{LOADED:"loaded",START:"start",FIRST_QUARTILE:"firstQuartile",MIDPOINT:"midpoint",THIRD_QUARTILE:"thirdQuartile",COMPLETE:"complete",PAUSE:"pause",RESUME:"resume",BUFFER_START:"bufferStart",BUFFER_FINISH:"bufferFinish",SKIPPED:"skipped",VOLUME_CHANGE:"volumeChange",PLAYER_STATE_CHANGE:"playerStateChange",AD_USER_INTERACTION:"adUserInteraction"},ErrorType:{GENERIC:"generic",VIDEO:"video"},AdSessionType:{NATIVE:"native",HTML:"html"},EventOwner:{NATIVE:"native",JAVASCRIPT:"javascript",NONE:"none"},AccessMode:{FULL:"full",LIMITED:"limited"},AppState:{BACKGROUNDED:"backgrounded",FOREGROUNDED:"foregrounded"},Environment:{MOBILE:"app"},InteractionType:{CLICK:"click",INVITATION_ACCEPT:"invitationAccept"},MediaType:{DISPLAY:"display",VIDEO:"video"},Reason:{NOT_FOUND:"notFound",HIDDEN:"hidden",BACKGROUNDED:"backgrounded",VIEWPORT:"viewport",OBSTRUCTED:"obstructed",CLIPPED:"clipped"},SupportedFeatures:{CONTAINER:"clid",VIDEO:"vlid"},VideoPosition:{PREROLL:"preroll",MIDROLL:"midroll",POSTROLL:"postroll",STANDALONE:"standalone"},VideoPlayerState:{MINIMIZED:"minimized",COLLAPSED:"collapsed",NORMAL:"normal",EXPANDED:"expanded",FULLSCREEN:"fullscreen"},NativeViewKeys:{X:"x",Y:"y",WIDTH:"width",HEIGHT:"height",AD_SESSION_ID:"adSessionId",IS_FRIENDLY_OBSTRUCTION_FOR:"isFriendlyObstructionFor",CLIPS_TO_BOUNDS:"clipsToBounds",CHILD_VIEWS:"childViews",END_X:"endX",END_Y:"endY",OBSTRUCTIONS:"obstructions"},MeasurementStateChangeSource:{CONTAINER:"container",CREATIVE:"creative"},ElementMarkup:{OMID_ELEMENT_CLASS_NAME:"omid-element"},CommunicationType:{NONE:"NONE",DIRECT:"DIRECT",POST_MESSAGE:"POST_MESSAGE"},OmidImplementer:{OMSDK:"omsdk"}},module$contents$omid$common$InternalMessage_GUID_KEY="omid_message_guid",module$contents$omid$common$InternalMessage_METHOD_KEY="omid_message_method",module$contents$omid$common$InternalMessage_VERSION_KEY="omid_message_version",module$contents$omid$common$InternalMessage_ARGS_KEY="omid_message_args",module$exports$omid$common$InternalMessage=function(e,t,n,i){this.guid=e,this.method=t,this.version=n,this.args=i};module$exports$omid$common$InternalMessage.isValidSerializedMessage=function(e){return!!e&&void 0!==e[module$contents$omid$common$InternalMessage_GUID_KEY]&&void 0!==e[module$contents$omid$common$InternalMessage_METHOD_KEY]&&void 0!==e[module$contents$omid$common$InternalMessage_VERSION_KEY]&&"string"==typeof e[module$contents$omid$common$InternalMessage_GUID_KEY]&&"string"==typeof e[module$contents$omid$common$InternalMessage_METHOD_KEY]&&"string"==typeof e[module$contents$omid$common$InternalMessage_VERSION_KEY]&&(void 0===e[module$contents$omid$common$InternalMessage_ARGS_KEY]||void 0!==e[module$contents$omid$common$InternalMessage_ARGS_KEY])},module$exports$omid$common$InternalMessage.deserialize=function(e){return new module$exports$omid$common$InternalMessage(e[module$contents$omid$common$InternalMessage_GUID_KEY],e[module$contents$omid$common$InternalMessage_METHOD_KEY],e[module$contents$omid$common$InternalMessage_VERSION_KEY],e[module$contents$omid$common$InternalMessage_ARGS_KEY])},module$exports$omid$common$InternalMessage.prototype.serialize=function(){var e={};return e[module$contents$omid$common$InternalMessage_GUID_KEY]=this.guid,e[module$contents$omid$common$InternalMessage_METHOD_KEY]=this.method,e[module$contents$omid$common$InternalMessage_VERSION_KEY]=this.version,e=e,void 0!==this.args&&(e[module$contents$omid$common$InternalMessage_ARGS_KEY]=this.args),e};var module$exports$omid$common$Communication=function(e){this.to=e,this.communicationType_=module$exports$omid$common$constants.CommunicationType.NONE};module$exports$omid$common$Communication.prototype.sendMessage=function(e,t){},module$exports$omid$common$Communication.prototype.handleMessage=function(e,t){this.onMessage&&this.onMessage(e,t)},module$exports$omid$common$Communication.prototype.generateGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return e="y"===e?(3&t|8).toString(16):t.toString(16)})},module$exports$omid$common$Communication.prototype.serialize=function(e){return JSON.stringify(e)},module$exports$omid$common$Communication.prototype.deserialize=function(e){return JSON.parse(e)},module$exports$omid$common$Communication.prototype.isDirectCommunication=function(){return this.communicationType_===module$exports$omid$common$constants.CommunicationType.DIRECT};var module$exports$omid$common$logger={error:function(e){for(var t=[],n=0;no)break;if(i')+"")))},appendPresenceIframe_:function(e){var t=e.document.createElement("iframe");t.id=module$exports$omid$common$DetectOmid.OMID_PRESENT_FRAME_NAME,t.name=module$exports$omid$common$DetectOmid.OMID_PRESENT_FRAME_NAME,t.style.display="none",e.document.body.appendChild(t)},isMutationObserverAvailable_:function(e){return"MutationObserver"in e},registerMutationObserver_:function(e){var t=new MutationObserver(function(n){n.forEach(function(n){"BODY"===n.addedNodes[0].nodeName&&(module$exports$omid$common$DetectOmid.appendPresenceIframe_(e),t.disconnect())})});t.observe(e.document.documentElement,{childList:!0})}},module$exports$omid$common$serviceCommunication={resolveTopWindowContext:function(e){if("undefined"==typeof e&&"undefined"!=typeof window&&window&&(e=window),"undefined"==typeof e||!e||"undefined"==typeof e.top||!e.top)return module$exports$omid$common$OmidGlobalProvider.omidGlobal;if(e===e.top)return e;try{return"undefined"==typeof e.top.location.hostname?e:e.top}catch(t){return e}}};module$exports$omid$common$serviceCommunication.startServiceCommunication=function(e,t,n){return n=void 0===n?module$exports$omid$common$DetectOmid.isOmidPresent:n,(t=module$contents$omid$common$serviceCommunication_getUnobfuscatedKey(e,t))?new module$exports$omid$common$DirectCommunication(t):e.top&&n(e.top)?new module$exports$omid$common$PostMessageCommunication(e,e.top):null};var module$exports$omid$common$version={ApiVersion:"1.0",Version:"1.2.5-iab615"},module$contents$omid$sessionClient$AdSession_SESSION_CLIENT_VERSION=module$exports$omid$common$version.Version,module$exports$omid$sessionClient$AdSession=function(e,t){t=void 0===t?(0,module$exports$omid$common$serviceCommunication.startServiceCommunication)((0,module$exports$omid$common$serviceCommunication.resolveTopWindowContext)(window),["omid","v1_SessionServiceCommunication"]):t,module$exports$omid$common$argsChecker.assertNotNullObject("AdSession.context",e),this.context=e,this.impressionOccurred_=!1,this.communication_=t,this.isSessionRunning_=this.hasVideoEvents_=this.hasAdEvents_=!1,this.callbackMap_={},this.communication_&&(this.communication_.onMessage=this.handleMessage_.bind(this),this.sendOneWayMessage("setClientInfo",module$exports$omid$common$version.Version,this.context.partner.name,this.context.partner.version)),this.injectVerificationScripts_(e.verificationScriptResources),this.sendSlotElement_(e.slotElement),this.sendVideoElement_(e.videoElement),this.watchSessionEvents_()};module$exports$omid$sessionClient$AdSession.prototype.isSupported=function(){return!!this.communication_},module$exports$omid$sessionClient$AdSession.prototype.registerSessionObserver=function(e){this.sendMessage("registerSessionObserver",e)},module$exports$omid$sessionClient$AdSession.prototype.error=function(e,t){this.sendOneWayMessage("sessionError",e,t)},module$exports$omid$sessionClient$AdSession.prototype.registerAdEvents=function(){if(this.hasAdEvents_)throw Error("AdEvents already registered.");this.hasAdEvents_=!0,this.sendOneWayMessage("registerAdEvents")},module$exports$omid$sessionClient$AdSession.prototype.registerVideoEvents=function(){if(this.hasVideoEvents_)throw Error("VideoEvents already registered.");this.hasVideoEvents_=!0,this.sendOneWayMessage("registerVideoEvents")},module$exports$omid$sessionClient$AdSession.prototype.sendOneWayMessage=function(e,t){for(var n=[],i=1;i0?e.click(o.url):e.click():t({name:"ad-click",trackClick:!0}):r[i]&&t({name:r[i]}),e.notifyVpaidEvent(i),"AdVideoComplete"===i&&e.adVideoPlayer.trigger("customDestroy")},k=i.isIos()||i.isAndroid(),T=this;e.options.overlayPlayer&&e.resizeVideo();var w=T.vastClient({url:"",jsVpaidUrl:m,playAdAlways:!0,adCancelTimeout:r,adsEnabled:!0,adParameters:n.adParameters,clickUrl:n.clickUrls[0],delayExpandUntilVPAIDInit:n.delayExpandUntilVPAIDInit,terminateUnresponsiveVPAIDCreative:n.terminateUnresponsiveVPAIDCreative,disableControlsOnMouseover:k,initialAudio:n.initialAudio,loggerCallback:y,vpaidEventCallback:b,delayExpandUntilVPAIDImpression:n.delayExpandUntilVPAIDImpression,vpaidEnvironmentVars:n.vpaidEnvironmentVars,overlayPlayer:n.overlayPlayer,mobileSDK:n.mobileSDK,initialPlayback:n.initialPlayback,controlBarPosition:n.controlBarPosition}),E=function(){if(e.options.overlayPlayer){var t=T,n=i.isAndroid()?1e3:500;setTimeout(function(){t.paused()&&t.tech&&t.tech.el()&&t.tech.el().src&&t.trigger("pause")},n)}};if(T.on("reset",function(){T.options().plugins["ads-setup"].adsEnabled?w.enable():w.disable()}),T.on("vast.adError",function(t){if(g!==!0){g=!0,T.loadingSpinner.hide(),e.destroyWithoutSkip(!0,a,!1,901);var n=t.error;n&&n.message&&p("JS-VPAID Error (vast.adError)"+n.message)}}),T.on("vpaid.AdVideoStart",function(){var t=e&&e.adVideoPlayer&&e.adVideoPlayer.player?e.adVideoPlayer.player().duration():0;if(e.test("VIDLA509",t),t&&t>0)e.setVastAttribute();else{var n=!1;T.one("loadedmetadata",function(){if(n=!0,t=e&&e.adVideoPlayer&&e.adVideoPlayer.player?e.adVideoPlayer.player().duration():0,e.test("VIDLA509",t),t&&t>0)e.setVastAttribute();else{var i=e.options.data.vastDurationMsec;i=i&&i>0?Math.round(i/1e3):0,e.test("VIDLA509-2",i),e.setVastAttribute(i)}}),setTimeout(function(){if(n===!1){var t=e.options.data.vastDurationMsec;t=t&&t>0?Math.round(t/1e3):0,e.test("VIDLA509-2",t),e.setVastAttribute(t)}},3e3)}}),T.on("vast.adTimeout",function(){T.loadingSpinner.hide(),e.destroyWithoutSkip(!0,s,!0,901)}),T.on("vpaid.AdError",function(t){if(g!==!0){g=!0,T.loadingSpinner.hide(),e.destroyWithoutSkip(!0,s,!1,901);var n=t.error;n&&n.message&&p("JS-VPAID Error (vpaid.AdError) "+n.message)}}),T.on("vast.adSkip",function(){e.destroy(),p("vast.adSkip")}),T.on("vpaid.AdSkipped",function(){e.destroy(),p("vpaid.AdSkipped")}),T.on("vpaid.AdIcons",function(t){t&&t.hasOwnProperty("adIcons")&&t.adIcons||(e.options.showVpaidIcons=!0)}),T.on("vast.adsCancel",function(){g||(g=!0,e.destroyWithoutSkip(),p("adsCancel"))}),T.on("vpaid.AdStopped",function(){return p("vpaid.AdStopped"),n.disableCollapse.replay===!0?void e.resetVpaid():(T.loadingSpinner.hide(),T.controlBar.hide(),T.bigPlayButton.hide(),void(e.isCompleted||(n.disableCollapse.enabled||e.destroyWithoutSkip(),e.isCompleted=!0)))}),T.one("vpaid.AdStarted",function(){E(),f&&n.overlayPlayer&&("edge"===A||"ie"===A?f.style.visibility="visible":f.style.display="block"),T.loadingSpinner.hide()}),T.one("vpaid.AdImpression",function(){E(),T.controlBar.show(),n.showBigPlayButton&&T.bigPlayButton.show()}),v.cbWhenReady){var S=function(){e.test("VIDLA509-1",""),p("callcbWhenReady (Impression, AdStarted are delivered"),e.isReadyToExpandForMobile=!0,T.tech.removeControlsListeners();var t=e.options.width/e.options.height;e.resizeVideo(t,i.isMobile()),n.isWaterfall&&n.firstAdAttempted&&n.delayExpandUntilVPAIDInit&&!n.isExpanded&&"auto"!==n.initialPlayback&&T.bigPlayButton.show(),"function"==typeof v.cbWhenReady&&v.cbWhenReady(e)},I=function(){var t=!1,n=T.volume(),o=!1,r=!1,a=!1,s=!1,l=100,d=function(){o&&r&&a&&t===!1&&(t=!0,setTimeout(S,500))};if(i.isIos()){T.on("timeupdate",function(){var t=T.player().currentTime();t>0&&s===!1&&e.isAlreadyPlaingForVPAID===!1&&(s=!0,a=!0,T.pause(),d(),p("pause by timeupdate when delayExpandUntilVPAIDImpression is true"))});var c=function(){var n=T.player().currentTime();n>0&&s===!1&&e.isAlreadyPlaingForVPAID===!1&&(s=!0,a=!0,T.pause(),d(),p("pause by timer when delayExpandUntilVPAIDImpression is true")),t||setTimeout(c,l)};setTimeout(c,l)}else T.one("vpaid.AdVideoStart",function(){e.isAlreadyPlaingForVPAID===!1&&T.pause(),T.volume(n),a=!0,d()});T.one("vpaid.AdStarted",function(){o=!0,d()}),T.one("vpaid.AdImpression",function(){r=!0,d()}),T.volume(0),e.delayEventHandler.ignoreNextQueue(),i.isIos()?(e.adVideoPlayer.trigger("play"),e.isDoneInitialPlay=!0):T.play()},C=function(){n.delayExpandUntilVPAIDImpression?I():S()};n.isWaterfall&&n.firstAdAttempted?T.one("an.doneInitialize",C):n.delayExpandUntilVPAIDInit?T.one("an.readytogovpaid",C):T.one("an.doneInitialize",C)}})};e.exports=m},function(e,t,n){var i="UserAgentParser",o=n(9);o.always(i,"Version 0.0.1");var r=function(e,t){var n="",i="?",o="function",a="object",s="string",l="model",d="name",c="type",u="vendor",p="version",h="console",m="mobile",v="tablet",f="smarttv",g="wearable",y={extend:function(e,t){var n={};for(var i in e)t[i]&&t[i].length%2===0?n[i]=t[i].concat(e[i]):n[i]=e[i];return n},has:function(e,t){return"string"==typeof e&&t.toLowerCase().indexOf(e.toLowerCase())!==-1},lowerize:function(e){return e.toLowerCase()},major:function(e){return typeof e===s?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},A={rgx:function(){var e,t,n,i,r,s,l={},d=0,c=arguments;for(n=0;n0?2===i.length?typeof i[1]===o?l[i[0]]=i[1].call(this,s):l[i[0]]=i[1]:3===i.length?typeof i[1]!==o||i[1].exec&&i[1].test?l[i[0]]=s?s.replace(i[1],i[2]):void 0:l[i[0]]=s?i[1].call(this,s,i[2]):void 0:4===i.length&&(l[i[0]]=s?i[3].call(this,s.replace(i[1],i[2])):void 0):l[i]=s?s:void 0;d+=2}return l},str:function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var o=0;o0&&t.explicitUnmute():t.explicitMute()};n.controlBar.muteToggle.on("click",l),n.controlBar.muteToggle.on("touchend",l)}else s("removing mute button"),n.controlBar.muteToggle.dispose();if(e.options.showVolume===!0&&e.displayVolumeControls()&&n.controlBar.volumeControl.volumeBar.on("mousedown",function(){var e=n.volume();e<=0&&!t.isMuted&&(s("muting from volume scrubber"),t.explicitMute()),e>0&&t.isMuted&&(s("unmuting from volume scrubber"),t.explicitUnmute())}),i.isIos()&&e.options.enableNativeInline&&parseInt(i.getIOSVersion())>9&&"click"!==e.options.initialPlayback&&(n.muted(!0),n.controlBar.muteToggle.update()),"boolean"==typeof e.options.customButton.enabled&&e.options.customButton.enabled===!0){var d=e.options.playerSkin.controlBarHeight||30,c=Math.min(50,e.options.customButton.imgWidth),u=Math.min(d,e.options.customButton.imgHeight),p=Math.floor((d-u)/2),h="a";e.isMobile()&&(h="span");var m=e.videojsOrigin.createEl("div",{innerHTML:"<"+h+' href="'+e.options.customButton.url+'" target="_blank">'+h+">",role:"button","aria-live":"polite",tabindex:"0"});m.style.cssText="float:right;font-family:VideoJS;font-size:1.5em;line-height:2;width:50px;height:100%;text-align:center",n.controlBar.addChild("button",{el:m}),n.controlBar.el().insertBefore(m,n.controlBar.fullscreenToggle.el())}n.controlBar.progressControl.seekBar.seekHandle.hide(),n.controlBar.progressControl.seekBar.el_.style.pointerEvents="none","boolean"==typeof e.options.showProgressBar?(e.options.showProgressBar===!1&&(s("removing progress bar"),n.controlBar.currentTimeDisplay.hide(),n.controlBar.timeDivider.hide(),n.controlBar.durationDisplay.hide()),n.controlBar.progressControl.seekBar.hide()):"text"===e.options.showProgressBar?(s("removing progress text"),n.controlBar.progressControl.seekBar.hide()):"bar"===e.options.showProgressBar&&(s("removing progress bar"),n.controlBar.currentTimeDisplay.hide(),n.controlBar.timeDivider.hide(),n.controlBar.durationDisplay.hide()),e.options.allowFullscreen===!1&&(s("removing fullscreen toggle"),n.controlBar.fullscreenToggle.addClass("vjs-hidden")),e.isMobile()&&e.options.allowFullscreen===!0&&e.options.showMute===!0&&(n.controlBar.fullscreenToggle.el().style.visibility="hidden",n.controlBar.muteToggle.el().style.visibility="hidden"),e.options.targetElement.addEventListener("outstream-impression",function(){e.isMobile()&&e.options.allowFullscreen===!0&&e.options.showMute===!0&&(n.controlBar.fullscreenToggle.el().style.visibility="visible",n.controlBar.muteToggle.el().style.visibility="visible")}),e.options.targetElement.addEventListener("vastplayer-impression",function(){e.isMobile()&&e.options.allowFullscreen===!0&&e.options.showMute===!0&&(n.controlBar.fullscreenToggle.el().style.visibility="visible")})}}}},function(e,t,n){var i="[PlayerManager_AdIndicator]",o=n(9),r=function(e){o.verbose(i,e)};e.exports=function(e,t){return{init:function(n,i,o,a,s){r("init"),o.id="ad_indicator_text",o.innerHTML=e.adIndicatorTextContent,o.className="top-bar-text",o.role="button";var l="3em";if(e.isMobile()&&(l="5em"),o.style["text-align"]="right",o.style["margin-right"]="1em",o.style["margin-left"]="1em",o.style["font-size"]="1em",o.style.right="0px",o.style.left="",o.style["line-height"]="24px",o.style.outline="0",o.style.position="absolute",o.style.padding="0",o.style.height="auto",o.style.width="auto",o.style["max-width"]="35%",o.style["white-space"]="nowrap",o.style.overflow="hidden",o.style["text-overflow"]="ellipsis",s?o.style.cursor="pointer":o.style["pointer-events"]="none",a.style["text-align"]="right",a.style["margin-right"]="1em",a.style["margin-left"]="1em",a.style["font-size"]="1em",a.style.right="0px",a.style.left="",a.style["line-height"]="3em",a.style.outline="0",a.style.position="absolute",a.style.padding="0",a.style.height=l,a.style["max-width"]="35%",a.style.width="auto",a.style["text-overflow"]="ellipsis",a.style["white-space"]="nowrap",a.style.overflow="hidden",a.style.display="none",s){a.style.cursor="pointer";var d=function(n){t.click(),e.isMobile()&&(n.stopPropagation(),n.preventDefault())};o.addEventListener("touchend",d),a.addEventListener("touchend",d),o.addEventListener("click",d),a.addEventListener("click",d)}else a.style["pointer-events"]="none";n.addChild("button",{el:a})}}}},function(e,t,n){var i="[PlayerManager_Skip]",o=n(9),r=n(8),a=function(e){o.debug(i,e)},s=function(e){o.verbose(i,e)};e.exports=function(e,t){return{init:function(n,i,o,l,d){a("init");var c,u;if(e.options.skippable.enabled===!0){s("creating and styling skip buttons and skip texts");var p=e.options.skippable.videoThreshold,h=e.options.skippable.skipText,m=e.options.skippable.skipButtonText;c=d.contentWindow.document.createElement("div"),c.id="skip_button",c.innerHTML=m,c.className="top-bar-text",c.role="button";var v="";e.isMobile()&&(v="5.0em"),c.style.display="none",c.style.cursor="pointer",c.style["font-weight"]="bold",c.style["margin-right"]="1em",c.style["margin-left"]="1em",c.style["font-size"]="1em",c.style.right="",c.style.left="0px",c.style["line-height"]="24px",c.style.outline="0",c.style.position="absolute",c.style.padding="0",c.style.height=v,c.style.width="auto",c.style["min-width"]="5em",c.style["text-align"]="left",e.floatingSkipButton=e.videojsOrigin.createEl("div",{className:"top-bar-text",role:"button",innerHTML:m}),e.floatingSkipButton.style.display="none",e.floatingSkipButton.style.cursor="pointer",e.floatingSkipButton.style["font-weight"]="bold",e.floatingSkipButton.style["margin-right"]="1em",e.floatingSkipButton.style["margin-left"]="1em",e.floatingSkipButton.style["font-size"]="1em",e.floatingSkipButton.style.right="",e.floatingSkipButton.style.left="0px",e.floatingSkipButton.style["line-height"]="3em",e.floatingSkipButton.style.outline="0",e.floatingSkipButton.style.position="absolute",e.floatingSkipButton.style.padding="0",e.floatingSkipButton.style.height=v,e.floatingSkipButton.style["min-width"]="5em",e.floatingSkipButton.style.width="auto",e.floatingSkipButton.style.display="none",e.floatingSkipButton.style["text-align"]="left",l.addChild("button",{el:e.floatingSkipButton});var f=function(n){return a("SKIP clicked, destroying player"),e.options.vpaid?(l.trigger("skip"),void(e.isMobile()&&(n.stopPropagation(),n.preventDefault(),e.options.overlayPlayer&&t.destroy()))):(t.destroy(),void(e.isMobile()&&(n.stopPropagation(),n.preventDefault(),t.isCompleted=!0)))};switch(e.isMobile()&&(c.addEventListener("touchend",f),e.floatingSkipButton.addEventListener("touchend",f),e.floatingSkipButton.addEventListener("mousedown",function(e){e.preventDefault()})),c.addEventListener("click",f),e.floatingSkipButton.addEventListener("click",f),e.floatingAdSkipText=e.videojsOrigin.createEl("div",{className:"top-bar-text",role:"button",innerHTML:""}),e.floatingAdSkipText.style["margin-left"]="1em",e.floatingAdSkipText.style["margin-right"]="1em",e.floatingAdSkipText.style.right="",e.floatingAdSkipText.style.left="0px",e.floatingAdSkipText.style["font-size"]="1em",e.floatingAdSkipText.style["line-height"]="3em",e.floatingAdSkipText.style.outline="0",e.floatingAdSkipText.style.position="absolute",e.floatingAdSkipText.style["text-align"]="left",e.floatingAdSkipText.style.padding="0",e.floatingAdSkipText.style.height="3em",e.floatingAdSkipText.style.width="auto",e.floatingAdSkipText.style["pointer-events"]="none",e.floatingAdSkipText.style.display="none",l.addChild("button",{el:e.floatingAdSkipText}),u=d.contentWindow.document.createElement("div"),u.id="ad_skip_text",u.innerHTML=m,u.className="top-bar-text", -u.role="button",u.style["margin-left"]="1em",u.style["margin-right"]="1em",u.style.right="",u.style.left="0px",u.style["font-size"]="1em",u.style["line-height"]="24px",u.style.outline="0",u.style.position="absolute",u.style["text-align"]="left",u.style.padding="0",u.style.height="3em",u.style.width="auto",u.style["pointer-events"]="none",u.style.display="none",e.options.skippable.skipLocation){case"top-right":c.style.right="0px",c.style.left="",c.style["text-align"]="right",u.style.right="0px",u.style.left="",e.floatingSkipButton.style.right="0px",e.floatingSkipButton.style.left="",e.floatingSkipButton.style["text-align"]="right",e.floatingAdSkipText.style.right="0px",e.floatingAdSkipText.style.left=""}var g=!1,y=!1,A=!1,b={},k=function(){var n,i=Math.round(l.player().currentTime()),a=Math.round(l.player().duration());n=t.options.skippable.allowOverride?Math.round(e.options.data.skipOffsetMsec/1e3):e.options.skippable.videoOffset;var s=n-i,d=!e.options.skippable.allowOverride||e.options.data.isVastVideoSkippable;d=!(n>a)&&d,t.test("VIDLA163_needToShowSkip",d),p0&&!t.startedReplay&&!t.isEnded?(e.floatingAdSkipText.innerHTML=h.replace("%%TIME%%",s),c.style.display="none",u.innerHTML=h.replace("%%TIME%%",s),u.style.display="block",r.elementsOverlap(u,o)&&(u.style.display="none")):(e.readyForSkip||(t.test("log",i),t.test("VIDLA163_skip",i)),e.readyForSkip=!0,t.isFullscreen&&!e.pendingFullscreenExit&&(e.floatingAdSkipText.style.display="none",e.floatingSkipButton.style.display="block"),u.style.display="none",c.style.display="block"))};l.on("resize",function(){k()}),l.on("timeupdate",function(){var n=t.options.data.vastProgressEvent;if(!e.options.isWaterfall||!e.options.vpaid||e.options.vpaidImpressionFired){var i=Math.round(l.player().currentTime()),o=1e3*i;if(n&&"object"==typeof n){var r=function(){t.test("VIDLA163_Tracking",b)};for(var a in n){var s=n[a];if("number"==typeof s&&s>=0&&o>=s&&Object.keys(b).indexOf(a)===-1){b[a]=s;var d={};d.name=a,d.name&&t.dispatchEventToAdunit(d,r)}}}k()}})}if(e.options.skippable&&e.options.skippable.skipLocation)switch(e.options.skippable.skipLocation){case"top-right":o.style.right="",o.style.left="0px",i.style.right="",i.style.left="0px"}!e.options.disableTopBar&&n&&(e.options.skippable.enabled===!0&&(n.appendChild(c),n.appendChild(u)),n.appendChild(o)),l.on("timeupdate",function(){if(!e.options.vpaid){var t=Math.round(l.player().currentTime()),n=l.player().duration();if(n){var i=n/4,o=n/4*2,r=n/4*3;!g&&t>=i&&t=o&&t=r&&(e.dispatchEventToAdunit({name:"video-third-quartile"}),A=!0)}}})}}}},function(e,t,n){var i="[PlayerManager_EndCardSetup]",o=n(9),r=function(e){o.debug(i,e)},a=n(24);e.exports=function(e,t){return{init:function(n){if(r("init"),e.options.endCard.enabled){var i=e.options.endCard;if(i.showDefaultButtons){for(var o=-1,s=0;s=0&&i.buttons.splice(o,1)}r("Creating EndCard."),t.endCard=new a(i,n,t)}}}}},function(e,t,n){var i="[EndCard]",o=n(25),r=n(9),a=function(e){r.debug(i,e)},s=function(e){r.verbose(i,e)},l=function(e,t,n){this.layers=[],this.buttons=[],this.options=e,this.vjsPlayer=t,this.playerManager=n,this.firedCreativeView=!1,this.onLayerClick=function(e){e.stopPropagation(),e.target===e.currentTarget&&n.click()},e.layers=[{type:"videoAd"}],e.layers.push({type:"color",width:"100%",height:"100%",color:e.color}),e.layers.push({type:"companionAd"}),e.layers.push({type:"image",width:e.imageWidth,height:e.imageHeight,imageUrl:e.imageUrl}),this.createEndCardContainer(t.player().el_),this.createLayers(),this.createButtons()};l.prototype.styleForCentering=function(e,t,n){e.style.display="block",e.style.position="absolute",e.style.top=0,e.style.bottom=0,e.style.left=0,e.style.right=0,e.style.margin="auto",e.style.maxWidth=t||"100%",e.style.maxHeight=n||"100%",t&&(e.style.width=t),n&&(e.style.height=n)},l.prototype.styleSizeLimitScaleDown=function(e,t,n){var i=this,o=e.elem,r=function(){t=t||i.endCardElem.offsetWidth,n=n||i.endCardElem.offsetHeight;var a=o.offsetWidth,s=o.offsetHeight;if(!(t&&n&&a&&s))return void setTimeout(r,5);var l,d=t/n,c=a/s;if(dt&&(s=t/c,c*=s,u*=s),u>n&&(s=n/u,c*=s,u*=s);else if(c>t||u>n){a("xxx Skipping Companion: ["+h+"] - Companion size ("+c+"x"+u+") won't fit in ad unit.");continue}d=Math.abs(c*u-i),de||i.companionAd.height>t?i.elem.style.display="none":i.elem.style.display="block"):"image"===i.type&&"block"===i.elem.style}},l.prototype.saveSetStyle=function(e,t,n){void 0!==n&&(e.styleSave||(e.styleSave={}),e.elem&&(void 0===e.styleSave[t]&&(e.styleSave[t]=e.elem.style[t]),e.elem.style[t]=n))},l.prototype.restoreStyle=function(e){if(e.styleSave){if(e.elem)for(var t in e.styleSave)e.elem.style[t]=e.styleSave[t];delete e.styleSave}},l.prototype.createEndCardContainer=function(e){this.endCardElem||(this.endCardElem=e.ownerDocument.createElement("div"),e.appendChild(this.endCardElem),this.endCardElem.className="video-js vjs-default-skin vjs-controls-enabled vjs-big-play-centered vjs-has-started vjs-paused vjs-ended vjs-user-active",this.playerManager.isIosInlineRequired()?(this.endCardElem.style["background-color"]="",this.endCardElem.style.background=this.playerManager.options.playerSkin.videoBackgroundColor,this.endCardElem.style.opacity=1):this.endCardElem.style["background-color"]="rgba(0,0,0,0)",this.endCardElem.setAttribute("name","endCardContainer"),this.endCardElem.style.width="100%",this.endCardElem.style.height="100%",this.endCardElem.style.display="none",this.endCardElem.style.cursor=this.options.clickable?"pointer":"default",this.endCardElem.style.position="relative",this.endCardElem.style["text-align"]="center",this.options.clickable&&(this.endCardElem.onclick=this.onLayerClick))},l.prototype.createImageLayer=function(e,t){var n={},i=e.ownerDocument.createElement("img");e.appendChild(i),i.setAttribute("name","ecImageLayer"),i.id=t.id||"endCardImageLayer",i.setAttribute("src",t.imageUrl||""),i.style.cursor=this.options.clickable?"pointer":"default",this.styleForCentering(i,t.width,t.height),i.style.display="none",n.elem=i,n.opts=t,this.layers.push(n)},l.prototype.createColorLayer=function(e,t){var n={},i=e.ownerDocument.createElement("div");e.appendChild(i),i.setAttribute("name","ecColorLayer"),i.id=t.id||"endCardColorLayer",i.style["background-color"]=t.color||"black",i.style.cursor=this.options.clickable?"pointer":"default",this.styleForCentering(i,t.width||"100%",t.height||"100%"),t.color||(i.style.display="none"),n.elem=i,n.opts=t,this.layers.push(n)},l.prototype.createAdVideoLayer=function(e,t){if(void 0===this.videoLayer){var n={};n.elem=e,n.opts=t,e&&this.playerManager.isIosInlineRequired()&&(n.videoParent=e.parentElement,n.videoSibling=e.nextSibling),this.videoLayer=this.layers.length,this.layers.push(n)}else a("Can't create new video layer because one already exists!")},l.prototype.createCompanionLayer=function(e,t){var n={},i=e.ownerDocument.createElement("div");e.appendChild(i),i.setAttribute("name","ecCompanionLayer"),i.id="endCardCompanionLayer",i.style.position="absolute",i.style.width=t.width||"100%",i.style.height=t.height||"100%",this.styleForCentering(i),i.style["background-color"]="rgba(0,0,0,0)",n.elem=i,n.opts=t,this.layers.push(n)},l.prototype.show=function(){if(this.vjsPlayer&&this.vjsPlayer.controlBar&&this.vjsPlayer.controlBar.hide(),void 0!==this.videoLayer){var e=this.layers[this.videoLayer],t=this.options.layers[this.videoLayer];e.elem&&(e.videoParent&&(this.videoLayer0?i.elem.style.display="none":i.opts.imageUrl&&(n.styleSizeLimitScaleDown(i),i.elem.style.display="block")),n.options.clickable&&i.elem&&(i.elem.addEventListener("click",n.onLayerClick),i.elem.style.cursor="pointer"))}}),this.endCardElem.style.display="block"},l.prototype.hide=function(){if(void 0!==this.videoLayer){var e=this.layers[this.videoLayer];this.restoreStyle(e),e.videoParent&&e.videoParent.insertBefore(e.elem,e.videoSibling)}for(var t=0;t ",a=function(e,t,i,o,r){var a=e,s=o,l=r,d=(new Date).getTime()+Math.floor(1e4*Math.random());l({command:"addTrackingEvents",uniqueId:d,data:s});var c=function(){s.CompanionClickTracking&&l({command:"requestTracking",uniqueId:d,data:"companion-click"}),s.hasOwnProperty("StaticResource")&&s.CompanionClickThrough&&window.open(s.CompanionClickThrough)},u=function(){s.TrackingEvents&&s.TrackingEvents.length>0&&l({command:"requestTracking",uniqueId:d,data:"creative-view"})},p=!0;if(s.hasOwnProperty("StaticResource")){var h=s.StaticResource.type;if("application/x-javascript"===h){var m=document.createElement("script");m.src=s.StaticResource.src,m.onload=u(),a.appendChild(m)}else if(0===h.indexOf("image")){var v=document.createElement("img");v.src=s.StaticResource.src,v.style.maxWidth="100%",v.style.maxHeight="100%",v.style.width="auto",v.style.height="auto",v.style.margin="auto",v.style.display="block",v.style.top=0,v.style.bottom=0,v.style.left=0,v.style.right=0,v.style.position="absolute",v.onload=u(),v.onclick=c,p=!1,v.style.cursor="pointer",a.innerHTML="",a.style.position="relative",a.appendChild(v)}}else if(s.hasOwnProperty("IFrameResource")){var f=document.createElement("iframe");f.src=s.IFrameResource,f.scrolling="no",f.style.width="100%",f.style.height="100%",f.style.border="none",f.style.overflow="hidden",f.onload=u(),p=!1,a.appendChild(f)}else if(s.hasOwnProperty("HTMLResource"))if(0===s.HTMLResource.indexOf("http")){var g=n(29);g.load(s.HTMLResource,function(e,t){e||0===t.length||(a.style.display="inline-block",a.style.position="relative",a.innerHTML=t,u())})}else a.style.display="inline-block",a.style.position="relative",a.innerHTML=s.HTMLResource,u();p&&(s.hasOwnProperty("StaticResource")&&s.CompanionClickThrough&&(a.style.cursor="pointer"),a.onclick=c),this.stop=function(){"concurrent"===s.renderingMode&&(a.innerHTML="")}},s=function(e,t,n){var s=e,l=t,d=n,c=[];o.always(r,"Version: 0.1.10");for(var u=[],p=0;p"),t!==-1&&(n=n.substr(0,t+1)),n.trim()},d=function(e){if(0===e.length)return o.warn(r,"parseCompanions > empty companions xml"),null;e=l(e),""+e+"");var t=null;if("undefined"!=typeof window.DOMParser){if(t=(new DOMParser).parseFromString(e,"text/xml"),"parsererror"===t.documentElement.nodeName){try{o.error(r,"parseCompanions > Error reason = "+t.documentElement.childNodes[0].nodeValue)}catch(i){}return o.warn(r,"parseCompanions > invalide xml structure"),null}}else{if("undefined"==typeof window.ActiveXObject)return o.error(r,"parseCompanions > Failed to parse vast xml by window.ActiveXObject(Microsoft.XMLDOM)"),null;try{if(t=new window.ActiveXObject("Microsoft.XMLDOM"),t.loadXML(e),0!==t.parseError.errorCode)return o.error(r,t.parseError),null}catch(a){return o.error(r,"parseCompanions > Failed to parse vast xml by window.ActiveXObject(Microsoft.XMLDOM)",a),null}}if(!t)return o.error(r,"parseCompanions > invalid xml structure"),null;var s=n(30),d=s.parse(t);return d};e.exports={renderCompanions:function(e,t,n){o.log(r,"renderCompanions called.");var i=new s(e,t,n);return i},stopCompanions:function(e){e&&e.stop()},parse:function(e){return d(e)}}},function(e,t,n){function i(e){for(var t=[],n=0;n=e&&(i===-1||i>=E[o].width-e)&&(i>E[o].width-e&&(n.length=0),n.push(E[o]),i=E[o].width-e);if(n.length>0)E.length=0,E=n.slice();else{for(o=0;o=e-E[o].width)&&(i>e-E[o].width&&(n.length=0),n.push(E[o]),i=e-E[o].width);n.length>0&&(E.length=0,E=n.slice())}if(1!==E.length){for(n.length=0,i=-1,o=0;o=t&&(i===-1||i>=E[o].height-t)&&(i>E[o].height-t&&(n.length=0),n.push(E[o]),i=E[o].height-t);if(n.length>0)E.length=0,E=n.slice();else{for(o=0;o=t-E[o].height)&&(i>t-E[o].height&&(n.length=0),n.push(E[o]),i=t-E[o].height);n.length>0&&(E.length=0,E=n.slice())}}}function d(e){return 0===S||(1!==S||!o(e))&&(3!==S||!r(e))}function c(e){for(var t=[],n=-1,i=0;i=e-E[i].bitrate)&&(n>e-E[i].bitrate&&(t.length=0),n=e-E[i].bitrate,t.push(E[i]));if(t.length>0)E.length=0,E=t.slice();else for(i=0;i=e&&(n===-1||n>=E[i].bitrate-e)&&(n>E[i].bitrate-e&&(t.length=0),n=E[i].bitrate-e,t.push(E[i]));if(1===t.length||0===S)return t[0];if(1===S||3===S){for(i=0;i0){if(1===E.length)return E[0];l(e,t),i=1===E.length?E[0]:c(n)}return null===i&&(E=o.slice()),i}function p(e){S=2,e&&e.playerTechnology&&Array.isArray(e.playerTechnology)&&e.playerTechnology.length>0&&(1===e.playerTechnology.length?S="html5"===e.playerTechnology[0]?1:3:"flash"===e.playerTechnology[0]&&(S=4))}function h(e){S=2,e&&e.playerTechnology&&Array.isArray(e.playerTechnology)&&e.playerTechnology.length>0&&1===e.playerTechnology.length&&(S="html5"===e.playerTechnology[0]?1:3)}function m(e){return e?(1===S?e.requiredPlayer=1:3===S?e.requiredPlayer=2:o(e.type.toLowerCase())?e.requiredPlayer=2:r(e.type.toLowerCase())?e.requiredPlayer=1:e.requiredPlayer=0,e.success=!0,C.info(P,"Selected rendition: ",e),e):(C.error(P,"Failed to select rendition"),{success:!1,errorCode:403})}function v(e){if(e&&e>0)return C.info(P,"Selected bitrate (not from cache): "+e),e;var t=1;try{var n=I.getGenericData("anxBandwidth");n?(t=n,C.info(P,"Selected bitrate (from cache): "+t)):C.info(P,"No bitrate data present in cache (use bitrate 1)")}catch(i){C.warn(P,"Exception during getting bitrate from cache (use bitrate 1)")}return t}function f(e){return e&&e.playerTechnology&&Array.isArray(e.playerTechnology)&&2===e.playerTechnology.length&&"flash"===e.playerTechnology[0]&&"html5"===e.playerTechnology[1]&&(e.playerTechnology=["html5","flash"]),e}function g(){return navigator.appVersion.indexOf("Mobile")>-1||navigator.appVersion.indexOf("Android")>-1}function y(e,t,n,i){var o=u(e,t,n);return o&&d(o.type.toLowerCase())?(C.info(P,"VPAID selected"),o):(h(i),0===E.length?null:1===E.length?d(E[0].type.toLowerCase())?E[0]:null:(l(e,t),1===E.length?(C.log(P,"Rendition selected by size"),d(E[0].type.toLowerCase())?E[0]:null):(C.log(P,"Try select rendition by bitrate"),c(n))))}function A(e,t,n,i){i=f(i),p(i),s();var r=v(n),a=E.slice();E.length=0;for(var l=0;l0;n++){var l=t[n];if(E.length=0,E=s.slice(),b(l.width,l.height),1!==E.length)if(0!==E.length){for(var d=!1,c=0;c ";e.exports={init:function(e){E=i(e)},getUrl:function(e,t,n,i){return A(e,t,n,i)},selectCompanionsForContainers:function(e,t){T(e,t)}}},function(e,t,n){function i(e,t,n){switch(w){case 0:a(e,t);break;case 1:d(e,t,n);break;default:case 2:p(e,t)}}function o(e){switch(w){case 0:return s(e);case 1:return c(e);default:case 2:return h(e)}}function r(e){switch(w){case 0:l(e);break;case 1:u(e);break;default:case 2:m(e)}}function a(e,t){localStorage&&localStorage.setItem(e,t)}function s(e){if(localStorage)return localStorage.getItem(e)}function l(e){localStorage&&localStorage.removeItem(e)}function d(e,t,n){D.setItem(e,t,n?1/0:new Date(Date.now()+j).toUTCString())}function c(e){return D.getItem(e)}function u(e){D.removeItem(e)}function p(e,t){V&&(V[e]=t)}function h(e){if(V)return V[e]}function m(e){V&&delete V[e]}function v(){try{if(localStorage){var e="apntestls"+Math.random();try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(t){}}}catch(t){}return!1}function f(){try{if(document&&document.cookie){var e="apntestcookie"+Math.random();try{D.setItem(e,e,1/0);var t=D.hasItem(e)&&D.getItem(e)===e;return D.removeItem(e),t}catch(n){}}}catch(n){}return!1}function g(e,t){var n={};n.timestamp=(new Date).getTime(),n.ad=e;try{i(t,JSON.stringify(n))}catch(o){}}function y(e){var t,n=(new Date).getTime();try{var i=o(e);t=i&&JSON.parse(i),r(e)}catch(a){}if(t&&t.timestamp&&t.timestamp>0){var s=n-t.timestamp;if(s<=j)return t.ad}return null}function A(e){try{r(e)}catch(t){}}function b(e){j=e*C}function k(){var e,t;return t=o(_),e=t?parseInt(t):0,i(_,e+=1,!0),e}function T(e){return"apn_"+e}var w,E=n(28),S="Cache Manager",I=40,C=6e4,P=I*C,j=P,x="___appnexus_video_cachemanager_generic_data___",_="___appnexus_video_cachemanager_ad_token___",V={};w=v()?0:f()?1:2,E.debug("Using Cache Method "+w,S);var D={getItem:function(e){return e?decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null:null},setItem:function(e,t,n,i,o,r){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;var a="";if(n)switch(n.constructor){case Number:a=n===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+n;break;case String:a="; expires="+n;break;case Date:a="; expires="+n.toUTCString()}return document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+a+(o?"; domain="+o:"")+(i?"; path="+i:"")+(r?"; secure":""),!0},removeItem:function(e,t,n){return!!this.hasItem(e)&&(document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(n?"; domain="+n:"")+(t?"; path="+t:""),!0)},hasItem:function(e){return!!e&&new RegExp("(?:^|;\\s*)"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(document.cookie)},keys:function(){for(var e=document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g,"").split(/\s*(?:\=[^;]*)?;\s*/),t=e.length,n=0;n0),t},objectToString:function(e,t){var n="null";if(t="undefined"!=typeof t?t:0,null!==e){n="OBJ[";var i="";for(var o in e){var a=e[o];if("object"==typeof a)if(t++,t0&&(i+=","),i+=o+"="+a}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 r in e)n.push(e[r].responseURL);var a=e[e.length-1];if(a){var s=i(a),l=a.responseURL;o.info(t,"Tag load chain:",n,"\n","Final Tag URL: ",l,"\n","Final Tag: ",s)}}}else{var d=i(e);o.info(t,"Tag URL:",e.responseURL,"\n","Tag:",d)}}catch(c){}}}},function(e,t,n){function i(e,t,o,r,a,s){var l,d=0,c=0,u=!1,p=n(28),h=n(27),m=!0,v=function(e){p.logDebug(e,"URL Loader")};if(a&&"undefined"!=typeof a.withCredentials&&(m=a.withCredentials),window.XMLHttpRequest)l=new XMLHttpRequest;else if(window.ActiveXObject)try{l=new ActiveXObject("Msxml2.XMLHTTP")}catch(f){try{l=new ActiveXObject("Microsoft.XMLHTTP")}catch(g){}}return l?(l.onreadystatechange=function(){if(4===l.readyState)if(200===l.status){if(o&&o.call(this,void 0,l.responseText,l),v("duration: "+c+", response length: "+l.responseText.length),u&&l.responseText&&l.responseText.length>2048){var e=8*l.responseText.length*1e3/(1024*Math.max(1,c)),t=parseInt(e.toString());v("Bandwidth: "+t);try{h.setGenericData("anxBandwidth",t)}catch(n){}}}else l.status>=400&&l.status<600&&o&&o.call(this,l.status,"",l);else 2===l.readyState?d=(new Date).getTime():3===l.readyState&&d>0&&(u=!0,c=(new Date).getTime()-d)},l.onerror=function(){if(m){var n=a?a:{};n.withCredentials=!1,i(e,t,o,r,n,s)}else if(o){var d=0===l.status?"404":l.status.toString();o.call(this,d,"",l)}},l.ontimeout=function(){o&&o.call(this,"Timeout","",l)},l.open(s,e),r&&(l.timeout=r),l.withCredentials=m,d=0,void("POST"===s?l.send(t):l.send())):void(o&&o.call(this,"406",""))}function o(e,t){r.log("Logging Event: "+t+" at url:"+e),new Image(1,1).src=e}var r=n(9);e.exports={load:function(e,t,n){i(e,null,t,n,{withCredentials:!0},"GET")},loadPost:function(e,t,n,o){i(e,t,n,o,{withCredentials:!0},"POST")},trackPixel:function(e,t){o(e,t)}}},function(e,t){var n={parse:function(e){var t={companions:[]},n=function(){this.getSubNodes=function(e,t){var n=e.getElementsByTagName(t);return n.length>0?n:null},this.getSubNode=function(e,t,n){n||(n=0);var i=e.getElementsByTagName(t);return i.length>n?i[n]:null},this.getNodeValue=function(e){if(0===e.childNodes.length)return"";var t=e.childNodes[0].nodeValue;return t.trim()},this.getNodeValues=function(e){if(0===e.childNodes.length)return"";for(var t="",n=0;n0&&(i=o.indexOf(".")>=0?parseFloat(o):parseInt(o)),i},this.getNodeAttributeBooleanValue=function(e,t,n){n||(n=!1);var i=n,o=this.getNodeAttributeValue(e,t);if(o.length>0){var r=o.toLowerCase().charAt(0); -i="t"===r}return i},this.getSubNodeValue=function(e,t,n){n="undefined"==typeof n?"":n;var i=this.getSubNode(e,t);return null!==i?this.getNodeValue(i):n},this.getSubNodeWholeValue=function(e,t,n){n="undefined"==typeof n?"":n;var i=this.getSubNode(e,t);return null!==i?this.getNodeValues(i):n},this.getSubNodeBooleanValue=function(e,t,n){n="undefined"==typeof n?"false":n;var i=this.getSubNodeValue(e,t);return i.length>0&&"t"===i.toLowerCase().charAt(0)||!(i.length>0&&"f"===i.toLowerCase().charAt(0))&&n}},i=new n,o=i.getSubNode(e,"CompanionAds"),r=i.getNodeAttributeValue(o,"required");r&&r.length>0&&(t.required=r);var a=i.getSubNodes(o,"Companion");if(a)for(var s=0;s0&&(d.assetWidth=p),p=i.getNodeAttributeNumberValue(l,"assetHeight",-1),p>0&&(d.assetHeight=p),p=i.getNodeAttributeNumberValue(l,"expandedWidth",-1),p>0&&(d.expandedWidth=p),p=i.getNodeAttributeNumberValue(l,"expandedHeight",-1),p>0&&(d.expandedHeight=p),p=i.getNodeAttributeValue(l,"apiFramework"),p&&(d.apiFramework=p),p=i.getNodeAttributeValue(l,"adSlotId"),p&&(d.adSlotId=p),p=i.getNodeAttributeValue(l,"required"),p&&(d.required=p),p=i.getNodeAttributeValue(l,"renderingMode"),p&&(d.renderingMode=p),p=i.getSubNodeValue(l,"AltText"),p&&(d.AltText=p),p=i.getSubNodeValue(l,"AdParameters"),p&&(d.AdParameters=p);var h=i.getSubNode(l,"StaticResource");if(h&&(p=i.getNodeAttributeValue(h,"creativeType"))){var m="video/x-flv"===p||"video/x-f4v"===p||"video/f4v"===p||"application/x-shockwave-flash"===p;if(m)continue;var v={type:p};p=i.getNodeValues(h),p&&(v.src=p,d.StaticResource=v)}p=i.getSubNodeWholeValue(l,"IFrameResource"),p&&(d.IFrameResource=p),p=i.getSubNodeWholeValue(l,"HTMLResource"),p&&(d.HTMLResource=p),p=i.getSubNodeValue(l,"CompanionClickThrough"),p&&(d.CompanionClickThrough=p);var f,g,y,A=i.getSubNodes(l,"CompanionClickTracking");if(A)for(d.CompanionClickTracking=[],f=0;f\n*/\n.vjs-default-skin {\n color: #CCCCCC;\n}\n/* Custom Icon Font\n--------------------------------------------------------------------------------\nThe control icons are from a custom font. Each icon corresponds to a character\n(e.g. "\\e001"). Font icons allow for easy scaling and coloring of icons.\n*/\n@font-face {\n font-family: \'VideoJS\';\n src: url(\'font/vjs.eot\');\n src: url(data:application/font-woff;base64,d09GRgABAAAAABG0AAsAAAAAEWgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIHUGNtYXAAAAFoAAAAfAAAAHyz47CpZ2FzcAAAAeQAAAAIAAAACAAAABBnbHlmAAAB7AAADTwAAA08MPTaTGhlYWQAAA8oAAAANgAAADYP2gkbaGhlYQAAD2AAAAAkAAAAJAkgBThobXR4AAAPhAAAAGQAAABkW54DGGxvY2EAAA/oAAAANAAAADQeIiIQbWF4cAAAEBwAAAAgAAAAIAAiAIluYW1lAAAQPAAAAVYAAAFWUqTEiXBvc3QAABGUAAAAIAAAACAAAwAAAAMD/AGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA6ioDwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEAGAAAAAUABAAAwAEAAEAIOAO4B/mAOkm6YTqKv/9//8AAAAAACDgAOAe5gDpJumE6ir//f//AAH/4yAEH/UaFRbwFpMV7gADAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAPAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAIAAP/ABAADwAAGAA0AAAERJwcnNycDBxchERc3BACgwGDAoKDAoP5goMADwP5goMBgwKD9YMCgAaCgwAAAAAABAMAAQANAA0AAAgAAEwkBwAKA/YADQP6A/oAAAgCAAEADgANAAAMABwAAEyERIQEhESGAAUD+wAHAAUD+wANA/QADAP0AAAABAAAADwHAA3EACwAAATYWFREUBi8BIxEzAZEUGxsU8aCgA3EUDBv8xBsMFPEBgAACAAAADwJHA3EAGAAkAAAlIiYnJjQ3PgE0JicmNDc2MhceARQGBw4BAzYWFREUBi8BIxEzAiUJEgcODh4fHx4ODg4oDiwtLSwHEp0UGxsU8aCg2wcHDigOHk1QTR4OKA4ODixxdHEsBwcClhQMG/zEGwwU8QGAAAADAAAADwNwA3EAHQA2AEIAACUiJicmNDc+ATQmJyY0NzYyFx4DFRQOAgcOASciJicmNDc+ATQmJyY0NzYyFx4BFAYHDgEDNhYVERQGLwEjETMC0AoRBw4OMTExMQ4ODicOHy8gEREgLx8HEbQJEgcODh4fHx4ODg4oDiwtLSwHEp0UGxsU8aCggAcIDicOMnuCezIOJw4PDx5HTVQrK1RNRx4IB1sHBw4oDh5NUE0eDigODg4scXRxLAcHApYUDBv8xBsMFPEBgAAAAAAEAAAADwRAA3EAIwBBAFoAZgAAJSImJyY0Nz4DNTQuAicmNDc2MhceAxUUDgIHDgEjJyImJyY0Nz4BNCYnJjQ3NjIXHgMVFA4CBw4BJyImJyY0Nz4BNCYnJjQ3NjIXHgEUBgcOAQM2FhURFAYvASMRMwN6CRIHDg4hMyISEiIzIQ4ODigOKD0pFhYpPSgHEgmqChEHDg4xMTExDg4OJw4fLyARESAvHwcRtAkSBw4OHh8fHg4ODigOLC0tLAcSnRQbGxTxoKAmBwcOKA4hTFNaLi5aU0whDigODg4oW2VsODhsZVsoBwdaBwgOJw4ye4J7Mg4nDg8PHkdNVCsrVE1HHggHWwcHDigOHk1QTR4OKA4ODixxdHEsBwcClhQMG/zEGwwU8QGAAAEAwP/AA0ADwAADAAAJAwIA/sABQAFAA8D+AP4AAgAABAAA/7oFXgPAAAMALwBSAHUAABMhESEBLgEnLgEnLgMjIg4CBw4BBw4BBx4BFx4BFx4DFz4DNz4BNz4BJS4DIyIOAhUUHgIzMj4CNyMOASMiJjU0NjMyFhczIS4DIyIOAhUUHgIzMj4CNyMOASMiJjU0NjMyFhczAAVe+qIE3QESIAUUCRBVfZxWVZ+AWBAJFAcfEQICER8HFAkQWICfVVacfVUQCRQFIBL9ugQgOE4yLlA7IiA8VjcrSTYjBIoEIyM2ICsmIikDiAHeBCE3TjMtUDsiIDxWNixJNiIFigQjIzcfKyYhKQSIA8D7+gIHh4opCQwHCxAKBAQKEAsHDAkpioeHiSoJDAYMEAoFAQEFChAMBgwJKom2NVM5HyhLa0JDa0soHzpUNSc1WzpPUS8rNVM5HyhLa0JDa0soHzpUNSc1WzpPUS8rAAABAIAAQAOAA0AAAwAAEyERIYADAP0AA0D9AAAACAA4AAADwAPAAAsAFwAjAC8ASABhAHoAhgAAARQWMzI2NTQmIyIGBRQWMzI2NTQmIyIGExQWMzI2NTQmIyIGAxQWMzI2NTQmIyIGBTgBMRQWMzI2NTgBMTgBMTQmIyIGFRQ0MSU4ATEUFjMyNjU4ATE4ATE0JiMiBhUUNDEDOAExFBYzMjY1OAExOAExNCYjIgYVFDQxAxQWMzI2NTQmIyIGAYBLNTVLSzU1SwEQSzU1S0s1NUuwJRsbJSUbGyVwJRsaJiYaGyX+8CUbGyUlGxsl/vAmGhslJRsaJiA5Jyg4OCgnOVgqHh4qKh4eKgNANUtLNTVLS6U1S0s1NUtL/rsbJSUbGyUl/tUaJiYaGyUlixslJRsbJSUbGxtwGiYmGhslJRsaGgIgKDg4KCc5OScoKP7wHioqHh4qKgAAAAACAAD/wAQAA8AABgANAAABEScHJzcnAQcXIREXNwHAoMBgwKAD4MCg/mCgwAGA/mCgwGDAoAHgwKABoKDAAAAAAQAA/8AEAAOAACIAAAEyHgIVFA4CIyImJw4DBzU+ATU0JicuAzU0PgICAGq7i1BQi7tqFCgUKVpdYDAzTQEBLEYxG1CLuwOAQXGYVlaYcUEDAikzHQoCGxpXNAcPBxxIUlwxVphxQQADAAD/wAQAA8AAEwAnAFoAAAEiDgIVFB4CMzI+AjU0LgIDMh4CFRQOAiMiLgI1ND4CAQ4DIyIuAicuAzU0PgI3FzgBMQ4BFBYXHgEzMjY3PgE0Jic3HgMVFA4CAgBqu4tQUIu7amq7i1BQi7tqNV1GKChGXTU1XUYoKEZdAWYeR01UKytUTUceHy8gEREgLx9DMTExMTB7Q0N7MDExMTFDHy8gEREgLwPAUIu7amq7i1BQi7tqaruLUP8AKEZdNTVdRigoRl01NV1GKP3PHy8gEREgLx8eR01UKytUTUceQzJ7gnsyLzMzLzJ7gnsyQx5HTVQrK1RNRwAAAAABAAD/wAQAA8AAMwAAASIGByU+ATU0JiclHgEzMjY1NCYjIgYVFBYXBS4BIyIGFRQWMzI2NwUOARUUFjMyNjU0JgNgIjsW/lEBAQEBAa8WOyJCXl5CQl4BAf5RFjsiQl5eQiI7FgGvAQFeQkJeXgEAGhfYBg0GBg0G2BcaXkJCXl5CBg0G2BcaXkJCXhoX2AYNBkJeXkJCXgAAAAACACD/8AQAA7AAOgByAAABLgEnLgEnLgEnLgEHDgEHDgEHDgEHDgEXHgEXHgEXHgEXHgE3PgE3PgE3PgE3PgE3OgEzMjY1PAE1MQcOAQcOAQcOAScuAScuAScuAScuATc+ATc+ATc+ATc+ARceARceARceARceAQcxHAEVFBYXDgEHBAABFRUUOSQjVC4tYTExXywtTyEhNBESEAEBFBMTNiEiTisrWi4uWSkpSx4fMRAJDgMBAgEbJWYRMx8fSSgoVSoqUycmRR0dLA8PDgEBEhARLh0eQyUlTycnTSQjQBobKQ4NDQEhGAUPCwHAMmMtLlIiIzUSEhEBARUTFDcjIlEtLF4vL1wrK00gIDIQERABARQSEjQhIEwpGTQbJRsBAwGqKEceHi4QDw8BARIRETEeHkcmJ1EpKVAlJUIcGysODw0BAREQEC0cHEEkI0smAQMBGSQDGjMYAAACAAD/wAQAA8AAGQAzAAABIg4CBz4DMzIeAhUUFjMyNjU0LgIDMj4CNw4DIyIuAjU0JiMiBhUUHgICAGm4ilIDAkNxlVVWmHFBOCgoOFCLu2ppuIpSAwJDcZVVVphxQTgoKDhQi7sDwE6Itmhbn3ZERnqjXSg4OChqu4tQ/ABOiLZoW592REZ6o10oODgoaruLUAAAAgAA/8AEAAPAADAAPAAAATUnLgEnNycHLgEvASMHDgEHJwcXDgEPARUXHgEXBxc3HgEfATM3PgE3FzcnPgE/AQUiJjU0NjMyFhUUBgQAkwQLBlaIeQwbDhjAGA4bDHmIVgYLBJOTBQoHV4h6DBoNGcAZDRoMeohXBwoFk/4ANUtLNTVLSwFgwBkNGg15iFYGCwWSkgULBlaIeQ0aDRnAGQ0aDXmIVwYLBZOTBQsGV4h5DRoNGSBLNTVLSzU1SwAABgBA/8ADwAPAABkAIQA3AEUAUwBhAAABLgEnLgEnLgEjISIGFREUFjMhMjY1ETQmJyceARcjNR4BExQGIyEiJjURNDYzMDoCMRUUFjsBAyEiJjU0NjMhMhYVFAYnISImNTQ2MyEyFhUUBichIiY1NDYzITIWFRQGA5YRLRkaMxcnKQv+ECEvLyEC4CEvDhyFFyUNmhEphgkH/SAHCQkHm7qbEw3goP5ADRMTDQHADRMTDf5ADRMTDQHADRMTDf5ADRMTDQHADRMTAtsXMxoZLREcDi8h/KAhLy8hAnALKSc2FykRmg0l/OgHCQkHA2AHCeANE/4AEw0NExMNDROAEw0NExMNDROAEw0NExMNDRMAAAAAAQAA/8AEAAPAAC0AAAEhNy4BIyIGBw4BFRQWFx4BMzI2Nz4BNxcOAyMiLgI1ND4CMzIeAhc3BAD+gJA3jE1NjDc2Ojo2N4xNTYw3BAkEYCNWYmw6aruLUFCLu2o1ZFxSI5YCQJA2Ojo2N4xNTYw3Njo6NgUJBVQoQS0ZUIu7amq7i1AVJzcjlgAAAAACAAAAAAPAA34ADwAqAAABFSMnByM1Nyc1Mxc3MxUHASImLwEjIiY1ETQ2OwE3PgEXHgEVERQGBw4BA8BVa2tVa2tVa2tVa/5LBgwF9nMNExMNc/YHEwkJCwsJAwYBVVVra1Vra1Vra1Vr/kAFBPcTDQFADRP3BgQDBBAK/MAKEAQBAQABAAAAAQAAi1igY18PPPUACwQAAAAAANWuYlIAAAAA1a5iUgAA/7oFXgPAAAAACAACAAAAAAAAAAEAAAPA/8AAAAVeAAAAAAVeAAEAAAAAAAAAAAAAAAAAAAAZBAAAAAAAAAAAAAAAAgAAAAQAAAAEAADABAAAgAQAAAAEAAAABAAAAARAAAAEAADABV4AAAQAAIAEAAA4BAAAAAQAAAAEAAAABAAAAAQAACAEAAAABAAAAAQAAEAEAAAABAAAAAAAAAAACgAUAB4APgBMAGIAegC2ARwBsAHAAmYCdAMUAzQDaAPmBDQE4gUsBYwGFgZcBp4AAQAAABkAhwAIAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAMAAAABAAAAAAACAAcAPAABAAAAAAADAAMAKgABAAAAAAAEAAMAUQABAAAAAAAFAAsACQABAAAAAAAGAAMAMwABAAAAAAAKABoAWgADAAEECQABAAYAAwADAAEECQACAA4AQwADAAEECQADAAYALQADAAEECQAEAAYAVAADAAEECQAFABYAFAADAAEECQAGAAYANgADAAEECQAKADQAdHZqcwB2AGoAc1ZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMHZqcwB2AGoAc3ZqcwB2AGoAc1JlZ3VsYXIAUgBlAGcAdQBsAGEAcnZqcwB2AGoAc0ZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=) format("woff"), url(\'font/vjs.eot?#iefix\') format(\'embedded-opentype\'), url(\'font/vjs.ttf\') format(\'truetype\'), url(\'font/vjs.svg#icomoon\') format(\'svg\');\n font-weight: normal;\n font-style: normal;\n}\n/* Base UI Component Classes\n--------------------------------------------------------------------------------\n*/\n/* Slider - used for Volume bar and Seek bar */\n.vjs-default-skin .vjs-slider {\n /* Replace browser focus highlight with handle highlight */\n outline: 0;\n position: relative;\n cursor: pointer;\n padding: 0;\n /* background-color-with-alpha */\n background-color: #333333;\n background-color: rgba(51, 51, 51, 0.9);\n}\n.vjs-default-skin .vjs-slider:focus {\n /* box-shadow */\n -webkit-box-shadow: 0 0 2em #fff;\n -moz-box-shadow: 0 0 2em #fff;\n box-shadow: 0 0 2em #fff;\n}\n.vjs-default-skin .vjs-slider-handle {\n position: absolute;\n /* Needed for IE6 */\n left: 0;\n top: 0;\n}\n.vjs-default-skin .vjs-slider-handle:before {\n content: "\\e009";\n font-family: VideoJS;\n font-size: 1em;\n line-height: 1;\n text-align: center;\n text-shadow: 0em 0em 1em #fff;\n position: absolute;\n top: 0;\n left: 0;\n /* Rotate the square icon to make a diamond */\n /* transform */\n -webkit-transform: rotate(-45deg);\n -moz-transform: rotate(-45deg);\n -ms-transform: rotate(-45deg);\n -o-transform: rotate(-45deg);\n transform: rotate(-45deg);\n}\n/* Control Bar\n--------------------------------------------------------------------------------\nThe default control bar that is a container for most of the controls.\n*/\n.vjs-default-skin .vjs-control-bar {\n /* Start hidden */\n display: none;\n position: absolute;\n /* Place control bar at the bottom of the player box/video.\n If you want more margin below the control bar, add more height. */\n bottom: 0;\n /* Use left/right to stretch to 100% width of player div */\n left: 0;\n right: 0;\n /* Height includes any margin you want above or below control items */\n height: 3.0em;\n /* background-color-with-alpha */\n background-color: #07141E;\n background-color: rgba(7, 20, 30, 0.7);\n}\n/* Show the control bar only once the video has started playing */\n.vjs-default-skin.vjs-has-started .vjs-control-bar {\n display: block;\n /* Visibility needed to make sure things hide in older browsers too. */\n visibility: visible;\n opacity: 1;\n /* transition */\n -webkit-transition: visibility 0.1s, opacity 0.1s;\n -moz-transition: visibility 0.1s, opacity 0.1s;\n -o-transition: visibility 0.1s, opacity 0.1s;\n transition: visibility 0.1s, opacity 0.1s;\n}\n/* Hide the control bar when the video is playing and the user is inactive */\n.vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {\n display: block;\n visibility: hidden;\n opacity: 0;\n /* transition */\n -webkit-transition: visibility 0.5s, opacity 0.5s;\n -moz-transition: visibility 0.5s, opacity 0.5s;\n -o-transition: visibility 0.5s, opacity 0.5s;\n transition: visibility 0.5s, opacity 0.5s;\n}\n.vjs-default-skin.vjs-controls-disabled .vjs-control-bar {\n display: none;\n}\n.vjs-default-skin.vjs-using-native-controls .vjs-control-bar {\n display: none;\n}\n/* The control bar shouldn\'t show after an error */\n.vjs-default-skin.vjs-error .vjs-control-bar {\n display: none;\n}\n/* Don\'t hide the control bar if it\'s audio */\n.vjs-audio.vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {\n opacity: 1;\n visibility: visible;\n}\n/* IE8 is flakey with fonts, and you have to change the actual content to force\nfonts to show/hide properly.\n - "\\9" IE8 hack didn\'t work for this\n - Found in XP IE8 from http://modern.ie. Does not show up in "IE8 mode" in IE9\n*/\n@media \\0screen {\n .vjs-default-skin.vjs-user-inactive.vjs-playing .vjs-control-bar :before {\n content: "";\n }\n}\n/* General styles for individual controls. */\n.vjs-default-skin .vjs-control {\n outline: none;\n position: relative;\n float: left;\n text-align: center;\n margin: 0;\n padding: 0;\n height: 3.0em;\n width: 4em;\n}\n/* Font button icons */\n.vjs-default-skin .vjs-control:before {\n font-family: VideoJS;\n font-size: 1.5em;\n line-height: 2;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n text-align: center;\n text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);\n}\n/* Replacement for focus outline */\n.vjs-default-skin .vjs-control:focus:before,\n.vjs-default-skin .vjs-control:hover:before {\n text-shadow: 0em 0em 1em #ffffff;\n}\n.vjs-default-skin .vjs-control:focus {\n /* outline: 0; */\n /* keyboard-only users cannot see the focus on several of the UI elements when\n this is set to 0 */\n}\n/* Hide control text visually, but have it available for screenreaders */\n.vjs-default-skin .vjs-control-text {\n /* hide-visually */\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n}\n/* Play/Pause\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-play-control {\n width: 5em;\n cursor: pointer;\n}\n.vjs-default-skin .vjs-play-control:before {\n content: "\\e001";\n}\n.vjs-default-skin.vjs-playing .vjs-play-control:before {\n content: "\\e002";\n}\n/* Playback toggle\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-playback-rate .vjs-playback-rate-value {\n font-size: 1.5em;\n line-height: 2;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n text-align: center;\n text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);\n}\n.vjs-default-skin .vjs-playback-rate.vjs-menu-button .vjs-menu .vjs-menu-content {\n width: 4em;\n left: -2em;\n list-style: none;\n}\n/* Volume/Mute\n-------------------------------------------------------------------------------- */\n.vjs-default-skin .vjs-mute-control,\n.vjs-default-skin .vjs-volume-menu-button {\n cursor: pointer;\n float: right;\n}\n.vjs-default-skin .vjs-mute-control:before,\n.vjs-default-skin .vjs-volume-menu-button:before {\n content: "\\e006";\n}\n.vjs-default-skin .vjs-mute-control.vjs-vol-0:before,\n.vjs-default-skin .vjs-volume-menu-button.vjs-vol-0:before {\n content: "\\e003";\n}\n.vjs-default-skin .vjs-mute-control.vjs-vol-1:before,\n.vjs-default-skin .vjs-volume-menu-button.vjs-vol-1:before {\n content: "\\e004";\n}\n.vjs-default-skin .vjs-mute-control.vjs-vol-2:before,\n.vjs-default-skin .vjs-volume-menu-button.vjs-vol-2:before {\n content: "\\e005";\n}\n.vjs-default-skin .vjs-volume-control {\n width: 5em;\n float: right;\n}\n.vjs-default-skin .vjs-volume-bar {\n width: 5em;\n height: 0.6em;\n margin: 1.1em auto 0;\n}\n.vjs-default-skin .vjs-volume-level {\n position: absolute;\n top: 0;\n left: 0;\n height: 0.5em;\n /* assuming volume starts at 1.0 */\n width: 100%;\n background: #66A8CC url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat;\n}\n.vjs-default-skin .vjs-volume-bar .vjs-volume-handle {\n width: 0.5em;\n height: 0.5em;\n /* Assumes volume starts at 1.0. If you change the size of the\n handle relative to the volume bar, you\'ll need to update this value\n too. */\n left: 4.5em;\n}\n.vjs-default-skin .vjs-volume-handle:before {\n font-size: 0.9em;\n top: -0.2em;\n left: -0.2em;\n width: 1em;\n height: 1em;\n}\n/* The volume menu button is like menu buttons (captions/subtitles) but works\n a little differently. It needs to be possible to tab to the volume slider\n without hitting space bar on the menu button. To do this we\'re not using\n display:none to hide the slider menu by default, and instead setting the\n width and height to zero. */\n.vjs-default-skin .vjs-volume-menu-button .vjs-menu {\n display: block;\n width: 0;\n height: 0;\n border-top-color: transparent;\n}\n.vjs-default-skin .vjs-volume-menu-button .vjs-menu .vjs-menu-content {\n height: 0;\n width: 0;\n}\n.vjs-default-skin .vjs-volume-menu-button:hover .vjs-menu,\n.vjs-default-skin .vjs-volume-menu-button .vjs-menu.vjs-lock-showing {\n border-top-color: rgba(7, 40, 50, 0.5);\n /* Same as ul background */\n}\n.vjs-default-skin .vjs-volume-menu-button:hover .vjs-menu .vjs-menu-content,\n.vjs-default-skin .vjs-volume-menu-button .vjs-menu.vjs-lock-showing .vjs-menu-content {\n height: 2.9em;\n width: 10em;\n}\n/* Progress\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-progress-control {\n position: absolute;\n left: 0;\n right: 0;\n width: auto;\n font-size: 0.3em;\n height: 1.2em;\n /* Increase default height of progress bar by a decision for VIDLA-1692 */\n /* Set above the rest of the controls. */\n top: -1em;\n /* Shrink the bar slower than it grows. */\n /* transition */\n -webkit-transition: all 0.4s;\n -moz-transition: all 0.4s;\n -o-transition: all 0.4s;\n transition: all 0.4s;\n}\n/* On hover, make the progress bar grow to something that\'s more clickable.\n This simply changes the overall font for the progress bar, and this\n updates both the em-based widths and heights, as wells as the icon font */\n.vjs-default-skin:hover .vjs-progress-control {\n /* commented out by a decision for VIDLA-1692 */\n /* font-size: .9em; */\n /* Even though we\'re not changing the top/height, we need to include them in\n the transition so they\'re handled correctly. */\n /* .transition(all 0.2s); */\n}\n/* Box containing play and load progresses. Also acts as seek scrubber. */\n.vjs-default-skin .vjs-progress-holder {\n height: 100%;\n}\n/* Progress Bars */\n.vjs-default-skin .vjs-progress-holder .vjs-play-progress,\n.vjs-default-skin .vjs-progress-holder .vjs-load-progress,\n.vjs-default-skin .vjs-progress-holder .vjs-load-progress div {\n position: absolute;\n display: block;\n height: 100%;\n margin: 0;\n padding: 0;\n /* updated by javascript during playback */\n width: 0;\n /* Needed for IE6 */\n left: 0;\n top: 0;\n}\n.vjs-default-skin .vjs-play-progress {\n /*\n Using a data URI to create the white diagonal lines with a transparent\n background. Surprisingly works in IE8.\n Created using http://www.patternify.com\n Changing the first color value will change the bar color.\n Also using a paralax effect to make the lines move backwards.\n The -50% left position makes that happen.\n */\n background: #66A8CC url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat;\n}\n.vjs-default-skin .vjs-load-progress {\n background: #646464 /* IE8- Fallback */;\n background: rgba(255, 255, 255, 0.2);\n}\n/* there are child elements of the load progress bar that represent the\n specific time ranges that have been buffered */\n.vjs-default-skin .vjs-load-progress div {\n background: #787878 /* IE8- Fallback */;\n background: rgba(255, 255, 255, 0.1);\n}\n.vjs-default-skin .vjs-seek-handle {\n width: 1.5em;\n height: 100%;\n}\n.vjs-default-skin .vjs-seek-handle:before {\n padding-top: 0.1em /* Minor adjustment */;\n}\n/* Live Mode\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin.vjs-live .vjs-time-controls,\n.vjs-default-skin.vjs-live .vjs-time-divider,\n.vjs-default-skin.vjs-live .vjs-progress-control {\n display: none;\n}\n.vjs-default-skin.vjs-live .vjs-live-display {\n display: block;\n}\n/* Live Display\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-live-display {\n display: none;\n font-size: 1em;\n line-height: 3em;\n}\n/* Time Display\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-time-controls {\n font-size: 1em;\n /* Align vertically by making the line height the same as the control bar */\n line-height: 3em;\n}\n.vjs-default-skin .vjs-current-time {\n float: left;\n}\n.vjs-default-skin .vjs-duration {\n float: left;\n}\n/* Remaining time is in the HTML, but not included in default design */\n.vjs-default-skin .vjs-remaining-time {\n display: none;\n float: left;\n}\n.vjs-time-divider {\n float: left;\n line-height: 3em;\n}\n/* Fullscreen\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-fullscreen-control {\n width: 3.8em;\n cursor: pointer;\n float: right;\n}\n.vjs-default-skin .vjs-fullscreen-control:before {\n content: "\\e000";\n}\n/* Switch to the exit icon when the player is in fullscreen */\n.vjs-default-skin.vjs-fullscreen .vjs-fullscreen-control:before {\n content: "\\e00b";\n}\n/* Big Play Button (play button at start)\n--------------------------------------------------------------------------------\nPositioning of the play button in the center or other corners can be done more\neasily in the skin designer. http://designer.videojs.com/\n*/\n.vjs-default-skin .vjs-big-play-button {\n left: 0.5em;\n top: 0.5em;\n font-size: 3em;\n display: block;\n z-index: 2;\n position: absolute;\n width: 4em;\n height: 2.6em;\n text-align: center;\n vertical-align: middle;\n cursor: pointer;\n opacity: 1;\n /* Need a slightly gray bg so it can be seen on black backgrounds */\n /* background-color-with-alpha */\n background-color: #07141E;\n background-color: rgba(7, 20, 30, 0.7);\n border: 0.1em solid #3b4249;\n /* border-radius */\n -webkit-border-radius: 0.8em;\n -moz-border-radius: 0.8em;\n border-radius: 0.8em;\n /* box-shadow */\n -webkit-box-shadow: 0px 0px 1em rgba(255, 255, 255, 0.25);\n -moz-box-shadow: 0px 0px 1em rgba(255, 255, 255, 0.25);\n box-shadow: 0px 0px 1em rgba(255, 255, 255, 0.25);\n /* transition */\n -webkit-transition: all 0.4s;\n -moz-transition: all 0.4s;\n -o-transition: all 0.4s;\n transition: all 0.4s;\n}\n/* Optionally center */\n.vjs-default-skin.vjs-big-play-centered .vjs-big-play-button {\n /* Center it horizontally */\n left: 50%;\n margin-left: -2.1em;\n /* Center it vertically */\n top: 50%;\n margin-top: -1.4em;\n}\n/* Hide if controls are disabled */\n.vjs-default-skin.vjs-controls-disabled .vjs-big-play-button {\n display: none;\n}\n/* Hide when video starts playing */\n.vjs-default-skin.vjs-has-started .vjs-big-play-button {\n display: none;\n}\n/* Hide on mobile devices. Remove when we stop using native controls\n by default on mobile */\n.vjs-default-skin.vjs-using-native-controls .vjs-big-play-button {\n display: none;\n}\n.vjs-default-skin:hover .vjs-big-play-button,\n.vjs-default-skin .vjs-big-play-button:focus {\n outline: 0;\n border-color: #fff;\n /* IE8 needs a non-glow hover state */\n background-color: #505050;\n background-color: rgba(50, 50, 50, 0.75);\n /* box-shadow */\n -webkit-box-shadow: 0 0 3em #fff;\n -moz-box-shadow: 0 0 3em #fff;\n box-shadow: 0 0 3em #fff;\n /* transition */\n -webkit-transition: all 0s;\n -moz-transition: all 0s;\n -o-transition: all 0s;\n transition: all 0s;\n}\n.vjs-default-skin .vjs-big-play-button:before {\n content: "\\e001";\n font-family: VideoJS;\n /* In order to center the play icon vertically we need to set the line height\n to the same as the button height */\n line-height: 2.6em;\n text-shadow: 0.05em 0.05em 0.1em #000;\n text-align: center /* Needed for IE8 */;\n position: absolute;\n left: 0;\n width: 100%;\n height: 100%;\n}\n.vjs-error .vjs-big-play-button {\n display: none;\n}\n/* Error Display\n--------------------------------------------------------------------------------\n*/\n.vjs-error-display {\n display: none;\n}\n.vjs-error .vjs-error-display {\n display: block;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n}\n.vjs-error .vjs-error-display:before {\n content: \'X\';\n font-family: Arial;\n font-size: 4em;\n color: #666666;\n /* In order to center the play icon vertically we need to set the line height\n to the same as the button height */\n line-height: 1;\n text-shadow: 0.05em 0.05em 0.1em #000;\n text-align: center /* Needed for IE8 */;\n vertical-align: middle;\n position: absolute;\n left: 0;\n top: 50%;\n margin-top: -0.5em;\n width: 100%;\n}\n.vjs-error-display div {\n position: absolute;\n bottom: 1em;\n right: 0;\n left: 0;\n font-size: 1.4em;\n text-align: center;\n padding: 3px;\n background: #000000;\n background: rgba(0, 0, 0, 0.5);\n}\n.vjs-error-display a,\n.vjs-error-display a:visited {\n color: #F4A460;\n}\n/* Loading Spinner\n--------------------------------------------------------------------------------\n*/\n.vjs-loading-spinner {\n /* Should be hidden by default */\n display: none;\n position: absolute;\n top: 50%;\n left: 50%;\n font-size: 4em;\n line-height: 1;\n width: 1em;\n height: 1em;\n margin-left: -0.5em;\n margin-top: -0.5em;\n opacity: 0.75;\n}\n/* Show the spinner when waiting for data and seeking to a new time */\n.vjs-waiting .vjs-loading-spinner,\n.vjs-seeking .vjs-loading-spinner {\n display: block;\n /* only animate when showing because it can be processor heavy */\n /* animation */\n -webkit-animation: spin 1.5s infinite linear;\n -moz-animation: spin 1.5s infinite linear;\n -o-animation: spin 1.5s infinite linear;\n animation: spin 1.5s infinite linear;\n}\n/* Errors are unrecoverable without user interaction so hide the spinner */\n.vjs-error .vjs-loading-spinner {\n display: none;\n /* ensure animation doesn\'t continue while hidden */\n /* animation */\n -webkit-animation: none;\n -moz-animation: none;\n -o-animation: none;\n animation: none;\n}\n.vjs-default-skin .vjs-loading-spinner:before {\n content: "\\e01e";\n font-family: VideoJS;\n position: absolute;\n top: 0;\n left: 0;\n width: 1em;\n height: 1em;\n text-align: center;\n text-shadow: 0em 0em 0.1em #000;\n}\n@-moz-keyframes spin {\n 0% {\n -moz-transform: rotate(0deg);\n }\n 100% {\n -moz-transform: rotate(359deg);\n }\n}\n@-webkit-keyframes spin {\n 0% {\n -webkit-transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n }\n}\n@-o-keyframes spin {\n 0% {\n -o-transform: rotate(0deg);\n }\n 100% {\n -o-transform: rotate(359deg);\n }\n}\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(359deg);\n }\n}\n/* Menu Buttons (Captions/Subtitles/etc.)\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-menu-button {\n float: right;\n cursor: pointer;\n}\n.vjs-default-skin .vjs-menu {\n display: none;\n position: absolute;\n bottom: 0;\n left: 0em;\n /* (Width of vjs-menu - width of button) / 2 */\n width: 0em;\n height: 0em;\n margin-bottom: 3em;\n border-left: 2em solid transparent;\n border-right: 2em solid transparent;\n border-top: 1.55em solid #000000;\n /* Same width top as ul bottom */\n border-top-color: rgba(7, 40, 50, 0.5);\n /* Same as ul background */\n}\n/* Button Pop-up Menu */\n.vjs-default-skin .vjs-menu-button .vjs-menu .vjs-menu-content {\n display: block;\n padding: 0;\n margin: 0;\n position: absolute;\n width: 10em;\n bottom: 1.5em;\n /* Same bottom as vjs-menu border-top */\n max-height: 15em;\n overflow: auto;\n left: -5em;\n /* Width of menu - width of button / 2 */\n /* background-color-with-alpha */\n background-color: #07141E;\n background-color: rgba(7, 20, 30, 0.7);\n /* box-shadow */\n -webkit-box-shadow: -0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2);\n -moz-box-shadow: -0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2);\n box-shadow: -0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2);\n}\n.vjs-default-skin .vjs-menu-button:hover .vjs-control-content .vjs-menu,\n.vjs-default-skin .vjs-control-content .vjs-menu.vjs-lock-showing {\n display: block;\n}\n/* prevent menus from opening while scrubbing (FF, IE) */\n.vjs-default-skin.vjs-scrubbing .vjs-menu-button:hover .vjs-control-content .vjs-menu {\n display: none;\n}\n.vjs-default-skin .vjs-menu-button ul li {\n list-style: none;\n margin: 0;\n padding: 0.3em 0 0.3em 0;\n line-height: 1.4em;\n font-size: 1.2em;\n text-align: center;\n text-transform: lowercase;\n}\n.vjs-default-skin .vjs-menu-button ul li.vjs-selected {\n background-color: #000;\n}\n.vjs-default-skin .vjs-menu-button ul li:focus,\n.vjs-default-skin .vjs-menu-button ul li:hover,\n.vjs-default-skin .vjs-menu-button ul li.vjs-selected:focus,\n.vjs-default-skin .vjs-menu-button ul li.vjs-selected:hover {\n outline: 0;\n color: #111;\n /* background-color-with-alpha */\n background-color: #ffffff;\n background-color: rgba(255, 255, 255, 0.75);\n /* box-shadow */\n -webkit-box-shadow: 0 0 1em #ffffff;\n -moz-box-shadow: 0 0 1em #ffffff;\n box-shadow: 0 0 1em #ffffff;\n}\n.vjs-default-skin .vjs-menu-button ul li.vjs-menu-title {\n text-align: center;\n text-transform: uppercase;\n font-size: 1em;\n line-height: 2em;\n padding: 0;\n margin: 0 0 0.3em 0;\n font-weight: bold;\n cursor: default;\n}\n/* Subtitles Button */\n.vjs-default-skin .vjs-subtitles-button:before {\n content: "\\e00c";\n}\n/* Captions Button */\n.vjs-default-skin .vjs-captions-button:before {\n content: "\\e008";\n}\n/* Chapters Button */\n.vjs-default-skin .vjs-chapters-button:before {\n content: "\\e00c";\n}\n.vjs-default-skin .vjs-chapters-button.vjs-menu-button .vjs-menu .vjs-menu-content {\n width: 24em;\n left: -12em;\n}\n/* Replacement for focus outline */\n.vjs-default-skin .vjs-captions-button:focus .vjs-control-content:before,\n.vjs-default-skin .vjs-captions-button:hover .vjs-control-content:before {\n /* box-shadow */\n -webkit-box-shadow: 0 0 1em #ffffff;\n -moz-box-shadow: 0 0 1em #ffffff;\n box-shadow: 0 0 1em #ffffff;\n}\n/*\nREQUIRED STYLES (be careful overriding)\n================================================================================\nWhen loading the player, the video tag is replaced with a DIV,\nthat will hold the video tag or object tag for other playback methods.\nThe div contains the video playback element (Flash or HTML5) and controls,\nand sets the width and height of the video.\n\n** If you want to add some kind of border/padding (e.g. a frame), or special\npositioning, use another containing element. Otherwise you risk messing up\ncontrol positioning and full window mode. **\n*/\n.video-js {\n background-color: #000;\n position: relative;\n padding: 0;\n /* Start with 10px for base font size so other dimensions can be em based and\n easily calculable. */\n font-size: 10px;\n /* Allow poster to be vertically aligned. */\n vertical-align: middle;\n /* display: table-cell; */\n /*This works in Safari but not Firefox.*/\n /* Provide some basic defaults for fonts */\n font-weight: normal;\n font-style: normal;\n /* Avoiding helvetica: issue #376 */\n font-family: Arial, sans-serif;\n /* Turn off user selection (text highlighting) by default.\n The majority of player components will not be text blocks.\n Text areas will need to turn user selection back on. */\n /* user-select */\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n/* Playback technology elements expand to the width/height of the containing div\n or */\n.video-js .vjs-tech {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n/* Fix for Firefox 9 fullscreen (only if it is enabled). Not needed when\n checking fullScreenEnabled. */\n.video-js:-moz-full-screen {\n position: absolute;\n}\n/* Fullscreen Styles */\nbody.vjs-full-window {\n padding: 0;\n margin: 0;\n height: 100%;\n /* Fix for IE6 full-window. http://www.cssplay.co.uk/layouts/fixed.html */\n overflow-y: auto;\n}\n.video-js.vjs-fullscreen {\n position: fixed;\n overflow: hidden;\n z-index: 1000;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n width: 100% !important;\n height: 100% !important;\n /* IE6 full-window (underscore hack) */\n _position: absolute;\n}\n.video-js:-webkit-full-screen {\n width: 100% !important;\n height: 100% !important;\n}\n.video-js.vjs-fullscreen.vjs-user-inactive {\n cursor: none;\n}\n/* Poster Styles */\n.vjs-poster {\n background-repeat: no-repeat;\n background-position: 50% 50%;\n background-size: contain;\n background-color: #000000;\n cursor: pointer;\n margin: 0;\n padding: 0;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.vjs-poster img {\n display: block;\n margin: 0 auto;\n max-height: 100%;\n padding: 0;\n width: 100%;\n}\n/* Hide the poster after the video has started playing */\n.video-js.vjs-has-started .vjs-poster {\n display: none;\n}\n/* Don\'t hide the poster if we\'re playing audio */\n.video-js.vjs-audio.vjs-has-started .vjs-poster {\n display: block;\n}\n/* Hide the poster when controls are disabled because it\'s clickable\n and the native poster can take over */\n.video-js.vjs-controls-disabled .vjs-poster {\n display: none;\n}\n/* Hide the poster when native controls are used otherwise it covers them */\n.video-js.vjs-using-native-controls .vjs-poster {\n display: none;\n}\n/* Text Track Styles */\n/* Overall track holder for both captions and subtitles */\n.video-js .vjs-text-track-display {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 3em;\n right: 0;\n pointer-events: none;\n}\n/* Captions Settings Dialog */\n.vjs-caption-settings {\n position: relative;\n top: 1em;\n background-color: #000;\n opacity: 0.75;\n color: #FFF;\n margin: 0 auto;\n padding: 0.5em;\n height: 15em;\n font-family: Arial, Helvetica, sans-serif;\n font-size: 12px;\n width: 40em;\n}\n.vjs-caption-settings .vjs-tracksettings {\n top: 0;\n bottom: 2em;\n left: 0;\n right: 0;\n position: absolute;\n overflow: auto;\n}\n.vjs-caption-settings .vjs-tracksettings-colors,\n.vjs-caption-settings .vjs-tracksettings-font {\n float: left;\n}\n.vjs-caption-settings .vjs-tracksettings-colors:after,\n.vjs-caption-settings .vjs-tracksettings-font:after,\n.vjs-caption-settings .vjs-tracksettings-controls:after {\n clear: both;\n}\n.vjs-caption-settings .vjs-tracksettings-controls {\n position: absolute;\n bottom: 1em;\n right: 1em;\n}\n.vjs-caption-settings .vjs-tracksetting {\n margin: 5px;\n padding: 3px;\n min-height: 40px;\n}\n.vjs-caption-settings .vjs-tracksetting label {\n display: block;\n width: 100px;\n margin-bottom: 5px;\n}\n.vjs-caption-settings .vjs-tracksetting span {\n display: inline;\n margin-left: 5px;\n}\n.vjs-caption-settings .vjs-tracksetting > div {\n margin-bottom: 5px;\n min-height: 20px;\n}\n.vjs-caption-settings .vjs-tracksetting > div:last-child {\n margin-bottom: 0;\n padding-bottom: 0;\n min-height: 0;\n}\n.vjs-caption-settings label > input {\n margin-right: 10px;\n}\n.vjs-caption-settings input[type="button"] {\n width: 40px;\n height: 40px;\n}\n/* Hide disabled or unsupported controls */\n.vjs-hidden {\n display: none !important;\n}\n.vjs-lock-showing {\n display: block !important;\n opacity: 1;\n visibility: visible;\n}\n/* In IE8 w/ no JavaScript (no HTML5 shim), the video tag doesn\'t register.\n The .video-js classname on the video tag also isn\'t considered.\n This optional paragraph inside the video tag can provide a message to users\n about what\'s required to play video. */\n.vjs-no-js {\n padding: 2em;\n color: #ccc;\n background-color: #333;\n font-size: 1.8em;\n font-family: Arial, sans-serif;\n text-align: center;\n width: 30em;\n height: 15em;\n margin: 0 auto;\n}\n.vjs-no-js a,\n.vjs-no-js a:visited {\n color: #F4A460;\n}\n/* -----------------------------------------------------------------------------\nThe original source of this file lives at\nhttps://github.com/videojs/video.js/blob/master/src/css/video-js.less */\n'; -},function(e,t,n){var i="[PlayerManager_Fullscreen]",o=n(9),r=function(e){o.debug(i,e)},a=function(e){o.verbose(i,e)};e.exports=function(e,t){return{init:function(n,i,o){r("init"),e.isMobile()===!1&&n.controlBar.fullscreenToggle.on("click",function(){t.isFullscreenToggled||(t.isFullscreenToggled=!0)}),n.on("fullscreenchange",function(){if(a("fullscreenchange"),e.isIos()&&t.isFullscreen&&t.play(),t.isFullscreen){e.pendingFullscreenExit=!0,e.isIos()&&!e.options.fixedSizePlayer?(n.controlBar.el().style.bottom="0.0em",e.options.disableTopBar||(i.style.display="block",e.floatingSkipButton&&(e.readyForSkip?(e.floatingSkipButton.style.display="block",e.floatingAdSkipText.style.display="none"):(e.floatingSkipButton.style.display="none",e.floatingAdSkipText.style.display="block")))):(n.controlBar.el().style.bottom="",e.options.disableTopBar||(o.style.display="block",i.style.display="none",e.floatingSkipButton&&(e.floatingSkipButton.style.display="none",e.floatingAdSkipText.style.display="none")));var r;r=e.isMobile()===!1?1e3:0,setTimeout(function(){e.pendingFullscreenExit=!1,t.isFullscreen=!1,t.isFullscreenToggled=!1,e.dispatchEventToAdunit({name:"fullscreenchange",fullscreenStatus:"exit"}),t.callbackForAdUnit.cbCoreVideoEvent("AdHandler","video_fullscreen_exit")},r)}else t.isFullscreen=!t.isFullscreen,n.controlBar.el().style.bottom="0.0em",e.options.disableTopBar||(i.style.display="block",o.style.display="none",e.floatingSkipButton&&(e.readyForSkip?(e.floatingSkipButton.style.display="block",e.floatingAdSkipText.style.display="none"):(e.floatingSkipButton.style.display="none",e.floatingAdSkipText.style.display="block"))),e.dispatchEventToAdunit({name:"fullscreenchange",fullscreenStatus:"enter"}),t.callbackForAdUnit.cbCoreVideoEvent("AdHandler","video_fullscreen_enter")})}}}},function(e,t,n){var i="[PlayerManager_Controls]",o=n(9),r=function(e){o.debug(i,e)};e.exports=function(e){return{init:function(t){r("init"),t.on("concealControls",function(){var e=t.player().controlBar;e&&!e.concealed&&(e.currentTimeDisplay&&e.currentTimeDisplay.hide(),e.durationDisplay&&e.durationDisplay.hide(),e.timeDivider&&e.timeDivider.hide(),e.muteToggle&&e.muteToggle.hide(),e.playToggle&&e.playToggle.hide(),e.fullscreenToggle&&e.fullscreenToggle.hide(),e.progressControl&&e.progressControl.hide(),e.volumeControl&&e.volumeControl.hide(),e.concealed=!0)}),t.on("revealControls",function(){var n=t.player().controlBar;n&&n.concealed&&("bar"!==e.options.showProgressBar&&e.options.showProgressBar!==!1&&(n.currentTimeDisplay&&n.currentTimeDisplay.show(),n.durationDisplay&&n.durationDisplay.show(),n.timeDivider&&n.timeDivider.show()),n.muteToggle&&e.options.showMute&&n.muteToggle.show(),n.playToggle&&e.options.showPlayToggle&&n.playToggle.show(),n.fullscreenToggle&&e.options.allowFullscreen&&n.fullscreenToggle.show(),e.options.showProgressBar!==!1&&"text"!==e.options.showProgressBar&&n.progressControl&&n.progressControl.show(),n.volumeControl&&e.options.showVolume&&e.displayVolumeControls()&&n.volumeControl.show(),n.concealed=!1)})}}}},function(e,t,n){var i="[PlayerManager_Orientation]",o=n(9),r=function(e){o.debug(i,e)};e.exports=function(e,t){return{init:function(){r("init");var n=e.options.isWaterfall?e.options.waterfallStepId:null;window.addEventListener("orientationchange",function(){if(!e.options.overlayPlayer&&t.isReadyToExpandForMobile){if(n&&n!==e.options.waterfallStepId)return;var i=!(!e.options.sideStreamObject||"function"!=typeof e.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated)&&e.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated();if(i)return;e.refreshVideoLookAndFeel(e.options,t)}}),window.addEventListener("resize",function(){if(t.options.shouldResizeVideoToFillMobileWebview){var e=window.innerWidth&&document.documentElement.clientWidth?Math.max(window.innerWidth,document.documentElement.clientWidth):window.innerWidth||document.documentElement.clientWidth||document.getElementsByTagName("body")[0].clientWidth,n=window.innerHeight&&document.documentElement.clientHeight?Math.max(window.innerHeight,document.documentElement.clientHeight):window.innerHeight||document.documentElement.clientHeight||document.getElementsByTagName("body")[0].clientHeight;t.options.width=e,t.options.height=n,t.resizeVideo(t.options.aspectRatio,!0)}})}}}},function(e,t,n){var i="[PlayerManager_BigPlayButton]",o=n(9),r=function(e){o.debug(i,e)},a=function(e){o.verbose(i,e)};e.exports=function(e,t){return{init:function(n){r("init");var i=function(){t.explicitPlay(),t.isEnded===!0&&(t.replay(),n.player().bigPlayButton.removeClass("vjs-big-play-button-replay"),e.options.showBigPlayButton===!1&&n.bigPlayButton&&n.bigPlayButton.hide()),setTimeout(function(){t.unmute()},e.bigbuttonUnmuteTimeout)};n.player().bigPlayButton.on("click",function(){a("big play button click"),i()}),n.player().bigPlayButton.on("touchend",function(){a("big play button touchend"),i()})}}}},function(e,t,n){var i="[PlayerManager_VideoPlay]",o=n(9),r=n(18)(),a=n(8),s=function(e){o.debug(i,e)},l=function(e){o.verbose(i,e)};e.exports=function(e,t){return{init:function(n){s("init"),n.controlBar.playToggle.on("click",function(){l("play button click"),t.explicitPaused=!t.explicitPaused}),n.controlBar.playToggle.on("touchend",function(){l("play button touchend"),t.explicitPaused=!t.explicitPaused}),n.on("durationchange",function(){e.dispatchEventToAdunit({name:"durationchange"})}),n.on("firstplay",function(){e.dispatchEventToAdunit({name:"firstplay"}),n.controlBar.muteToggle&&n.controlBar.muteToggle.update(),n.controlBar.volumeControl&&n.controlBar.volumeControl.volumeBar&&n.controlBar.volumeControl.volumeBar.update(),i()});var i=function(){e.dispatchEventToAdunit({name:"volume-change",obj:{volume:t.isMuted?0:n.volume()},eventType:"AdUnit"})};n.on("volumechange",i),n.controlBar.playToggle.on("click",function(){l("play button click"),t.isPlayingVideo===!0?t.explicitPause():(t.explicitPlay(),t.unmute())}),n.controlBar.playToggle.on("touchend",function(){l("play button touchend"),t.isPlayingVideo===!0?t.explicitPause():(t.explicitPlay(),t.unmute())}),n.on("loadstart",function(){e.dispatchEventToAdunit({name:"loadstart"})}),n.on("pause",function(){e.options.overlayPlayer&&Math.abs(n.player().duration()-n.player().currentTime())<.5?(l("hiding big play button for overlay player at the end of the video"),n.player().bigPlayButton.el().style.display="none"):(l("showing big play button"),n.player().bigPlayButton.el().style.display="block"),t.isPlayingVideo=!1,e.options.hasOwnProperty("overlayPlayer")&&(a.isIphone()&&parseInt(a.getIOSVersion())<10||a.isIos()&&n.isFullscreen())&&e.dispatchEventToAdunit({name:"video_pause"})}),n.on("play",function(){if(n.player().bigPlayButton.el().style.display="",t.options.shouldResizeVideoToFillMobileWebview){var i=window.innerWidth&&document.documentElement.clientWidth?Math.max(window.innerWidth,document.documentElement.clientWidth):window.innerWidth||document.documentElement.clientWidth||document.getElementsByTagName("body")[0].clientWidth,o=window.innerHeight&&document.documentElement.clientHeight?Math.max(window.innerHeight,document.documentElement.clientHeight):window.innerHeight||document.documentElement.clientHeight||document.getElementsByTagName("body")[0].clientHeight;t.options.width=i,t.options.height=o,t.resizeVideo(t.options.aspectRatio,!0)}t.isPlayingVideo=!0,e.options.hasOwnProperty("overlayPlayer")&&(a.isIphone()&&parseInt(a.getIOSVersion())<10||a.isIos()&&n.isFullscreen())&&e.dispatchEventToAdunit({name:"video_resume"})}),n.on("error",function(n){s("error in video js");var i=r.browser.name.toLowerCase(),o=n&&n.target&&e.options&&(e.options.vpaid||"ie"===i&&e.options.isWaterfall);o&&(n.target.toString().indexOf('poster="null"')>0||"video"===n.target.nodeName.toLowerCase()&&n.target.networkState<=2||"div"===n.target.nodeName.toLowerCase())||(l("destroying due to error in video js"),t.destroyWithoutSkip(!0,e.CONST_MESSAGE_GENERAL_ERROR,null,900))}),e.options.vpaid===!1&&n.one("loadedmetadata",function(i){var o=i.currentTarget;t.videoObjectId=o.id,t.isReadyToExpandForMobile=!0,s("loadedmetadata video.js is ready to play"),n.tech.removeControlsListeners();var r=o.videoWidth,a=o.videoHeight,l=r/a;r>0?(t.resizeVideo(l),"function"==typeof e.callbackForAdUnit.cbWhenReady&&e.callbackForAdUnit.cbWhenReady(t)):(t.resizeVideo(0),e.callbackForAdUnit.cbWhenReady(t))})}}}},function(e,t,n){var i="[PlayerManager_PostProcess]",o=n(9),r=function(e){o.debug(i,e)};e.exports=function(e,t){return{init:function(i,o,a){r("init"),n(40)(e,t).init(i,o,a),e.isMobile()&&e.options.hasOwnProperty("overlayPlayer")&&("click"===e.options.initialPlayback||"mouseover"===e.options.initialPlayback)?i&&(i.controlBar.el_.style.setProperty("display","none","important"),e.options.hiddenControls=!0):e.options.hasOwnProperty("overlayPlayer")&&e.isIos()&&parseInt(o.getIOSVersion())<10&&"auto"===e.options.initialPlayback&&i&&(i.controlBar.el_.style.setProperty("display","none","important"),e.options.hiddenControls=!0)}}}},function(e,t,n){var i="[PlayerManager_SettingAdIcons]",o=n(9),r=n(41),a=function(e){o.debug(i,e)};e.exports=function(e,t){return{init:function(n,i,o){a("init");var s=t.options.playerSkin.controlBarHeight,l=new r;l.init(t.options.data.adIcons);var d=l.getIcons();if(d&&(!d||0!==d.length)){var c=t.options.disableTopBar?0:o,u=i.isMobile()||"below"===t.options.controlBarPosition?s:0;if(n.controlBar.el_.style.zIndex=10,t.test("adIconOffset",l),!i.isMobile()){var p=document.getElementById(e.options.iframeVideoWrapperId).contentWindow.document.getElementById(e.an_video_ad_player_id),h=function(){if(t.isExpanded&&"below"!==t.options.controlBarPosition){var e=t.getFinalSize(),n=e.height-o-s-10,i=0;l.redraw(i,n)}},m=function(){if(t.isExpanded&&"below"!==t.options.controlBarPosition){var e=t.getFinalSize(),n=e.height-o-s-10;l.redraw(s,n)}};n.on("useractive",function(){m()}),n.on("userinactive",function(){n.paused()===!1&&h()}),n.on("handleManualUserActive",function(){m()}),n.on("handleManualUserInActive",function(){n.paused()===!1&&h()}),p.addEventListener("mouseenter",function(){m()}),p.addEventListener("mousemove",function(){m()})}n.on("timeupdate",function(){if(!t.options.vpaid||t.options.showVpaidIcons){var e=Math.round(n.player().currentTime()),i=1e3*e,o=Math.round(n.player().duration()),r=1e3*o;d&&d.length>0&&l.renderIcons(function(e){var n={};n.name=e,t.dispatchEventToAdunit(n)},function(e){t.click(e,!1)},n.player().el_,c,u,i,r)}})}}}}},function(e,t,n){var i="[AdIcon]",o=n(8),r=n(9),a=function(e){r.debug(i,e)},s=function(){var e=5,t=function(e){for(var t=0;t=0&&(e[t].content=""),i.indexOf(o.type.toLowerCase())>=0&&(e[t].content=""),e[t].isDisplay=!1}}return e};this.icons=[],this.init=function(e){a("initalize ad icon"),e&&(this.icons=t(e))},this.getIcons=function(){return this.icons},this.renderIcons=function(t,n,i,r,s,l,d){var c=this.getIcons(),u=this;if(s=0!==s?s+e:s,c&&!(c.length<1)){var p,h=function(e){return function(){n(e.IconClickThrough),t("IconClickTracking_"+e.program),a("fire IconClickTracking for "+e.program)}},m=function(e){setTimeout(function(){u.resolveCollision(e),a("start to check a collision of ad icon")},500)};for(p=0;p0&&l>=d){for(A=0;Af+v&&g.isDisplay&&y)y.style.display="none";else if(!g.isDisplay){var T="left",w=Number(w)<0?0:w,E="top",S=Number(w)<0?0:w,I=Number(r)>0?r:0,C=Number(s)>0?s:0;g&&"left"===g.xPosition&&(T="left",w=0),g&&"right"===g.xPosition&&(T="right",w=0),g&&Number(g.xPosition)>=0&&(T="left",w=Number(g.xPosition)),g&&"bottom"===g.yPosition&&(E="bottom",S=0,S+=C),g&&"top"===g.yPosition&&(E="top",S=0,S+=I),g&&Number(g.yPosition)>=0&&(E="top",S=Number(g.yPosition),S+=I);var P;y?(P=y,a("reuse ad icon for "+g.program)):(P=i.ownerDocument.createElement("div"),a("create ad icon for "+g.program)),i.appendChild(P),P.setAttribute("name","adicon"),P.id="adicon_"+g.program,P.innerHTML=g.content,P.style.position="fixed",P.style.cursor="hand",P.style[T]=w+"px",P.style[E]=S+"px",P.style.zIndex=2147483647,P.style.display="block",P.style.width=g.width+"px",P.style.height=g.height+"px",g.isDisplay=!0,g.htmlReference=P,g.document=i.ownerDocument,g.originalStyle={},g.originalStyle[T]=w,g.originalStyle[E]=S,g.clickRegisterd||(P.addEventListener("click",h(g)),g.clickRegisterd=!0,a("ad icon click handler registered for "+g.program)),c[p]=g,t&&"function"==typeof t&&(t("IconViewTracking_"+g.program),a("check and fire IconViewTracking for "+g.program)),p===c.length-1&&m(c)}}}}},this.elementsFromPoint=function(e,t,n){try{if(n.elementsFromPoint)return n.elementsFromPoint(e,t);var i=[],o=void 0;do o!==n.elementFromPoint(e,t)?(o=n.elementFromPoint(e,t),i.push(o),o&&o.style&&(o.style.pointerEvents="none")):o=!1;while(o);return i.forEach(function(e){var t;return e&&e.style&&(t=e.style.pointerEvents="all"),t}),i}catch(r){return a(r),null}};var n=function(e){var t=0;return e&&Number(e)>=0&&(t=Number(e)),e&&"string"==typeof e&&e.toLowerCase()&&e.indexOf("px")&&(t=Number(e.replace("px","")),t=t>0?t:0),t};this.resolveCollision=function(e){var t,i=this,o=function(e,t){var i;for(i=0;i=0&&(a("collision resolved by moving icon to left for ad icon program - "+k),s.htmlReference.style.left=I.next_left+"px",S=!0),I=r("right",d,u,c,p,T,w,s.document,s.htmlReference),S===!1&&I.newSpaceOwner_topLeft.result===!1&&I.newSpaceOwner_topRight.result===!1&&I.newSpaceOwner_bootomRight.result===!1&&I.newSpaceOwner_bootomLeft.result===!1&&(a("collision resolved by moving icon to right for ad icon program - "+k),s.htmlReference.style.left=I.next_left+"px",S=!0),S===!1&&(a("hide ad-icon due to no way to avoid collision for ad icon program - "+k),s.htmlReference.style.display="none"),a("collision detection end for ad icon program - "+k)}}}},this.redraw=function(e){var t;for(t=0;tr?0:o,O=t,i/=1e3,W(i);var l=n.currentTime,d=n.duration;if(l>=d){if(a("close checking by iOSInlinePlayer"),f!==!1)return a("closed by iOSInlinePlayer"),w(),N=!1,void window.cancelAnimationFrame(p);var c=s.currentTime,u=s.duration;if(c>=u)return a("closed with audio by iOSInlinePlayer"),w(),N=!1,void window.cancelAnimationFrame(p)}v===!1?p=window.requestAnimationFrame(e):(N=!1,window.cancelAnimationFrame(p))}var t,n,i,s,l,d,c,u,p,h,m,v,f,g,y,A,b,k,T,w,E,S,I,C,P,j,x,_,V,D,M=!1,N=!1,O=0,R={keepWidth:null,keepHeight:null};this.setPubOptions=function(e){D=e};var U=function(){var e=navigator.appVersion.indexOf("Mobile");return e>-1};this.renderVideo=function(e,r){return o("renderVideo"),U()?(V=e.cbTimeUpdate,d=e.mediaUrl,E=e.divArea,w=e.cbWhenVideoComplete,S=e.targetElement,C=e.iframeVideoWrapper,j=e.el_wholeArea,a("generating initial canvas object"),t=document.createElement("canvas"),t.style["image-rendering"]="auto",E.appendChild(t),E.style.width="100%",E.style.height="100%",R.keepWidth=t.style.width,R.keepHeight=t.style.height,"undefined"!=typeof e.videoElement?n=e.videoElement:(a("creating video tag"),n=document.createElement("video"),i=document.createElement("source"),n.style.display="none",n.autoplay=!1,n.preload="auto",n.controls=!0,i.src=d,n.appendChild(i),E.appendChild(n)),a("preparing audio tag"),s=document.createElement("audio"),l=document.createElement("source"),D.preloadInlineAudioForIos&&!D.vpaid&&this.activateAudio(),c=t.getContext("2d"),u=Date.now(),h=35,m=!1,v=!1,f=!0,g=.3,y=.3,A=.1,b=!1,k=!1,T=99999999,a("renderVideo callback"),void r(!0)):void r(!1)};var L=function(e){a("saveCSS");var t={},n={position:"",width:"",height:"",top:"",left:"",marginRight:"",transform:"",background:""};for(var i in n)t[i]=e.style[i];return t},F=function(e,t){a("loadCSS");for(var n in t)e.style[n]=t[n]},B=function(e){var i=n.videoWidth/n.videoHeight,o=0,r=0,a=D.sideStream&&D.sideStream.enabled&&D.sideStreamObject&&D.sideStreamObject.isActivated;if(!e&&a){var s,l,d=D.sideStream.width,c=D.sideStream.height,u=0,p=30;D.disableTopBar||(u=24),c-=p+u,d||c||(d=D.width,c=D.mediaHeight),d&&c?(s=d,l=c):(s=d?d:c/i,l=c?c:d/i),o=Math.round(Math.min(l*i,s)),r=Math.round(Math.min(s/i,l))}else o=t.parentElement.parentElement.style.width.replace("px",""),r=t.parentElement.parentElement.style.height.replace("px","");return{width:o,height:r}},$=function(e){var n=B(e).width,i=B(e).height;e?(t.width=n,t.height=i):(t.width=n,t.height=D.mediaHeight)},H=function(){var e=t.height/n.videoHeight*n.videoWidth,i=t.height,o=(t.width-e)/2,r=0;if(e>t.width){var a=t.width/n.videoWidth*n.videoHeight;o=0,r=Math.abs(t.height-a)/2,c.drawImage(n,o,r,t.width,a)}else c.drawImage(n,o,r,e,i)},W=function(e){var t=0;n.currentTime=n.currentTime+e,$(k),t=Math.abs(s.currentTime-n.currentTime),f===!1&&t>=g&&t<=T&&(n.currentTime=s.currentTime+e),H(),V()},z=function(){return window.innerHeight>window.innerWidth},q=function(){this.resumeVideo()},J=function(e){var t=window.innerWidth,n=window.innerHeight,i=D.playerSkin.controlBarHeight,o=t,r=n-i,a=0,s=0;return{width:o,height:r,top:a,left:s}},G=function(){S.style.backgroundColor="black",S.style.width="100%",S.style.height="100%",S.style.position="fixed",S.style.top="0px",S.style.left="0px",S.style.zIndex="999999",S.style.background="rgba(0,0,0,1)",S.style.transition="height 0s ease",j.style.background="rgba(0,0,0,1)",t.style.background="rgba(0,0,0,1)",C.style.background="rgba(0,0,0,1)"},Q=function(){F(S,I),S.style.height=J().height+"px"},X=function(e){A=e.target.videoWidth/e.target.videoHeight},Y=function(){var e=z(),t=J(e),n=t.width,i=t.height,o=t.top,r=t.left;C.style.position="absolute",C.style.width=n,C.style.height=i,C.style.top=o+"px",C.style.left=r+"px",C.style.marginRight="",C.style.transform="",j.style.width=n+"px",j.style.height=i+"px",j.style.marginLeft="",j.style.marginRight=""},K=function(){k=!1,S.ontouchmove=function(){return!0},t.ontouchmove=function(){return!0},j.ontouchmove=function(){return!0},Q(),F(S,I),F(C,P),F(j,x),F(t,_)};this.exitFullscreeenAsCanvas=function(){K(),v===!0&&this.resizeAndRedraw()},this.enterFullscreenAsCanvas=function(){S.ontouchmove=function(){return!1},t.ontouchmove=function(){return!1},j.ontouchmove=function(){return!1},I=L(S),P=L(C),x=L(j),_=L(t),S.style.marginLeft="0px",S.style.marginRight="0px",S.style.marginTop="0px",S.style.marginBottom="0px",k=!0,G(),Y(),v===!0&&this.resizeAndRedraw()},this.resizeAndRedraw=function(){$(k),H()},this.initialPlay=function(e){this.play(e)},this.play=function(t){N||(v=!1,t&&s&&s.play&&s.play(),p=window.requestAnimationFrame(e))},this.resumeVideo=function(){v=!1,s&&s.play&&s.play(),p=window.requestAnimationFrame(e)},this.pauseVideo=function(){v=!0,s.pause(),window.cancelAnimationFrame(p),N=!1},this.activateAudio=function(){r("activateAudio : "+n.src),s.style.display="none",s.autoplay=!1,s.preload="auto",s.controls=!0,l.src=n.src,s.appendChild(l),E.appendChild(s),s.load()},this.hearAudio=function(){return b?(r("resume audio"),f=!1,s.currentTime=n.currentTime,void(v||s.play())):(s.addEventListener("playing",function(){r("first playing audio"),s.currentTime=n.currentTime+g,f=!1,b=!0}),D.preloadInlineAudioForIos===!1&&this.activateAudio(),s.currentTime=n.currentTime,void(v||s.play()))},this.stopAudio=function(){r("pausing audio"),s.pause(),f=!0},this.checkOrientation=function(){M&&!D.disableCollapse.enabled||(k?(Q(),G(),Y(),v===!0&&this.resizeAndRedraw()):($(k),H()))},this.initiate=function(){n.addEventListener("canplaythrough",X.bind(this)),n.addEventListener("webkitendfullscreen",q,!1),n.load(),n.pause()},this.getCanvas=function(){return t},this.destroy=function(){window.cancelAnimationFrame(p),k&&K(),M=!0},this.resizeCanvas=$,this.redrawCanvas=H};e.exports=s},function(e,t,n){var i=n(8),o=n(9),r=function(e){o.debug("iOSInlineVideoPlayer :: EmulateHtml5Video: "+e)},a=function(e){o.verbose("iOSInlineVideoPlayer :: EmulateHtml5Video: "+e)},s=n(32);e.exports=function(e,t){return{handleFullScreen:function(n){t.isFullscreen=!0,r("handleFullScreen");var o=n.contentWindow.document.getElementById("top_chrome");e.dispatchEventToAdunit({name:"fullscreenchange",fullscreenStatus:"enter"}),e.iOSVideoPlayer.enterFullscreenAsCanvas(),e.isFullscreen=!0,o&&(o.style.display="none"),e.options.disableTopBar||(a("Hiding ad text for fullscreen"),e.floatingAdIndicator.style.display="block",e.floatingSkipButton&&(e.readyForSkip?(e.floatingSkipButton.style.display="block",e.floatingAdSkipText.style.display="none"):(e.floatingSkipButton.style.display="none",e.floatingAdSkipText.style.display="block"))),i.makeIframeFlexbileSize(t)},handleNormalScreen:function(n){t.isFullscreen=!1,r("handleNormalScreen");var o=n.contentWindow.document.getElementById("top_chrome");e.dispatchEventToAdunit({name:"fullscreenchange",fullscreenStatus:"exit"}),o&&(o.style.display="block"),e.options.disableTopBar||(a("Showing ad text for fullscreen"),e.floatingAdIndicator.style.display="none",e.floatingSkipButton&&(e.floatingSkipButton.style.display="none",e.floatingAdSkipText.style.display="none")),e.iOSVideoPlayer.exitFullscreeenAsCanvas(),e.isFullscreen=!1;var s=t.options.sideStream&&t.options.sideStream.enabled&&t.options.sideStreamObject&&t.options.sideStreamObject.isActivated;s===!1&&e.refreshVideoLookAndFeel(e.options,t),e.resizeIosCanvas(e.isFullscreen);var l=document.getElementById(t.videoObjectId);l&&"undefined"!=typeof l&&(l.style.width=e.options.width,l.style.height=e.options.height);var d=t.options.sideStream&&t.options.sideStream.enabled,c=t.options.sideStreamObject&&"function"==typeof t.options.sideStreamObject.moveAdUnitBack;d&&c&&t.options.sideStreamObject.moveAdUnitBack(),i.makeIframeFlexbileSize(t)},resizeIosCanvas:function(t){e.iOSVideoPlayer.resizeCanvas(t),e.iOSVideoPlayer.redrawCanvas(t)},cbWhenVideoComplete:function(n,o){if(r("cbWhenVideoComplete"),e.isFullscreen&&(e.fromFullscreen=!0,e.handleNormalScreen(n)),e.options.disableCollapse.enabled===!0&&(t.options.sideStreamObject&&t.options.sideStreamObject.isActivated&&t.options.sideStreamObject.moveAdUnitBack(),t.options.sideStream.wasEnabled=t.options.sideStream.enabled,t.options.sideStream.enabled=!1),e.options.disableCollapse.enabled!==!0||e.options.disableCollapse.replay!==!0&&e.options.endCard.enabled!==!0){if(e.isAlreadyDoneVideoComplete)return;e.isAlreadyDoneVideoComplete=!0,"below"===e.options.controlBarPosition&&(e.videojsPlayer.controlBar.el().style.bottom=s.getBottomMarginForControlbar(e.options,!1)+"em"),a("removing control bar items"),e.videojsPlayer.trigger("concealControls"),a("destroying iOSVideoPlayer"),e.iOSVideoPlayer.destroy(),e.resizeIosCanvas(e.isFullscreen),e.options.disableCollapse.enabled||(window.removeEventListener("orientationchange",e.eventOrientationChange),window.removeEventListener("resize",e.eventSizeChange));var l=function(){if(!e.options.disableCollapse.enabled){var n=t.options.sideStream&&t.options.sideStream.enabled&&t.options.sideStreamObject&&t.options.sideStreamObject.isActivated;n?t.isFullscreen=!1:t.isFullscreen=!0,t.destroyWithoutSkip()}t.isCompleted=!0,e.options.vpaid&&i.fireEvent(o,"ended")};e.dispatchEventToAdunit({name:"video_complete"},l)}else e.options.endCard.enabled&&t.endCard?(e.videojsPlayer.trigger("concealControls"),e.dispatchEventToAdunit({name:"video_complete"}),t.endCard.show()):(e.videojsPlayer.bigPlayButton.addClass("vjs-big-play-button-replay"),t.explicitPause(),e.videojsPlayer.currentTime(0),e.videojsPlayer.bigPlayButton.show(),e.videojsPlayer.player().bigPlayButton.el().style.display="block",e.dispatchEventToAdunit({name:"video_complete"}));t.isEnded=!0}}}},function(e,t,n){var i=n(8),o=n(17),r=n(9),a=function(e){r.log("iOSInlineVideoPlayer: "+e)},s=function(e){r.debug("iOSInlineVideoPlayer :: Events: "+e)},l=function(e){r.error("iOSInlineVideoPlayer :: Events: "+e)},d=n(41),c=n(24),u=24;e.exports=function(e,t,r){return{fnMainProcess:function(p){var h;a("fnMainProcess");var m=p.contentWindow.document.getElementById(e.an_video_ad_player_id);if(t.iframeVideoWrapper=p,e.options.vpaid)try{t.options.showVpaidIcons=!1,o(t)}catch(v){l(v)}else e.options.isWaterfall&&e.options.plugins&&(e.options.plugins=null);e.options.nativeControlsForTouch=!1,e.options.customControlsOnMobile=!1,e.videojsPlayer=e.videojsOrigin(m,e.options,function(){}),n(47)(e,t,r,e.videojsPlayer,p).run(),t.adVideoPlayer=e.videojsPlayer;var f=document.getElementById(e.options.iframeVideoWrapperId).contentWindow.document.getElementById(e.an_video_ad_player_id),g=document.getElementById(e.options.iframeVideoWrapperId).contentWindow.document.getElementById(e.an_video_ad_player_html5_api_id);e.options.enableInlineVideoForIos===!0&&(g.style.width="0.1px",g.style.height="0.1px");var y=document.createElement("div");y.style.position="absolute",y.style.top="0px",y.style.left="0px",e.options.vpaid||(y.className="vjs-tech"),y.style.textAlign="center",f.insertBefore(y,g),e.options.targetElement.addEventListener("IOS_INLINE_RESIZE",function(){e.resizeIosCanvas(!1)}),e.options.targetElement.addEventListener("IOS_INLINE_REFERESH",function(){e.refreshVideoLookAndFeel(e.options,t),e.iOSVideoPlayer.checkOrientation(),e.customFullscreenBtn.style.visibility="hidden"});var A={mediaUrl:e.options.videoUrl,divArea:y,width:e.options.width,height:e.options.height,videoElement:g,cbWhenVideoComplete:function(){e.cbWhenVideoComplete(p,g)},targetElement:e.options.targetElement,iframeVideoWrapper:p,el_wholeArea:f,cbTimeUpdate:function(){e.videojsPlayer.trigger("timeupdate")}},b=e.options.isWaterfall?e.options.waterfallStepId:null;e.iOSVideoPlayer.setPubOptions(e.options),e.iOSVideoPlayer.renderVideo(A,function(n){return n?(e.eventOrientationChange=function(){if((!b||b===e.options.waterfallStepId)&&t.isReadyToExpandForMobile){var n=!(!t.options.sideStreamObject||"function"!=typeof t.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated)&&t.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated();if(n)return;e.refreshVideoLookAndFeel(e.options,t),e.iOSVideoPlayer.checkOrientation()}},e.eventSizeChange=function(){b&&b!==e.options.waterfallStepId||e.isFullscreen&&(t.resizeVideo(-1,e.shouldConsiderHeightOfDevice),e.iOSVideoPlayer.checkOrientation())},window.addEventListener("resize",e.eventSizeChange),window.addEventListener("orientationchange",function(){(t.isCompleted||t.isEnded)&&e.options.disableCollapse.enabled===!1||(clearTimeout(h),h=setTimeout(function(){e.eventOrientationChange()},250))}),g.onseeked=function(){return!1},"auto"===e.options.initialPlayback?e.videojsPlayer.player().loadingSpinner.show():e.videojsPlayer.player().loadingSpinner.hide(),e.videojsPlayer.player().off("seeked"),e.iOSVideoPlayer.initiate(),"click"===e.options.initialPlayback&&g.addEventListener("canplay",function(){e.iOSVideoPlayer.checkOrientation()}),void 0):void s("only works in iOS")}),e.videojsPlayer.controlBar.fullscreenToggle.dispose(),e.options.allowFullscreen===!0&&e.enableFullscreen&&(e.customFullscreenBtn=e.videojsOrigin.createEl("div",{id:"customFullscreenToggle",role:"button",innerHTML:'Fullscreen' -}),e.customFullscreenBtn.style.cssText="text-align:right;float:right;margin-right:0em;font-size:1em;line-height:3em;outline:0;position:relative;padding:0;height:3em",e.customFullscreenBtn.className="vjs-fullscreen-control vjs-control",e.videojsPlayer.controlBar.addChild("button",{el:e.customFullscreenBtn}),e.customFullscreenBtn.addEventListener("touchend",function(t){setTimeout(function(){if(e.isFullscreen){var n=document.getElementById(e.options.iframeVideoWrapperId).contentWindow.document.getElementById(e.an_video_ad_player_html5_api_id),i=n.style.visibility;n.style.visibility="hidden",setTimeout(function(){e.handleNormalScreen(p),n.style.visibility=i},0)}else e.handleFullScreen(p);t.preventDefault()},200)})),e.iOSVideoPlayer.getCanvas().onclick=function(){e.options.learnMore.enabled===!1?(t.options.expandable||t.explicitPause(),t.click()):e.options.learnMore.clickToPause===!0&&(e.isTogglePaused===!1?t.explicitPause():t.explicitPlay())};var k=function(t){t?e.customPlayToggle.innerHTML="":e.customPlayToggle.innerHTML=""},T=function(){e.videojsPlayer.player().bigPlayButton.hide(),e.videojsPlayer.player().loadingSpinner.hide(),e.videojsPlayer.player().addClass("vjs-has-started"),e.videojsPlayer.player().removeClass("vjs-paused"),e.videojsPlayer.player().addClass("vjs-playing");try{k(!1);var n=e.enabledAudio;e.iOSVideoPlayer.initialPlay(n),s("override play method"),e.isDoneiOSInitialPlay?(i.fireEvent(g,"play"),i.fireEvent(g,"playing")):(i.fireEvent(g,"play"),i.fireEvent(g,"playing"),e.isDoneiOSInitialPlay=!0),t.isPlayingVideo=!0,e.isTogglePaused=!1}catch(o){l(o)}},w=function(){if(!e.isTogglePaused&&!t.isCompleted&&!t.isEnded){if(e.options.showBigPlayButton!==!1){var n=t.options.sideStream&&t.options.sideStream.enabled&&t.options.sideStreamObject&&t.options.sideStreamObject.isActivated;n===!0&&t.options.showPlayToggle===!0&&1==t.options.sideStream.dynamicBigPlayButtonOnSideStream||(e.videojsPlayer.bigPlayButton.show(),e.videojsPlayer.player().bigPlayButton.el().style.display="block")}e.iOSVideoPlayer.pauseVideo(),s("override pause method"),k(!0),t.isPlayingVideo=!1,e.isTogglePaused=!0,i.fireEvent(g,"pause")}},E=function(){var t=function(e){e&&0===e.readyState&&e.load()};g.play=function(){t(g),T()},g.pause=function(){w()},e.videojsPlayer.one("vpaid.AdStarted",function(){t(g)}),e.videojsPlayer.one("an.readytogovpaid",function(){e.iOSVideoPlayer.activateAudio(),t(g)})};e.options.vpaid?E():(g.play=T,g.pause=w),e.videojsPlayer.controlBar.el().ontouchend=function(){},e.videojsPlayer.controlBar.playToggle.dispose(),e.customPlayToggle=e.videojsOrigin.createEl("div",{id:"customPlayToggle",role:"button","aria-live":"polite",tabindex:"0",innerHTML:"",width:"5em"}),e.customPlayToggle.style.cssText="float:left;font-family:VideoJS;font-size:1.5em;line-height:2;width:3em;height:100%;text-align:center",e.videojsPlayer.controlBar.addChild("button",{el:e.customPlayToggle}),e.videojsPlayer.controlBar.el().insertBefore(e.customPlayToggle,e.videojsPlayer.controlBar.currentTimeDisplay.el()),e.customPlayToggle.ontouchend=function(n){e.isTogglePaused===!1?t.explicitPause():t.explicitPlay(),n.preventDefault()},e.customPlayToggle.onclick=function(){e.isTogglePaused===!1?t.explicitPause():t.explicitPlay()},e.videojsPlayer.controlBar.muteToggle.el().ontouchend=function(){e.enabledAudio?(e.iOSVideoPlayer.stopAudio(),e.enabledAudio=!1,e.videojsPlayer.controlBar.muteToggle.el_.style.opacity="0.3",t.dispatchEventToAdunit({name:"video_mute"})):(e.iOSVideoPlayer.hearAudio(),e.enabledAudio=!0,e.videojsPlayer.controlBar.muteToggle.el_.style.opacity="1",t.dispatchEventToAdunit({name:"video_unmute"}),e.isTogglePaused===!0&&t.explicitPause())},e.videojsPlayer.controlBar.muteToggle.el().onclick=function(){e.enabledAudio?(e.iOSVideoPlayer.stopAudio(),e.enabledAudio=!1,e.videojsPlayer.controlBar.muteToggle.el_.style.opacity="0.3"):(e.iOSVideoPlayer.hearAudio(),e.enabledAudio=!0,e.videojsPlayer.controlBar.muteToggle.el_.style.opacity="1",e.isTogglePaused===!0&&t.explicitPause())},e.videojsPlayer.one("loadedmetadata",function(n){if(e.options.showPlayToggle===!1&&e.videojsPlayer.controlBar.playToggle.hide(),e.options.showBigPlayButton===!1&&e.videojsPlayer.bigPlayButton.hide(),e.options.showMute===!1?e.videojsPlayer.controlBar.muteToggle.hide():(e.videojsPlayer.controlBar.muteToggle.show(),e.videojsPlayer.controlBar.muteToggle.el_.style.opacity="0.3"),e.options.allowFullscreen===!0&&(e.customFullscreenBtn.style.display="none"),e.options.showMute===!0&&e.videojsPlayer.controlBar.muteToggle.hide(),e.options.targetElement.addEventListener("outstream-impression",function(){e.options.allowFullscreen===!0&&(e.customFullscreenBtn.style.display="block"),e.options.showMute===!0&&e.videojsPlayer.controlBar.muteToggle.show()}),!t.options.vpaid){t.isReadyToExpandForMobile=!0,t.videoObjectId=n.currentTarget.id,s("loadedmetadata"),s("video.js is ready to play"),e.videojsPlayer.tech.removeControlsListeners();var i=n.currentTarget.videoWidth,o=n.currentTarget.videoHeight,r=i/o;i>0?(t.resizeVideo(r,e.shouldConsiderHeightOfDevice),"function"==typeof e.callbackForAdUnit.cbWhenReady&&e.callbackForAdUnit.cbWhenReady(t)):(t.resizeVideo(0,e.shouldConsiderHeightOfDevice),e.callbackForAdUnit.cbWhenReady(t))}}),t.customSkinning.render(e,e.videojsPlayer,p.contentWindow.document,!0);var S=function(){var n=t.options.playerSkin.controlBarHeight,i=e.videojsPlayer,o=new d;o.init(t.options.data.adIcons);var r=o.getIcons();if(r&&(!r||0!==r.length)){var a=t.options.disableTopBar?0:u,s=n;i.controlBar.el_.style.zIndex=10,t.test("adIconOffset",o),i.on("timeupdate",function(){if(!t.options.vpaid||t.options.showVpaidIcons){var e=Math.round(i.player().currentTime()),n=1e3*e,l=Math.round(i.player().duration()),d=1e3*l;r&&r.length>0&&o.renderIcons(function(e){var n={};n.name=e,t.dispatchEventToAdunit(n)},function(e){t.options.expandable||t.explicitPause(),t.click(e,!1)},i.player().el_,a,s,n,d)}})}};r(f,g),S(),e.options.vpaid&&e.videojsPlayer.trigger("an.doneInitialize"),e.options.endCard.enabled&&(t.endCard=new c(e.options.endCard,e.videojsPlayer,t)),e.videojsPlayer.on("concealControls",function(){var t=e.videojsPlayer.player().controlBar;t&&!t.concealed&&(t.currentTimeDisplay&&t.currentTimeDisplay.hide(),t.durationDisplay&&t.durationDisplay.hide(),t.timeDivider&&t.timeDivider.hide(),t.muteToggle&&t.muteToggle.hide(),t.playToggle&&t.playToggle.hide(),t.fullscreenToggle&&t.fullscreenToggle.hide(),t.progressControl&&t.progressControl.hide(),t.volumeControl&&t.volumeControl.hide(),i.isEmptyAndObject(e.customPlayToggle)===!1&&(e.customPlayToggle.style.display="none"),i.isEmptyAndObject(e.customFullscreenBtn)===!1&&(e.customFullscreenBtn.style.display="none"),e.savedBackgroundColorForBottomBar=t.el_.style.backgroundColor,e.savedBackgroundForBottomBar=t.el_.style.background,t.concealed=!0)}),e.videojsPlayer.on("revealControls",function(){var t=e.videojsPlayer.player().controlBar;t&&t.concealed&&("bar"!==e.options.showProgressBar&&e.options.showProgressBar!==!1&&(t.currentTimeDisplay&&t.currentTimeDisplay.show(),t.durationDisplay&&t.durationDisplay.show(),t.timeDivider&&t.timeDivider.show()),t.muteToggle&&e.options.showMute&&t.muteToggle.show(),t.playToggle&&e.options.showPlayToggle&&t.playToggle.show(),t.fullscreenToggle&&e.options.allowFullscreen&&t.fullscreenToggle.show(),e.options.showProgressBar!==!1&&"text"!==e.options.showProgressBar&&t.progressControl&&t.progressControl.show(),i.isEmptyAndObject(e.customPlayToggle)===!1&&(e.customPlayToggle.style.display="block"),i.isEmptyAndObject(e.customFullscreenBtn)===!1&&(e.customFullscreenBtn.style.display="block"),t.el_.style.backgroundColor=e.savedBackgroundColorForBottomBar,t.el_.style.background=e.savedBackgroundForBottomBar,t.concealed=!1)})}}}},function(e,t,n){var i=n(9),o=function(e){i.debug("iOSInlineVideoPlayer :: CustomizeVideoArea: "+e)},r=function(e){i.verbose("Video Player: "+e)},a=n(8),s="General error reported from HTML5 video player (iOS inline)";e.exports=function(e,t,n,i,l){return{run:function(){if(o("run"),e.options.isWaterfall&&e.options.vpaid&&(i.controlBar.hide(),e.options.firstAdAttempted&&i.bigPlayButton.hide()),"boolean"==typeof e.options.customButton.enabled&&e.options.customButton.enabled===!0){var n=e.options.playerSkin.controlBarHeight||30,d=Math.min(50,e.options.customButton.imgWidth),c=Math.min(n,e.options.customButton.imgHeight),u=Math.floor((n-c)/2),p=e.videojsOrigin.createEl("div",{innerHTML:'',role:"button","aria-live":"polite",tabindex:"0"});p.style.cssText="float:right;font-family:VideoJS;font-size:1.5em;line-height:2;width:50px;height:100%;text-align:center",i.controlBar.addChild("button",{el:p}),i.controlBar.el().insertBefore(p,i.controlBar.fullscreenToggle.el())}i.controlBar.progressControl.seekBar.seekHandle.hide(),i.controlBar.progressControl.seekBar.el_.style.pointerEvents="none","boolean"==typeof e.options.showProgressBar?(e.options.showProgressBar===!1&&(r("removing progress bar"),i.controlBar.currentTimeDisplay.hide(),i.controlBar.timeDivider.hide(),i.controlBar.durationDisplay.hide()),i.controlBar.progressControl.seekBar.hide()):"text"===e.options.showProgressBar?(r("removing progress text"),i.controlBar.progressControl.seekBar.hide()):"bar"===e.options.showProgressBar&&(r("removing progress bar"),i.controlBar.currentTimeDisplay.hide(),i.controlBar.timeDivider.hide(),i.controlBar.durationDisplay.hide()),e.options.showVolume===!1&&i.controlBar.volumeControl.dispose();var h=e.videojsOrigin.createEl("div");h.className="vjs-control-bar-divider",h.style.position="absolute",h.style.left="0",h.style.right="0",i.controlBar.addChild("button",{el:h});var m=l.contentWindow.document.getElementById("top_chrome"),v=l.contentWindow.document.createElement("div");v.id="ad_indicator_text";var f=e.options.adText,g=e.options.learnMore.enabled;if(e.options.clickUrls[0]||(g=!1),g&&("top-right"===e.options.skippable.skipLocation?f=e.options.learnMore.text+" "+e.options.learnMore.separator+" "+f:f+=" "+e.options.learnMore.separator+" "+e.options.learnMore.text),v.innerHTML=f,v.className="top-bar-text",v.role="button",v.style["text-align"]="right",v.style["margin-right"]="1em",v.style["margin-left"]="1em",v.style["font-size"]="1em",v.style.right="0px",v.style.left="",v.style["line-height"]="24px",v.style.outline="0",v.style.position="absolute",v.style.padding="0",v.style.height="auto",v.style.width="auto",v.style["max-width"]="35%",v.style["white-space"]="nowrap",v.style.overflow="hidden",v.style["text-overflow"]="ellipsis",e.floatingAdIndicator=e.videojsOrigin.createEl("div",{role:"button",innerHTML:f,className:"top-bar-text"}),e.floatingAdIndicator.style["text-align"]="right",e.floatingAdIndicator.style["margin-right"]="1em",e.floatingAdIndicator.style["margin-left"]="1em",e.floatingAdIndicator.style["font-size"]="1em",e.floatingAdIndicator.style.right="0px",e.floatingAdIndicator.style.left="",e.floatingAdIndicator.style["line-height"]="3em",e.floatingAdIndicator.style.outline="0",e.floatingAdIndicator.style.position="absolute",e.floatingAdIndicator.style.padding="0",e.floatingAdIndicator.style.height="3em",e.floatingAdIndicator.style["max-width"]="35%",e.floatingAdIndicator.style.width="auto",e.floatingAdIndicator.style["text-overflow"]="ellipsis",e.floatingAdIndicator.style["white-space"]="nowrap",e.floatingAdIndicator.style.overflow="hidden",e.floatingAdIndicator.style.display="none",i.addChild("button",{el:e.floatingAdIndicator}),g){var y=function(n){e.iOSVideoPlayer.pauseVideo(),t.click(),n.stopPropagation(),n.preventDefault()};v.addEventListener("click",y),e.floatingAdIndicator.addEventListener("click",y)}var A,b;if(e.options.skippable.enabled===!0){var k=e.options.skippable.videoThreshold,T=e.options.skippable.skipText,w=e.options.skippable.skipButtonText;A=l.contentWindow.document.createElement("div"),A.id="skip_button",A.innerHTML=w,A.className="top-bar-text",A.role="button",A.style.display="none",A.style.cursor="pointer",A.style["font-weight"]="bold",A.style["margin-right"]="1em",A.style["margin-left"]="1em",A.style["font-size"]="1em",A.style.right="",A.style.left="0px",A.style["line-height"]="24px",A.style.outline="0",A.style.position="absolute",A.style.padding="0",A.style.height="5em",A.style.width="auto",A.style["min-width"]="5em",A.style["text-align"]="left",e.floatingSkipButton=e.videojsOrigin.createEl("div",{className:"top-bar-text",role:"button",innerHTML:w}),e.floatingSkipButton.style.display="none",e.floatingSkipButton.style.cursor="pointer",e.floatingSkipButton.style["font-weight"]="bold",e.floatingSkipButton.style["margin-right"]="1em",e.floatingSkipButton.style["margin-left"]="1em",e.floatingSkipButton.style["font-size"]="1em",e.floatingSkipButton.style.right="",e.floatingSkipButton.style.left="0px",e.floatingSkipButton.style["line-height"]="3em",e.floatingSkipButton.style.outline="0",e.floatingSkipButton.style.position="absolute",e.floatingSkipButton.style.padding="0",e.floatingSkipButton.style.height="5em",e.floatingSkipButton.style["min-width"]="5em",e.floatingSkipButton.style.width="auto",e.floatingSkipButton.style.display="none",e.floatingSkipButton.style["text-align"]="left",i.addChild("button",{el:e.floatingSkipButton});var E=function(n){window.removeEventListener("orientationchange",e.eventOrientationChange),window.removeEventListener("resize",e.eventSizeChange),e.iOSVideoPlayer.destroy(),t.pause(),t.isFullscreen=e.isFullscreen,t.forceToSkip=!0,t.destroy(),t.isCompleted=!0,n.stopPropagation(),n.preventDefault()};switch(A.addEventListener("touchend",E),A.addEventListener("click",E),e.floatingSkipButton.addEventListener("touchend",E),e.floatingSkipButton.addEventListener("click",E),b=l.contentWindow.document.createElement("div"),b.id="ad_skip_text",b.innerHTML=w,b.className="top-bar-text",b.role="button",b.style["margin-left"]="1em",b.style["margin-right"]="1em",b.style.right="",b.style.left="0px",b.style["font-size"]="1em",b.style["line-height"]="24px",b.style.outline="0",b.style.position="absolute",b.style["text-align"]="left",b.style.padding="0",b.style.height="3em",b.style.width="auto",b.style["pointer-events"]="none",b.style.display="none",e.floatingAdSkipText=e.videojsOrigin.createEl("div",{role:"button",className:"top-bar-text",innerHTML:""}),e.floatingAdSkipText.style["margin-left"]="1em",e.floatingAdSkipText.style["margin-right"]="1em",e.floatingAdSkipText.style.right="",e.floatingAdSkipText.style.left="0px",e.floatingAdSkipText.style["font-size"]="1em",e.floatingAdSkipText.style["line-height"]="3em",e.floatingAdSkipText.style.outline="0",e.floatingAdSkipText.style.position="absolute",e.floatingAdSkipText.style["text-align"]="left",e.floatingAdSkipText.style.padding="0",e.floatingAdSkipText.style.height="3em",e.floatingAdSkipText.style.width="auto",e.floatingAdSkipText.style["pointer-events"]="none",e.floatingAdSkipText.style.display="none",i.addChild("button",{el:e.floatingAdSkipText}),e.options.skippable.skipLocation){case"top-right":A.style.right="0px",A.style.left="",A.style["text-align"]="right",b.style.right="0px",b.style.left="",e.floatingSkipButton.style.right="0px",e.floatingSkipButton.style.left="",e.floatingSkipButton.style["text-align"]="right",e.floatingAdSkipText.style.right="0px",e.floatingAdSkipText.style.left=""}var S=!1,I=!1,C=!1,P={},j=function(){var n,o=Math.round(i.player().duration()),r=Math.round(i.player().currentTime());n=t.options.skippable.allowOverride?Math.round(e.options.data.skipOffsetMsec/1e3):e.options.skippable.videoOffset;var s=n-r,l=!e.options.skippable.allowOverride||e.options.data.isVastVideoSkippable;l=!(n>o)&&l,t.test("VIDLA163_needToShowSkip",l),k0&&!t.startedReplay&&!t.isEnded?(e.floatingAdSkipText.innerHTML=T.replace("%%TIME%%",s),A.style.display="none",b.innerHTML=T.replace("%%TIME%%",s),b.style.display="block",a.elementsOverlap(b,v)&&(b.style.display="none")):(e.readyForSkip||(t.test("log",r),t.test("VIDLA163_skip",r)),e.readyForSkip=!0,e.isFullscreen&&(e.floatingAdSkipText.style.display="none",e.floatingSkipButton.style.display="block"),b.style.display="none",A.style.display="block"))};i.on("resize",function(){j()}),i.on("timeupdate",function(){var n=t.options.data.vastProgressEvent;if(!e.options.isWaterfall||!e.options.vpaid||e.options.vpaidImpressionFired){var o=Math.round(i.player().currentTime()),r=1e3*o;if(n&&"object"==typeof n){var a=function(){t.test("VIDLA163_Tracking",P)};for(var s in n){var l=n[s];if(l&&l>=0&&r>=l&&Object.keys(P).indexOf(s)===-1){P[s]=l;var d={};d.name=s,d.name&&t.dispatchEventToAdunit(d,a)}}}j()}})}if(e.options.skippable&&e.options.skippable.skipLocation)switch(e.options.skippable.skipLocation){case"top-right":v.style.right="",v.style.left="0px",e.floatingAdIndicator.style.right="",e.floatingAdIndicator.style.left="0px"}!e.options.disableTopBar&&m&&(e.options.skippable.enabled===!0&&(m.appendChild(A),m.appendChild(b)),m.appendChild(v)),i.on("timeupdate",function(){if(!e.options.vpaid){var t=Math.round(i.player().currentTime()),n=i.player().duration(),o=n/4,r=n/4*2,a=n/4*3;!S&&t>=o&&t=r&&t=a&&(e.dispatchEventToAdunit({name:"video-third-quartile"}),C=!0)}});var x=function(){t.isEnded&&e.options.disableCollapse.replay&&(t.replay(),e.options.showBigPlayButton===!1&&i.player().bigPlayButton.hide(),i.player().bigPlayButton.removeClass("vjs-big-play-button-replay")),t.isDoneInitialPlay&&(t.isPlayingVideo=!1),t.explicitPlay()};i.player().bigPlayButton.on("touchend",function(e){x(),e.preventDefault()}),i.player().bigPlayButton.on("click",function(){x()}),i.on("error",function(){t.destroyWithoutSkip(!0,s,null,900)}),i.on("loadstart",function(){e.dispatchEventToAdunit({name:"loadstart"})}),i.on("pause",function(){var e=t.options.sideStream&&t.options.sideStream.enabled&&t.options.sideStreamObject&&t.options.sideStreamObject.isActivated;e===!0&&t.options.showPlayToggle===!0&&1==t.options.sideStream.dynamicBigPlayButtonOnSideStream||t.isFullscreen||(i.player().bigPlayButton.el().style.display="block")})}}}},function(e,t,n){var i=n(9),o=function(e){i.log("Video Player: "+e)},r=function(e){i.debug("Video Player: "+e)},a=n(49);e.exports=function(e,t){return{createIframeAndRequiredObject:function(n){o("createIframeAndRequiredObject");var i=e.options,s=document.createElement("iframe");s.src="about:blank",i.targetElement.appendChild(s),s.style.width=i.width+"px",s.style.height=i.height+"px",s.id=i.iframeVideoWrapperId,s.setAttribute("allowfullscreen","true"),s.setAttribute("webkitallowfullscreen","true"),s.setAttribute("mozallowfullscreen","true");var l="";s.contentWindow.document.open(),s.contentWindow.document.write(l),s.contentWindow.document.close(),"undefined"!=typeof i.enableInlineVideoFullscreenButton&&(e.enableFullscreen=i.enableInlineVideoFullscreenButton);var d=s.contentWindow.document,c=s.contentWindow.window;r("Creating and styling top chrome bar");var u=d.createElement("div");u.id="top_chrome",u.style.height=function(){return i.playerSkin&&"number"==typeof i.playerSkin.dividerHeight?e.topChromeHeight-i.playerSkin.dividerHeight+"px":e.topChromeHeight-1+"px"}(),u.style.width=i.width+"px",u.style.marginRight="auto",u.style.marginLeft="auto",u.className="video-js vjs-default-skin",r("Generating and styling video object");var p=d.createElement("video");if(p.id=e.an_video_ad_player_id,p.className="video-js vjs-default-skin",p.style.marginRight="auto",p.style.marginLeft="auto",u.style["z-index"]=p.style["z-index"]+1,!i.vpaid){r("Generating source object");var h=d.createElement("source");h.type="video/mp4",h.src=i.videoUrl,p.appendChild(h)}if(r("Injecting required elements into iframe"),i.disableTopBar||d.body.appendChild(u),d.body.appendChild(p),c.videojs=e.videojsOrigin,d.body.style.margin="0px",d.body.style.overflow="hidden",i.vpaid){var m=d.createElement("script");m.innerHTML=t.videojs_vpaid,d.head.appendChild(m)}e.options.verifications&&(t.verificationManager=new a(e.options.verifications,{parentDoc:d,videoElement:p,viewableImpression:e.options.viewableImpression,adServingId:e.options.adServingId,player:t}),t.verificationManager.init(),t.verificationManager.start()),n(s)}}}},function(e,t,n){var i=n(12),o=n(14),r="[PlayerManager_Verifications]",a=n(9);e.exports=function(e,t){var n=e,s=t,l=[],d=new o(e,t.player);return{init:function(){a.debug(r,"init verifications");for(var e=0;eu&&l<1&&(c=u,r=c+C-y-A,g=Math.round(u*l))}if(n.setFinalAspectRatio(l),p.height=c,p.mediaHeight=r,i.isMobile()&&p.isWaterfall&&(p.targetElement.style.height=p.height+"px"),"html5"===m(p.requiredPlayer)){var P=window.innerWidth&&document.documentElement.clientWidth?Math.max(window.innerWidth,document.documentElement.clientWidth):window.innerWidth||document.documentElement.clientWidth||document.getElementsByTagName("body")[0].clientWidth,j=window.innerHeight&&document.documentElement.clientHeight?Math.max(window.innerHeight,document.documentElement.clientHeight):window.innerHeight||document.documentElement.clientHeight||document.getElementsByTagName("body")[0].clientHeight;if(v&&"object"==typeof v&&v.style){if(v.style.border="none",v.style.width=P+"px",v.style.height=c+"px",v.style.position="absolute",p.shouldResizeVideoToFillMobileWebview&&r+A+yj){var _=j,V=j-A-y;f.height(V),a("mobile set video.js height to : "+V),p.height=_,a("mobile options.height to : "+_),p.mediaHeight=V,a("mobile options.mediaHeight to : "+V),v.style.height=V+"px",a("mobile set iframeVideoWrapper to : "+V)}else{var D=r;E()||(D+=A),f.height(D),a("desktop set video.js height to : "+D)}n.isEnded&&n.endCard&&n.endCard.onVideoResized(P,r)}else f.width=g+"px",f.height=c+"px",f.style.width=g+"px",f.style.height=c+"px",a("flash width : "+g),a("flash height : "+c);p.targetElement.style.visibility="visible","function"==typeof o&&o()},d=function(e,t,n,o){var r=!1;a("resizeVideo-sidestream");var s,l,d,c,u=e.options,p=e.isIosInlineRequired.bind(e),h=e.decidePlayer.bind(e),m=e.iframeVideoWrapper,v=e.adVideoPlayer,f=t,g=0,y=0,A=!0,b=u.video.width,k=u.video.height,T=function(){return i.isAndroid()||p()||"below"===u.controlBarPosition};if(d=u.aspectRatio||u.playerAspectRatio,a("options.height : "+n),i.isEmpty(d)&&(d=i.isEmpty(n)?"16:9":"none"),a("aspectRatioOption : "+d),l="undefined"==typeof b||"undefined"==typeof k||0===b||0===k?16/9:b/k,u.disableTopBar||(g=24),T()&&(y+=u.playerSkin.controlBarHeight),a("initial VAST width : "+b), -a("initial VAST height : "+k),a("initial topOffset : "+g),a("initial bottomOffset : "+y),a("initial mediaAspectRatio : "+l),A)c=n,f=t,s=n-g-y;else{var w=d.split(":");if(2===w.length)try{l=w[0]/w[1]}catch(E){a(E)}s=Math.round(f/l),c=s+g+y}if(n&&t&&(u.mediaHeight=s),"html5"===h(u.requiredPlayer)){var S=window.innerWidth&&document.documentElement.clientWidth?Math.max(window.innerWidth,document.documentElement.clientWidth):window.innerWidth||document.documentElement.clientWidth||document.getElementsByTagName("body")[0].clientWidth,I=window.innerHeight&&document.documentElement.clientHeight?Math.max(window.innerHeight,document.documentElement.clientHeight):window.innerHeight||document.documentElement.clientHeight||document.getElementsByTagName("body")[0].clientHeight;if(m&&"object"==typeof m&&m.style){if(m.style.border="none",m.style.width=S+"px",m.style.height=c+"px",m.contentWindow){var C=m.contentWindow.document&&m.contentWindow.document.getElementById("top_chrome");C&&(C.style.width=S,C.style.marginLeft="",C.style.marginRight="")}e.adVideoPlayer.el_.style.marginLeft="",e.adVideoPlayer.el_.style.marginRight="",a("final wrapper width for html5 : "+S),a("final wrapper height for html5 : "+c)}if(v.width(S),u.sideStream&&u.sideStream.enabled===!0&&u.emptyDiv?u.targetElement.style.width=S+"px":u.targetElement.style.width="",a("resize video.js width to : "+S),a("shouldConsiderHeightOfDevice : "+r),a("mediaHeight + bottomOffset + topOffset : "+(s+y+g)),a("viewPortHeight : "+I),r&&s+y+g>I){var P=I-g,j=I,x=I-y-g;v.height(P),a("mobile set video.js height to : "+P),a("mobile options.height to : "+j),a("mobile options.mediaHeight to : "+x),e.isEnded&&e.endCard&&e.endCard.onVideoResized(S,x)}else{var _=s;T()||(_+=y),v.height(_),a("desktop set video.js height to : "+_),e.isEnded&&e.endCard&&e.endCard.onVideoResized(S,s)}}else v.width=f+"px",v.height=c+"px",v.style.width=f+"px",v.style.height=c+"px",a("flash width : "+f),a("flash height : "+c);"function"==typeof o&&o()},c=function(e){a("setSizeForInitialRender");var t=e.width;e.autoInitialSize&&(t=e.targetElement.offsetWidth,t<=0&&(t=e.width,s("Width of target element was not set or zero, using tag width for player instead"))),a("setSizeForInitialRender using width: "+t),e.width=t},u=function(e){var t={width:0,height:0};if("flash"===e.decidePlayer(e.options.requiredPlayer))t={width:e.adVideoPlayer.offsetWidth,height:e.adVideoPlayer.offsetHeight};else{var n=document.getElementById(e.options.iframeVideoWrapperId);t={width:n.offsetWidth,height:n.offsetHeight}}return t},p=function(e,t,n){if(a("resizePlayer"),n.overlayPlayer&&n.adVideoPlayer)if("flash"===n.decidePlayer(n.options.requiredPlayer))n.adVideoPlayer.width=e+"px",n.adVideoPlayer.height=t+"px",n.adVideoPlayer.style.width=e+"px",n.adVideoPlayer.style.height=t+"px";else{if(n.resizeVideoWithDimensions(e,t),n.iframeVideoWrapper&&"object"==typeof n.iframeVideoWrapper){n.iframeVideoWrapper.style.border="none",n.iframeVideoWrapper.style.width=e+"px",n.iframeVideoWrapper.style.height=t+"px";var o=n&&n.iframeVideoWrapper&&n.iframeVideoWrapper.contentWindow&&n.iframeVideoWrapper.contentWindow.document&&n.iframeVideoWrapper.contentWindow.document.getElementById("top_chrome");o&&(o.style.width=e+"px",i.isIos()&&(o.style.marginLeft="",o.style.marginRight="")),i.isIos()&&(n.adVideoPlayer.el_.style.marginLeft="",n.adVideoPlayer.el_.style.marginRight="")}n.adVideoPlayer.width(e);var r=0;n.options.disableTopBar||(r=24),(i.isAndroid()||n.isIosInlineRequired()||"below"===n.options.controlBarPosition)&&(r+=n.options.playerSkin.controlBarHeight,n.adVideoPlayer.controlBar&&n.adVideoPlayer.controlBar.progressControl&&(r+=n.adVideoPlayer.controlBar.progressControl.el_.offsetHeight)),n.adVideoPlayer.height(t-r)}};e.exports={resizeVideo:l,setSizeForInitialRender:c,getFinalSize:u,resizePlayer:p,resizeVideoForSideStream:d}},function(e,t){e.exports="/* jshint ignore:start */\n(function(window, document, vjs, undefined) {\n (function e(t, n, r) {\n function s(o, u) {\n if (!n[o]) {\n if (!t[o]) {\n var a = typeof require == \"function\" && require;\n if (!u && a) return a(o, !0);\n if (i) return i(o, !0);\n var f = new Error(\"Cannot find module '\" + o + \"'\");\n throw f.code = \"MODULE_NOT_FOUND\", f }\n var l = n[o] = { exports: {} };\n t[o][0].call(l.exports, function(e) {\n var n = t[o][1][e];\n return s(n ? n : e) }, l, l.exports, e, t, n, r) }\n return n[o].exports }\n var i = typeof require == \"function\" && require;\n for (var o = 0; o < r.length; o++) s(r[o]);\n return s })({\n 1: [function(require, module, exports) {\n 'use strict';\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n\n var _createClass = (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor); } }\n return function(Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor; }; })();\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function'); } }\n\n //simple representation of the API\n\n var IVPAIDAdUnit = (function() {\n function IVPAIDAdUnit() {\n _classCallCheck(this, IVPAIDAdUnit);\n }\n\n _createClass(IVPAIDAdUnit, [{\n key: 'handshakeVersion',\n\n //all methods below\n //are async methods\n value: function handshakeVersion() {\n var playerVPAIDVersion = arguments[0] === undefined ? '2.0' : arguments[0];\n var callback = arguments[1] === undefined ? undefined : arguments[1];\n }\n }, {\n key: 'initAd',\n\n //creativeData is an object to be consistent with VPAIDHTML\n value: function initAd(width, height, viewMode, desiredBitrate) {\n var creativeData = arguments[4] === undefined ? { AdParameters: '' } : arguments[4];\n var environmentVars = arguments[5] === undefined ? { flashVars: '' } : arguments[5];\n var callback = arguments[6] === undefined ? undefined : arguments[6];\n }\n }, {\n key: 'resizeAd',\n value: function resizeAd(width, height, viewMode) {\n var callback = arguments[3] === undefined ? undefined : arguments[3];\n }\n }, {\n key: 'startAd',\n value: function startAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n }\n }, {\n key: 'stopAd',\n value: function stopAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n }\n }, {\n key: 'pauseAd',\n value: function pauseAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n }\n }, {\n key: 'resumeAd',\n value: function resumeAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n }\n }, {\n key: 'expandAd',\n value: function expandAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n }\n }, {\n key: 'collapseAd',\n value: function collapseAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n }\n }, {\n key: 'skipAd',\n value: function skipAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n }\n }, {\n key: 'getAdLinear',\n\n //properties that will be treat as async methods\n value: function getAdLinear(callback) {}\n }, {\n key: 'getAdWidth',\n value: function getAdWidth(callback) {}\n }, {\n key: 'getAdHeight',\n value: function getAdHeight(callback) {}\n }, {\n key: 'getAdExpanded',\n value: function getAdExpanded(callback) {}\n }, {\n key: 'getAdSkippableState',\n value: function getAdSkippableState(callback) {}\n }, {\n key: 'getAdRemainingTime',\n value: function getAdRemainingTime(callback) {}\n }, {\n key: 'getAdDuration',\n value: function getAdDuration(callback) {}\n }, {\n key: 'setAdVolume',\n value: function setAdVolume(soundVolume) {\n var callback = arguments[1] === undefined ? undefined : arguments[1];\n }\n }, {\n key: 'getAdVolume',\n value: function getAdVolume(callback) {}\n }, {\n key: 'getAdCompanions',\n value: function getAdCompanions(callback) {}\n }, {\n key: 'getAdIcons',\n value: function getAdIcons(callback) {}\n }]);\n\n return IVPAIDAdUnit;\n })();\n\n exports.IVPAIDAdUnit = IVPAIDAdUnit;\n\n Object.defineProperty(IVPAIDAdUnit, 'EVENTS', {\n writable: false,\n configurable: false,\n value: ['AdLoaded', 'AdStarted', 'AdStopped', 'AdSkipped', 'AdSkippableStateChange', // VPAID 2.0 new event\n 'AdSizeChange', // VPAID 2.0 new event\n 'AdLinearChange', 'AdDurationChange', // VPAID 2.0 new event\n 'AdExpandedChange', 'AdRemainingTimeChange', // [Deprecated in 2.0] but will be still fired for backwards compatibility\n 'AdVolumeChange', 'AdImpression', 'AdVideoStart', 'AdVideoFirstQuartile', 'AdVideoMidpoint', 'AdVideoThirdQuartile', 'AdVideoComplete', 'AdClickThru', 'AdInteraction', // VPAID 2.0 new event\n 'AdUserAcceptInvitation', 'AdUserMinimize', 'AdUserClose', 'AdPaused', 'AdPlaying', 'AdLog', 'AdError'\n ]\n });\n\n }, {}],\n 2: [function(require, module, exports) {\n 'use strict';\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n\n var _createClass = (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor); } }\n return function(Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor; }; })();\n\n var _get = function get(_x15, _x16, _x17) {\n var _again = true;\n _function: while (_again) {\n var object = _x15,\n property = _x16,\n receiver = _x17;\n desc = parent = getter = undefined;\n _again = false;\n if (object === null) object = Function.prototype;\n var desc = Object.getOwnPropertyDescriptor(object, property);\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n if (parent === null) {\n return undefined; } else { _x15 = parent;\n _x16 = property;\n _x17 = receiver;\n _again = true;\n continue _function; } } else if ('value' in desc) {\n return desc.value; } else {\n var getter = desc.get;\n if (getter === undefined) {\n return undefined; }\n return getter.call(receiver); } } };\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function'); } }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== 'function' && superClass !== null) {\n throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); }\n subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });\n if (superClass) subClass.__proto__ = superClass; }\n\n var IVPAIDAdUnit = require('./IVPAIDAdUnit').IVPAIDAdUnit;\n var ALL_VPAID_METHODS = Object.getOwnPropertyNames(IVPAIDAdUnit.prototype).filter(function(property) {\n return ['constructor'].indexOf(property) === -1;\n });\n\n var VPAIDAdUnit = (function(_IVPAIDAdUnit) {\n function VPAIDAdUnit(flash) {\n _classCallCheck(this, VPAIDAdUnit);\n\n _get(Object.getPrototypeOf(VPAIDAdUnit.prototype), 'constructor', this).call(this);\n this._destroyed = false;\n this._flash = flash;\n }\n\n _inherits(VPAIDAdUnit, _IVPAIDAdUnit);\n\n _createClass(VPAIDAdUnit, [{\n key: '_destroy',\n value: function _destroy() {\n var _this = this;\n\n this._destroyed = true;\n ALL_VPAID_METHODS.forEach(function(methodName) {\n _this._flash.removeCallbackByMethodName(methodName);\n });\n IVPAIDAdUnit.EVENTS.forEach(function(event) {\n _this._flash.offEvent(event);\n });\n\n this._flash = null;\n }\n }, {\n key: 'isDestroyed',\n value: function isDestroyed() {\n return this._destroyed;\n }\n }, {\n key: 'on',\n value: function on(eventName, callback) {\n this._flash.on(eventName, callback);\n }\n }, {\n key: 'off',\n value: function off(eventName, callback) {\n this._flash.off(eventName, callback);\n }\n }, {\n key: 'handshakeVersion',\n\n //VPAID interface\n value: function handshakeVersion() {\n var playerVPAIDVersion = arguments[0] === undefined ? '2.0' : arguments[0];\n var callback = arguments[1] === undefined ? undefined : arguments[1];\n\n this._flash.callFlashMethod('handshakeVersion', [playerVPAIDVersion], callback);\n }\n }, {\n key: 'initAd',\n value: function initAd(width, height, viewMode, desiredBitrate) {\n var creativeData = arguments[4] === undefined ? { AdParameters: '' } : arguments[4];\n var environmentVars = arguments[5] === undefined ? { flashVars: '' } : arguments[5];\n var callback = arguments[6] === undefined ? undefined : arguments[6];\n\n //resize element that has the flash object\n this._flash.setSize(width, height);\n creativeData = creativeData || { AdParameters: '' };\n environmentVars = environmentVars || { flashVars: '' };\n\n this._flash.callFlashMethod('initAd', [this._flash.getWidth(), this._flash.getHeight(), viewMode, desiredBitrate, creativeData.AdParameters || '', environmentVars.flashVars || ''], callback);\n }\n }, {\n key: 'resizeAd',\n value: function resizeAd(width, height, viewMode) {\n var callback = arguments[3] === undefined ? undefined : arguments[3];\n\n //resize element that has the flash object\n this._flash.setSize(width, height);\n\n //resize ad inside the flash\n this._flash.callFlashMethod('resizeAd', [this._flash.getWidth(), this._flash.getHeight(), viewMode], callback);\n }\n }, {\n key: 'startAd',\n value: function startAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n\n this._flash.callFlashMethod('startAd', [], callback);\n }\n }, {\n key: 'stopAd',\n value: function stopAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n\n this._flash.callFlashMethod('stopAd', [], callback);\n }\n }, {\n key: 'pauseAd',\n value: function pauseAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n\n this._flash.callFlashMethod('pauseAd', [], callback);\n }\n }, {\n key: 'resumeAd',\n value: function resumeAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n\n this._flash.callFlashMethod('resumeAd', [], callback);\n }\n }, {\n key: 'expandAd',\n value: function expandAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n\n this._flash.callFlashMethod('expandAd', [], callback);\n }\n }, {\n key: 'collapseAd',\n value: function collapseAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n\n this._flash.callFlashMethod('collapseAd', [], callback);\n }\n }, {\n key: 'skipAd',\n value: function skipAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n\n this._flash.callFlashMethod('skipAd', [], callback);\n }\n }, {\n key: 'getAdLinear',\n\n //properties that will be treat as async methods\n value: function getAdLinear(callback) {\n this._flash.callFlashMethod('getAdLinear', [], callback);\n }\n }, {\n key: 'getAdWidth',\n value: function getAdWidth(callback) {\n this._flash.callFlashMethod('getAdWidth', [], callback);\n }\n }, {\n key: 'getAdHeight',\n value: function getAdHeight(callback) {\n this._flash.callFlashMethod('getAdHeight', [], callback);\n }\n }, {\n key: 'getAdExpanded',\n value: function getAdExpanded(callback) {\n this._flash.callFlashMethod('getAdExpanded', [], callback);\n }\n }, {\n key: 'getAdSkippableState',\n value: function getAdSkippableState(callback) {\n this._flash.callFlashMethod('getAdSkippableState', [], callback);\n }\n }, {\n key: 'getAdRemainingTime',\n value: function getAdRemainingTime(callback) {\n this._flash.callFlashMethod('getAdRemainingTime', [], callback);\n }\n }, {\n key: 'getAdDuration',\n value: function getAdDuration(callback) {\n this._flash.callFlashMethod('getAdDuration', [], callback);\n }\n }, {\n key: 'setAdVolume',\n value: function setAdVolume(volume) {\n var callback = arguments[1] === undefined ? undefined : arguments[1];\n\n this._flash.callFlashMethod('setAdVolume', [volume], callback);\n }\n }, {\n key: 'getAdVolume',\n value: function getAdVolume(callback) {\n this._flash.callFlashMethod('getAdVolume', [], callback);\n }\n }, {\n key: 'getAdCompanions',\n value: function getAdCompanions(callback) {\n this._flash.callFlashMethod('getAdCompanions', [], callback);\n }\n }, {\n key: 'getAdIcons',\n value: function getAdIcons(callback) {\n this._flash.callFlashMethod('getAdIcons', [], callback);\n }\n }]);\n\n return VPAIDAdUnit;\n })(IVPAIDAdUnit);\n\n exports.VPAIDAdUnit = VPAIDAdUnit;\n\n }, { \"./IVPAIDAdUnit\": 1 }],\n 3: [function(require, module, exports) {\n 'use strict';\n\n var _createClass = (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor); } }\n return function(Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor; }; })();\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function'); } }\n\n var JSFlashBridge = require('./jsFlashBridge').JSFlashBridge;\n var VPAIDAdUnit = require('./VPAIDAdUnit').VPAIDAdUnit;\n\n var noop = require('./utils').noop;\n var callbackTimeout = require('./utils').callbackTimeout;\n var isPositiveInt = require('./utils').isPositiveInt;\n var createElementWithID = require('./utils').createElementWithID;\n var uniqueVPAID = require('./utils').unique('vpaid');\n\n var ERROR = 'error';\n var FLASH_VERSION = '10.1.0';\n\n var VPAIDFLASHClient = (function() {\n function VPAIDFLASHClient(vpaidParentEl, callback) {\n var swfConfig = arguments[2] === undefined ? { data: 'VPAIDFlash.swf', width: 800, height: 400 } : arguments[2];\n\n var _this = this;\n\n var params = arguments[3] === undefined ? { wmode: 'transparent', salign: 'tl', align: 'left', allowScriptAccess: 'always', scale: 'noScale', allowFullScreen: 'true', quality: 'high' } : arguments[3];\n var vpaidOptions = arguments[4] === undefined ? { debug: false, timeout: 10000 } : arguments[4];\n\n _classCallCheck(this, VPAIDFLASHClient);\n\n if (!VPAIDFLASHClient.hasExternalDependencies()) {\n return onError('no swfobject in global scope. check: https://github.com/swfobject/swfobject or https://code.google.com/p/swfobject/');\n }\n\n this._vpaidParentEl = vpaidParentEl;\n this._flashID = uniqueVPAID();\n this._destroyed = false;\n callback = callback || noop;\n\n swfConfig.width = isPositiveInt(swfConfig.width, 800);\n swfConfig.height = isPositiveInt(swfConfig.height, 400);\n\n createElementWithID(vpaidParentEl, this._flashID);\n\n params.movie = swfConfig.data;\n params.FlashVars = 'flashid=' + this._flashID + '&handler=' + JSFlashBridge.VPAID_FLASH_HANDLER + '&debug=' + vpaidOptions.debug + '&salign=' + params.salign;\n\n if (!VPAIDFLASHClient.isSupported()) {\n return onError('user don\\'t support flash or doesn\\'t have the minimum required version of flash ' + FLASH_VERSION);\n }\n\n this.el = swfobject.createSWF(swfConfig, params, this._flashID);\n\n if (!this.el) {\n return onError('swfobject failed to create object in element');\n }\n\n var handler = callbackTimeout(vpaidOptions.timeout, function(err, data) {\n $loadPendedAdUnit.call(_this);\n callback(err, data);\n }, function() {\n callback('vpaid flash load timeout ' + vpaidOptions.timeout);\n });\n\n this._flash = new JSFlashBridge(this.el, swfConfig.data, this._flashID, swfConfig.width, swfConfig.height, handler);\n\n function onError(error) {\n setTimeout(function() {\n callback(new Error(error));\n }, 0);\n return this;\n }\n }\n\n _createClass(VPAIDFLASHClient, [{\n key: 'destroy',\n value: function destroy() {\n this._destroyAdUnit();\n\n if (this._flash) {\n this._flash.destroy();\n this._flash = null;\n }\n this.el = null;\n this._destroyed = true;\n }\n }, {\n key: 'isDestroyed',\n value: function isDestroyed() {\n return this._destroyed;\n }\n }, {\n key: '_destroyAdUnit',\n value: function _destroyAdUnit() {\n delete this._loadLater;\n\n if (this._adUnitLoad) {\n this._adUnitLoad = null;\n this._flash.removeCallback(this._adUnitLoad);\n }\n\n if (this._adUnit) {\n this._adUnit._destroy();\n this._adUnit = null;\n }\n }\n }, {\n key: 'loadAdUnit',\n value: function loadAdUnit(adURL, callback) {\n var _this2 = this;\n\n $throwIfDestroyed.call(this);\n\n if (this._adUnit) {\n this._destroyAdUnit();\n }\n\n if (this._flash.isReady()) {\n this._adUnitLoad = function(err, message) {\n if (!err) {\n _this2._adUnit = new VPAIDAdUnit(_this2._flash);\n }\n _this2._adUnitLoad = null;\n callback(err, _this2._adUnit);\n };\n\n this._flash.callFlashMethod('loadAdUnit', [adURL], this._adUnitLoad);\n } else {\n this._loadLater = { url: adURL, callback: callback };\n }\n }\n }, {\n key: 'unloadAdUnit',\n value: function unloadAdUnit() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n\n $throwIfDestroyed.call(this);\n\n this._destroyAdUnit();\n this._flash.callFlashMethod('unloadAdUnit', [], callback);\n }\n }, {\n key: 'getFlashID',\n value: function getFlashID() {\n $throwIfDestroyed.call(this);\n return this._flash.getFlashID();\n }\n }, {\n key: 'getFlashURL',\n value: function getFlashURL() {\n $throwIfDestroyed.call(this);\n return this._flash.getFlashURL();\n }\n }]);\n\n return VPAIDFLASHClient;\n })();\n\n setStaticProperty('isSupported', function() {\n return VPAIDFLASHClient.hasExternalDependencies() && swfobject.hasFlashPlayerVersion(FLASH_VERSION);\n });\n\n setStaticProperty('hasExternalDependencies', function() {\n return !!window.swfobject;\n });\n\n function $throwIfDestroyed() {\n if (this._destroyed) {\n throw new error('VPAIDFlashToJS is destroyed!');\n }\n }\n\n function $loadPendedAdUnit() {\n if (this._loadLater) {\n this.loadAdUnit(this._loadLater.url, this._loadLater.callback);\n delete this._loadLater;\n }\n }\n\n function setStaticProperty(propertyName, value) {\n Object.defineProperty(VPAIDFLASHClient, propertyName, {\n writable: false,\n configurable: false,\n value: value\n });\n }\n\n window.VPAIDFLASHClient = VPAIDFLASHClient;\n module.exports = VPAIDFLASHClient;\n\n }, { \"./VPAIDAdUnit\": 2, \"./jsFlashBridge\": 4, \"./utils\": 7 }],\n 4: [function(require, module, exports) {\n 'use strict';\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n\n var _createClass = (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor); } }\n return function(Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor; }; })();\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function'); } }\n\n var unique = require('./utils').unique;\n var isPositiveInt = require('./utils').isPositiveInt;\n var stringEndsWith = require('./utils').stringEndsWith;\n var SingleValueRegistry = require('./registry').SingleValueRegistry;\n var MultipleValuesRegistry = require('./registry').MultipleValuesRegistry;\n var registry = require('./jsFlashBridgeRegistry');\n var VPAID_FLASH_HANDLER = 'vpaid_video_flash_handler';\n var ERROR = 'AdError';\n\n var JSFlashBridge = (function() {\n function JSFlashBridge(el, flashURL, flashID, width, height, loadHandShake) {\n _classCallCheck(this, JSFlashBridge);\n\n this._el = el;\n this._flashID = flashID;\n this._flashURL = flashURL;\n this._width = width;\n this._height = height;\n this._handlers = new MultipleValuesRegistry();\n this._callbacks = new SingleValueRegistry();\n this._uniqueMethodIdentifier = unique(this._flashID);\n this._ready = false;\n this._handShakeHandler = loadHandShake;\n\n registry.addInstance(this._flashID, this);\n }\n\n _createClass(JSFlashBridge, [{\n key: 'on',\n value: function on(eventName, callback) {\n this._handlers.add(eventName, callback);\n }\n }, {\n key: 'off',\n value: function off(eventName, callback) {\n return this._handlers.remove(eventName, callback);\n }\n }, {\n key: 'offEvent',\n value: function offEvent(eventName) {\n return this._handlers.removeByKey(eventName);\n }\n }, {\n key: 'offAll',\n value: function offAll() {\n return this._handlers.removeAll();\n }\n }, {\n key: 'callFlashMethod',\n value: function callFlashMethod(methodName) {\n var args = arguments[1] === undefined ? [] : arguments[1];\n var callback = arguments[2] === undefined ? undefined : arguments[2];\n\n var callbackID = '';\n // if no callback, some methods the return is void so they don't need callback\n if (callback) {\n callbackID = this._uniqueMethodIdentifier() + '_' + methodName;\n this._callbacks.add(callbackID, callback);\n }\n\n try {\n //methods are created by ExternalInterface.addCallback in as3 code, if for some reason it failed\n //this code will throw an error\n this._el[methodName]([callbackID].concat(args));\n } catch (e) {\n if (callback) {\n $asyncCallback.call(this, callbackID, e);\n } else {\n\n //if there isn't any callback to return error use error event handler\n this._trigger(ERROR, e);\n }\n }\n }\n }, {\n key: 'removeCallback',\n value: function removeCallback(callback) {\n return this._callbacks.removeByValue(callback);\n }\n }, {\n key: 'removeCallbackByMethodName',\n value: function removeCallbackByMethodName(suffix) {\n var _this = this;\n\n this._callbacks.filterKeys(function(key) {\n return stringEndsWith(key, suffix);\n }).forEach(function(key) {\n _this._callbacks.remove(key);\n });\n }\n }, {\n key: 'removeAllCallbacks',\n value: function removeAllCallbacks() {\n return this._callbacks.removeAll();\n }\n }, {\n key: '_trigger',\n value: function _trigger(eventName, event) {\n var _this2 = this;\n\n this._handlers.get(eventName).forEach(function(callback) {\n //clickThru has to be sync, if not will be block by the popupblocker\n if (eventName === 'AdClickThru') {\n callback(event);\n } else {\n setTimeout(function() {\n if (_this2._handlers.get(eventName).length > 0) {\n callback(event);\n }\n }, 0);\n }\n });\n }\n }, {\n key: '_callCallback',\n value: function _callCallback(methodName, callbackID, err, result) {\n\n var callback = this._callbacks.get(callbackID);\n\n //not all methods callback's are mandatory\n //but if there exist an error, fire the error event\n if (!callback) {\n if (err && callbackID === '') {\n this.trigger(ERROR, err);\n }\n return;\n }\n\n $asyncCallback.call(this, callbackID, err, result);\n }\n }, {\n key: '_handShake',\n value: function _handShake(err, data) {\n this._ready = true;\n if (this._handShakeHandler) {\n this._handShakeHandler(err, data);\n delete this._handShakeHandler;\n }\n }\n }, {\n key: 'getSize',\n\n //methods like properties specific to this implementation of VPAID\n value: function getSize() {\n return { width: this._width, height: this._height };\n }\n }, {\n key: 'setSize',\n value: function setSize(newWidth, newHeight) {\n this._width = isPositiveInt(newWidth, this._width);\n this._height = isPositiveInt(newHeight, this._height);\n this._el.setAttribute('width', this._width);\n this._el.setAttribute('height', this._height);\n }\n }, {\n key: 'getWidth',\n value: function getWidth() {\n return this._width;\n }\n }, {\n key: 'setWidth',\n value: function setWidth(newWidth) {\n this.setSize(newWidth, this._height);\n }\n }, {\n key: 'getHeight',\n value: function getHeight() {\n return this._height;\n }\n }, {\n key: 'setHeight',\n value: function setHeight(newHeight) {\n this.setSize(this._width, newHeight);\n }\n }, {\n key: 'getFlashID',\n value: function getFlashID() {\n return this._flashID;\n }\n }, {\n key: 'getFlashURL',\n value: function getFlashURL() {\n return this._flashURL;\n }\n }, {\n key: 'isReady',\n value: function isReady() {\n return this._ready;\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.offAll();\n this.removeAllCallbacks();\n registry.removeInstanceByID(this._flashID);\n if (this._el.parentElement) {\n this._el.parentElement.removeChild(this._el);\n }\n }\n }]);\n\n return JSFlashBridge;\n })();\n\n exports.JSFlashBridge = JSFlashBridge;\n\n function $asyncCallback(callbackID, err, result) {\n var _this3 = this;\n\n setTimeout(function() {\n var callback = _this3._callbacks.get(callbackID);\n if (callback) {\n _this3._callbacks.remove(callbackID);\n callback(err, result);\n }\n }, 0);\n }\n\n Object.defineProperty(JSFlashBridge, 'VPAID_FLASH_HANDLER', {\n writable: false,\n configurable: false,\n value: VPAID_FLASH_HANDLER\n });\n\n /**\n * External interface handler\n *\n * @param {string} flashID identifier of the flash who call this\n * @param {string} typeID what type of message is, can be 'event' or 'callback'\n * @param {string} typeName if the typeID is a event the typeName will be the eventName, if is a callback the typeID is the methodName that is related this callback\n * @param {string} callbackID only applies when the typeID is 'callback', identifier of the callback to call\n * @param {object} error error object\n * @param {object} data\n */\n window[VPAID_FLASH_HANDLER] = function(flashID, typeID, typeName, callbackID, error, data) {\n var instance = registry.getInstanceByID(flashID);\n if (!instance) return;\n if (typeName === 'handShake') {\n instance._handShake(error, data);\n } else {\n if (typeID !== 'event') {\n instance._callCallback(typeName, callbackID, error, data);\n } else {\n instance._trigger(typeName, data);\n }\n }\n };\n\n }, { \"./jsFlashBridgeRegistry\": 5, \"./registry\": 6, \"./utils\": 7 }],\n 5: [function(require, module, exports) {\n 'use strict';\n\n var SingleValueRegistry = require('./registry').SingleValueRegistry;\n var instances = new SingleValueRegistry();\n\n var JSFlashBridgeRegistry = {};\n Object.defineProperty(JSFlashBridgeRegistry, 'addInstance', {\n writable: false,\n configurable: false,\n value: function value(id, instance) {\n instances.add(id, instance);\n }\n });\n\n Object.defineProperty(JSFlashBridgeRegistry, 'getInstanceByID', {\n writable: false,\n configurable: false,\n value: function value(id) {\n return instances.get(id);\n }\n });\n\n Object.defineProperty(JSFlashBridgeRegistry, 'removeInstanceByID', {\n writable: false,\n configurable: false,\n value: function value(id) {\n return instances.remove(id);\n }\n });\n\n module.exports = JSFlashBridgeRegistry;\n\n }, { \"./registry\": 6 }],\n 6: [function(require, module, exports) {\n 'use strict';\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n\n var _createClass = (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor); } }\n return function(Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor; }; })();\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function'); } }\n\n var MultipleValuesRegistry = (function() {\n function MultipleValuesRegistry() {\n _classCallCheck(this, MultipleValuesRegistry);\n\n this._registries = {};\n }\n\n _createClass(MultipleValuesRegistry, [{\n key: 'add',\n value: function add(id, value) {\n if (!this._registries[id]) {\n this._registries[id] = [];\n }\n if (this._registries[id].indexOf(value) === -1) {\n this._registries[id].push(value);\n }\n }\n }, {\n key: 'get',\n value: function get(id) {\n return this._registries[id] || [];\n }\n }, {\n key: 'filterKeys',\n value: function filterKeys(handler) {\n return Object.keys(this._registries).filter(handler);\n }\n }, {\n key: 'findByValue',\n value: function findByValue(value) {\n var _this = this;\n\n var keys = Object.keys(this._registries).filter(function(key) {\n return _this._registries[key].indexOf(value) !== -1;\n });\n\n return keys;\n }\n }, {\n key: 'remove',\n value: function remove(key, value) {\n if (!this._registries[key]) {\n return;\n }\n\n var index = this._registries[key].indexOf(value);\n\n if (index < 0) {\n return;\n }\n return this._registries[key].splice(index, 1);\n }\n }, {\n key: 'removeByKey',\n value: function removeByKey(id) {\n var old = this._registries[id];\n delete this._registries[id];\n return old;\n }\n }, {\n key: 'removeByValue',\n value: function removeByValue(value) {\n var _this2 = this;\n\n var keys = this.findByValue(value);\n return keys.map(function(key) {\n return _this2.remove(key, value);\n });\n }\n }, {\n key: 'removeAll',\n value: function removeAll() {\n var old = this._registries;\n this._registries = {};\n return old;\n }\n }, {\n key: 'size',\n value: function size() {\n return Object.keys(this._registries).length;\n }\n }]);\n\n return MultipleValuesRegistry;\n })();\n\n exports.MultipleValuesRegistry = MultipleValuesRegistry;\n\n var SingleValueRegistry = (function() {\n function SingleValueRegistry() {\n _classCallCheck(this, SingleValueRegistry);\n\n this._registries = {};\n }\n\n _createClass(SingleValueRegistry, [{\n key: 'add',\n value: function add(id, value) {\n this._registries[id] = value;\n }\n }, {\n key: 'get',\n value: function get(id) {\n return this._registries[id];\n }\n }, {\n key: 'filterKeys',\n value: function filterKeys(handler) {\n return Object.keys(this._registries).filter(handler);\n }\n }, {\n key: 'findByValue',\n value: function findByValue(value) {\n var _this3 = this;\n\n var keys = Object.keys(this._registries).filter(function(key) {\n return _this3._registries[key] === value;\n });\n\n return keys;\n }\n }, {\n key: 'remove',\n value: function remove(id) {\n var old = this._registries[id];\n delete this._registries[id];\n return old;\n }\n }, {\n key: 'removeByValue',\n value: function removeByValue(value) {\n var _this4 = this;\n\n var keys = this.findByValue(value);\n return keys.map(function(key) {\n return _this4.remove(key);\n });\n }\n }, {\n key: 'removeAll',\n value: function removeAll() {\n var old = this._registries;\n this._registries = {};\n return old;\n }\n }, {\n key: 'size',\n value: function size() {\n return Object.keys(this._registries).length;\n }\n }]);\n\n return SingleValueRegistry;\n })();\n\n exports.SingleValueRegistry = SingleValueRegistry;\n\n }, {}],\n 7: [function(require, module, exports) {\n 'use strict';\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n exports.unique = unique;\n exports.noop = noop;\n exports.callbackTimeout = callbackTimeout;\n exports.createElementWithID = createElementWithID;\n exports.isPositiveInt = isPositiveInt;\n exports.stringEndsWith = stringEndsWith;\n\n function unique(prefix) {\n var count = -1;\n return function(f) {\n return prefix + '_' + ++count;\n };\n }\n\n function noop() {}\n\n function callbackTimeout(timer, onSuccess, onTimeout) {\n\n var timeout = setTimeout(function() {\n\n onSuccess = noop;\n onTimeout();\n }, timer);\n\n return function() {\n clearTimeout(timeout);\n onSuccess.apply(this, arguments);\n };\n }\n\n function createElementWithID(parent, id) {\n var nEl = document.createElement('div');\n nEl.id = id;\n parent.innerHTML = '';\n parent.appendChild(nEl);\n return nEl;\n }\n\n function isPositiveInt(newVal, oldVal) {\n return !isNaN(parseFloat(newVal)) && isFinite(newVal) && newVal > 0 ? newVal : oldVal;\n }\n\n var endsWith = (function() {\n if (String.prototype.endsWith) return String.prototype.endsWith;\n return function endsWith(searchString, position) {\n var subjectString = this.toString();\n if (position === undefined || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n };\n })();\n\n function stringEndsWith(string, search) {\n return endsWith.call(string, search);\n }\n\n }, {}]\n }, {}, [3])\n\n\n //# sourceMappingURL=VPAIDFLASHClient.js.map\n ;\n /*jshint unused:false */\n \"use strict\";\n\n var NODE_TYPE_ELEMENT = 1;\n\n function noop() {}\n\n function isNull(o) {\n return o === null;\n }\n\n function isDefined(o) {\n return o !== undefined;\n }\n\n function isUndefined(o) {\n return o === undefined;\n }\n\n function isObject(obj) {\n return typeof obj === 'object';\n }\n\n function isFunction(str) {\n return typeof str === 'function';\n }\n\n function isNumber(num) {\n return typeof num === 'number';\n }\n\n function isWindow(obj) {\n return isObject(obj) && obj.window === obj;\n }\n\n function isArray(array) {\n return Object.prototype.toString.call(array) === '[object Array]';\n }\n\n function isArrayLike(obj) {\n if (obj === null || isWindow(obj) || isFunction(obj) || isUndefined(obj)) {\n return false;\n }\n\n var length = obj.length;\n\n if (obj.nodeType === NODE_TYPE_ELEMENT && length) {\n return true;\n }\n\n return isString(obj) || isArray(obj) || length === 0 ||\n typeof length === 'number' && length > 0 && (length - 1) in obj;\n }\n\n function isString(str) {\n return typeof str === 'string';\n }\n\n function isEmptyString(str) {\n return isString(str) && str.length === 0;\n }\n\n function isNotEmptyString(str) {\n return isString(str) && str.length !== 0;\n }\n\n function arrayLikeObjToArray(args) {\n return Array.prototype.slice.call(args);\n }\n\n function forEach(obj, iterator, context) {\n var key, length;\n if (obj) {\n if (isFunction(obj)) {\n for (key in obj) {\n // Need to check if hasOwnProperty exists,\n // as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function\n if (key !== 'prototype' && key !== 'length' && key !== 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else if (isArray(obj)) {\n var isPrimitive = typeof obj !== 'object';\n for (key = 0, length = obj.length; key < length; key++) {\n if (isPrimitive || key in obj) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else if (obj.forEach && obj.forEach !== forEach) {\n obj.forEach(iterator, context, obj);\n } else {\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n }\n }\n return obj;\n }\n\n var SNAKE_CASE_REGEXP = /[A-Z]/g;\n\n function snake_case(name, separator) {\n separator = separator || '_';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }\n\n function isValidEmail(email) {\n if (!isString(email)) {\n return false;\n }\n var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i;\n return EMAIL_REGEXP.test(email.trim());\n }\n\n function extend(obj) {\n var arg, i, k;\n for (i = 1; i < arguments.length; i++) {\n arg = arguments[i];\n for (k in arg) {\n if (arg.hasOwnProperty(k)) {\n if (isObject(obj[k]) && !isNull(obj[k]) && isObject(arg[k])) {\n obj[k] = extend({}, obj[k], arg[k]);\n } else {\n obj[k] = arg[k];\n }\n }\n }\n }\n return obj;\n }\n\n function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n }\n\n function decapitalize(s) {\n return s.charAt(0).toLowerCase() + s.slice(1);\n }\n\n /**\n * This method works the same way array.prototype.map works but if the transformer returns undefine, then\n * it won't be added to the transformed Array.\n */\n function transformArray(array, transformer) {\n var transformedArray = [];\n\n array.forEach(function(item, index) {\n var transformedItem = transformer(item, index);\n if (isDefined(transformedItem)) {\n transformedArray.push(transformedItem);\n }\n });\n\n return transformedArray;\n }\n\n function toFixedDigits(num, digits) {\n var formattedNum = num + '';\n digits = isNumber(digits) ? digits : 0;\n num = isNumber(num) ? num : parseInt(num, 10);\n if (isNumber(num) && !isNaN(num)) {\n formattedNum = num + '';\n while (formattedNum.length < digits) {\n formattedNum = '0' + formattedNum;\n }\n return formattedNum;\n }\n return NaN + '';\n }\n\n function debounce(callback, wait) {\n var timeoutId;\n\n return function() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(function() {\n callback.apply(this, arguments);\n timeoutId = undefined;\n }, wait);\n };\n }\n\n // a function designed to blow up the stack in a naive way\n // but it is ok for videoJs children components\n function treeSearch(root, getChildren, found) {\n var children = getChildren(root);\n for (var i = 0; i < children.length; i++) {\n if (found(children[i])) {\n return children[i];\n } else {\n var el = treeSearch(children[i], getChildren, found);\n if (el) {\n return el;\n }\n }\n }\n }\n\n function echoFn(val) {\n return function() {\n return val;\n };\n }\n\n //Note: Supported formats come from http://www.w3.org/TR/NOTE-datetime\n // and the iso8601 regex comes from http://www.pelagodesign.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/\n function isISO8601(value) {\n if (isNumber(value)) {\n value = value + ''; //we make sure that we are working with strings\n }\n\n if (!isString(value)) {\n return false;\n }\n\n /*jslint maxlen: 500 */\n var iso8086Regex = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\n return iso8086Regex.test(value.trim());\n }\n\n /**\n * Checks if the Browser is IE9 and below\n * @returns {boolean}\n */\n function isOldIE() {\n var version = getInternetExplorerVersion(navigator);\n if (version === -1) {\n return false;\n }\n\n return version < 10;\n }\n\n /**\n * Returns the version of Internet Explorer or a -1 (indicating the use of another browser).\n * Source: https://msdn.microsoft.com/en-us/library/ms537509(v=vs.85).aspx\n * @returns {number} the version of Internet Explorer or a -1 (indicating the use of another browser).\n */\n function getInternetExplorerVersion(navigator) {\n var rv = -1;\n\n if (navigator.appName == 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent;\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n var res = re.exec(ua);\n if (res !== null) {\n rv = parseFloat(res[1]);\n }\n }\n\n return rv;\n }\n\n /*** Mobile Utility functions ***/\n var _UA = navigator.userAgent;\n\n function isIDevice() {\n return /iP(hone|ad)/.test(_UA);\n }\n\n function isMobile() {\n return /iP(hone|ad|od)|Android|Windows Phone/.test(_UA);\n }\n\n function isIPhone() {\n return /iP(hone|od)/.test(_UA);\n }\n\n function isAndroid() {\n return /Android/.test(_UA);\n }\n\n ;\n (function e(t, n, r) {\n function s(o, u) {\n if (!n[o]) {\n if (!t[o]) {\n var a = typeof require == \"function\" && require;\n if (!u && a) return a(o, !0);\n if (i) return i(o, !0);\n var f = new Error(\"Cannot find module '\" + o + \"'\");\n throw f.code = \"MODULE_NOT_FOUND\", f }\n var l = n[o] = { exports: {} };\n t[o][0].call(l.exports, function(e) {\n var n = t[o][1][e];\n return s(n ? n : e) }, l, l.exports, e, t, n, r) }\n return n[o].exports }\n var i = typeof require == \"function\" && require;\n for (var o = 0; o < r.length; o++) s(r[o]);\n return s })({\n 1: [function(require, module, exports) {\n 'use strict';\n\n var METHODS = [\n 'handshakeVersion',\n 'initAd',\n 'startAd',\n 'stopAd',\n 'skipAd', // VPAID 2.0 new method\n 'resizeAd',\n 'pauseAd',\n 'resumeAd',\n 'expandAd',\n 'collapseAd',\n 'subscribe',\n 'unsubscribe'\n ];\n\n var EVENTS = [\n 'AdLoaded',\n 'AdStarted',\n 'AdStopped',\n 'AdSkipped',\n 'AdSkippableStateChange', // VPAID 2.0 new event\n 'AdSizeChange', // VPAID 2.0 new event\n 'AdLinearChange',\n 'AdDurationChange', // VPAID 2.0 new event\n 'AdExpandedChange',\n 'AdRemainingTimeChange', // [Deprecated in 2.0] but will be still fired for backwards compatibility\n 'AdVolumeChange',\n 'AdImpression',\n 'AdVideoStart',\n 'AdVideoFirstQuartile',\n 'AdVideoMidpoint',\n 'AdVideoThirdQuartile',\n 'AdVideoComplete',\n 'AdClickThru',\n 'AdInteraction', // VPAID 2.0 new event\n 'AdUserAcceptInvitation',\n 'AdUserMinimize',\n 'AdUserClose',\n 'AdPaused',\n 'AdPlaying',\n 'AdLog',\n 'AdError'\n ];\n\n var GETTERS = [\n 'getAdLinear',\n 'getAdWidth', // VPAID 2.0 new getter\n 'getAdHeight', // VPAID 2.0 new getter\n 'getAdExpanded',\n 'getAdSkippableState', // VPAID 2.0 new getter\n 'getAdRemainingTime',\n 'getAdDuration', // VPAID 2.0 new getter\n 'getAdVolume',\n 'getAdCompanions', // VPAID 2.0 new getter\n 'getAdIcons' // VPAID 2.0 new getter\n ];\n\n var SETTERS = [\n 'setAdVolume'\n ];\n\n\n /**\n * This callback is displayed as global member. The callback use nodejs error-first callback style\n * @callback NodeStyleCallback\n * @param {string|null}\n * @param {undefined|object}\n */\n\n\n /**\n * IVPAIDAdUnit\n *\n * @class\n *\n * @param {object} creative\n * @param {HTMLElement} el\n * @param {HTMLVideoElement} video\n */\n function IVPAIDAdUnit(creative, el, video) {}\n\n\n /**\n * handshakeVersion\n *\n * @param {string} VPAIDVersion\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.handshakeVersion = function(VPAIDVersion, callback) {};\n\n /**\n * initAd\n *\n * @param {number} width\n * @param {number} height\n * @param {string} viewMode can be 'normal', 'thumbnail' or 'fullscreen'\n * @param {number} desiredBitrate indicates the desired bitrate in kbps\n * @param {object} [creativeData] used for additional initialization data\n * @param {object} [environmentVars] used for passing implementation-specific of js version\n * @param {NodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.initAd = function(width, height, viewMode, desiredBitrate, creativeData, environmentVars, callback) {};\n\n /**\n * startAd\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.startAd = function(callback) {};\n\n /**\n * stopAd\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.stopAd = function(callback) {};\n\n /**\n * skipAd\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.skipAd = function(callback) {};\n\n /**\n * resizeAd\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.resizeAd = function(width, height, viewMode, callback) {};\n\n /**\n * pauseAd\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.pauseAd = function(callback) {};\n\n /**\n * resumeAd\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.resumeAd = function(callback) {};\n\n /**\n * expandAd\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.expandAd = function(callback) {};\n\n /**\n * collapseAd\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.collapseAd = function(callback) {};\n\n /**\n * subscribe\n *\n * @param {string} event\n * @param {nodeStyleCallback} handler\n * @param {object} context\n */\n IVPAIDAdUnit.prototype.subscribe = function(event, handler, context) {};\n\n /**\n * startAd\n *\n * @param {string} event\n * @param {function} handler\n */\n IVPAIDAdUnit.prototype.unsubscribe = function(event, handler) {};\n\n\n\n /**\n * getAdLinear\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdLinear = function(callback) {};\n\n /**\n * getAdWidth\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdWidth = function(callback) {};\n\n /**\n * getAdHeight\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdHeight = function(callback) {};\n\n /**\n * getAdExpanded\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdExpanded = function(callback) {};\n\n /**\n * getAdSkippableState\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdSkippableState = function(callback) {};\n\n /**\n * getAdRemainingTime\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdRemainingTime = function(callback) {};\n\n /**\n * getAdDuration\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdDuration = function(callback) {};\n\n /**\n * getAdVolume\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdVolume = function(callback) {};\n\n /**\n * getAdCompanions\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdCompanions = function(callback) {};\n\n /**\n * getAdIcons\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdIcons = function(callback) {};\n\n /**\n * setAdVolume\n *\n * @param {number} volume\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.setAdVolume = function(volume, callback) {};\n\n addStaticToInterface(IVPAIDAdUnit, 'METHODS', METHODS);\n addStaticToInterface(IVPAIDAdUnit, 'GETTERS', GETTERS);\n addStaticToInterface(IVPAIDAdUnit, 'SETTERS', SETTERS);\n addStaticToInterface(IVPAIDAdUnit, 'EVENTS', EVENTS);\n\n\n var VPAID1_METHODS = METHODS.filter(function(method) {\n return ['skipAd'].indexOf(method) === -1;\n });\n\n addStaticToInterface(IVPAIDAdUnit, 'checkVPAIDInterface', function checkVPAIDInterface(creative) {\n var result = VPAID1_METHODS.every(function(key) {\n return typeof creative[key] === 'function';\n });\n return result;\n });\n\n module.exports = IVPAIDAdUnit;\n\n function addStaticToInterface(Interface, name, value) {\n Object.defineProperty(Interface, name, {\n writable: false,\n configurable: false,\n value: value\n });\n }\n\n\n }, {}],\n 2: [function(require, module, exports) {\n 'use strict';\n\n var IVPAIDAdUnit = require('./IVPAIDAdUnit');\n var Subscriber = require('./subscriber');\n var checkVPAIDInterface = IVPAIDAdUnit.checkVPAIDInterface;\n var utils = require('./utils');\n var METHODS = IVPAIDAdUnit.METHODS;\n var ERROR = 'AdError';\n var AD_CLICK = 'AdClickThru';\n var FILTERED_EVENTS = IVPAIDAdUnit.EVENTS.filter(function(event) {\n return event != AD_CLICK;\n });\n\n /**\n * This callback is displayed as global member. The callback use nodejs error-first callback style\n * @callback NodeStyleCallback\n * @param {string|null}\n * @param {undefined|object}\n */\n\n\n /**\n * VPAIDAdUnit\n * @class\n *\n * @param VPAIDCreative\n * @param {HTMLElement} [el] this will be used in initAd environmentVars.slot if defined\n * @param {HTMLVideoElement} [video] this will be used in initAd environmentVars.videoSlot if defined\n */\n function VPAIDAdUnit(VPAIDCreative, el, video, iframe) {\n this._isValid = checkVPAIDInterface(VPAIDCreative);\n if (this._isValid) {\n this._creative = VPAIDCreative;\n this._el = el;\n this._videoEl = video;\n this._iframe = iframe;\n this._subscribers = new Subscriber();\n $addEventsSubscribers.call(this);\n }\n }\n\n VPAIDAdUnit.prototype = Object.create(IVPAIDAdUnit.prototype);\n\n /**\n * isValidVPAIDAd will return if the VPAIDCreative passed in constructor is valid or not\n *\n * @return {boolean}\n */\n VPAIDAdUnit.prototype.isValidVPAIDAd = function isValidVPAIDAd() {\n return this._isValid;\n };\n\n IVPAIDAdUnit.METHODS.forEach(function(method) {\n //NOTE: this methods arguments order are implemented differently from the spec\n var ignores = [\n 'subscribe',\n 'unsubscribe',\n 'initAd'\n ];\n\n if (ignores.indexOf(method) !== -1) return;\n\n VPAIDAdUnit.prototype[method] = function() {\n var ariaty = IVPAIDAdUnit.prototype[method].length;\n // TODO avoid leaking arguments\n // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments\n var args = Array.prototype.slice.call(arguments);\n var callback = (ariaty === args.length) ? args.pop() : undefined;\n\n setTimeout(function() {\n var result, error = null;\n try {\n result = this._creative[method].apply(this._creative, args);\n } catch (e) {\n error = e;\n }\n\n callOrTriggerEvent(callback, this._subscribers, error, result);\n }.bind(this), 0);\n };\n });\n\n\n /**\n * initAd concreate implementation\n *\n * @param {number} width\n * @param {number} height\n * @param {string} viewMode can be 'normal', 'thumbnail' or 'fullscreen'\n * @param {number} desiredBitrate indicates the desired bitrate in kbps\n * @param {object} [creativeData] used for additional initialization data\n * @param {object} [environmentVars] used for passing implementation-specific of js version, if el & video was used in constructor slot & videoSlot will be added to the object\n * @param {NodeStyleCallback} callback\n */\n VPAIDAdUnit.prototype.initAd = function initAd(width, height, viewMode, desiredBitrate, creativeData, environmentVars, callback) {\n creativeData = creativeData || {};\n environmentVars = utils.extend({\n slot: this._el,\n videoSlot: this._videoEl\n }, environmentVars || {});\n\n setTimeout(function() {\n var error;\n try {\n this._creative.initAd(width, height, viewMode, desiredBitrate, creativeData, environmentVars);\n } catch (e) {\n error = e;\n }\n\n callOrTriggerEvent(callback, this._subscribers, error);\n }.bind(this), 0);\n };\n\n /**\n * subscribe\n *\n * @param {string} event\n * @param {nodeStyleCallback} handler\n * @param {object} context\n */\n VPAIDAdUnit.prototype.subscribe = function subscribe(event, handler, context) {\n this._subscribers.subscribe(handler, event, context);\n };\n\n\n /**\n * unsubscribe\n *\n * @param {string} event\n * @param {nodeStyleCallback} handler\n */\n VPAIDAdUnit.prototype.unsubscribe = function unsubscribe(event, handler) {\n this._subscribers.unsubscribe(handler, event);\n };\n\n //alias\n VPAIDAdUnit.prototype.on = VPAIDAdUnit.prototype.subscribe;\n VPAIDAdUnit.prototype.off = VPAIDAdUnit.prototype.unsubscribe;\n\n IVPAIDAdUnit.GETTERS.forEach(function(getter) {\n VPAIDAdUnit.prototype[getter] = function(callback) {\n setTimeout(function() {\n\n var result, error = null;\n try {\n result = this._creative[getter]();\n } catch (e) {\n error = e;\n }\n\n callOrTriggerEvent(callback, this._subscribers, error, result);\n }.bind(this), 0);\n };\n });\n\n /**\n * setAdVolume\n *\n * @param volume\n * @param {nodeStyleCallback} callback\n */\n VPAIDAdUnit.prototype.setAdVolume = function setAdVolume(volume, callback) {\n setTimeout(function() {\n\n var self = this;\n var result, error = null;\n try {\n this._creative.setAdVolume(volume);\n } catch (e) {\n error = e;\n }\n // Wait for creative volume to be set\n setTimeout(function() {\n result = self._creative.getAdVolume();\n if (!error) {\n error = utils.validate(result === volume, 'failed to apply volume: ' + volume);\n }\n callOrTriggerEvent(callback, self._subscribers, error, result);\n }, 200)\n }.bind(this), 0);\n };\n\n VPAIDAdUnit.prototype._destroy = function destroy() {\n this.stopAd();\n this._subscribers.unsubscribeAll();\n };\n\n function $addEventsSubscribers() {\n // some ads implement\n // so they only handle one subscriber\n // to handle this we create our one\n FILTERED_EVENTS.forEach(function(event) {\n this._creative.subscribe($trigger.bind(this, event), event);\n }.bind(this));\n\n // map the click event to be an object instead of depending of the order of the arguments\n // and to be consistent with the flash\n this._creative.subscribe($clickThruHook.bind(this), AD_CLICK);\n\n // because we are adding the element inside the iframe\n // the user is not able to click in the video\n if (this._videoEl) {\n var documentElement = this._iframe.contentDocument.documentElement;\n var videoEl = this._videoEl;\n documentElement.addEventListener('click', function(e) {\n if (e.target === documentElement) {\n videoEl.click();\n }\n });\n }\n }\n\n function $clickThruHook(url, id, playerHandles) {\n this._subscribers.triggerSync(AD_CLICK, { url: url, id: id, playerHandles: playerHandles });\n }\n\n function $trigger(event) {\n // TODO avoid leaking arguments\n // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments\n this._subscribers.trigger(event, Array.prototype.slice.call(arguments, 1));\n }\n\n function callOrTriggerEvent(callback, subscribers, error, result) {\n if (callback) {\n callback(error, result);\n } else if (error) {\n subscribers.trigger(ERROR, error);\n }\n }\n\n module.exports = VPAIDAdUnit;\n\n\n }, { \"./IVPAIDAdUnit\": 1, \"./subscriber\": 4, \"./utils\": 5 }],\n 3: [function(require, module, exports) {\n 'use strict';\n\n\n var utils = require('./utils');\n var unique = utils.unique('vpaidIframe');\n var VPAIDAdUnit = require('./VPAIDAdUnit');\n //var defaultTemplate = \"\\n\\n\\n \\n\\n\\n \\n \\n \\n \\n\\n\\n\";\n var defaultTemplate = \"\\n\\n \\n \\n \\n \\n \\n \\n \\n\\n\\n\";\n\n var AD_STOPPED = 'AdStopped';\n\n /**\n * This callback is displayed as global member. The callback use nodejs error-first callback style\n * @callback NodeStyleCallback\n * @param {string|null}\n * @param {undefined|object}\n */\n\n /**\n * VPAIDHTML5Client\n * @class\n *\n * @param {HTMLElement} el that will contain the iframe to load adUnit and a el to add to adUnit slot\n * @param {HTMLVideoElement} video default video element to be used by adUnit\n * @param {object} [templateConfig] template: html template to be used instead of the default, extraOptions: to be used when rendering the template\n * @param {object} [vpaidOptions] timeout: when loading adUnit\n */\n function VPAIDHTML5Client(el, video, templateConfig, vpaidOptions) {\n templateConfig = templateConfig || {};\n\n this._id = unique();\n this._destroyed = false;\n\n this._frameContainer = utils.createElementInEl(el, 'div');\n this._videoEl = video;\n this._vpaidOptions = vpaidOptions || { timeout: 10000 };\n\n this._templateConfig = {\n template: templateConfig.template || defaultTemplate,\n extraOptions: templateConfig.extraOptions || {}\n };\n\n }\n\n /**\n * destroy\n *\n */\n VPAIDHTML5Client.prototype.destroy = function destroy() {\n if (this._destroyed) {\n return;\n }\n this._destroyed = true;\n $unloadPreviousAdUnit.call(this);\n };\n\n /**\n * isDestroyed\n *\n * @return {boolean}\n */\n VPAIDHTML5Client.prototype.isDestroyed = function isDestroyed() {\n return this._destroyed;\n };\n\n /**\n * loadAdUnit\n *\n * @param {string} adURL url of the js of the adUnit\n * @param {nodeStyleCallback} callback\n */\n VPAIDHTML5Client.prototype.loadAdUnit = function loadAdUnit(adURL, callback) {\n $throwIfDestroyed.call(this);\n $unloadPreviousAdUnit.call(this);\n\n var frame = utils.createIframeWithContent(\n this._frameContainer,\n this._templateConfig.template,\n utils.extend({\n iframeURL_JS: adURL,\n iframeID: this.getID()\n }, this._templateConfig.extraOptions)\n );\n this._frame = frame;\n\n this._onLoad = utils.callbackTimeout(\n this._vpaidOptions.timeout,\n onLoad.bind(this),\n onTimeout.bind(this)\n );\n\n // Set up user activity detection Hook for the iframe;\n handleUserActivityIframeEvents(this._frame);\n\n window.addEventListener('message', this._onLoad);\n\n function onLoad(e) {\n\n console.log(\"got postMessage from container\");\n\n //minthe : this should have proper logic for dynamic iframe generates on runtime.\n //don't clear timeout\n //if (e.origin !== window.location.origin) return;\n var result = JSON.parse(e.data);\n\n //don't clear timeout\n if (result.id !== this.getID()) return;\n\n var adUnit, error, createAd;\n if (!this._frame.contentWindow) {\n\n error = 'the iframe is not anymore in the DOM tree';\n\n } else {\n createAd = this._frame.contentWindow.getVPAIDAd;\n error = utils.validate(typeof createAd === 'function', 'the ad didn\\'t return a function to create an ad');\n }\n\n if (!error) {\n var adEl = this._frame.contentWindow.document.querySelector('.ad-element');\n adUnit = new VPAIDAdUnit(createAd(), adEl, this._videoEl, this._frame);\n adUnit.subscribe(AD_STOPPED, $adDestroyed.bind(this));\n error = utils.validate(adUnit.isValidVPAIDAd(), 'the add is not fully complaint with VPAID specification');\n }\n\n this._adUnit = adUnit;\n $destroyLoadListener.call(this);\n callback(error, error ? null : adUnit);\n\n //clear timeout\n return true;\n }\n\n function onTimeout() {\n callback('timeout', null);\n }\n\n // VIDLA 1106 + VIDLA 601:\n // Root cause for video JS not detecting UserActivity.\n // if mousemove and touch events happens inside an iframe,\n // then it is not automatically propogated to the player element.\n // This code is forcing the mouse and touch event up to video js\n // so that useractivity logic works just as for Vast mp4s\n function handleUserActivityIframeEvents(iframe){\n // Save any previous handler\n var existingOnMouseMove = iframe.contentWindow.onmousemove;\n var existingOnMouseOver = iframe.contentWindow.onmouseover;\n\n var existingOnTouchStart = iframe.contentWindow.ontouchstart;\n var existingOnTouchEnd = iframe.contentWindow.ontouchend;\n\n iframe.contentWindow.onmousemove = function(e) {\n if (existingOnMouseMove) existingOnMouseMove(e);\n forwardMouseEvent(e, \"mousemove\");\n };\n\n iframe.contentWindow.onmouseover = function(e) {\n if (existingOnMouseOver) existingOnMouseOver(e);\n forwardMouseEvent(e, \"mouseover\");\n };\n\n function forwardMouseEvent(e, nameOfEvent){\n var evt = document.createEvent(\"MouseEvents\");\n // We'll need this to offset the mouse move appropriately\n var boundingClientRect = iframe.getBoundingClientRect();\n // Initialize the event, copying exiting event values\n // for the most part\n evt.initMouseEvent(\n nameOfEvent,\n true, // bubbles\n false, // not cancelable\n window,\n e.detail,\n e.screenX,\n e.screenY,\n e.clientX + boundingClientRect.left,\n e.clientY + boundingClientRect.top,\n e.ctrlKey,\n e.altKey,\n e.shiftKey,\n e.metaKey,\n e.button,\n null // no related element\n );\n iframe.dispatchEvent(evt);\n };\n\n iframe.contentWindow.ontouchstart = function(e) {\n if (existingOnTouchStart) existingOnTouchStart(e);\n forwardTouch(e);\n };\n\n iframe.contentWindow.ontouchend = function(e) {\n if (existingOnTouchEnd) existingOnTouchEnd(e);\n forwardTouch(e);\n };\n\n function forwardTouch(e){\n var evt = document.createEvent(\"HTMLEvents\");\n evt.initEvent(\n e.type,\n true, // bubbles\n false, // not cancelable\n window);\n iframe.dispatchEvent(evt);\n };\n };\n };\n\n /**\n * unloadAdUnit\n *\n */\n VPAIDHTML5Client.prototype.unloadAdUnit = function unloadAdUnit() {\n $unloadPreviousAdUnit.call(this);\n };\n\n /**\n * getID will return the unique id\n *\n * @return {string}\n */\n VPAIDHTML5Client.prototype.getID = function() {\n return this._id;\n };\n\n\n /**\n * $removeEl\n *\n * @param {string} key\n */\n function $removeEl(key) {\n var el = this[key];\n if (el) {\n el.remove();\n delete this[key];\n }\n }\n\n function $adDestroyed() {\n $removeAdElements.call(this);\n delete this._adUnit;\n }\n\n function $unloadPreviousAdUnit() {\n $removeAdElements.call(this);\n $destroyAdUnit.call(this);\n }\n\n function $removeAdElements() {\n $removeEl.call(this, '_frame');\n $destroyLoadListener.call(this);\n }\n\n /**\n * $destroyLoadListener\n *\n */\n function $destroyLoadListener() {\n if (this._onLoad) {\n window.removeEventListener('message', this._onLoad);\n utils.clearCallbackTimeout(this._onLoad);\n delete this._onLoad;\n }\n }\n\n\n function $destroyAdUnit() {\n if (this._adUnit) {\n this._adUnit.stopAd();\n delete this._adUnit;\n }\n }\n\n /**\n * $throwIfDestroyed\n *\n */\n function $throwIfDestroyed() {\n if (this._destroyed) {\n throw new Error('VPAIDHTML5Client already destroyed!');\n }\n }\n\n module.exports = VPAIDHTML5Client;\n window.VPAIDHTML5Client = VPAIDHTML5Client;\n\n\n }, { \"./VPAIDAdUnit\": 2, \"./utils\": 5 }],\n 4: [function(require, module, exports) {\n 'use strict';\n\n function Subscriber() {\n this._subscribers = {};\n }\n\n Subscriber.prototype.subscribe = function subscribe(handler, eventName, context) {\n this.get(eventName).push({ handler: handler, context: context });\n };\n\n Subscriber.prototype.unsubscribe = function unsubscribe(handler, eventName) {\n this._subscribers[eventName] = this.get(eventName).filter(function(subscriber) {\n return handler === subscriber.handler;\n });\n };\n\n Subscriber.prototype.unsubscribeAll = function unsubscribeAll() {\n this._subscribers = {};\n };\n\n Subscriber.prototype.trigger = function(eventName, data) {\n var that = this;\n that.get(eventName).forEach(function(subscriber) {\n setTimeout(function() {\n if (that.get(eventName)) {\n subscriber.handler.call(subscriber.context, data);\n }\n }, 0);\n });\n };\n\n Subscriber.prototype.triggerSync = function(eventName, data) {\n this.get(eventName).forEach(function(subscriber) {\n subscriber.handler.call(subscriber.context, data);\n });\n };\n\n Subscriber.prototype.get = function get(eventName) {\n if (!this._subscribers[eventName]) {\n this._subscribers[eventName] = [];\n }\n return this._subscribers[eventName];\n };\n\n module.exports = Subscriber;\n\n\n }, {}],\n 5: [function(require, module, exports) {\n 'use strict';\n\n /**\n * noop a empty function\n */\n function noop() {}\n\n /**\n * validate if is not validate will return an Error with the message\n *\n * @param {boolean} isValid\n * @param {string} message\n */\n function validate(isValid, message) {\n return isValid ? null : new Error(message);\n }\n\n var timeouts = {};\n /**\n * clearCallbackTimeout\n *\n * @param {function} func handler to remove\n */\n function clearCallbackTimeout(func) {\n var timeout = timeouts[func];\n if (timeout) {\n clearTimeout(timeout);\n delete timeouts[func];\n }\n }\n\n /**\n * callbackTimeout if the onSuccess is not called and returns true in the timelimit then onTimeout will be called\n *\n * @param {number} timer\n * @param {function} onSuccess\n * @param {function} onTimeout\n */\n function callbackTimeout(timer, onSuccess, onTimeout) {\n var callback, timeout;\n\n timeout = setTimeout(function() {\n onSuccess = noop;\n if (!timeouts[callback]) {\n // Timeout has already been resolved.\n return;\n }\n delete timeout[callback];\n onTimeout();\n }, timer);\n\n callback = function() {\n // TODO avoid leaking arguments\n // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments\n if (onSuccess.apply(this, arguments)) {\n clearCallbackTimeout(callback);\n }\n };\n\n timeouts[callback] = timeout;\n\n return callback;\n }\n\n\n /**\n * createElementInEl\n *\n * @param {HTMLElement} parent\n * @param {string} tagName\n * @param {string} id\n */\n function createElementInEl(parent, tagName, id) {\n var nEl = document.createElement(tagName);\n if (id) nEl.id = id;\n parent.appendChild(nEl);\n return nEl;\n }\n\n /**\n * createIframeWithContent\n *\n * @param {HTMLElement} parent\n * @param {string} template simple template using {{var}}\n * @param {object} data\n */\n function createIframeWithContent(parent, template, data) {\n var iframe = createIframe(parent);\n if (!setIframeContent(iframe, simpleTemplate(template, data))) return;\n return iframe;\n }\n\n /**\n * createIframe\n *\n * @param {HTMLElement} parent\n * @param {string} url\n */\n function createIframe(parent, url) {\n var nEl = document.createElement('iframe');\n nEl.src = url || 'about:blank';\n nEl.width = '100%';\n nEl.height = '100%';\n nEl.style.position = 'absolute';\n nEl.style.left = '0';\n nEl.style.top = '0';\n nEl.style.border = '0';\n parent.innerHTML = '';\n parent.appendChild(nEl);\n return nEl;\n }\n\n /**\n * simpleTemplate\n *\n * @param {string} template\n * @param {object} data\n */\n function simpleTemplate(template, data) {\n Object.keys(data).forEach(function(key) {\n var value = (typeof value === 'object') ? JSON.stringify(data[key]) : data[key];\n template = template.replace(new RegExp('{{' + key + '}}', 'g'), value);\n });\n return template;\n }\n\n /**\n * setIframeContent\n *\n * @param {HTMLIframeElement} iframeEl\n * @param content\n */\n function setIframeContent(iframeEl, content) {\n var iframeDoc = iframeEl.contentWindow && iframeEl.contentWindow.document;\n if (!iframeDoc) return false;\n\n iframeDoc.write(content);\n\n return true;\n }\n\n\n /**\n * extend object with keys from another object\n *\n * @param {object} toExtend\n * @param {object} fromSource\n */\n function extend(toExtend, fromSource) {\n Object.keys(fromSource).forEach(function(key) {\n toExtend[key] = fromSource[key];\n });\n return toExtend;\n }\n\n\n /**\n * unique will create a unique string everytime is called, sequentially and prefixed\n *\n * @param {string} prefix\n */\n function unique(prefix) {\n var count = -1;\n return function() {\n return prefix + '_' + (++count);\n };\n }\n\n module.exports = {\n noop: noop,\n validate: validate,\n clearCallbackTimeout: clearCallbackTimeout,\n callbackTimeout: callbackTimeout,\n createElementInEl: createElementInEl,\n createIframeWithContent: createIframeWithContent,\n createIframe: createIframe,\n simpleTemplate: simpleTemplate,\n setIframeContent: setIframeContent,\n extend: extend,\n unique: unique\n };\n\n\n }, {}]\n }, {}, [3])\n\n\n //# sourceMappingURL=VPAIDHTML5Client.js.map\n ;\n //Small subset of async\n var async = {};\n\n async.setImmediate = function(fn) {\n setTimeout(fn, 0);\n };\n\n async.iterator = function(tasks) {\n var makeCallback = function(index) {\n var fn = function() {\n if (tasks.length) {\n tasks[index].apply(null, arguments);\n }\n return fn.next();\n };\n fn.next = function() {\n return (index < tasks.length - 1) ? makeCallback(index + 1) : null;\n };\n return fn;\n };\n return makeCallback(0);\n };\n\n\n async.waterfall = function(tasks, callback) {\n callback = callback || function() {};\n if (!isArray(tasks)) {\n var err = new Error('First argument to waterfall must be an array of functions');\n return callback(err);\n }\n if (!tasks.length) {\n return callback();\n }\n var wrapIterator = function(iterator) {\n return function(err) {\n if (err) {\n callback.apply(null, arguments);\n callback = function() {};\n } else {\n var args = Array.prototype.slice.call(arguments, 1);\n var next = iterator.next();\n if (next) {\n args.push(wrapIterator(next));\n } else {\n args.push(callback);\n }\n async.setImmediate(function() {\n iterator.apply(null, args);\n });\n }\n };\n };\n wrapIterator(async.iterator(tasks))();\n };\n\n async.when = function(condition, callback) {\n if (!isFunction(callback)) {\n throw new Error(\"async.when error: missing callback argument\");\n }\n\n var isAllowed = isFunction(condition) ? condition : function() {\n return !!condition;\n };\n\n return function() {\n var args = arrayLikeObjToArray(arguments);\n var next = args.pop();\n\n if (isAllowed.apply(null, args)) {\n return callback.apply(this, arguments);\n }\n\n args.unshift(null);\n return next.apply(null, args);\n };\n };\n\n\n\n ;\n \"use strict\";\n\n var dom = {};\n\n dom.isVisible = function isVisible(el) {\n var style = window.getComputedStyle(el);\n return style.visibility !== 'hidden';\n };\n\n dom.isHidden = function isHidden(el) {\n var style = window.getComputedStyle(el);\n return style.display === 'none';\n };\n\n dom.isShown = function isShown(el) {\n return !dom.isHidden(el);\n };\n\n dom.hide = function hide(el) {\n el.__prev_style_display_ = el.style.display;\n el.style.display = 'none';\n };\n\n dom.show = function show(el) {\n if (dom.isHidden(el)) {\n el.style.display = el.__prev_style_display_;\n }\n el.__prev_style_display_ = undefined;\n };\n\n dom.hasClass = function hasClass(el, cssClass) {\n var classes, i, len;\n\n if (isNotEmptyString(cssClass)) {\n if (el.classList) {\n return el.classList.contains(cssClass);\n }\n\n classes = isString(el.getAttribute('class')) ? el.getAttribute('class').split(/\\s+/) : [];\n cssClass = (cssClass || '');\n\n for (i = 0, len = classes.length; i < len; i += 1) {\n if (classes[i] === cssClass) {\n return true;\n }\n }\n }\n return false;\n };\n\n dom.addClass = function(el, cssClass) {\n var classes;\n\n if (isNotEmptyString(cssClass)) {\n if (el.classList) {\n return el.classList.add(cssClass);\n }\n\n classes = isString(el.getAttribute('class')) ? el.getAttribute('class').split(/\\s+/) : [];\n if (isString(cssClass) && isNotEmptyString(cssClass.replace(/\\s+/, ''))) {\n classes.push(cssClass);\n el.setAttribute('class', classes.join(' '));\n }\n }\n };\n\n dom.removeClass = function(el, cssClass) {\n var classes;\n\n if (isNotEmptyString(cssClass)) {\n if (el.classList) {\n return el.classList.remove(cssClass);\n }\n\n classes = isString(el.getAttribute('class')) ? el.getAttribute('class').split(/\\s+/) : [];\n var newClasses = [];\n var i, len;\n if (isString(cssClass) && isNotEmptyString(cssClass.replace(/\\s+/, ''))) {\n\n for (i = 0, len = classes.length; i < len; i += 1) {\n if (cssClass !== classes[i]) {\n newClasses.push(classes[i]);\n }\n }\n el.setAttribute('class', newClasses.join(' '));\n }\n }\n };\n\n dom.addEventListener = function addEventListener(el, type, handler) {\n if (isArray(el)) {\n forEach(el, function(e) {\n dom.addEventListener(e, type, handler);\n });\n return;\n }\n\n if (isArray(type)) {\n forEach(type, function(t) {\n dom.addEventListener(el, t, handler);\n });\n return;\n }\n\n if (el.addEventListener) {\n el.addEventListener(type, handler, false);\n } else if (el.attachEvent) {\n // WARNING!!! this is a very naive implementation !\n // the event object that should be passed to the handler\n // would not be there for IE8\n // we should use \"window.event\" and then \"event.srcElement\"\n // instead of \"event.target\"\n el.attachEvent(\"on\" + type, handler);\n }\n };\n\n dom.removeEventListener = function removeEventListener(el, type, handler) {\n if (isArray(el)) {\n forEach(el, function(e) {\n dom.removeEventListener(e, type, handler);\n });\n return;\n }\n\n if (isArray(type)) {\n forEach(type, function(t) {\n dom.removeEventListener(el, t, handler);\n });\n return;\n }\n\n if (el.removeEventListener) {\n el.removeEventListener(type, handler, false);\n } else if (el.detachEvent) {\n el.detachEvent(\"on\" + type, handler);\n } else {\n el[\"on\" + type] = null;\n }\n };\n\n dom.dispatchEvent = function dispatchEvent(el, event) {\n if (el.dispatchEvent) {\n el.dispatchEvent(event);\n } else {\n el.fireEvent(\"on\" + event.eventType, event);\n }\n };\n\n dom.isDescendant = function isDescendant(parent, child) {\n var node = child.parentNode;\n while (node !== null) {\n if (node === parent) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n };\n\n dom.getTextContent = function getTextContent(el) {\n return el.textContent || el.text;\n };\n\n dom.prependChild = function prependChild(parent, child) {\n if (child.parentNode) {\n child.parentNode.removeChild(child);\n }\n return parent.insertBefore(child, parent.firstChild);\n };\n\n dom.remove = function removeNode(node) {\n if (node && node.parentNode) {\n node.parentNode.removeChild(node);\n }\n };\n\n dom.isDomElement = function isDomElement(o) {\n return o instanceof Element;\n };\n\n dom.click = function(el, handler) {\n dom.addEventListener(el, 'click', handler);\n };\n\n dom.once = function(el, type, handler) {\n function handlerWrap() {\n handler.apply(null, arguments);\n dom.removeEventListener(el, type, handlerWrap);\n }\n\n dom.addEventListener(el, type, handlerWrap);\n };\n\n //Note: there is no getBoundingClientRect on iPad so we need a fallback\n dom.getDimension = function getDimension(element) {\n var rect;\n var parentNode = element.parentNode;\n // VIDLA-910 Always initializing with 1x1 for creative to better deal with falsy cases.\n // some creatives do not like 0x0 initializations specially inside iframe.\n var width = 1;\n var height = 1;\n if (parentNode) {\n width = parentNode.clientWidth ? parentNode.clientWidth : width;\n height = parentNode.clientHeight ? parentNode.clientHeight : height;\n }else {\n width = element.offsetWidth ? element.offsetWidth : width;\n height = element.offsetHeight ? element.offsetHeight : height;\n }\n return {\n width: width,\n height: height\n };\n };\n\n \"use strict\";\n\n var logger = {};\n\n ;\n \"use strict\";\n\n //minthe2 profile\n var profile = {};\n\n profile.timeout = 0;\n profile.initAdTimestamp = 0;\n profile.adLoadedTimestamp = 0;\n\n profile.startAdTimestamp = 0;\n profile.adStartedTimestamp = 0;\n\n profile.adImpressionTimestamp = 0;\n\n profile.getState = function() {\n if (profile.adImpressionTimestamp) {\n return 'adImpression';\n }\n if (profile.startAdTimestamp) {\n return 'startAd';\n }\n if (profile.initAdTimestamp) {\n return 'initAd';\n }\n return 'pluginInit';\n };\n\n profile.getRemainingTime = function(type) {\n var offset = 0;\n var currTime = new Date().getTime();\n switch (type) {\n case 'initAd':\n offset = currTime - profile.initAdTimestamp;\n break;\n case 'AdLoaded':\n offset = profile.getInitTime();\n break;\n case 'startAd':\n offset = profile.getInitTime();\n break;\n case 'AdStarted':\n offset = profile.getInitTime() + profile.getStartTime();\n break;\n case 'AdImpression':\n offset = profile.getTotalTime();\n break;\n default:\n break;\n }\n var remainingTime = profile.timeout - offset;\n return remainingTime;\n };\n\n profile.getInitTime = function() {\n var interval = profile.adLoadedTimestamp - profile.initAdTimestamp;\n return interval;\n };\n\n profile.getStartTime = function() {\n var interval = profile.adStartedTimestamp - profile.startAdTimestamp;\n return interval;\n };\n\n profile.getAdImpressionTime = function() {\n var interval = profile.adImpressionTimestamp - profile.startAdTimestamp;\n return interval;\n };\n\n profile.getTotalTime = function() {\n\n var interval = profile.getInitTime();\n\n if (profile.adStartedTimestamp > profile.adImpressionTimestamp) {\n interval = interval + profile.getStartTime();\n } else {\n interval = interval + profile.getAdImpressionTime();\n }\n\n // if (profile.adImpressionTimestamp) {\n // interval = interval + profile.getAdImpressionTime();\n // }\n return interval;\n };\n\n ;\n \"use strict\";\n\n //minthe2 timer\n var timer = {};\n\n timer.killUnresponsiveCreative = false;\n timer.responseWaitingTime = 1000;\n timer.killTimeout = null;\n timer.adCancelTimeout = 5000;\n timer.adLoadTimeout = null;\n timer.adStartTimeout = null;\n // timer.adImpressionTimeout = null;\n timer.adStartedResponseTime = 0;\n timer.adImpressionResponseTime = 0;\n\n\n timer.startKillTimeout = function(adUnit) {\n if (timer.killUnresponsiveCreative) {\n // if already timeout is set . cleanup\n if (timer.killTimeout) {\n timer.stopKillTimeout();\n }\n timer.killTimeout = setTimeout(function() {\n if (timer.killTimeout) {\n logger.log('killUnresponsiveCreative Timeout reached ');\n adUnit.stopAd();\n }\n }, timer.responseWaitingTime);\n }\n };\n\n timer.stopKillTimeout = function() {\n if (!timer.killTimeout) {\n return;\n }\n timer.clearTimeout(timer.killTimeout);\n timer.killTimeout = null;\n };\n\n timer.handleAdTimeout = function(cb, state) {\n logger.error('VPAID AD TIMED OUT :: AFTER ' + state + ' ,timeout value : ' + timer.adCancelTimeout);\n if (cb) {\n cb(new VASTError('timeout while waiting for the video to start playing', 402));\n }\n };\n\n timer.clearTimeout = function(timeout) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n timer.startInitAdTimeout = function(cb) {\n profile.timeout = timer.adCancelTimeout;\n profile.initAdTimestamp = new Date().getTime();\n timer.adLoadTimeout = setTimeout(function() {\n timer.handleAdTimeout(cb, \"initAd\");\n }, timer.adCancelTimeout);\n };\n\n timer.stopInitAdTimeout = function() {\n profile.adLoadedTimestamp = new Date().getTime();\n timer.adStartedResponseTime = timer.adCancelTimeout - profile.getInitTime();\n timer.clearTimeout(timer.adLoadTimeout);\n\n };\n\n timer.startStartAdTimeout = function(cb) {\n profile.startAdTimestamp = new Date().getTime();\n var timeoutFunction;\n\n timeoutFunction = function() {\n if (profile.adStartedTimestamp > 0) {\n timer.handleAdTimeout(cb, \"AdStarted\");\n } else {\n timer.handleAdTimeout(cb, \"startAd\");\n }\n }\n\n timer.adStartTimeout = setTimeout(timeoutFunction, timer.adStartedResponseTime);\n };\n\n timer.stopStartAdTimeout = function() {\n timer.clearTimeout(timer.adStartTimeout);\n logger.debug(\"stopStartAdTimeout\");\n };\n\n // timer.startAdImpressionTimeout = function(cb) {\n // profile.adImpressionTimestamp = new Date().getTime();\n // timer.adImpressionTimeout = setTimeout(function(){\n // timer.handleAdTimeout(cb,\"AdStarted\");\n // }, timer.adImpressionResponseTime);\n // };\n\n // timer.stopAdImpressionTimeout = function() {\n // profile.adImpressionTimestamp = new Date().getTime();\n // timer.clearTimeout(timer.adImpressionTimeout);\n // };\n\n timer.stopAdTimeouts = function() {\n logger.debug(\"stopAdTimeouts\");\n timer.clearTimeout(timer.adLoadTimeout);\n timer.clearTimeout(timer.adStartTimeout);\n // timer.clearTimeout(timer.adImpressionTimeout);\n };\n\n ;\n \"use strict\";\n\n function HttpRequestError(message) {\n this.message = 'HttpRequest Error: ' + (message || '');\n }\n HttpRequestError.prototype = new Error();\n HttpRequestError.prototype.name = \"HttpRequest Error\";\n\n function HttpRequest(createXhr) {\n if (!isFunction(createXhr)) {\n throw new HttpRequestError('Missing XMLHttpRequest factory method');\n }\n\n this.createXhr = createXhr;\n }\n\n HttpRequest.prototype.run = function(method, url, callback, options) {\n sanityCheck(url, callback, options);\n var timeout, timeoutId;\n var xhr = this.createXhr();\n options = options || {};\n timeout = isNumber(options.timeout) ? options.timeout : 0;\n\n xhr.open(method, urlParts(url).href, true);\n\n if (options.headers) {\n setHeaders(xhr, options.headers);\n }\n\n if (options.withCredentials) {\n xhr.withCredentials = true;\n }\n\n xhr.onload = function() {\n var statusText, response, status;\n\n /**\n * The only way to do a secure request on IE8 and IE9 is with the XDomainRequest object. Unfortunately, microsoft is\n * so nice that decided that the status property and the 'getAllResponseHeaders' method where not needed so we have to\n * fake them. If the request gets done with an XDomainRequest instance, we will assume that there are no headers and\n * the status will always be 200. If you don't like it, DO NOT USE ANCIENT BROWSERS!!!\n *\n * For mor info go to: https://msdn.microsoft.com/en-us/library/cc288060(v=vs.85).aspx\n */\n if (!xhr.getAllResponseHeaders) {\n xhr.getAllResponseHeaders = function() {\n return null;\n };\n }\n\n if (!xhr.status) {\n xhr.status = 200;\n }\n\n if (isDefined(timeoutId)) {\n clearTimeout(timeoutId);\n timeoutId = undefined;\n }\n\n statusText = xhr.statusText || '';\n\n // responseText is the old-school way of retrieving response (supported by IE8 & 9)\n // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)\n response = ('response' in xhr) ? xhr.response : xhr.responseText;\n\n // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)\n status = xhr.status === 1223 ? 204 : xhr.status;\n\n callback(\n status,\n response,\n xhr.getAllResponseHeaders(),\n statusText);\n };\n\n xhr.onerror = requestError;\n xhr.onabort = requestError;\n\n xhr.send();\n\n if (timeout > 0) {\n timeoutId = setTimeout(function() {\n xhr && xhr.abort();\n }, timeout);\n }\n\n function sanityCheck(url, callback, options) {\n if (!isString(url) || isEmptyString(url)) {\n throw new HttpRequestError(\"Invalid url '\" + url + \"'\");\n }\n\n if (!isFunction(callback)) {\n throw new HttpRequestError(\"Invalid handler '\" + callback + \"' for the http request\");\n }\n\n if (isDefined(options) && !isObject(options)) {\n throw new HttpRequestError(\"Invalid options map '\" + options + \"'\");\n }\n }\n\n function setHeaders(xhr, headers) {\n forEach(headers, function(value, key) {\n if (isDefined(value)) {\n xhr.setRequestHeader(key, value);\n }\n });\n }\n\n function requestError() {\n callback(-1, null, null, '');\n }\n };\n\n HttpRequest.prototype.get = function(url, callback, options) {\n this.run('GET', url, processResponse, options);\n\n function processResponse(status, response, headersString, statusText) {\n if (isSuccess(status)) {\n callback(null, response, status, headersString, statusText);\n } else {\n callback(new HttpRequestError(statusText), response, status, headersString, statusText);\n }\n }\n\n function isSuccess(status) {\n return 200 <= status && status < 300;\n }\n };\n\n function createXhr() {\n var xhr = new XMLHttpRequest();\n if (!(\"withCredentials\" in xhr)) {\n // XDomainRequest for IE.\n xhr = new XDomainRequest();\n }\n return xhr;\n }\n\n var http = new HttpRequest(createXhr);\n\n ;\n var playerUtils = {};\n\n /**\n * Returns an object that captures the portions of player state relevant to\n * video playback. The result of this function can be passed to\n * restorePlayerSnapshot with a player to return the player to the state it\n * was in when this function was invoked.\n * @param {object} player The videojs player object\n */\n playerUtils.getPlayerSnapshot = function getPlayerSnapshot(player) {\n var tech = player.el().querySelector('.vjs-tech');\n var snapshot = {\n ended: player.ended(),\n src: player.currentSrc(),\n currentTime: player.currentTime(),\n type: player.currentType(),\n playing: !player.paused(),\n suppressedTracks: getSuppressedTracks(player)\n };\n\n if (tech) {\n snapshot.nativePoster = tech.poster;\n snapshot.style = tech.getAttribute('style');\n }\n\n return snapshot;\n\n /**** Local Functions ****/\n function getSuppressedTracks(player) {\n var tracks = player.remoteTextTracks ? player.remoteTextTracks() : [];\n\n if (tracks && isArray(tracks.tracks_)) {\n tracks = tracks.tracks_;\n }\n\n if (!isArray(tracks)) {\n tracks = [];\n }\n\n var suppressedTracks = [];\n tracks.forEach(function(track) {\n suppressedTracks.push({\n track: track,\n mode: track.mode\n });\n track.mode = 'disabled';\n });\n\n return suppressedTracks;\n }\n };\n\n /**\n * Attempts to modify the specified player so that its state is equivalent to\n * the state of the snapshot.\n * @param {object} snapshot - the player state to apply\n */\n playerUtils.restorePlayerSnapshot = function restorePlayerSnapshot(player, snapshot) {\n var tech = player.el().querySelector('.vjs-tech');\n var attempts = 20; // the number of remaining attempts to restore the snapshot\n\n if (snapshot.nativePoster) {\n tech.poster = snapshot.nativePoster;\n }\n\n if ('style' in snapshot) {\n // overwrite all css style properties to restore state precisely\n tech.setAttribute('style', snapshot.style || '');\n }\n\n if (hasSrcChanged(player, snapshot)) {\n // on ios7, fiddling with textTracks too early will cause safari to crash\n player.one('contentloadedmetadata', restoreTracks);\n\n player.one('canplay', tryToResume);\n ensureCanplayEvtGetsFired();\n\n // if the src changed for ad playback, reset it\n player.src({ src: snapshot.src, type: snapshot.type });\n\n // safari requires a call to `load` to pick up a changed source\n player.load();\n\n } else {\n restoreTracks();\n\n if (snapshot.playing) {\n player.play();\n }\n }\n\n /*** Local Functions ***/\n\n /**\n * Sometimes firefox does not trigger the 'canplay' evt.\n * This code ensure that it always gets triggered triggered.\n */\n function ensureCanplayEvtGetsFired() {\n var timeoutId = setTimeout(function() {\n player.trigger('canplay');\n }, 1000);\n\n player.one('canplay', function() {\n clearTimeout(timeoutId);\n });\n }\n\n /**\n * Determine whether the player needs to be restored to its state\n * before ad playback began. With a custom ad display or burned-in\n * ads, the content player state hasn't been modified and so no\n * restoration is required\n */\n function hasSrcChanged(player, snapshot) {\n if (player.src()) {\n return player.src() !== snapshot.src;\n }\n // the player was configured through source element children\n return player.currentSrc() !== snapshot.src;\n }\n\n function restoreTracks() {\n var suppressedTracks = snapshot.suppressedTracks;\n suppressedTracks.forEach(function(trackSnapshot) {\n trackSnapshot.track.mode = trackSnapshot.mode;\n });\n }\n\n /**\n * Determine if the video element has loaded enough of the snapshot source\n * to be ready to apply the rest of the state\n */\n function tryToResume() {\n if (playerUtils.isReadyToResume(tech)) {\n // if some period of the video is seekable, resume playback\n return resume();\n }\n\n // delay a bit and then check again unless we're out of attempts\n if (attempts--) {\n setTimeout(tryToResume, 50);\n } else {\n (function() {\n try {\n resume();\n } catch (e) {\n videojs.log.warn('Failed to resume the content after an advertisement', e);\n }\n })();\n }\n\n\n /*** Local functions ***/\n function resume() {\n player.currentTime(snapshot.currentTime);\n\n if (snapshot.playing) {\n player.play();\n }\n }\n\n }\n };\n\n playerUtils.isReadyToResume = function(tech) {\n if (tech.readyState > 1) {\n // some browsers and media aren't \"seekable\".\n // readyState greater than 1 allows for seeking without exceptions\n return true;\n }\n\n if (tech.seekable === undefined) {\n // if the tech doesn't expose the seekable time ranges, try to\n // resume playback immediately\n return true;\n }\n\n if (tech.seekable.length > 0) {\n // if some period of the video is seekable, resume playback\n return true;\n }\n\n return false;\n };\n\n /**\n * This function prepares the player to display ads.\n * Adding convenience events like the 'vast.firsPlay' that gets fired when the video is first played\n * and ads the blackPoster to the player to prevent content from being displayed before the preroll ad.\n *\n * @param player\n */\n playerUtils.prepareForAds = function(player, disableMonkeyPatchPlayerApi) {\n\n var blackPoster = player.addChild('blackPoster');\n var _firstPlay = true;\n var volumeSnapshot;\n\n // VID-1955 Causes Interference with Waterfall playback\n // VIDLA-853 Causes Interference with Mobile App playback\n if (!disableMonkeyPatchPlayerApi) {\n monkeyPatchPlayerApi();\n }\n\n player.on('play', tryToTriggerFirstPlay);\n player.on('vast.reset', resetFirstPlay); //Every time we change the sources we reset the first play.\n player.on('vast.firstPlay', restoreContentVolume);\n player.on('error', hideBlackPoster); //If there is an error in the player we remove the blackposter to show the err msg\n player.on('vast.adStart', hideBlackPoster);\n player.on('vast.adsCancel', hideBlackPoster);\n player.on('vast.adError', hideBlackPoster);\n player.on('vast.adStart', addStyles);\n player.on('vast.adEnd', removeStyles);\n player.on('vast.adsCancel', removeStyles);\n\n /*** Local Functions ***/\n\n /**\n What this function does is ugly and horrible and I should think twice before calling myself a good developer. With that said,\n it is the best solution I could find to mute the video until the 'play' event happens (on mobile devices) and the plugin can decide whether\n to play the ad or not.\n\n We also need this monkeypatch to be able to pause and resume an ad using the player's API\n\n If you have a better solution please do tell me.\n */\n function monkeyPatchPlayerApi() {\n\n /**\n * Monkey patch needed to handle firstPlay and resume of playing ad.\n *\n * @param prepareForAds necessary flag to prevent infinite loop when you are restoring a VAST ad.\n * @returns {player}\n */\n var origPlay = player.play;\n player.play = function(callOrigPlay) {\n\n\n\n\n if (isFirstPlay()) {\n firstPlay.call(this);\n } else {\n resume.call(this, callOrigPlay);\n }\n\n return this;\n\n /*** local functions ***/\n function firstPlay() {\n\n\n if (!isIPhone()) {\n volumeSnapshot = saveVolumeSnapshot();\n player.muted(true);\n }\n // Do not call play on the video element instead just trigger startAd and the creative will call play as it is suppose to.\n // VID-2515 Force the enabling of the spinner. As we do not call actual play the wait state to trigger spinner never gets activated until its too late.\n player.addClass('vjs-waiting');\n player.trigger('firstplay');\n player.trigger('play');\n }\n\n function resume(callOrigPlay) {\n if (isAdPlaying() && !callOrigPlay) {\n player.vast.adUnit.resumeAd();\n } else {\n origPlay.apply(this, arguments);\n }\n }\n };\n\n\n /**\n * Needed monkey patch to handle pause of playing ad.\n *\n * @param callOrigPlay necessary flag to prevent infinite loop when you are pausing a VAST ad.\n * @returns {player}\n */\n var origPause = player.pause;\n player.pause = function(callOrigPause) {\n if (isAdPlaying() && !callOrigPause) {\n player.vast.adUnit.pauseAd();\n } else {\n origPause.apply(this, arguments);\n }\n return this;\n };\n\n\n /**\n * Needed monkey patch to handle paused state of the player when ads are playing.\n *\n * @param callOrigPlay necessary flag to prevent infinite loop when you are pausing a VAST ad.\n * @returns {player}\n */\n var origPaused = player.paused;\n player.paused = function(callOrigPaused) {\n if (isAdPlaying() && !callOrigPaused) {\n return player.vast.adUnit.isPaused();\n }\n return origPaused.apply(this, arguments);\n };\n }\n\n function isAdPlaying() {\n return player.vast && player.vast.adUnit;\n }\n\n function tryToTriggerFirstPlay() {\n\n if (isFirstPlay()) {\n _firstPlay = false;\n player.trigger('vast.firstPlay');\n }\n }\n\n function resetFirstPlay() {\n _firstPlay = true;\n blackPoster.show();\n restoreContentVolume();\n }\n\n function isFirstPlay() {\n return _firstPlay;\n }\n\n function saveVolumeSnapshot() {\n return {\n muted: player.muted(),\n volume: player.volume()\n };\n }\n\n function restoreContentVolume() {\n if (volumeSnapshot) {\n player.currentTime(0);\n restoreVolumeSnapshot(volumeSnapshot);\n volumeSnapshot = null;\n }\n }\n\n function restoreVolumeSnapshot(snapshot) {\n if (isObject(snapshot)) {\n player.volume(snapshot.volume);\n player.muted(snapshot.muted);\n }\n }\n\n function hideBlackPoster() {\n if (!dom.hasClass(blackPoster.el(), 'vjs-hidden')) {\n blackPoster.hide();\n }\n }\n\n function addStyles() {\n dom.addClass(player.el(), 'vjs-ad-playing');\n }\n\n function removeStyles() {\n dom.removeClass(player.el(), 'vjs-ad-playing');\n }\n };\n\n /**\n * Remove the poster attribute from the video element tech, if present. When\n * reusing a video element for multiple videos, the poster image will briefly\n * reappear while the new source loads. Removing the attribute ahead of time\n * prevents the poster from showing up between videos.\n * @param {object} player The videojs player object\n */\n playerUtils.removeNativePoster = function(player) {\n var tech = player.el().querySelector('.vjs-tech');\n if (tech) {\n tech.removeAttribute('poster');\n }\n };\n\n /**\n * Helper function to listen to many events until one of them gets fired, then we\n * execute the handler and unsubscribe all the event listeners;\n *\n * @param player specific player from where to listen for the events\n * @param events array of events\n * @param handler function to execute once one of the events fires\n */\n playerUtils.once = function once(player, events, handler) {\n function listener() {\n handler.apply(null, arguments);\n\n events.forEach(function(event) {\n player.off(event, listener);\n });\n }\n\n events.forEach(function(event) {\n player.on(event, listener);\n });\n };\n\n ;\n 'use strict';\n\n /**\n * documentMode is an IE-only property\n * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx\n */\n var msie = document.documentMode;\n\n /**\n *\n * IMPORTANT NOTE: This function comes from angularJs and was originally called urlResolve\n * you can take a look at the original code here https://github.com/angular/angular.js/blob/master/src/ng/urlUtils.js\n *\n * Implementation Notes for non-IE browsers\n * ----------------------------------------\n * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM,\n * results both in the normalizing and parsing of the URL. Normalizing means that a relative\n * URL will be resolved into an absolute URL in the context of the application document.\n * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related\n * properties are all populated to reflect the normalized URL. This approach has wide\n * compatibility - Safari 1+, Mozilla 1+, Opera 7+,e etc. See\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n *\n * Implementation Notes for IE\n * ---------------------------\n * IE >= 8 and <= 10 normalizes the URL when assigned to the anchor node similar to the other\n * browsers. However, the parsed components will not be set if the URL assigned did not specify\n * them. (e.g. if you assign a.href = \"foo\", then a.protocol, a.host, etc. will be empty.) We\n * work around that by performing the parsing in a 2nd step by taking a previously normalized\n * URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the\n * properties such as protocol, hostname, port, etc.\n *\n * IE7 does not normalize the URL when assigned to an anchor node. (Apparently, it does, if one\n * uses the inner HTML approach to assign the URL as part of an HTML snippet -\n * http://stackoverflow.com/a/472729) However, setting img[src] does normalize the URL.\n * Unfortunately, setting img[src] to something like \"javascript:foo\" on IE throws an exception.\n * Since the primary usage for normalizing URLs is to sanitize such URLs, we can't use that\n * method and IE < 8 is unsupported.\n *\n * References:\n * http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n * http://url.spec.whatwg.org/#urlutils\n * https://github.com/angular/angular.js/pull/2902\n * http://james.padolsey.com/javascript/parsing-urls-with-the-dom/\n *\n * @kind function\n * @param {string} url The URL to be parsed.\n * @description Normalizes and parses a URL.\n * @returns {object} Returns the normalized URL as a dictionary.\n *\n * | member name | Description |\n * |---------------|----------------|\n * | href | A normalized version of the provided URL if it was not an absolute URL |\n * | protocol | The protocol including the trailing colon |\n * | host | The host and port (if the port is non-default) of the normalizedUrl |\n * | search | The search params, minus the question mark |\n * | hash | The hash string, minus the hash symbol\n * | hostname | The hostname\n * | port | The port, without \":\"\n * | pathname | The pathname, beginning with \"/\"\n *\n */\n\n var urlParsingNode = document.createElement(\"a\");\n\n function urlParts(url) {\n var href = url;\n\n if (msie) {\n // Normalize before parse. Refer Implementation Notes on why this is\n // done in two steps on IE.\n urlParsingNode.setAttribute(\"href\", href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: isNotEmptyString(urlParsingNode.port) ? urlParsingNode.port : 80,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname : '/' + urlParsingNode.pathname\n };\n }\n\n\n /**\n * This function accepts a query string (search part of a url) and returns a dictionary with\n * the different key value pairs\n * @param {string} qs queryString\n */\n function queryStringToObj(qs, cond) {\n var pairs, qsObj;\n\n cond = isFunction(cond) ? cond : function() {\n return true;\n };\n\n qs = qs.trim().replace(/^\\?/, '');\n pairs = qs.split('&');\n qsObj = {};\n\n forEach(pairs, function(pair) {\n var keyValue, key, value;\n if (pair !== '') {\n keyValue = pair.split('=');\n key = keyValue[0];\n value = keyValue[1];\n if (cond(key, value)) {\n qsObj[key] = value;\n }\n }\n });\n\n return qsObj;\n }\n\n /**\n * This function accepts an object and serializes it into a query string without the leading '?'\n * @param obj\n * @returns {string}\n */\n function objToQueryString(obj) {\n var pairs = [];\n forEach(obj, function(value, key) {\n pairs.push(key + '=' + value);\n });\n return pairs.join('&');\n }\n\n\n ;\n var xml = {};\n\n xml.strToXMLDoc = function strToXMLDoc(stringContainingXMLSource) {\n //IE 8\n if (typeof window.DOMParser === 'undefined') {\n var xmlDocument = new ActiveXObject('Microsoft.XMLDOM');\n xmlDocument.async = false;\n xmlDocument.loadXML(stringContainingXMLSource);\n return xmlDocument;\n }\n\n return parseString(stringContainingXMLSource);\n\n function parseString(stringContainingXMLSource) {\n var parser = new DOMParser();\n var parsedDocument;\n\n //Note: This try catch is to deal with the fact that on IE parser.parseFromString does throw an error but the rest of the browsers don't.\n try {\n parsedDocument = parser.parseFromString(stringContainingXMLSource, \"application/xml\");\n\n if (isParseError(parsedDocument) || isEmptyString(stringContainingXMLSource)) {\n throw new Error();\n }\n } catch (e) {\n throw new Error(\"xml.strToXMLDOC: Error parsing the string: '\" + stringContainingXMLSource + \"'\");\n }\n\n return parsedDocument;\n }\n\n function isParseError(parsedDocument) {\n try { // parser and parsererrorNS could be cached on startup for efficiency\n var parser = new DOMParser(),\n errorneousParse = parser.parseFromString('INVALID', 'text/xml'),\n parsererrorNS = errorneousParse.getElementsByTagName(\"parsererror\")[0].namespaceURI;\n\n if (parsererrorNS === 'http://www.w3.org/1999/xhtml') {\n // In PhantomJS the parseerror element doesn't seem to have a special namespace, so we are just guessing here :(\n return parsedDocument.getElementsByTagName(\"parsererror\").length > 0;\n }\n\n return parsedDocument.getElementsByTagNameNS(parsererrorNS, 'parsererror').length > 0;\n } catch (e) {\n //Note on IE parseString throws an error by itself and it will never reach this code. Because it will have failed before\n }\n }\n };\n\n xml.parseText = function parseText(sValue) {\n if (/^\\s*$/.test(sValue)) {\n return null; }\n if (/^(?:true|false)$/i.test(sValue)) {\n return sValue.toLowerCase() === \"true\"; }\n if (isFinite(sValue)) {\n return parseFloat(sValue); }\n if (isISO8601(sValue)) {\n return new Date(sValue); }\n return sValue.trim();\n };\n\n xml.JXONTree = function JXONTree(oXMLParent) {\n var parseText = xml.parseText;\n\n //The document object is an especial object that it may miss some functions or attrs depending on the browser.\n //To prevent this problem with create the JXONTree using the root childNode which is a fully fleshed node on all supported\n //browsers.\n if (oXMLParent.documentElement) {\n return new xml.JXONTree(oXMLParent.documentElement);\n }\n\n if (oXMLParent.hasChildNodes()) {\n var sCollectedTxt = \"\";\n for (var oNode, sProp, vContent, nItem = 0; nItem < oXMLParent.childNodes.length; nItem++) {\n oNode = oXMLParent.childNodes.item(nItem);\n /*jshint bitwise: false*/\n if ((oNode.nodeType - 1 | 1) === 3) { sCollectedTxt += oNode.nodeType === 3 ? oNode.nodeValue.trim() : oNode.nodeValue; } else if (oNode.nodeType === 1 && !oNode.prefix) {\n sProp = decapitalize(oNode.nodeName);\n vContent = new xml.JXONTree(oNode);\n if (this.hasOwnProperty(sProp)) {\n if (this[sProp].constructor !== Array) { this[sProp] = [this[sProp]]; }\n this[sProp].push(vContent);\n } else { this[sProp] = vContent; }\n }\n }\n if (sCollectedTxt) { this.keyValue = parseText(sCollectedTxt); }\n }\n\n //IE8 Stupid fix\n var hasAttr = typeof oXMLParent.hasAttributes === 'undefined' ? oXMLParent.attributes.length > 0 : oXMLParent.hasAttributes();\n if (hasAttr) {\n var oAttrib;\n for (var nAttrib = 0; nAttrib < oXMLParent.attributes.length; nAttrib++) {\n oAttrib = oXMLParent.attributes.item(nAttrib);\n this[\"@\" + decapitalize(oAttrib.name)] = parseText(oAttrib.value.trim());\n }\n }\n };\n\n xml.JXONTree.prototype.attr = function(attr) {\n return this['@' + decapitalize(attr)];\n };\n\n xml.toJXONTree = function toJXONTree(xmlString) {\n var xmlDoc = xml.strToXMLDoc(xmlString);\n return new xml.JXONTree(xmlDoc);\n };\n\n /**\n * Helper function to extract the keyvalue of a JXONTree obj\n *\n * @param xmlObj {JXONTree}\n * return the key value or undefined;\n */\n xml.keyValue = function getKeyValue(xmlObj) {\n if (xmlObj) {\n return xmlObj.keyValue;\n }\n return undefined;\n };\n\n xml.attr = function getAttrValue(xmlObj, attr) {\n if (xmlObj) {\n return xmlObj['@' + decapitalize(attr)];\n }\n return undefined;\n };\n\n xml.encode = function encodeXML(str) {\n return str.replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n };\n\n xml.decode = function decodeXML(str) {\n return str.replace(/'/g, \"'\")\n .replace(/"/g, '\"')\n .replace(/>/g, '>')\n .replace(/</g, '<')\n .replace(/&/g, '&');\n };;\n\n //minthe : initalize vastClient\n vjs.plugin('vastClient', function VASTPlugin(options) {\n\n var snapshot;\n var player = this;\n var vast = new VASTClient();\n var adsCanceled = false;\n var defaultOpts = {\n // maximum amount of time in ms to wait to receive `adsready` from the ad\n // implementation after play has been requested. Ad implementations are\n // expected to load any dynamic libraries and make any requests to determine\n // ad policies for a video during this time.\n timeout: 500,\n\n //TODO:finish this IOS FIX\n //Whenever you play an add on IOS, the native player kicks in and we loose control of it. On very heavy pages the 'play' event\n // May occur after the video content has already started. This is wrong if you want to play a preroll ad that needs to happen before the user\n // starts watching the content. To prevent this usec\n iosPrerollCancelTimeout: 2000,\n\n // maximun amount of time for the ad to actually start playing. If this timeout gets\n // triggered the ads will be cancelled\n adCancelTimeout: 5000,\n\n // Boolean flag that configures the player to play a new ad before the user sees the video again\n // the current video\n playAdAlways: false,\n\n // Flag to enable or disable the ads by default.\n adsEnabled: true,\n\n // Boolean flag to enable or disable the resize with window.resize or orientationchange\n autoResize: true,\n\n // Path to the VPAID flash ad's loader\n vpaidFlashLoaderPath: '/VPAIDFlash.swf',\n\n //Boolean flag to enable/disable Controls on mouse over/out.\n disableControlsOnMouseover: false,\n\n initialAudio: 'off',\n\n overlayPlayer: false,\n\n mobileSDK: false,\n\n controlBarPosition: \"below\"\n };\n\n var settings = extend({}, defaultOpts, options || {});\n\n if (isUndefined(settings.adTagUrl) && isDefined(settings.url)) {\n settings.adTagUrl = settings.url;\n }\n\n if (isString(settings.adTagUrl)) {\n settings.adTagUrl = echoFn(settings.adTagUrl);\n }\n\n if (isDefined(settings.adTagXML) && !isFunction(settings.adTagXML)) {\n return trackAdError(new VASTError('on VideoJS VAST plugin, the passed adTagXML option does not contain a function'));\n }\n\n if (!isDefined(settings.adTagUrl) && !isFunction(settings.adTagXML)) {\n return trackAdError(new VASTError('on VideoJS VAST plugin, missing adTagUrl on options object'));\n }\n //VIDLA-1491 Disabling for iOS. Few creatives such as Mediamind(Bemruda) and Moat create playback problems\n var disableForOverlay = settings.overlayPlayer && isIDevice();\n var disableMonkeyPatchPlayerApi = disableForOverlay || settings.mobileSDK ;\n playerUtils.prepareForAds(player, disableMonkeyPatchPlayerApi);\n if (settings.playAdAlways) {\n // No matter what happens we play a new ad before the user sees the video again.\n player.on('vast.contentEnd', function() {\n setTimeout(function() {\n player.trigger('vast.reset');\n }, 0);\n });\n }\n\n player.on('vast.firstPlay', tryToPlayPrerollAd);\n\n player.on('vast.reset', function() {\n //If we are reseting the plugin, we don't want to restore the content\n snapshot = null;\n cancelAds();\n });\n\n player.vast = {\n isEnabled: function() {\n return settings.adsEnabled;\n },\n\n enable: function() {\n settings.adsEnabled = true;\n },\n\n disable: function() {\n settings.adsEnabled = false;\n }\n };\n\n if (settings.loggerCallback) {\n logger = settings.loggerCallback;\n } else {\n logger = console;\n }\n if (settings.terminateUnresponsiveVPAIDCreative) {\n timer.killUnresponsiveCreative = true;\n }\n if (settings.adCancelTimeout) {\n timer.adCancelTimeout = settings.adCancelTimeout;\n }\n\n var vastResponse = getAnVastXml();\n var adIntegrator = isVPAID(vastResponse) ? new VPAIDIntegrator(player, settings) : new VASTIntegrator(player);\n\n if (settings.delayExpandUntilVPAIDInit) {\n checkAd(); //minthe : invoke init method of vpaid creative here in order to check valid ad, at the end of this checkAd process it will dispatch custom event which is called \"an.readytogovpaid\"\n }\n\n return player.vast;\n\n\n\n /**** Local functions ****/\n function tryToPlayPrerollAd() {\n //We remove the poster to prevent flickering whenever the content starts playing\n playerUtils.removeNativePoster(player);\n\n playerUtils.once(player, ['vast.adsCancel', 'vast.adEnd'], function() {\n removeAdUnit();\n restoreVideoContent();\n });\n\n async.waterfall([\n checkAdsEnabled,\n preparePlayerForAd,\n playPrerollAd\n ], function(error, response) {\n if (error) {\n trackAdError(error, response);\n } else {\n player.trigger('vast.adEnd');\n }\n });\n\n /*** Local functions ***/\n\n function removeAdUnit() {\n if (player.vast && player.vast.adUnit) {\n player.vast.adUnit = null; //We remove the adUnit\n }\n }\n\n function restoreVideoContent() {\n setupContentEvents();\n if (snapshot) {\n playerUtils.restorePlayerSnapshot(player, snapshot);\n snapshot = null;\n }\n }\n\n function setupContentEvents() {\n playerUtils.once(player, ['playing', 'vast.reset', 'vast.firstPlay'], function(evt) {\n if (evt.type !== 'playing') {\n return;\n }\n\n player.trigger('vast.contentStart');\n\n playerUtils.once(player, ['ended', 'vast.reset', 'vast.firstPlay'], function(evt) {\n if (evt.type === 'ended') {\n player.trigger('vast.contentEnd');\n }\n });\n });\n }\n\n function checkAdsEnabled(next) {\n if (settings.adsEnabled) {\n return next(null);\n }\n next(new VASTError('Ads are not enabled'));\n }\n\n function preparePlayerForAd(next) {\n if (canPlayPrerollAd()) {\n snapshot = playerUtils.getPlayerSnapshot(player);\n addSpinnerIcon();\n next(null);\n } else {\n next(new VASTError('video content has been playing before preroll ad'));\n }\n }\n\n function canPlayPrerollAd() {\n return !isIPhone() || player.currentTime() <= settings.iosPrerollCancelTimeout;\n }\n\n function addSpinnerIcon() {\n dom.addClass(player.el(), 'vjs-vast-ad-loading');\n playerUtils.once(player, ['vast.adStart', 'vast.adsCancel'], removeSpinnerIcon);\n }\n\n function removeSpinnerIcon() {\n //IMPORTANT NOTE: We remove the spinnerIcon asynchronously to give time to the browser to start the video.\n // If we remove it synchronously we see a flash of the content video before the ad starts playing.\n setTimeout(function() {\n dom.removeClass(player.el(), 'vjs-vast-ad-loading');\n }, 100);\n }\n\n }\n\n function cancelAds() {\n player.trigger('vast.adsCancel');\n adsCanceled = true;\n }\n\n function playPrerollAd(callback) {\n async.waterfall([\n //getVastResponse,//minthe : comment out, we're not using mail online's vast parser and loader\n playAd\n ], callback);\n }\n\n function getVastResponse(callback) {\n vast.getVASTResponse(settings.adTagUrl ? settings.adTagUrl() : settings.adTagXML, callback);\n }\n\n function getAnVastXml() { //minthe : override vast response to use jsVpaidUrl coming from videoplayer framework\n var vastResponse = new VASTResponse();\n vastResponse._linearAdded = true;\n vastResponse.ads = [{\n \"id\": 1234567,\n \"inLine\": {\n \"adTitle\": \"\",\n \"adSystem\": \"\",\n \"impressions\": [],\n \"creatives\": [{\n \"sequence\": 1,\n \"linear\": {\n \"duration\": 13000,\n \"mediaFiles\": [{\n \"src\": settings.jsVpaidUrl,\n \"type\": \"application/javascript\",\n \"apiFramework\": \"VPAID\"\n }],\n \"skipoffset\": null,\n }\n }, { \"sequence\": 1 }],\n \"description\": \"Vpaid Linear Video Ad\",\n \"surveys\": []\n }\n }];\n vastResponse.errorURLMacros = [];\n vastResponse.impressions = [];\n vastResponse.customClicks = [];\n vastResponse.mediaFiles = [{\n \"src\": settings.jsVpaidUrl,\n \"type\": \"application/javascript\",\n \"apiFramework\": \"VPAID\"\n }];\n vastResponse.clickThrough = settings.clickUrl;\n vastResponse.adTitle = \"\";\n vastResponse.adParameters = settings.adParameters;\n\n return vastResponse;\n }\n\n function playAd(vastResponse, callback) {\n\n //minthe : override vast response to use jsVpaidUrl coming from videoplayer framework\n vastResponse = getAnVastXml();\n\n //TODO: Find a better way to stop the play. The 'playPrerollWaterfall' ends in an inconsistent situation\n //If the state is not 'preroll?' it means the ads were canceled therefore, we break the waterfall\n if (adsCanceled) {\n return;\n }\n\n var adFinished = false;\n\n //comment out for VID-1359\n //if (isIDevice()) {\n //preventManualProgress();\n //}\n callback = callback || trackAdError;\n player.vast.adUnit = adIntegrator.playAd(vastResponse, callback);\n\n //comment out for VID-1359\n //function preventManualProgress() {\n // //IOS video clock is very unreliable and we need a 3 seconds threshold to ensure that the user forwarded/rewound the ad\n // var PROGRESS_THRESHOLD = 3;\n // var previousTime = 0;\n // var tech = player.el().querySelector('.vjs-tech');\n // var skipad_attempts = 0;\n //\n // player.on('timeupdate', adTimeupdateHandler);\n // playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel', 'vast.adError'], stopPreventManualProgress);\n //\n // /*** Local functions ***/\n // function adTimeupdateHandler() {\n // var currentTime = player.currentTime();\n // var progressDelta = Math.abs(currentTime - previousTime);\n //\n // if (progressDelta > PROGRESS_THRESHOLD) {\n // skipad_attempts += 1;\n // if (skipad_attempts >= 2) {\n // player.pause();\n // }\n // player.currentTime(previousTime);\n // } else {\n // previousTime = currentTime;\n // }\n // }\n //\n // function stopPreventManualProgress() {\n // player.off('timeupdate', adTimeupdateHandler);\n // }\n //}\n }\n\n //minthe : checkAd to check vpaid ad is ready to go\n function checkAd(vastResponse, callback) {\n vastResponse = getAnVastXml();\n callback = callback || trackAdError;\n player.vast.adUnit = adIntegrator.playAd(vastResponse, callback, true);\n }\n\n function trackAdError(error, vastResponse) {\n if (!error) return;\n player.trigger({ type: 'vast.adError', error: error });\n cancelAds();\n if (console && console.log) {\n console.log('AD ERROR:', error.message, error, vastResponse);\n }\n }\n\n function isVPAID(vastResponse) {\n var i, len;\n var mediaFiles = vastResponse.mediaFiles;\n for (i = 0, len = mediaFiles.length; i < len; i++) {\n if (vastUtil.isVPAID(mediaFiles[i])) {\n return true;\n }\n }\n return false;\n }\n });\n\n ;\n vjs.AdsLabel = vjs.Component.extend({\n /** @constructor */\n init: function(player, options) {\n vjs.Component.call(this, player, options);\n\n var that = this;\n\n // We asynchronously reposition the ads label element\n setTimeout(function() {\n var currentTimeComp = player.controlBar && (player.controlBar.getChild(\"timerControls\") || player.controlBar.getChild(\"currentTimeDisplay\"));\n if (currentTimeComp) {\n player.controlBar.el().insertBefore(that.el(), currentTimeComp.el());\n }\n dom.removeClass(that.el(), 'vjs-label-hidden');\n }, 0);\n }\n });\n\n vjs.AdsLabel.prototype.createEl = function() {\n return vjs.Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-ads-label vjs-control vjs-label-hidden',\n innerHTML: 'Advertisement'\n });\n };;\n /**\n * The component that shows a black screen until the ads plugin has decided if it can or it can not play the ad.\n *\n * Note: In case you wonder why instead of this black poster we don't just show the spinner loader.\n * IOS devices do not work well with animations and the browser chrashes from time to time That is why we chose to\n * have a secondary black poster.\n *\n * It also makes it much more easier for the users of the plugin since it does not change the default behaviour of the\n * spinner and the player works the same way with and without the plugin.\n *\n * @param {vjs.Player|Object} player\n * @param {Object=} options\n * @constructor\n */\n vjs.BlackPoster = vjs.Component.extend({\n /** @constructor */\n init: function(player, options) {\n vjs.Component.call(this, player, options);\n\n var posterImg = player.getChild('posterImage');\n\n //We need to do it asynchronously to be sure that the black poster el is on the dom.\n setTimeout(function() {\n if (posterImg) {\n player.el().insertBefore(this.el(), posterImg.el());\n }\n }.bind(this), 0);\n }\n });\n\n /**\n * Create the black poster div element\n * @return {Element}\n */\n vjs.BlackPoster.prototype.createEl = function() {\n return vjs.createEl('div', {\n className: 'vjs-black-poster'\n });\n };;\n\n function VPAIDAdUnitWrapper(vpaidAdUnit, opts) {\n if (!(this instanceof VPAIDAdUnitWrapper)) {\n return new VPAIDAdUnitWrapper(vpaidAdUnit, opts);\n }\n sanityCheck(vpaidAdUnit, opts);\n\n this.options = extend({}, opts);\n\n this._adUnit = vpaidAdUnit;\n this._adLoaded = false;\n this._adStopped = false;\n this._adStarted = false;\n this._adSkipped = false;\n\n /*** Local Functions ***/\n function sanityCheck(adUnit, opts) {\n if (!adUnit || !VPAIDAdUnitWrapper.checkVPAIDInterface(adUnit)) {\n throw new VASTError('on VPAIDAdUnitWrapper, the passed VPAID adUnit does not fully implement the VPAID interface');\n }\n\n if (!isObject(opts)) {\n throw new VASTError(\"on VPAIDAdUnitWrapper, expected options hash but got '\" + opts + \"'\");\n }\n\n if (!(\"adCancelTimeout\" in opts) || !isNumber(opts.adCancelTimeout)) {\n throw new VASTError(\"on VPAIDAdUnitWrapper, expected adCancelTimeout in options\");\n }\n }\n }\n\n VPAIDAdUnitWrapper.checkVPAIDInterface = function checkVPAIDInterface(VPAIDAdUnit) {\n //NOTE: skipAd is not part of the method list because it only appears in VPAID 2.0 and we support VPAID 1.0\n var VPAIDInterfaceMethods = [\n 'handshakeVersion', 'initAd', 'startAd', 'stopAd', 'resizeAd', 'pauseAd', 'expandAd', 'collapseAd'\n ];\n\n for (var i = 0, len = VPAIDInterfaceMethods.length; i < len; i++) {\n if (!VPAIDAdUnit || !isFunction(VPAIDAdUnit[VPAIDInterfaceMethods[i]])) {\n return false;\n }\n }\n\n\n return canSubscribeToEvents(VPAIDAdUnit) && canUnsubscribeFromEvents(VPAIDAdUnit);\n\n /*** Local Functions ***/\n\n function canSubscribeToEvents(adUnit) {\n return isFunction(adUnit.subscribe) || isFunction(adUnit.addEventListener) || isFunction(adUnit.on);\n }\n\n function canUnsubscribeFromEvents(adUnit) {\n return isFunction(adUnit.unsubscribe) || isFunction(adUnit.removeEventListener) || isFunction(adUnit.off);\n\n }\n };\n\n VPAIDAdUnitWrapper.prototype.adUnitAsyncCall = function() {\n var args = arrayLikeObjToArray(arguments);\n var method = args.shift();\n var cb = args.pop();\n var timeoutId;\n\n sanityCheck(method, cb, this._adUnit);\n args.push(wrapCallback());\n\n this._adUnit[method].apply(this._adUnit, args);\n timeoutId = setTimeout(function() {\n timeoutId = null;\n cb(new VASTError(\"on VPAIDAdUnitWrapper, timeout while waiting for a response on call '\" + method + \"'\"));\n cb = noop;\n }, this.options.adCancelTimeout);\n\n /*** Local functions ***/\n function sanityCheck(method, cb, adUnit) {\n if (!isString(method) || !isFunction(adUnit[method])) {\n throw new VASTError(\"on VPAIDAdUnitWrapper.adUnitAsyncCall, invalid method name\");\n }\n\n if (!isFunction(cb)) {\n throw new VASTError(\"on VPAIDAdUnitWrapper.adUnitAsyncCall, missing callback\");\n }\n }\n\n function wrapCallback() {\n return function() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n cb.apply(this, arguments);\n };\n }\n };\n\n VPAIDAdUnitWrapper.prototype.on = function(evtName, handler) {\n var addEventListener = this._adUnit.addEventListener || this._adUnit.subscribe || this._adUnit.on;\n addEventListener.call(this._adUnit, evtName, handler);\n };\n\n VPAIDAdUnitWrapper.prototype.off = function(evtName, handler) {\n var removeEventListener = this._adUnit.removeEventListener || this._adUnit.unsubscribe || this._adUnit.off;\n removeEventListener.call(this._adUnit, evtName, handler);\n };\n\n //minthe : waitForEvent\n VPAIDAdUnitWrapper.prototype.waitForEvent = function(evtName, cb, context) {\n var timeoutId;\n sanityCheck(evtName, cb);\n context = context || null;\n\n this.on(evtName, responseListener);\n\n timeoutId = setTimeout(function() {\n cb(new VASTError(\"on VPAIDAdUnitWrapper.waitForEvent, timeout while waiting for event '\" + evtName + \"'\"));\n timeoutId = null;\n cb = noop;\n }, this.options.adCancelTimeout);\n\n /*** Local functions ***/\n function sanityCheck(evtName, cb) {\n if (!isString(evtName)) {\n throw new VASTError(\"on VPAIDAdUnitWrapper.waitForEvent, missing evt name\");\n }\n\n if (!isFunction(cb)) {\n throw new VASTError(\"on VPAIDAdUnitWrapper.waitForEvent, missing callback\");\n }\n }\n\n function responseListener() {\n var args = arrayLikeObjToArray(arguments);\n if (timeoutId) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n\n args.unshift(null);\n cb.apply(context, args);\n }\n };\n\n // VPAID METHODS\n VPAIDAdUnitWrapper.prototype.handshakeVersion = function(version, cb) {\n this.adUnitAsyncCall('handshakeVersion', version, cb);\n };\n\n /* jshint maxparams:6 */\n VPAIDAdUnitWrapper.prototype.initAd = function(width, height, viewMode, desiredBitrate, adUnitData, environmentVars, cb) {\n //minthe : AdLoaded\n logger.info('Calling VPAID initAd, time remaining =' + profile.getRemainingTime('initAd'));\n this.waitForEvent('AdLoaded', cb);\n\n //minthe VID-1580\n this._adUnit.initAd(width, height, viewMode, desiredBitrate, adUnitData, environmentVars);\n\n };\n\n VPAIDAdUnitWrapper.prototype.resizeAd = function(width, height, viewMode, cb) {\n // NOTE: AdSizeChange event is only supported on VPAID 2.0 so for the moment we are not going to use it\n // and will assume that everything is fine after the async call\n this.adUnitAsyncCall('resizeAd', width, height, viewMode, cb);\n };\n\n VPAIDAdUnitWrapper.prototype.startAd = function(cb) {\n logger.info('Calling VPAID startAd, time remaining =' + profile.getRemainingTime('startAd'));\n this.waitForEvent('AdStarted', cb);\n this._adUnit.startAd();\n };\n\n VPAIDAdUnitWrapper.prototype.stopAd = function(cb) {\n logger.info(' Calling VPAID stopAd');\n this.waitForEvent('AdStopped', cb);\n this._adUnit.stopAd();\n };\n\n VPAIDAdUnitWrapper.prototype.pauseAd = function(cb) {\n if (this._adStopped || !this._adStarted) return;\n logger.log(' Calling VPAID pauseAd');\n this._adUnit.pauseAd();\n timer.startKillTimeout(this._adUnit);\n };\n\n VPAIDAdUnitWrapper.prototype.resumeAd = function(cb) {\n if (this._adStopped || !this._adStarted) return;\n logger.log(' Calling VPAID resumeAd');\n this.waitForEvent('AdPlaying', cb);\n this._adUnit.resumeAd();\n timer.startKillTimeout(this._adUnit);\n };\n\n VPAIDAdUnitWrapper.prototype.expandAd = function(cb) {\n if (this._adStopped) return;\n this.waitForEvent('AdExpandedChange', cb);\n this._adUnit.expandAd();\n };\n\n VPAIDAdUnitWrapper.prototype.collapseAd = function(cb) {\n if (this._adStopped) return;\n this.waitForEvent('AdExpandedChange', cb);\n this._adUnit.collapseAd();\n };\n\n VPAIDAdUnitWrapper.prototype.skipAd = function(cb) {\n var skipAnyway = function() {\n if(!this._adSkipped){\n logger.debug('VPAID Creative has ' + ((this._adStopped) ? 'already stopped' : 'not responded with AdSkipped') + ': Forcing AdSkipped');\n this._adSkipped = true;\n this.player.trigger('vpaid.AdSkipped');\n }\n }\n\n if (this._adStopped) {\n // VIDLA-990 VPAID Ads that have already stopped should be skipped anyway (to support collapsing ad unit when disableCollapse is on)\n skipAnyway.apply(this);\n return;\n }\n logger.log('Calling VPAID skipAd');\n if (cb) {\n this.waitForEvent('AdSkipped', cb);\n }\n this._adUnit.skipAd();\n //VIDLA-442 VPAID Ads that don't respond to skipAd should be skipped anyway\n setTimeout(function() {\n skipAnyway.apply(this);\n }.bind(this), 500);\n };\n\n //VPAID property getters\n [\n 'adLinear',\n 'adWidth',\n 'adHeight',\n 'adExpanded',\n 'adSkippableState',\n 'adRemainingTime',\n 'adDuration',\n 'adVolume',\n 'adCompanions',\n 'adIcons'\n ].forEach(function(property) {\n var getterName = 'get' + capitalize(property);\n\n VPAIDAdUnitWrapper.prototype[getterName] = function(cb) {\n this.adUnitAsyncCall(getterName, cb);\n };\n });\n\n //VPAID property setters\n VPAIDAdUnitWrapper.prototype.setAdVolume = function(volume, cb) {\n if (this._adStopped) return;\n logger.debug('Calling VPAID setAdVolume :: volume :' + volume);\n this.adUnitAsyncCall('setAdVolume', volume, cb);\n };\n\n ;\n\n function VPAIDFlashTech(mediaFile, settings) {\n if (!(this instanceof VPAIDFlashTech)) {\n return new VPAIDFlashTech(mediaFile);\n }\n sanityCheck(mediaFile);\n this.name = 'vpaid-flash';\n this.mediaFile = mediaFile;\n this.containerEl = null;\n this.vpaidFlashClient = null;\n this.settings = settings;\n\n /*** local functions ***/\n function sanityCheck(mediaFile) {\n if (!mediaFile || !isString(mediaFile.src)) {\n throw new VASTError('on VPAIDFlashTech, invalid MediaFile');\n }\n }\n }\n\n VPAIDFlashTech.supports = function(type) {\n return type === 'application/x-shockwave-flash' && VPAIDFLASHClient.isSupported();\n };\n\n VPAIDFlashTech.prototype.loadAdUnit = function loadFlashCreative(containerEl, objectEl, callback) {\n var that = this;\n var flashClientOpts = this.settings && this.settings.vpaidFlashLoaderPath ? { data: this.settings.vpaidFlashLoaderPath } : undefined;\n sanityCheck(containerEl, callback);\n\n this.containerEl = containerEl;\n this.vpaidFlashClient = new VPAIDFLASHClient(containerEl, function(error) {\n if (error) {\n return callback(error);\n }\n\n that.vpaidFlashClient.loadAdUnit(that.mediaFile.src, callback);\n }, flashClientOpts);\n\n /*** Local Functions ***/\n function sanityCheck(container, cb) {\n\n if (!dom.isDomElement(container)) {\n throw new VASTError('on VPAIDFlashTech.loadAdUnit, invalid dom container element');\n }\n\n if (!isFunction(cb)) {\n throw new VASTError('on VPAIDFlashTech.loadAdUnit, missing valid callback');\n }\n }\n };\n\n VPAIDFlashTech.prototype.unloadAdUnit = function() {\n if (this.vpaidFlashClient) {\n try {\n this.vpaidFlashClient.destroy();\n } catch (e) {\n if (console && isFunction(console.log)) {\n console.log('VAST ERROR: trying to unload the VPAID adunit');\n }\n }\n this.vpaidFlashClient = null;\n }\n\n if (this.containerEl) {\n dom.remove(this.containerEl);\n this.containerEl = null;\n }\n };\n\n ;\n\n function VPAIDHTML5Tech(mediaFile) {\n\n if (!(this instanceof VPAIDHTML5Tech)) {\n return new VPAIDHTML5Tech(mediaFile);\n }\n\n sanityCheck(mediaFile);\n\n this.name = 'vpaid-html5';\n this.containerEl = null;\n this.videoEl = null;\n this.vpaidHTMLClient = null;\n\n this.mediaFile = mediaFile;\n\n function sanityCheck(mediaFile) {\n if (!mediaFile || !isString(mediaFile.src)) {\n throw new VASTError(VPAIDHTML5Tech.INVALID_MEDIA_FILE);\n }\n }\n }\n\n VPAIDHTML5Tech.supports = function(type) {\n return !isOldIE() && type === 'application/javascript';\n };\n\n VPAIDHTML5Tech.prototype.loadAdUnit = function loadAdUnit(containerEl, videoEl, callback) {\n sanityCheck(containerEl, videoEl, callback);\n\n this.containerEl = containerEl;\n this.videoEl = videoEl;\n this.vpaidHTMLClient = new VPAIDHTML5Client(containerEl, videoEl, {});\n this.vpaidHTMLClient.loadAdUnit(this.mediaFile.src, callback);\n\n\n\n function sanityCheck(container, video, cb) {\n if (!dom.isDomElement(container)) {\n throw new VASTError(VPAIDHTML5Tech.INVALID_DOM_CONTAINER_EL);\n }\n\n if (!dom.isDomElement(video) || video.tagName.toLowerCase() !== 'video') {\n throw new VASTError(VPAIDHTML5Tech.INVALID_DOM_CONTAINER_EL);\n }\n\n if (!isFunction(cb)) {\n throw new VASTError(VPAIDHTML5Tech.MISSING_CALLBACK);\n }\n }\n };\n\n VPAIDHTML5Tech.prototype.unloadAdUnit = function unloadAdUnit() {\n if (this.vpaidHTMLClient) {\n try {\n this.vpaidHTMLClient.destroy();\n } catch (e) {\n if (console && isFunction(console.log)) {\n console.log('VAST ERROR: trying to unload the VPAID adunit');\n }\n }\n\n this.vpaidHTMLClient = null;\n }\n\n if (this.containerEl) {\n dom.remove(this.containerEl);\n this.containerEl = null;\n }\n };\n\n var PREFIX = 'on VPAIDHTML5Tech';\n VPAIDHTML5Tech.INVALID_MEDIA_FILE = PREFIX + ', invalid MediaFile';\n VPAIDHTML5Tech.INVALID_DOM_CONTAINER_EL = PREFIX + ', invalid container HtmlElement';\n VPAIDHTML5Tech.INVALID_DOM_VIDEO_EL = PREFIX + ', invalid HTMLVideoElement';\n VPAIDHTML5Tech.MISSING_CALLBACK = PREFIX + ', missing valid callback';\n\n\n ;\n\n function VPAIDIntegrator(player, settings) {\n if (!(this instanceof VPAIDIntegrator)) {\n return new VPAIDIntegrator(player);\n }\n\n this.VIEW_MODE = {\n NORMAL: 'normal',\n FULLSCREEN: \"fullscreen\",\n THUMBNAIL: \"thumbnail\"\n };\n this.player = player;\n this.containerEl = createVPAIDContainerEl(player);\n this.options = {\n adCancelTimeout: 5000,\n VPAID_VERSION: '2.0'\n };\n this.settings = settings;\n this.volume = 1;\n this.initVolume = 1;\n if (this.settings.initialAudio === 'off') {\n logger.log(\"Initial audio off\");\n this.initVolume = 0;\n }\n this.initAdUnitCalled = false;\n this.initialisedAdUnit = null;\n this.initAdTimeout = false;\n /*** Local functions ***/\n\n function createVPAIDContainerEl() {\n var containerEl = document.createElement('div');\n dom.addClass(containerEl, 'VPAID-container');\n player.el().insertBefore(containerEl, player.controlBar.el());\n return containerEl;\n\n }\n this.EVENTS = [\n 'AdLoaded', 'AdStarted', 'AdStopped', 'AdSkipped', 'AdSkippableStateChange',\n 'AdSizeChange', 'AdLinearChange', 'AdDurationChange', 'AdExpandedChange',\n 'AdRemainingTimeChange', 'AdVolumeChange', 'AdImpression', 'AdVideoStart',\n 'AdVideoFirstQuartile', 'AdVideoMidpoint', 'AdVideoThirdQuartile',\n 'AdVideoComplete', 'AdClickThru', 'AdInteraction', 'AdUserAcceptInvitation',\n 'AdUserMinimize', 'AdUserClose', 'AdPaused', 'AdPlaying', 'AdLog', 'AdError'\n ];\n }\n\n //List of supported VPAID technologies\n VPAIDIntegrator.techs = [\n VPAIDFlashTech,\n VPAIDHTML5Tech\n ];\n\n //minthe : protoype.playAd\n VPAIDIntegrator.prototype.playAd = function playVPaidAd(vastResponse, callback, isTestPlay) {\n //flag to sperate logic for checking vpaid ad is valid\n isTestPlay = (isTestPlay && isTestPlay !== undefined ? isTestPlay : false);\n\n var that = this;\n var tech;\n var player = this.player;\n\n callback = callback || noop;\n if (!(vastResponse instanceof VASTResponse)) {\n return callback(new VASTError('on VASTIntegrator.playAd, missing required VASTResponse'));\n }\n\n tech = this._findSupportedTech(vastResponse, this.settings);\n dom.addClass(player.el(), 'vjs-vpaid-ad');\n\n player.on('vast.adsCancel', triggerVpaidAdEnd);\n player.one('vpaid.adEnd', function() {\n player.off('vast.adsCancel', triggerVpaidAdEnd);\n removeAdUnit();\n });\n\n if (tech) {\n\n //if it's test-play this routine will invoke initAd and return result to notify the creative is ready to go\n if (isTestPlay) {\n async.waterfall([\n function(next) {\n next(null, tech, vastResponse);\n },\n this._loadAdUnit.bind(this),\n this._initAdUnit.bind(this)\n ], function(error, adUnit, vastResponse) {\n if (error) {\n that._trackError(vastResponse);\n } else {\n player.trigger('an.readytogovpaid');\n }\n callback(error, vastResponse);\n });\n } else {\n var errorCallback = function(error, adUnit, vastResponse) {\n if (error) {\n that._trackError(vastResponse);\n }\n player.trigger('vpaid.adEnd');\n callback(error, vastResponse);\n };\n var taskList = [\n function(next) {\n next(null, that.initialisedAdUnit, vastResponse, true);\n },\n this._playAdUnit.bind(this)\n ];\n if (this.initialisedAdUnit) {\n async.waterfall(taskList, errorCallback);\n } else {\n if (this.initAdUnitCalled) {\n player.one(\"an.readytogovpaid\", function() {\n async.waterfall(taskList, errorCallback);\n });\n } else {\n async.waterfall([\n function(next) {\n next(null, tech, vastResponse);\n },\n this._loadAdUnit.bind(this),\n this._initAdUnit.bind(this),\n this._playAdUnit.bind(this)\n ], errorCallback);\n }\n }\n }\n\n this._adUnit = {\n _paused: true,\n _completed: false,\n type: 'VPAID',\n pauseAd: function() {\n player.trigger('vpaid.pauseAd');\n // VIDLA-1327-1329 Reverting back the pause which caused the regression.\n player.pause(true);\n },\n resumeAd: function() {\n player.trigger('vpaid.resumeAd');\n },\n isPaused: function() {\n return that.player.paused(true);\n },\n getSrc: function() {\n return tech.mediaFile;\n }\n };\n\n return this._adUnit;\n }\n\n callback(new VASTError('on VPAIDIntegrator.playAd, could not find a supported mediaFile'));\n\n return null;\n /*** Local functions ***/\n function triggerVpaidAdEnd() {\n player.trigger('vpaid.adEnd');\n }\n\n function removeAdUnit() {\n if (tech) {\n tech.unloadAdUnit();\n }\n dom.removeClass(player.el(), 'vjs-vpaid-ad');\n }\n };\n\n VPAIDIntegrator.prototype._findSupportedTech = function(vastResponse, settings) {\n if (!(vastResponse instanceof VASTResponse)) {\n return null;\n }\n\n var vpaidMediaFiles = vastResponse.mediaFiles.filter(vastUtil.isVPAID);\n var i, len, mediaFile, VPAIDTech;\n\n for (i = 0, len = vpaidMediaFiles.length; i < len; i += 1) {\n mediaFile = vpaidMediaFiles[i];\n VPAIDTech = findSupportedTech(mediaFile);\n if (VPAIDTech) {\n return new VPAIDTech(mediaFile, settings);\n }\n }\n\n return null;\n\n /*** Local functions ***/\n function findSupportedTech(mediafile) {\n var type = mediafile.type;\n var i, len, VPAIDTech;\n\n for (i = 0, len = VPAIDIntegrator.techs.length; i < len; i += 1) {\n VPAIDTech = VPAIDIntegrator.techs[i];\n if (VPAIDTech.supports(type)) {\n return VPAIDTech;\n }\n }\n return null;\n }\n };\n\n //minthe : loadAdUnit\n VPAIDIntegrator.prototype._loadAdUnit = function(tech, vastResponse, next) {\n if (this.initAdUnitCalled) {\n return;\n }\n var player = this.player;\n var vjsTechEl = player.el().querySelector('.vjs-tech');\n var adCancelTimeout = this.settings.adCancelTimeout || this.options.adCancelTimeout;\n var overlayPlayer = this.settings.overlayPlayer;\n var initialPlayback = this.settings.initialPlayback;\n var controlBarPosition = this.settings.controlBarPosition;\n tech.loadAdUnit(this.containerEl, vjsTechEl, function(error, adUnit) {\n if (error) {\n return next(error, adUnit, vastResponse);\n }\n\n try {\n var WrappedAdUnit = new VPAIDAdUnitWrapper(adUnit, { src: tech.mediaFile.src, adCancelTimeout: adCancelTimeout, overlayPlayer: overlayPlayer, initialPlayback: initialPlayback, controlBarPosition: controlBarPosition });\n WrappedAdUnit.player = player;\n var techClass = 'vjs-' + tech.name + '-ad';\n dom.addClass(player.el(), techClass);\n player.one('vpaid.adEnd', function() {\n dom.removeClass(player.el(), techClass);\n });\n //Entry point for player's skip button which trigger 'skip' event;\n player.on('skip', function() {\n WrappedAdUnit.skipAd();\n });\n next(null, WrappedAdUnit, vastResponse);\n } catch (e) {\n next(e, adUnit, vastResponse);\n }\n });\n };\n\n\n //minthe : _testAdUnit\n VPAIDIntegrator.prototype._initAdUnit = function(adUnit, vastResponse, callback) {\n if (this.initAdUnitCalled) {\n return;\n }\n this.initAdUnitCalled = true;\n async.waterfall([\n function(next) {\n next(null, adUnit, vastResponse);\n },\n this._handshake.bind(this),\n this._setupEvents.bind(this),\n this._initAd.bind(this)\n ], callback);\n };\n\n //minthe : _playAdUnit\n VPAIDIntegrator.prototype._playAdUnit = function(adUnit, vastResponse, callback) {\n async.waterfall([\n function(next) {\n next(null, adUnit, vastResponse);\n },\n this._linkPlayerControls.bind(this),\n this._startAd.bind(this)\n ], callback);\n };\n\n VPAIDIntegrator.prototype._handshake = function handshake(adUnit, vastResponse, next) {\n adUnit.handshakeVersion(this.options.VPAID_VERSION, function(error, version) {\n if (error) {\n return next(error, adUnit, vastResponse);\n }\n\n if (version && isSupportedVersion(version)) {\n return next(null, adUnit, vastResponse);\n }\n\n return next(new VASTError('on VPAIDIntegrator._handshake, unsupported version \"' + version + '\"'), adUnit, vastResponse);\n });\n\n function isSupportedVersion(version) {\n var majorNum = major(version);\n return majorNum >= 1 && majorNum <= 2;\n }\n\n function major(version) {\n var parts = version.split('.');\n return parseInt(parts[0], 10);\n }\n };\n\n //minthe : _initAd\n VPAIDIntegrator.prototype._initAd = function(adUnit, vastResponse, next) {\n var self = this;\n var tech = this.player.el().querySelector('.vjs-tech');\n var dimension = dom.getDimension(tech);\n // Reset the timeout flag\n self.initAdTimeout = false;\n\n timer.startInitAdTimeout(function(error) {\n self.initAdTimeout = true;\n self._reportTimeout(adUnit, error);\n });\n /*\n adUnit.initAd(dimension.width, dimension.height, this.VIEW_MODE.NORMAL, -1, {AdParameters: vastResponse.adParameters || ''}, function (error) {\n self.initialisedAdUnit = adUnit;\n next(error, adUnit, vastResponse);\n });\n */\n\n adUnit.initAd(dimension.width, dimension.height, this.VIEW_MODE.NORMAL, -1, { AdParameters: vastResponse.adParameters || '' }, self.settings.vpaidEnvironmentVars, function(error) {\n self.initialisedAdUnit = adUnit;\n next(error, adUnit, vastResponse);\n });\n };\n\n VPAIDIntegrator.prototype._setupEvents = function(adUnit, vastResponse, next) {\n var adUnitSrc = adUnit.options.src;\n var tracker = new VASTTracker(adUnitSrc, vastResponse);\n var player = this.player;\n var that = this;\n\n function setupEventCallbacks() {\n var cb = that.settings.vpaidEventCallback;\n if (!cb) return;\n that.EVENTS.forEach(function(event) {\n adUnit.on(event, function(data) {\n cb.call(this, event, data);\n });\n });\n };\n\n setupEventCallbacks();\n\n adUnit.on('AdLoaded', function() {\n adUnit._adLoaded = true;\n timer.stopInitAdTimeout();\n logger.info('VPAID event received :: AdLoaded, time = ' + profile.getInitTime() + ', time remaining = ' + profile.getRemainingTime('AdLoaded'));\n });\n\n //minthe2 AdStarted Handler\n //fix for VID-1525\n adUnit.on('AdStarted', function() {\n\n adUnit._adStarted = true;\n profile.adStartedTimestamp = new Date().getTime();\n\n if (that.settings.delayExpandUntilVPAIDImpression) {\n if (profile.adImpressionTimestamp !== 0 && profile.adStartedTimestamp !== 0) {\n timer.stopStartAdTimeout();\n }\n } else {\n timer.stopStartAdTimeout();\n }\n\n // if (profile.adImpressionTimestamp !== 0) {//if AdImpression is deliverd without AdStarted\n // profile.adLoadedTimestamp = profile.adImpressionTimestamp;\n // }\n\n\n if (!adUnit._adLoaded) {\n var remainingTime = profile.timeout - (profile.adStartedTimestamp - profile.initAdTimestamp);\n logger.info('VPAID event received :: AdStarted, time = ' + 0 + ', time remaining = ' + remainingTime + ', Out of order AdStarted');\n } else {\n if (that.settings.delayExpandUntilVPAIDImpression && profile.adImpressionTimestamp === 0) {\n logger.info('VPAID event received :: AdStarted');\n } else {\n logger.info('VPAID event received :: AdStarted, time = ' + profile.getStartTime() + ', total time = ' + profile.getTotalTime() + ', time remaining = ' + profile.getRemainingTime('AdStarted'));\n }\n }\n player.trigger('vpaid.AdStarted');\n tracker.trackCreativeView();\n notifyPlayToPlayer();\n\n\n //activate impression timer if it's not already started\n if (that.settings.delayExpandUntilVPAIDImpression && profile.adImpressionTimestamp === 0) {\n profile.adImpressionTimestamp = new Date().getTime();\n // timer.startAdImpressionTimeout(function (error) {\n // that._reportTimeout(adUnit, error);\n // });\n }\n if (isAndroid()) {\n ChiveFacebookHack();\n }\n });\n\n // For creatives that do not use the video tag provided by the player.\n function handleAdPlayPause() {\n // Ad creatives do not creative their own video tags on devices so no need to handle AdProgess timer\n // TODO : find more reliable way to figure out the video src set.\n if (isIDevice() || isAndroid()) {\n // VIDLA-421 (do not ignore pause/resume event handlers for overlay player)\n if (!adUnit.options.overlayPlayer) {\n return;\n }\n }\n\n // Ad uses video JS Slot\n if (isVideoSlotUsed()) {\n return;\n }\n var creative = adUnit._adUnit ? adUnit._adUnit._creative : null;\n\n if (adUnit.options.overlayPlayer) {\n // since no monkeypatch api is activated.\n player.on('pause', function() {\n if (adUnit._adUnit && creative) {\n that._adUnit.pauseAd();\n }\n });\n player.on('play', function() {\n if (adUnit._adUnit && creative) {\n that._adUnit.resumeAd();\n }\n });\n }\n\n //IE11 has an issue to not listen this pause event - VID-2405, VID-2406\n //video.js has their own event pooling sytem for video element and parent div of video element, the \"pause event\" area is so crowded for now - when vpaid player injects \"pause\" listener to player object on IE11, the video.js doesn't handle as well. looks like incorrect GUID setting problem in order to get events unique\n //for handling this vpaid-creative.pause by \"pause\" signal from video.js we don't have to stick with the crowded \"pause\" signal. we can do samething with differnet signal for this\n // player.on('pause', function(){\n // if(creative){\n // that._adUnit.pauseAd();\n // }\n // });\n player.on('apn-vpaid-pause', function() { //this \"apn-vpaid-pause\" will be dispatch from video.js pause.\n if (creative) {\n // that._adUnit.pauseAd();//no need to dispatch pause again to video.js because video.js already dispatch pause before triggered \"apn-vpaid-pause\". this will also cover a case showing pause button on the UI\n player.trigger('vpaid.pauseAd'); //vpaid video pause\n }\n });\n };\n\n // For creatives that do not use the video tag provided by the player.\n function handleAdProgress() {\n\n // Ad creatives do not creative their own video tags on devices so no need to handle AdProgess timer\n // TODO : find more reliable way to figure out the video src set.\n //if(isIDevice() || isAndroid()){\n if (isIDevice()) { //for VID-2597\n return;\n }\n\n // Ad uses video JS Slot\n if (isVideoSlotUsed()) {\n return;\n }\n\n // Ad is using its own Video slot.\n var creative = adUnit._adUnit._creative;\n var remainingTimeUnknown = false;\n\n function updateProgress() {\n var duration = creative.getAdDuration ? creative.getAdDuration() : 0;\n var remainingTime = creative.getAdRemainingTime ? creative.getAdRemainingTime() : -1;\n remainingTime = isNumber(remainingTime) ? remainingTime : -1;\n remainingTime = (remainingTime > duration) ? duration : remainingTime;//fix VIDLA-429\n var currentTime = duration - remainingTime;\n\n switch (remainingTime) {\n case -2:\n // If time is not currently known\n remainingTimeUnknown = true;\n player.controlBar.currentTimeDisplay.hide();\n player.controlBar.timeDivider.hide();\n player.controlBar.durationDisplay.hide();\n break;\n case -1:\n // If time is not implemeneted\n clearInterval(progressHandler);\n player.controlBar.currentTimeDisplay.hide();\n player.controlBar.timeDivider.hide();\n player.controlBar.durationDisplay.hide();\n break;\n case 0:\n clearInterval(progressHandler);\n break;\n default:\n if (remainingTimeUnknown) {\n remainingTimeUnknown = false;\n player.controlBar.currentTimeDisplay.show();\n player.controlBar.timeDivider.show();\n player.controlBar.durationDisplay.show();\n }\n player.currentTime(currentTime);\n player.controlBar.currentTimeDisplay.updateContent();\n player.duration(duration);\n player.controlBar.durationDisplay.updateContent();\n break;\n }\n }\n var progressHandler = setInterval(updateProgress, 200);\n updateProgress();\n }\n\n adUnit.on('AdSkipped', function() {\n logger.log('VPAID event received :: AdSkipped');\n if(!adUnit._adSkipped) {\n adUnit._adSkipped = true;\n player.trigger('vpaid.AdSkipped');\n tracker.trackSkip();\n }\n });\n\n\n //minthe2 AdImpression Handler\n adUnit.on('AdImpression', function() {\n\n profile.adImpressionTimestamp = new Date().getTime();\n\n\n if (that.settings.delayExpandUntilVPAIDImpression) {\n if (profile.adImpressionTimestamp !== 0 && profile.adStartedTimestamp !== 0) {\n timer.stopStartAdTimeout();\n }\n }\n\n // if (profile.adImpressionTimestamp !== 0) {//if AdImpression is deliverd without AdStarted\n // profile.adLoadedTimestamp = profile.adImpressionTimestamp;\n // }\n // if (profile.adStartedTimestamp === 0) {//if AdImpression is deliverd without AdStarted\n // profile.adStartedTimestamp = profile.adLoadedTimestamp;\n // }\n\n if (that.settings.delayExpandUntilVPAIDImpression && profile.adStartedTimestamp === 0) {\n logger.info('VPAID event received :: AdImpression');\n } else {\n logger.info('VPAID event received :: AdImpression, time = ' + profile.getAdImpressionTime() + ', total time = ' + profile.getTotalTime() + ', time remaining = ' + profile.getRemainingTime('AdImpression'));\n }\n\n\n player.trigger('vpaid.AdImpression');\n tracker.trackImpressions();\n if(adUnit._adUnit && adUnit._adUnit._creative){\n var creative = adUnit._adUnit._creative;\n var creativeIcons = false;\n if(creative.getAdIcons){\n creativeIcons = creative.getAdIcons();\n }\n player.trigger({type: 'vpaid.AdIcons', adIcons: creativeIcons});\n }\n });\n\n adUnit.on('AdVideoStart', function() {\n logger.info('VPAID event received :: AdVideoStart');\n\n // VIDLA-441 This is definitely when the Ad video has started and all the metadata is ready. AdStarted event may be too early\n handleAdPlayPause();\n handleAdProgress();\n\n player.trigger('vpaid.AdVideoStart');\n tracker.trackStart();\n notifyPlayToPlayer();\n if (that.settings.initialAudio === 'off') {\n player.muted(true);\n } else {\n player.muted(false);\n }\n linkVolumeControl();\n\n\n var controlBarPosition = adUnit.options.controlBarPosition ? adUnit.options.controlBarPosition : \"over\";\n if (controlBarPosition === \"over\") {\n var handleUserActive = function() {\n logger.debug(\"caught useractive\");\n resizeAd(player, adUnit, that.VIEW_MODE, true);\n logger.debug(\"did resizeAd\");\n };\n var handleUserInActive = function() {\n logger.debug(\"caught userinactive\");\n if (player.hasClass(\"vjs-paused\") === false || player.paused() === false || that._adUnit._completed === true) {//fix unnecessary resize after pause which can cause bad user experience with transparent controlbar color\n resizeAd(player, adUnit, that.VIEW_MODE, true);\n logger.debug(\"did resizeAd\");\n }\n };\n var handleManualUserActive = function() {\n logger.debug(\"caught handleManualUserActive\");\n setTimeout(function() {\n resizeAd(player, adUnit, that.VIEW_MODE, true, \"useractive\");\n logger.debug(\"did resizeAd\");\n },0);\n };\n var handleManualUserInActive = function(e) {\n logger.debug(\"caught handleManualUserInActive\");\n setTimeout(function() {\n resizeAd(player, adUnit, that.VIEW_MODE, true, \"userinactive\");\n logger.debug(\"did resizeAd\");\n },0);\n };\n\n //handle VPAID resize by useractive event from video.js\n player.on(\"useractive\", handleUserActive);\n\n //handle VPAID resize by userinactive event from video.js\n player.on(\"userinactive\", handleUserInActive);\n\n //handle VPAID resize by useractive event from video.js\n player.on(\"handleManualUserActive\", handleManualUserActive);\n\n //handle VPAID resize by userinactive event from video.js\n player.on(\"handleManualUserInActive\", handleManualUserInActive);\n\n }\n\n //VIDLA-2143\n //to figure out specific creative issue which has 1px of height after AdVideoStart\n //details here: https://stash.corp.appnexus.com/projects/VIDEO/repos/resources_video-ad-video-player-html5-plugin-vpaid/pull-requests/14/overview\n resizeAd(player, adUnit, that.VIEW_MODE, true);\n\n if (isIDevice()) {\n ChiveFacebookHack();\n }\n });\n\n // VID-3052 This is a temporary hack for FB creative autoplay on chive pages. Please see ticket for details.\n function ChiveFacebookHack() {\n var videoSlot = adUnit._adUnit._videoEl;\n if (adUnit.options.overlayPlayer && adUnit.options.initialPlayback === 'auto' && videoSlot.paused) {\n setTimeout(function() {\n // Overlay Chive hack for Facebook Creative\n logger.log('Applying Facebook Chive Hack');\n player.muted(true);\n that._adUnit.resumeAd();\n }, 1000);\n }\n };\n\n adUnit.on('AdPlaying', function() {\n logger.log('VPAID event received :: AdPlaying');\n timer.stopKillTimeout();\n player.trigger('vpaid.AdPlaying');\n tracker.trackResume();\n notifyPlayToPlayer();\n player.trigger(\"handleManualUserInActive\");\n });\n\n adUnit.on('AdPaused', function() {\n logger.log('VPAID event received :: AdPaused');\n timer.stopKillTimeout();\n player.trigger('vpaid.AdPaused');\n tracker.trackPause();\n notifyPauseToPlayer();\n player.trigger(\"handleManualUserActive\");\n });\n\n function notifyPlayToPlayer() {\n if (that._adUnit && that._adUnit.isPaused()) {\n that._adUnit._paused = false;\n }\n player.trigger('play');\n\n }\n\n function notifyPauseToPlayer() {\n if (that._adUnit) {\n that._adUnit._paused = true;\n }\n player.trigger('pause');\n }\n\n adUnit.on('AdVideoFirstQuartile', function() {\n logger.info('VPAID event received :: AdVideoFirstQuartile');\n player.trigger('vpaid.AdVideoFirstQuartile');\n tracker.trackFirstQuartile();\n });\n\n adUnit.on('AdVideoMidpoint', function() {\n logger.info('VPAID event received :: AdVideoMidpoint');\n player.trigger('vpaid.AdVideoMidpoint');\n tracker.trackMidpoint();\n });\n\n adUnit.on('AdVideoThirdQuartile', function() {\n logger.info('VPAID event received :: AdVideoThirdQuartile');\n player.trigger('vpaid.AdVideoThirdQuartile');\n tracker.trackThirdQuartile();\n });\n\n adUnit.on('AdVideoComplete', function() {\n logger.info('VPAID event received :: AdVideoComplete');\n player.trigger('vpaid.AdVideoComplete');\n tracker.trackComplete();\n that._adUnit._completed = true;\n });\n\n adUnit.on('AdClickThru', function(data) {\n player.trigger('vpaid.AdClickThru');\n });\n\n adUnit.on('AdUserAcceptInvitation', function() {\n player.trigger('vpaid.AdUserAcceptInvitation');\n tracker.trackAcceptInvitation();\n tracker.trackAcceptInvitationLinear();\n });\n\n adUnit.on('AdUserClose', function() {\n player.trigger('vpaid.AdUserClose');\n tracker.trackClose();\n tracker.trackCloseLinear();\n });\n\n adUnit.on('AdUserMinimize', function() {\n player.trigger('vpaid.AdUserMinimize');\n tracker.trackCollapse();\n });\n\n adUnit.on('AdError', function(message) {\n timer.stopAdTimeouts();\n logger.error('VPAID event received :: AdError : message : ' + message);\n //player.trigger('vast.adError');//TODO jeff's change for VID-583\n player.trigger('vpaid.AdError');\n //NOTE: we track errors code 901, as noted in VAST 3.0\n tracker.trackErrorWithCode(901);\n });\n\n adUnit.on('AdVolumeChange', function() {\n logger.debug('VPAID event received :: AdVolumeChange');\n player.trigger('vpaid.AdVolumeChange');\n });\n\n adUnit.on('AdStopped', function() {\n logger.info('VPAID event received :: AdStopped');\n adUnit._adStopped = true;\n player.trigger('vpaid.AdStopped');\n });\n\n var updateViewSize = resizeAd.bind(this, player, adUnit, this.VIEW_MODE);\n var autoResize = this.settings.autoResize;\n\n if (autoResize) {\n dom.addEventListener(window, 'resize', updateViewSize);\n dom.addEventListener(window, 'orientationchange', updateViewSize);\n }\n\n player.on('vast.resize', updateViewSize);\n player.on('vpaid.pauseAd', pauseAdUnit);\n player.on('vpaid.resumeAd', resumeAdUnit);\n\n player.one('vpaid.adEnd', function() {\n player.off('vast.resize', updateViewSize);\n player.off('vpaid.pauseAd', pauseAdUnit);\n player.off('vpaid.resumeAd', resumeAdUnit);\n\n if (autoResize) {\n dom.removeEventListener(window, 'resize', updateViewSize);\n dom.removeEventListener(window, 'orientationchange', updateViewSize);\n }\n });\n\n next(null, adUnit, vastResponse);\n\n /*** Local Functions ***/\n function pauseAdUnit() {\n adUnit.pauseAd(noop);\n }\n\n function resumeAdUnit() {\n adUnit.resumeAd(noop);\n }\n\n function isVideoSlotUsed() {\n var videoSlot = adUnit._adUnit._videoEl;\n var creative = adUnit._adUnit._creative;\n var hasSource = videoSlot && videoSlot.src;\n\n if (videoSlot && !hasSource) {\n var sources = videoSlot.getElementsByTagName('source');\n for (var i = 0; i < sources; i++) {\n if (sources[i].src) {\n hasSource = true;\n }\n }\n }\n\n // Ad uses video JS Slot\n if (!creative || !videoSlot || hasSource) {\n return true;\n }\n\n return false;\n }\n\n function linkVolumeControl() {\n // Ad uses video JS slot. Volume be controlled via Player Framework\n if (isVideoSlotUsed()) {\n return;\n }\n // for creatives that create own tag set initial volume appropriately\n adUnit.setAdVolume(that.initVolume, function(error, result) {\n if (error) {\n logger.log('The volume change is not implemented as part of the ad unit');\n } else {\n logger.debug('The volume change is implemented as part of the ad unit');\n }\n });\n // Ad is using its own Video slot. Volume be controlled by setAdVolume\n player.on('volumechange', updateAdUnitVolume);\n\n player.one('vpaid.adEnd', function() {\n player.off('volumechange', updateAdUnitVolume);\n });\n\n /*** local functions ***/\n function updateAdUnitVolume() {\n var vol;\n if (player.muted()) {\n vol = 0;\n } else {\n that.volume = player.volume() ? player.volume() : that.volume;\n vol = that.volume;\n }\n adUnit.setAdVolume(vol, logError);\n }\n }\n };\n\n VPAIDIntegrator.prototype._linkPlayerControls = function(adUnit, vastResponse, next) {\n var that = this;\n linkFullScreenControl(this.player, adUnit, this.VIEW_MODE);\n\n next(null, adUnit, vastResponse);\n\n /*** Local functions ***/\n\n function linkFullScreenControl(player, adUnit, VIEW_MODE) {\n var updateViewSize = resizeAd.bind(this, player, adUnit, VIEW_MODE);\n\n player.on('fullscreenchange', updateViewSize);\n\n player.on('fullscreenchange', function() {\n if (player.paused() || player.hasClass(\"vjs-paused\")) {\n player.trigger(\"handleManualUserActive\");\n }\n });\n\n player.one('vpaid.adEnd', function() {\n player.off('fullscreenchange', updateViewSize);\n });\n }\n };\n\n //minthe : _startAd\n VPAIDIntegrator.prototype._startAd = function(adUnit, vastResponse, next) {\n var self = this;\n var player = this.player;\n\n if (self.initAdTimeout) {\n return;\n }\n // VIDLA-245 IAS hack: If AdStarted is received before calling startAd then do not cap it with a timer.\n if (!adUnit._adStarted) {\n timer.startStartAdTimeout(function(error) {\n self._reportTimeout(adUnit, error);\n });\n } else {\n //Just set the timestamp correctly for VIDLA-245\n profile.startAdTimestamp = new Date().getTime();\n }\n adUnit.startAd(function(error) {\n if (!error) {\n player.trigger('vast.adStart');\n }\n });\n };\n\n\n VPAIDIntegrator.prototype._trackError = function trackError(response) {\n vastUtil.track(response.errorURLMacros, { ERRORCODE: 901 });\n };\n\n VPAIDIntegrator.prototype._reportTimeout = function(adUnit, error) {\n var player = this.player;\n player.trigger({ type: 'vast.adTimeout', error: error });\n try {\n if (adUnit && adUnit._adUnit) {\n logger.log(\"Calling VPAID stopAd on TIMEOUT\");\n adUnit._adUnit.stopAd();\n }\n } catch (e) {\n logger.log('VPAID error in calling stopAd on Timeout');\n }\n };\n\n function resizeAd(player, adUnit, VIEW_MODE, isAdVideoStart, manualUserActive) {\n\n var tech = player.el().querySelector('.vjs-tech');\n var dimension = dom.getDimension(tech);\n var width = dimension.width;\n var height = dimension.height;\n var MODE = player.isFullscreen() ? VIEW_MODE.FULLSCREEN : VIEW_MODE.NORMAL;\n\n var slot = adUnit._adUnit._el;\n var videoSlot = adUnit._adUnit._videoEl;\n var controlBar = player.controlBar;\n var needToUserActive = player.hasClass(\"vjs-controls-enabled\") && player.hasClass(\"vjs-has-started\") && player.hasClass(\"vjs-paused\");\n\n if (needToUserActive || player.userActive() || manualUserActive != undefined) {//if video.js's useractive status is true by mousemove\n\n if (needToUserActive) {\n manualUserActive = \"useractive\";\n }\n\n var controlBarPosition = adUnit.options.controlBarPosition ? adUnit.options.controlBarPosition : \"over\";\n var currentControlBarHeight = (manualUserActive === \"userinactive\") ? 0 : controlBar.height();\n var controlBarHeight = (controlBar && controlBarPosition === \"over\") ? currentControlBarHeight : 0;\n\n if (controlBar && controlBarHeight && player.hasClass(\"vjs-ended\") === false) {\n height = dimension.height - controlBarHeight;\n }\n }\n\n //Resize both slot and video slot (Ads could use either or both)\n if (slot && videoSlot) {\n slot.style.height = height + 'px';\n videoSlot.style.height = height + 'px';\n }\n\n //VIDLA-2143\n //To figure out specific creative issue which has 1px of height after AdVideoStart\n //details here: https://stash.corp.appnexus.com/projects/VIDEO/repos/resources_video-ad-video-player-html5-plugin-vpaid/pull-requests/14/overview\n if (isAdVideoStart && isAdVideoStart === true) {\n adUnit.resizeAd(width + 1, height + 1, MODE, logError);\n adUnit.resizeAd(width, height, MODE, logError);\n } else {\n adUnit.resizeAd(width, height, MODE, logError);\n }\n };\n\n function logError(error) {\n if (error) {\n logger.log('ERROR: ' + error.message);\n }\n };\n\n function Ad(adJTree) {\n if (!(this instanceof Ad)) {\n return new Ad(adJTree);\n }\n\n this.id = adJTree.attr('id');\n this.sequence = adJTree.attr('sequence');\n\n if (adJTree.inLine) {\n this.inLine = new InLine(adJTree.inLine);\n }\n\n if (adJTree.wrapper) {\n this.wrapper = new Wrapper(adJTree.wrapper);\n }\n };\n\n function Creative(creativeJTree) {\n if (!(this instanceof Creative)) {\n return new Creative(creativeJTree);\n }\n\n this.id = creativeJTree.attr('id');\n this.sequence = creativeJTree.attr('sequence');\n this.adId = creativeJTree.attr('adId');\n this.apiFramework = creativeJTree.attr('apiFramework');\n\n if (creativeJTree.linear) {\n this.linear = new Linear(creativeJTree.linear);\n }\n };\n\n function InLine(inlineJTree) {\n if (!(this instanceof InLine)) {\n return new InLine(inlineJTree);\n }\n\n //Required Fields\n this.adTitle = xml.keyValue(inlineJTree.adTitle);\n this.adSystem = xml.keyValue(inlineJTree.adSystem);\n this.impressions = vastUtil.parseImpressions(inlineJTree.impression);\n this.creatives = vastUtil.parseCreatives(inlineJTree.creatives);\n\n //Optional Fields\n this.description = xml.keyValue(inlineJTree.description);\n this.advertiser = xml.keyValue(inlineJTree.advertiser);\n this.surveys = parseSurveys(inlineJTree.survey);\n this.error = xml.keyValue(inlineJTree.error);\n this.pricing = xml.keyValue(inlineJTree.pricing);\n this.extensions = inlineJTree.extensions;\n\n /*** Local Functions ***/\n function parseSurveys(inlineSurveys) {\n if (inlineSurveys) {\n return transformArray(isArray(inlineSurveys) ? inlineSurveys : [inlineSurveys], function(survey) {\n if (isNotEmptyString(survey.keyValue)) {\n return {\n uri: survey.keyValue,\n type: survey.attr('type')\n };\n }\n\n return undefined;\n });\n }\n return [];\n }\n };\n\n function Linear(linearJTree) {\n if (!(this instanceof Linear)) {\n return new Linear(linearJTree);\n }\n\n //Required Elements\n this.duration = vastUtil.parseDuration(xml.keyValue(linearJTree.duration));\n this.mediaFiles = parseMediaFiles(linearJTree.mediaFiles && linearJTree.mediaFiles.mediaFile);\n\n //Optional fields\n this.trackingEvents = parseTrackingEvents(linearJTree.trackingEvents && linearJTree.trackingEvents.tracking, this.duration);\n this.skipoffset = vastUtil.parseOffset(xml.attr(linearJTree, 'skipoffset'), this.duration);\n\n if (linearJTree.videoClicks) {\n this.videoClicks = new VideoClicks(linearJTree.videoClicks);\n }\n\n if (linearJTree.adParameters) {\n this.adParameters = xml.keyValue(linearJTree.adParameters);\n\n if (xml.attr(linearJTree.adParameters, 'xmlEncoded')) {\n this.adParameters = xml.decode(this.adParameters);\n }\n }\n\n /*** Local functions ***/\n function parseTrackingEvents(trackingEvents, duration) {\n var trackings = [];\n if (isDefined(trackingEvents)) {\n trackingEvents = isArray(trackingEvents) ? trackingEvents : [trackingEvents];\n trackingEvents.forEach(function(trackingData) {\n trackings.push(new TrackingEvent(trackingData, duration));\n });\n }\n return trackings;\n }\n\n function parseMediaFiles(mediaFilesJxonTree) {\n var mediaFiles = [];\n if (isDefined(mediaFilesJxonTree)) {\n mediaFilesJxonTree = isArray(mediaFilesJxonTree) ? mediaFilesJxonTree : [mediaFilesJxonTree];\n\n mediaFilesJxonTree.forEach(function(mfData) {\n mediaFiles.push(new MediaFile(mfData));\n });\n }\n return mediaFiles;\n }\n };\n\n function MediaFile(mediaFileJTree) {\n if (!(this instanceof MediaFile)) {\n return new MediaFile(mediaFileJTree);\n }\n\n //Required attributes\n this.src = xml.keyValue(mediaFileJTree);\n this.delivery = mediaFileJTree.attr('delivery');\n this.type = mediaFileJTree.attr('type');\n this.width = mediaFileJTree.attr('width');\n this.height = mediaFileJTree.attr('height');\n\n //Optional attributes\n this.codec = mediaFileJTree.attr('codec');\n this.id = mediaFileJTree.attr('id');\n this.bitrate = mediaFileJTree.attr('bitrate');\n this.minBitrate = mediaFileJTree.attr('minBitrate');\n this.maxBitrate = mediaFileJTree.attr('maxBitrate');\n this.scalable = mediaFileJTree.attr('scalable');\n this.maintainAspectRatio = mediaFileJTree.attr('maintainAspectRatio');\n this.apiFramework = mediaFileJTree.attr('apiFramework');\n };\n\n function TrackingEvent(trackingJTree, duration) {\n if (!(this instanceof TrackingEvent)) {\n return new TrackingEvent(trackingJTree, duration);\n }\n\n this.name = trackingJTree.attr('event');\n this.uri = xml.keyValue(trackingJTree);\n\n if ('progress' === this.name) {\n this.offset = vastUtil.parseOffset(trackingJTree.attr('offset'), duration);\n }\n }\n\n ;\n\n //minthe : VASTClient initialize\n function VASTClient(options) {\n\n if (!(this instanceof VASTClient)) {\n return new VASTClient(options);\n }\n var defaultOptions = {\n WRAPPER_LIMIT: 5\n };\n\n options = options || {};\n this.settings = extend({}, options, defaultOptions);\n this.errorURLMacros = [];\n }\n\n VASTClient.prototype.getVASTResponse = function getVASTResponse(adTagUrl, callback) {\n var that = this;\n\n var error = sanityCheck(adTagUrl, callback);\n if (error) {\n if (isFunction(callback)) {\n return callback(error);\n }\n throw error;\n }\n\n async.waterfall([\n this._getVASTAd.bind(this, adTagUrl),\n buildVASTResponse\n ],\n callback);\n\n /*** Local functions ***/\n function buildVASTResponse(adsChain, cb) {\n try {\n var response = that._buildVASTResponse(adsChain);\n cb(null, response);\n } catch (e) {\n cb(e);\n }\n }\n\n function sanityCheck(adTagUrl, cb) {\n if (!adTagUrl) {\n return new VASTError('on VASTClient.getVASTResponse, missing ad tag URL');\n }\n\n if (!isFunction(cb)) {\n return new VASTError('on VASTClient.getVASTResponse, missing callback function');\n }\n }\n };\n\n VASTClient.prototype._getVASTAd = function(adTagUrl, callback) {\n var that = this;\n\n getAdWaterfall(adTagUrl, function(error, vastTree) {\n var waterfallAds = vastTree && isArray(vastTree.ads) ? vastTree.ads : null;\n if (error) {\n that._trackError(error, waterfallAds);\n return callback(error, waterfallAds);\n }\n\n getAd(waterfallAds.shift(), [], waterfallHandler);\n\n /*** Local functions ***/\n function waterfallHandler(error, adChain) {\n if (error) {\n that._trackError(error, adChain);\n if (waterfallAds.length > 0) {\n getAd(waterfallAds.shift(), [], waterfallHandler);\n } else {\n callback(error, adChain);\n }\n } else {\n callback(null, adChain);\n }\n }\n });\n\n /*** Local functions ***/\n function getAdWaterfall(adTagUrl, callback) {\n var requestVastXML = that._requestVASTXml.bind(that, adTagUrl);\n async.waterfall([\n requestVastXML,\n buildVastWaterfall\n ], callback);\n }\n\n function buildVastWaterfall(xmlStr, callback) {\n var vastTree;\n try {\n vastTree = xml.toJXONTree(xmlStr);\n vastTree.ads = isArray(vastTree.ad) ? vastTree.ad : [vastTree.ad];\n callback(validateVASTTree(vastTree), vastTree);\n } catch (e) {\n callback(new VASTError(\"on VASTClient.getVASTAd.buildVastWaterfall, error parsing xml\", 100), null);\n }\n }\n\n function validateVASTTree(vastTree) {\n var vastVersion = xml.attr(vastTree, 'version');\n\n if (!vastTree.ad) {\n return new VASTError('on VASTClient.getVASTAd.validateVASTTree, no Ad in VAST tree', 303);\n }\n\n if (vastVersion && (vastVersion != 3 && vastVersion != 2)) {\n return new VASTError('on VASTClient.getVASTAd.validateVASTTree, not supported VAST version \"' + vastVersion + '\"', 102);\n }\n\n return null;\n }\n\n function getAd(adTagUrl, adChain, callback) {\n if (adChain.length >= that.WRAPPER_LIMIT) {\n return callback(new VASTError(\"on VASTClient.getVASTAd.getAd, players wrapper limit reached (the limit is \" + that.WRAPPER_LIMIT + \")\", 302), adChain);\n }\n\n async.waterfall([\n function(next) {\n if (isString(adTagUrl)) {\n requestVASTAd(adTagUrl, next);\n } else {\n next(null, adTagUrl);\n }\n },\n buildAd\n ], function(error, ad) {\n if (ad) {\n adChain.push(ad);\n }\n\n if (error) {\n return callback(error, adChain);\n }\n\n if (ad.wrapper) {\n return getAd(ad.wrapper.VASTAdTagURI, adChain, callback);\n }\n\n return callback(null, adChain);\n });\n }\n\n function buildAd(adJxonTree, callback) {\n try {\n var ad = new Ad(adJxonTree);\n callback(validateAd(ad), ad);\n } catch (e) {\n callback(new VASTError('on VASTClient.getVASTAd.buildAd, error parsing xml', 100), null);\n }\n }\n\n function validateAd(ad) {\n var wrapper = ad.wrapper;\n var inLine = ad.inLine;\n var errMsgPrefix = 'on VASTClient.getVASTAd.validateAd, ';\n\n if (inLine && wrapper) {\n return new VASTError(errMsgPrefix + \"InLine and Wrapper both found on the same Ad\", 101);\n }\n\n if (!inLine && !wrapper) {\n return new VASTError(errMsgPrefix + \"nor wrapper nor inline elements found on the Ad\", 101);\n }\n\n if (inLine && inLine.creatives.length === 0) {\n return new VASTError(errMsgPrefix + \"missing creative in InLine element\", 101);\n }\n\n if (wrapper && !wrapper.VASTAdTagURI) {\n return new VASTError(errMsgPrefix + \"missing 'VASTAdTagURI' in wrapper\", 101);\n }\n }\n\n function requestVASTAd(adTagUrl, callback) {\n that._requestVASTXml(adTagUrl, function(error, xmlStr) {\n if (error) {\n return callback(error);\n }\n try {\n var vastTree = xml.toJXONTree(xmlStr);\n callback(validateVASTTree(vastTree), vastTree.ad);\n } catch (e) {\n callback(new VASTError(\"on VASTClient.getVASTAd.requestVASTAd, error parsing xml\", 100));\n }\n });\n }\n };\n\n VASTClient.prototype._requestVASTXml = function requestVASTXml(adTagUrl, callback) {\n try {\n if (isFunction(adTagUrl)) {\n adTagUrl(requestHandler);\n } else {\n http.get(adTagUrl, requestHandler, {\n withCredentials: true\n });\n }\n } catch (e) {\n callback(e);\n }\n\n /*** Local functions ***/\n function requestHandler(error, response, status) {\n if (error) {\n var errMsg = isDefined(status) ?\n \"on VASTClient.requestVastXML, HTTP request error with status '\" + status + \"'\" :\n \"on VASTClient.requestVastXML, Error getting the the VAST XML with he passed adTagXML fn\";\n return callback(new VASTError(errMsg, 301), null);\n }\n\n callback(null, response);\n }\n };\n\n VASTClient.prototype._buildVASTResponse = function buildVASTResponse(adsChain) {\n var response = new VASTResponse();\n addAdsToResponse(response, adsChain);\n validateResponse(response);\n\n return response;\n\n //*** Local function ****\n function addAdsToResponse(response, ads) {\n ads.forEach(function(ad) {\n response.addAd(ad);\n });\n }\n\n function validateResponse(response) {\n var progressEvents = response.trackingEvents.progress;\n\n if (!response.hasLinear()) {\n throw new VASTError(\"on VASTClient._buildVASTResponse, Received an Ad type that is not supported\", 200);\n }\n\n if (response.duration === undefined) {\n throw new VASTError(\"on VASTClient._buildVASTResponse, Missing duration field in VAST response\", 101);\n }\n\n if (progressEvents) {\n progressEvents.forEach(function(progressEvent) {\n if (!isNumber(progressEvent.offset)) {\n throw new VASTError(\"on VASTClient._buildVASTResponse, missing or wrong offset attribute on progress tracking event\", 101);\n }\n });\n }\n }\n };\n\n VASTClient.prototype._trackError = function(error, adChain) {\n if (!isArray(adChain) || adChain.length === 0) { //There is nothing to track\n return;\n }\n\n var errorURLMacros = [];\n adChain.forEach(addErrorUrlMacros);\n vastUtil.track(errorURLMacros, { ERRORCODE: error.code || 900 }); //900 <== Undefined error\n\n /*** Local functions ***/\n function addErrorUrlMacros(ad) {\n if (ad.wrapper && ad.wrapper.error) {\n errorURLMacros.push(ad.wrapper.error);\n }\n\n if (ad.inLine && ad.inLine.error) {\n errorURLMacros.push(ad.inLine.error);\n }\n }\n };\n\n ;\n var VAST = {};\n\n function VASTError(message, code) {\n this.message = 'VAST Error: ' + (message || '');\n if (code) {\n this.code = code;\n }\n }\n\n VASTError.prototype = new Error();\n VASTError.prototype.name = \"VAST Error\";;\n /**\n * Inner helper class that deals with the logic of the individual steps needed to setup an ad in the player.\n *\n * @param player {object} instance of the player that will play the ad. It assumes that the videojs-contrib-ads plugin\n * has been initialized when you use its utility functions.\n *\n * @constructor\n */\n function VASTIntegrator(player) {\n if (!(this instanceof VASTIntegrator)) {\n return new VASTIntegrator(player);\n }\n\n this.player = player;\n }\n\n VASTIntegrator.prototype.playAd = function playAd(vastResponse, callback) {\n var that = this;\n callback = callback || noop;\n\n if (!(vastResponse instanceof VASTResponse)) {\n return callback(new VASTError('On VASTIntegrator, missing required VASTResponse'));\n }\n\n async.waterfall([\n function(next) {\n next(null, vastResponse);\n },\n this._selectAdSource.bind(this),\n this._createVASTTracker.bind(this),\n this._addClickThrough.bind(this),\n this._setupEvents.bind(this),\n this._playSelectedAd.bind(this)\n ], function(error, response) {\n if (error && response) {\n that._trackError(error, response);\n }\n callback(error, response);\n });\n\n this._adUnit = {\n _src: null,\n type: 'VAST',\n pauseAd: function() {\n that.player.pause(true); //video.js player pause\n },\n\n resumeAd: function() {\n that.player.play(true);\n },\n\n isPaused: function() {\n return that.player.paused(true);\n },\n\n getSrc: function() {\n return this._src;\n }\n };\n\n return this._adUnit;\n };\n\n VASTIntegrator.prototype._selectAdSource = function selectAdSource(response, callback) {\n var source;\n\n var playerWidth = dom.getDimension(this.player.el()).width;\n response.mediaFiles.sort(function compareTo(a, b) {\n var deltaA = Math.abs(playerWidth - a.width);\n var deltaB = Math.abs(playerWidth - b.width);\n return deltaA - deltaB;\n });\n\n source = this.player.selectSource(response.mediaFiles).source;\n\n if (source) {\n if (this._adUnit) {\n this._adUnit._src = source;\n }\n return callback(null, source, response);\n }\n\n // code 403 <== Couldn't find MediaFile that is supported by this video player\n callback(new VASTError(\"Could not find Ad mediafile supported by this player\", 403), response);\n };\n\n VASTIntegrator.prototype._createVASTTracker = function createVASTTracker(adMediaFile, response, callback) {\n try {\n callback(null, adMediaFile, new VASTTracker(adMediaFile.src, response), response);\n } catch (e) {\n callback(e, response);\n }\n };\n\n VASTIntegrator.prototype._setupEvents = function setupEvents(adMediaFile, tracker, response, callback) {\n var previouslyMuted;\n var player = this.player;\n player.on('fullscreenchange', trackFullscreenChange);\n player.on('vast.adStart', trackImpressions);\n player.on('pause', trackPause);\n player.on('timeupdate', trackProgress);\n player.on('volumechange', trackVolumeChange);\n\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel'], unbindEvents);\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel', 'vast.adSkip'], function(evt) {\n if (evt.type === 'vast.adEnd') {\n tracker.trackComplete();\n }\n });\n\n return callback(null, adMediaFile, response);\n\n /*** Local Functions ***/\n function unbindEvents() {\n player.off('fullscreenchange', trackFullscreenChange);\n player.off('vast.adStart', trackImpressions);\n player.off('pause', trackPause);\n player.off('timeupdate', trackProgress);\n player.off('volumechange', trackVolumeChange);\n }\n\n function trackFullscreenChange() {\n if (player.isFullscreen()) {\n tracker.trackFullscreen();\n } else {\n tracker.trackExitFullscreen();\n }\n }\n\n function trackPause() {\n //NOTE: whenever a video ends the video Element triggers a 'pause' event before the 'ended' event.\n // We should not track this pause event because it makes the VAST tracking confusing again we use a\n // Threshold of 2 seconds to prevent false positives on IOS.\n if (Math.abs(player.duration() - player.currentTime()) < 2) {\n return;\n }\n\n tracker.trackPause();\n playerUtils.once(player, ['play', 'vast.adEnd', 'vast.adsCancel'], function(evt) {\n if (evt.type === 'play') {\n tracker.trackResume();\n }\n });\n }\n\n function trackProgress() {\n var currentTimeInMs = player.currentTime() * 1000;\n tracker.trackProgress(currentTimeInMs);\n }\n\n function trackImpressions() {\n tracker.trackImpressions();\n tracker.trackCreativeView();\n }\n\n function trackVolumeChange() {\n var muted = player.muted();\n if (muted) {\n tracker.trackMute();\n } else if (previouslyMuted) {\n tracker.trackUnmute();\n }\n previouslyMuted = muted;\n }\n };\n\n VASTIntegrator.prototype._addClickThrough = function addClickThrough(mediaFile, tracker, response, callback) {\n var player = this.player;\n var blocker = createClickThroughBlocker(player, tracker, response);\n var updateBlocker = updateBlockerURL.bind(this, blocker, response, player);\n\n player.el().insertBefore(blocker, player.controlBar.el());\n player.on('timeupdate', updateBlocker);\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel'], removeBlocker);\n\n return callback(null, mediaFile, tracker, response);\n\n /*** Local Functions ***/\n\n function createClickThroughBlocker(player, tracker, response) {\n var blocker = window.document.createElement(\"a\");\n var clickThroughMacro = response.clickThrough;\n\n dom.addClass(blocker, 'vast-blocker');\n blocker.href = generateClickThroughURL(clickThroughMacro, player);\n\n if (isString(clickThroughMacro)) {\n blocker.target = \"_blank\";\n }\n\n blocker.onclick = function(e) {\n if (player.paused()) {\n player.play();\n\n //We prevent event propagation to avoid problems with the player's normal pause mechanism\n if (window.Event.prototype.stopPropagation !== undefined) {\n e.stopPropagation();\n }\n return false;\n }\n\n player.pause();\n tracker.trackClick();\n };\n\n return blocker;\n }\n\n function updateBlockerURL(blocker, response, player) {\n blocker.href = generateClickThroughURL(response.clickThrough, player);\n }\n\n function generateClickThroughURL(clickThroughMacro, player) {\n var variables = {\n ASSETURI: mediaFile.src,\n CONTENTPLAYHEAD: vastUtil.formatProgress(player.currentTime() * 1000)\n };\n\n return clickThroughMacro ? vastUtil.parseURLMacro(clickThroughMacro, variables) : '#';\n }\n\n function removeBlocker() {\n player.off('timeupdate', updateBlocker);\n dom.remove(blocker);\n }\n };\n\n VASTIntegrator.prototype._playSelectedAd = function playSelectedAd(source, response, callback) {\n var player = this.player;\n\n player.preload(\"auto\"); //without preload=auto the durationchange event is never fired\n player.src(source);\n\n playerUtils.once(player, ['durationchange', 'error', 'vast.adsCancel'], function(evt) {\n if (evt.type === 'durationchange') {\n playAd();\n } else if (evt.type === 'error') {\n callback(new VASTError(\"on VASTIntegrator, Player is unable to play the Ad\", 400), response);\n }\n //NOTE: If the ads get canceled we do nothing/\n });\n\n /**** local functions ******/\n function playAd() {\n player.play();\n playerUtils.once(player, ['playing', 'vast.adsCancel'], function(evt) {\n if (evt.type === 'vast.adsCancel') {\n return;\n }\n\n player.trigger('vast.adStart');\n\n playerUtils.once(player, ['ended', 'vast.adsCancel', 'vast.adSkip'], function(evt) {\n if (evt.type === 'ended' || evt.type === 'vast.adSkip') {\n callback(null, response);\n }\n //NOTE: if the ads get cancel we do nothing\n });\n });\n }\n };\n\n VASTIntegrator.prototype._trackError = function trackError(error, response) {\n vastUtil.track(response.errorURLMacros, { ERRORCODE: error.code || 900 });\n };\n\n ;\n (function(window) {\n \"use strict\";\n\n\n function VASTResponse() {\n if (!(this instanceof VASTResponse)) {\n return new VASTResponse();\n }\n\n this._linearAdded = false;\n this.ads = [];\n this.errorURLMacros = [];\n this.impressions = [];\n this.clickTrackings = [];\n this.customClicks = [];\n this.trackingEvents = {};\n this.mediaFiles = [];\n this.clickThrough = undefined;\n this.adTitle = '';\n this.duration = undefined;\n this.skipoffset = undefined;\n }\n\n VASTResponse.prototype.addAd = function(ad) {\n var inLine, wrapper;\n\n if (ad instanceof Ad) {\n inLine = ad.inLine;\n wrapper = ad.wrapper;\n\n this.ads.push(ad);\n\n if (inLine) {\n this._addInLine(inLine);\n }\n\n if (wrapper) {\n this._addWrapper(wrapper);\n }\n }\n };\n\n VASTResponse.prototype._addErrorTrackUrl = function(error) {\n var errorURL = error instanceof xml.JXONTree ? xml.keyValue(error) : error;\n if (errorURL) {\n this.errorURLMacros.push(errorURL);\n }\n };\n\n VASTResponse.prototype._addImpressions = function(impressions) {\n isArray(impressions) && appendToArray(this.impressions, impressions);\n };\n\n VASTResponse.prototype._addClickThrough = function(clickThrough) {\n if (isNotEmptyString(clickThrough)) {\n this.clickThrough = clickThrough;\n }\n };\n\n VASTResponse.prototype._addClickTrackings = function(clickTrackings) {\n isArray(clickTrackings) && appendToArray(this.clickTrackings, clickTrackings);\n };\n\n VASTResponse.prototype._addCustomClicks = function(customClicks) {\n isArray(customClicks) && appendToArray(this.customClicks, customClicks);\n };\n\n VASTResponse.prototype._addTrackingEvents = function(trackingEvents) {\n var eventsMap = this.trackingEvents;\n\n if (trackingEvents) {\n trackingEvents = isArray(trackingEvents) ? trackingEvents : [trackingEvents];\n trackingEvents.forEach(function(trackingEvent) {\n if (!eventsMap[trackingEvent.name]) {\n eventsMap[trackingEvent.name] = [];\n }\n eventsMap[trackingEvent.name].push(trackingEvent);\n });\n }\n };\n\n VASTResponse.prototype._addTitle = function(title) {\n if (isNotEmptyString(title)) {\n this.adTitle = title;\n }\n };\n\n VASTResponse.prototype._addDuration = function(duration) {\n if (isNumber(duration)) {\n this.duration = duration;\n }\n };\n\n VASTResponse.prototype._addVideoClicks = function(videoClicks) {\n if (videoClicks instanceof VideoClicks) {\n this._addClickThrough(videoClicks.clickThrough);\n this._addClickTrackings(videoClicks.clickTrackings);\n this._addCustomClicks(videoClicks.customClicks);\n }\n };\n\n VASTResponse.prototype._addMediaFiles = function(mediaFiles) {\n isArray(mediaFiles) && appendToArray(this.mediaFiles, mediaFiles);\n };\n\n VASTResponse.prototype._addSkipoffset = function(offset) {\n if (offset) {\n this.skipoffset = offset;\n }\n };\n\n VASTResponse.prototype._addAdParameters = function(adParameters) {\n if (adParameters) {\n this.adParameters = adParameters;\n }\n };\n\n VASTResponse.prototype._addLinear = function(linear) {\n if (linear instanceof Linear) {\n this._addDuration(linear.duration);\n this._addTrackingEvents(linear.trackingEvents);\n this._addVideoClicks(linear.videoClicks);\n this._addMediaFiles(linear.mediaFiles);\n this._addSkipoffset(linear.skipoffset);\n this._addAdParameters(linear.adParameters);\n this._linearAdded = true;\n }\n };\n\n VASTResponse.prototype._addInLine = function(inLine) {\n var that = this;\n\n if (inLine instanceof InLine) {\n this._addTitle(inLine.adTitle);\n this._addErrorTrackUrl(inLine.error);\n this._addImpressions(inLine.impressions);\n\n inLine.creatives.forEach(function(creative) {\n if (creative.linear) {\n that._addLinear(creative.linear);\n }\n });\n }\n };\n\n VASTResponse.prototype._addWrapper = function(wrapper) {\n var that = this;\n\n if (wrapper instanceof Wrapper) {\n this._addErrorTrackUrl(wrapper.error);\n this._addImpressions(wrapper.impressions);\n\n wrapper.creatives.forEach(function(creative) {\n var linear = creative.linear;\n if (linear) {\n that._addVideoClicks(linear.videoClicks);\n that.clickThrough = undefined; //We ensure that no clickThrough has been added\n that._addTrackingEvents(linear.trackingEvents);\n }\n });\n }\n };\n\n VASTResponse.prototype.hasLinear = function() {\n return this._linearAdded;\n };\n\n function appendToArray(array, items) {\n items.forEach(function(item) {\n array.push(item);\n });\n }\n\n window.VASTResponse = VASTResponse;\n })(window);\n\n ;\n\n function VASTTracker(assetURI, vastResponse) {\n if (!(this instanceof VASTTracker)) {\n return new VASTTracker(assetURI, vastResponse);\n }\n\n sanityCheck(assetURI, vastResponse);\n this.response = vastResponse;\n this.assetURI = assetURI;\n this.progress = 0;\n this.quartiles = {\n firstQuartile: { tracked: false, time: Math.round(25 * vastResponse.duration) / 100 },\n midpoint: { tracked: false, time: Math.round(50 * vastResponse.duration) / 100 },\n thirdQuartile: { tracked: false, time: Math.round(75 * vastResponse.duration) / 100 }\n };\n\n /*** Local Functions ***/\n function sanityCheck(assetURI, vastResponse) {\n if (!isString(assetURI) || isEmptyString(assetURI)) {\n throw new VASTError('on VASTTracker constructor, missing required the URI of the ad asset being played');\n }\n\n if (!(vastResponse instanceof VASTResponse)) {\n throw new VASTError('on VASTTracker constructor, missing required VAST response');\n }\n }\n }\n\n VASTTracker.prototype.trackURLs = function trackURLs(urls, variables) {\n if (isArray(urls) && urls.length > 0) {\n variables = extend({\n ASSETURI: this.assetURI,\n CONTENTPLAYHEAD: vastUtil.formatProgress(this.progress)\n }, variables || {});\n\n vastUtil.track(urls, variables);\n }\n };\n\n VASTTracker.prototype.trackEvent = function trackEvent(eventName, trackOnce) {\n this.trackURLs(getEventUris(this.response.trackingEvents[eventName]));\n if (trackOnce) {\n this.response.trackingEvents[eventName] = undefined;\n }\n\n /*** Local function ***/\n function getEventUris(trackingEvents) {\n var uris;\n\n if (trackingEvents) {\n uris = [];\n trackingEvents.forEach(function(event) {\n uris.push(event.uri);\n });\n }\n return uris;\n }\n };\n\n VASTTracker.prototype.trackProgress = function trackProgress(newProgressInMs) {\n var events = [];\n var ONCE = true;\n var ALWAYS = false;\n var trackingEvents = this.response.trackingEvents;\n\n if (isNumber(newProgressInMs)) {\n addTrackEvent('start', ONCE, newProgressInMs > 0);\n addTrackEvent('rewind', ALWAYS, hasRewound(this.progress, newProgressInMs));\n addQuartileEvents.call(this, newProgressInMs);\n trackProgressEvents.call(this, newProgressInMs);\n trackEvents.call(this);\n this.progress = newProgressInMs;\n }\n\n /*** Local function ***/\n function hasRewound(currentProgress, newProgress) {\n var REWIND_THRESHOLD = 3000; //IOS video clock is very unreliable and we need a 3 seconds threshold to ensure that there was a rewind an that it was on purpose.\n return currentProgress > newProgressInMs && Math.abs(newProgress - currentProgress) > REWIND_THRESHOLD;\n }\n\n function addTrackEvent(eventName, trackOnce, canBeAdded) {\n if (trackingEvents[eventName] && canBeAdded) {\n events.push({\n name: eventName,\n trackOnce: !!trackOnce\n });\n }\n }\n\n function addQuartileEvents(progress) {\n var quartiles = this.quartiles;\n var firstQuartile = this.quartiles.firstQuartile;\n var midpoint = this.quartiles.midpoint;\n var thirdQuartile = this.quartiles.thirdQuartile;\n\n if (!firstQuartile.tracked) {\n trackQuartile('firstQuartile', progress);\n } else if (!midpoint.tracked) {\n trackQuartile('midpoint', progress);\n } else {\n trackQuartile('thirdQuartile', progress);\n }\n\n /*** Local function ***/\n function trackQuartile(quartileName, progress) {\n var quartile = quartiles[quartileName];\n if (canBeTracked(quartile, progress)) {\n quartile.tracked = true;\n addTrackEvent(quartileName, ONCE, true);\n }\n }\n }\n\n function canBeTracked(quartile, progress) {\n var quartileTime = quartile.time;\n //We only fire the quartile event if the progress is bigger than the quartile time by 5 seconds at most.\n return progress >= quartileTime && progress <= (quartileTime + 5000);\n }\n\n function trackProgressEvents(progress) {\n if (!isArray(trackingEvents.progress)) {\n return; //Nothing to track\n }\n\n var pendingProgressEvts = [];\n var that = this;\n\n trackingEvents.progress.forEach(function(evt) {\n if (evt.offset <= progress) {\n that.trackURLs([evt.uri]);\n } else {\n pendingProgressEvts.push(evt);\n }\n });\n trackingEvents.progress = pendingProgressEvts;\n }\n\n function trackEvents() {\n events.forEach(function(event) {\n this.trackEvent(event.name, event.trackOnce);\n }, this);\n }\n };\n\n [\n 'rewind',\n 'fullscreen',\n 'exitFullscreen',\n 'pause',\n 'resume',\n 'mute',\n 'unmute',\n 'acceptInvitation',\n 'acceptInvitationLinear',\n 'collapse',\n 'expand'\n ].forEach(function(eventName) {\n VASTTracker.prototype['track' + capitalize(eventName)] = function() {\n this.trackEvent(eventName);\n };\n });\n\n [\n 'start',\n 'skip',\n 'close',\n 'closeLinear'\n ].forEach(function(eventName) {\n VASTTracker.prototype['track' + capitalize(eventName)] = function() {\n this.trackEvent(eventName, true);\n };\n });\n\n [\n 'firstQuartile',\n 'midpoint',\n 'thirdQuartile'\n ].forEach(function(quartile) {\n VASTTracker.prototype['track' + capitalize(quartile)] = function() {\n this.quartiles[quartile].tracked = true;\n this.trackEvent(quartile, true);\n };\n });\n\n VASTTracker.prototype.trackComplete = function() {\n if (this.quartiles.thirdQuartile.tracked) {\n this.trackEvent('complete', true);\n }\n };\n\n VASTTracker.prototype.trackErrorWithCode = function trackErrorWithCode(errorcode) {\n if (isNumber(errorcode)) {\n this.trackURLs(this.response.errorURLMacros, { ERRORCODE: errorcode });\n }\n };\n\n VASTTracker.prototype.trackImpressions = function trackImpressions() {\n this.trackURLs(this.response.impressions);\n };\n\n VASTTracker.prototype.trackCreativeView = function trackCreativeView() {\n this.trackEvent('creativeView');\n };\n\n VASTTracker.prototype.trackClick = function trackClick() {\n this.trackURLs(this.response.clickTrackings);\n };\n\n ;\n\n function VideoClicks(videoClickJTree) {\n if (!(this instanceof VideoClicks)) {\n return new VideoClicks(videoClickJTree);\n }\n\n this.clickThrough = xml.keyValue(videoClickJTree.clickThrough);\n this.clickTrackings = parseClickTrackings(videoClickJTree.clickTracking);\n this.customClicks = parseClickTrackings(videoClickJTree.customClick);\n\n /*** Local functions ***/\n function parseClickTrackings(trackingData) {\n var clickTrackings = [];\n if (trackingData) {\n trackingData = isArray(trackingData) ? trackingData : [trackingData];\n trackingData.forEach(function(clickTrackingData) {\n clickTrackings.push(xml.keyValue(clickTrackingData));\n });\n }\n return clickTrackings;\n }\n };\n\n function Wrapper(wrapperJTree) {\n if (!(this instanceof Wrapper)) {\n return new Wrapper(wrapperJTree);\n }\n\n //Required elements\n this.adSystem = xml.keyValue(wrapperJTree.adSystem);\n this.impressions = vastUtil.parseImpressions(wrapperJTree.impression);\n this.VASTAdTagURI = xml.keyValue(wrapperJTree.vASTAdTagURI);\n\n //Optional elements\n this.creatives = vastUtil.parseCreatives(wrapperJTree.creatives);\n this.error = xml.keyValue(wrapperJTree.error);\n this.extensions = wrapperJTree.extensions;\n\n //Optional attrs\n this.followAdditionalWrappers = isDefined(xml.attr(wrapperJTree, 'followAdditionalWrappers')) ? xml.attr(wrapperJTree, 'followAdditionalWrappers') : true;\n this.allowMultipleAds = xml.attr(wrapperJTree, 'allowMultipleAds');\n this.fallbackOnNoAd = xml.attr(wrapperJTree, 'fallbackOnNoAd');\n }\n\n\n ;\n \"use strict\";\n\n var vastUtil = {\n\n track: function track(URLMacros, variables) {\n var sources = vastUtil.parseURLMacros(URLMacros, variables);\n var trackImgs = [];\n sources.forEach(function(src) {\n var img = new Image();\n img.src = src;\n trackImgs.push(img);\n });\n return trackImgs;\n },\n\n parseURLMacros: function parseMacros(URLMacros, variables) {\n var parsedURLs = [];\n\n variables = variables || {};\n\n if (!(variables[\"CACHEBUSTING\"])) {\n variables[\"CACHEBUSTING\"] = Math.round(Math.random() * 1.0e+10);\n }\n\n URLMacros.forEach(function(URLMacro) {\n parsedURLs.push(vastUtil._parseURLMacro(URLMacro, variables));\n });\n\n return parsedURLs;\n },\n\n parseURLMacro: function parseMacro(URLMacro, variables) {\n variables = variables || {};\n\n if (!(variables[\"CACHEBUSTING\"])) {\n variables[\"CACHEBUSTING\"] = Math.round(Math.random() * 1.0e+10);\n }\n\n return vastUtil._parseURLMacro(URLMacro, variables);\n },\n\n _parseURLMacro: function parseMacro(URLMacro, variables) {\n variables = variables || {};\n\n forEach(variables, function(value, key) {\n URLMacro = URLMacro.replace(new RegExp(\"\\\\[\" + key + \"\\\\\\]\", 'gm'), value);\n });\n\n return URLMacro;\n },\n\n parseDuration: function parseDuration(durationStr) {\n var durationRegex = /(\\d\\d):(\\d\\d):(\\d\\d)(\\.(\\d\\d\\d))?/;\n var match, durationInMs;\n\n if (isString(durationStr)) {\n match = durationStr.match(durationRegex);\n if (match) {\n durationInMs = parseHoursToMs(match[1]) + parseMinToMs(match[2]) + parseSecToMs(match[3]) + parseInt(match[5] || 0);\n }\n }\n\n return isNaN(durationInMs) ? null : durationInMs;\n\n /*** local functions ***/\n function parseHoursToMs(hourStr) {\n return parseInt(hourStr, 10) * 60 * 60 * 1000;\n }\n\n function parseMinToMs(minStr) {\n return parseInt(minStr, 10) * 60 * 1000;\n }\n\n function parseSecToMs(secStr) {\n return parseInt(secStr, 10) * 1000;\n }\n },\n\n parseImpressions: function parseImpressions(impressions) {\n if (impressions) {\n impressions = isArray(impressions) ? impressions : [impressions];\n return transformArray(impressions, function(impression) {\n if (isNotEmptyString(impression.keyValue)) {\n return impression.keyValue;\n }\n return undefined;\n });\n }\n return [];\n },\n\n parseCreatives: function parseCreatives(creativesJTree) {\n var creatives = [];\n var creativesData;\n if (isDefined(creativesJTree) && isDefined(creativesJTree.creative)) {\n creativesData = isArray(creativesJTree.creative) ? creativesJTree.creative : [creativesJTree.creative];\n creativesData.forEach(function(creative) {\n creatives.push(new Creative(creative));\n });\n }\n return creatives;\n },\n\n //We assume that the progress is going to arrive in milliseconds\n formatProgress: function formatProgress(progress) {\n var hours, minutes, seconds, milliseconds;\n hours = progress / (60 * 60 * 1000);\n hours = Math.floor(hours);\n minutes = (progress / (60 * 1000)) % 60;\n minutes = Math.floor(minutes);\n seconds = (progress / 1000) % 60;\n seconds = Math.floor(seconds);\n milliseconds = progress % 1000;\n return toFixedDigits(hours, 2) + ':' + toFixedDigits(minutes, 2) + ':' + toFixedDigits(seconds, 2) + '.' + toFixedDigits(milliseconds, 3);\n },\n\n parseOffset: function parseOffset(offset, duration) {\n if (isPercentage(offset)) {\n return calculatePercentage(offset, duration);\n }\n return vastUtil.parseDuration(offset);\n\n /*** Local function ***/\n function isPercentage(offset) {\n var percentageRegex = /^\\d+(\\.\\d+)?%$/g;\n return percentageRegex.test(offset);\n }\n\n function calculatePercentage(percentStr, duration) {\n if (duration) {\n return calcPercent(duration, parseFloat(percentStr.replace('%', '')));\n }\n return null;\n }\n\n function calcPercent(quantity, percent) {\n return quantity * percent / 100;\n }\n },\n\n isVPAID: function isVPAIDMediaFile(mediaFile) {\n return !!mediaFile && mediaFile.apiFramework === 'VPAID';\n }\n };\n})(window, document, videojs);\n//# sourceMappingURL=videojs-vast-vpaid.js.map\n\n/* jshint ignore:end */\n"; -},function(e,t){var n=function(e,t){function n(e){return"object"==typeof e}function i(e){return null===e}function o(e){var t,r,a;for(r=1;r=0&&(r.disableCollapseForDelay=r.disableCollapse),r.disableCollapse=!1),r.enableExplicitPause=!0,r};e.exports=n},function(e,t,n){var i=n(56),o="[PlayerManager_ANVideoViewabilityTracker]",r=n(9),a=function(e){r.verbose(o,e)},s=function(e){r.info(o,e)},l=function(){var e,t,n=null,o={video_start:"start",expand:"expand",collapse:"collapse",video_unmute:"sound_on",video_mute:"sound_off",video_pause:"pause",video_resume:"resume","ad-click":"click",video_skip:"stop",video_complete:"stop",fullscreen:"fullscreen",exitFullscreen:"exitFullscreen"},r={video_start:!1,video_skip:!1,video_complete:!1},l=function(e){return e&&e.viewability&&e.viewability.config},d=function(e){return e.targetElement},c=function(e,t,n){return{duration:e,w:t,h:n}},u=function(e){if(e)return e.playerContextId},p=function(n,i){if(e&&i){var o=/notifyEvent.*\[(.[^\]]+)\]/.exec(i);o=Array.isArray(o)&&o.length>1?o[1]:null,o&&e("VIEW",o,t,i)}n&&"debug"===n?a(i):s(i)};this.init=function(o,r,h,m,v){s("initialize with duration: "+r+", width: "+h+", height: "+m+", event: "+v),o&&(e=o.cbNotification,t=o.ASTadId);try{n=new i(l(o),d(o),c(r,h,m),u(o),p),this.isReady=!0}catch(f){a("error on viewability library: "),a(f)}},this.invokeEvent=function(e){if(e&&o[e])try{if(r.hasOwnProperty(e)){if(r[e])return void s("supressing fireOnceEvents event as it is already fired once by viewability library: "+o[e]);r[e]=!0}s("event invoked by viewability library: "+o[e]),n.notifyEvent(o[e])}catch(t){a("error on viewability library: "),a(t)}},this.isReady=!1};e.exports=l},function(e,t){var n={DEBUG:"debug",INFO:"info",ERROR:"error"},i={NO_VIEWABILITY_DATA:100,MISSING_MANDATORY_PARAMETER_JS:101,FAILED_TO_LOAD_VIEWABILITY_JS:102,INITIALIZATION_FAILED:103,MISSING_MANDATORY_PARAMETER_CB:104,MISSING_MANDATORY_PARAMETER_RDCB:105,MISSING_MANDATORY_PARAMETER_VC:106},o=function(e,t,o,r,a,s){"use strict";if(this.contextKey=r,a&&(this.loggerCallback=a),s&&(this.errorCallback=s),this.adUID="WR_"+(new Date).getTime()+Math.round(1e3*Math.random()),this.viewabilityMeasurementActive=!0,this.viewabilityData=this.decodePayload(e),!this.viewabilityData)return void(this.viewabilityMeasurementActive=!1);if(this.contextKey&&""!==this.contextKey&&(this.log(n.INFO,"contextKey is set in this app, checking contextKey in viewability config"),!this.viewabilityData.hasOwnProperty("contextKey")||this.viewabilityData.contextKey.indexOf(this.contextKey)===-1))return this.log(n.INFO,"contextKey doesn't match, disabling viewability measurement"),void(this.viewabilityMeasurementActive=!1);var l="";try{"object"==typeof t?(this.videoNodeDocument=t.ownerDocument,this.videoNodeWindow=this.videoNodeDocument.defaultView||this.videoNodeDocument.videoNodeWindow,""===t.id&&(t.id="an_video_"+this.adUID),l=t.id):(l=t,this.videoNodeDocument=document,this.videoNodeWindow=window)}catch(d){this.videoNodeDocument=document,this.videoNodeWindow=window}this.videoInfo=this.decodeVideoInfos(o),this.log(n.INFO,"ANVideoViewabilityTracker start with parameters \nDomID:\t\t["+l+"]\nadUID:\t\t["+this.adUID+"]\nDuration:\t["+this.videoInfo.duration+"]\nPayload:\t"+e+"\n\nDimension:\t("+this.videoInfo.w+","+this.videoInfo.h+")\nPosition:\t("+this.videoInfo.x+","+this.videoInfo.y+")");try{if("undefined"==typeof this.videoNodeWindow.anxVVAPICache){this.videoNodeWindow.anxVVAPICache={events:Array(),init:Array()};var c=this.videoNodeDocument.createElement("script");c.type="text/javascript",c.async=!0,c.src=this.viewabilityData.vjs,c.readyState&&(c.onreadystatechange=function(){"loaded"!=c.readyState&&"complete"!=c.readyState||(c.onreadystatechange=null)}),c.onerror=function(e){this.log(n.DEBUG,"script load onerror",e),this.error(i.FAILED_TO_LOAD_VIEWABILITY_JS,"ANVideoViewabilityTracker failed to load viewability script ("+c.src+")."),this.viewabilityMeasurementActive=!1}.bind(this);var u=this.videoNodeDocument.getElementsByTagName("head")[0];u.appendChild(c)}}catch(d){this.error(i.INITIALIZATION_FAILED,{message:"ANVideoViewabilityTracker initialization failed",exception:d})}if(this.extractVersionModule(this.viewabilityData),"undefined"==typeof this.videoNodeWindow.anxVVAPI){var p={a:this.adUID,params:this.viewabilityData.viewParams,id:l,v:this.VIEWABILITY_MODULE_VERSION,dur:this.videoInfo.duration,w:this.videoInfo.w,h:this.videoInfo.h,x:this.videoInfo.x,y:this.videoInfo.y};this.videoNodeWindow.anxVVAPICache.init.push(p)}else this.videoNodeWindow.anxVVAPI.initializeFromParams(this.viewabilityData.viewParams,l,this.adUID,this.VIEWABILITY_MODULE_VERSION,this.videoInfo.duration,this.videoInfo.w,this.videoInfo.h,this.videoInfo.x,this.videoInfo.y)};o.prototype={VIEWABILITY_MODULE_VERSION:1,loggerCallback:null,errorCallback:null,log:function(e,t){"use strict";if(this.loggerCallback)try{this.loggerCallback(e,t)}catch(n){console.trace(n)}},error:function(e,t){"use strict";if(this.errorCallback)try{this.errorCallback(e,t)}catch(i){console.trace(i)}else this.log(n.ERROR,"ERR-"+e+": "+t)},lastKnownVolume:-1,parseUrl:function(e){"use strict";var t={http:"",params:""};try{if(e&&"string"==typeof e){var i=e.split(/:/);if(2===i.length&&(e=i[1],t.http=i[0]),i=e.split(/\?/),2===i.length?t.params=i[1]:(""===t.http||"//"!==e.substr(0,2))&&e.indexOf("=")>-1&&(t.params=i[0]),""!==t.params){i=t.params.split(/&/),t.params={};for(var o in i){var r=i[o].split(/=/);if(2===r.length)t.params[r[0]]=decodeURIComponent(r[1]);else if(r.length>2){for(var a="",s=1;s0)&&(t.duration=e.duration),("number"==typeof e.w||e.w>0)&&(t.w=e.w),("number"==typeof e.h||e.h>0)&&(t.h=e.h),("number"==typeof e.x||e.x>0)&&(t.x=e.x),("number"==typeof e.y||e.y>0)&&(t.y=e.y),t},extractVersionModule:function(e){"use strict";if(e){var t=/.+\/(\d+)\/trk\.js/,n=t.exec(e.viewJS);n&&n[1]&&(this.VIEWABILITY_MODULE_VERSION=n[1])}},notifyEvent:function(e){"use strict";if(!this.viewabilityMeasurementActive)return void this.log(n.INFO,"notifyEvent cancelled because viewability is not active");switch(this.log(n.INFO,"notifyEvent: ["+e+"]"),"an_outstream"==this.contextKey&&"sound_off"==e&&(e="sound_on"),e){case"fullscreen":e="expand";break;case"exitFullscreen":e="collapse";break;case"expand":case"collapse":return}var t=(new Date).getTime();try{if("undefined"==typeof this.videoNodeWindow.anxVVAPI){var i={a:this.adUID,c:e,d:t};this.videoNodeWindow.anxVVAPICache.events.push(i)}else this.videoNodeWindow.anxVVAPI.notifyEvent(this.adUID,e)}catch(o){this.log(n.DEBUG,{message:"notifyEvent failed",exception:o})}},onVolumeChange:function(e){"use strict";return this.viewabilityMeasurementActive?void("number"==typeof e&&(e>1&&(e=1),e<0&&(e=0),e!==this.lastKnownVolume&&(e>0?this.notifyEvent("sound_on"):this.notifyEvent("sound_off"),this.lastKnownVolume=e))):void this.log(n.INFO,"onVolumeChange cancelled because viewability is not active")}},e.exports=o,e.exports.LOG_LEVEL=n,e.exports.ERROR_CODE=i},function(e,t,n){var i,o=n(9),r="https:"===document.location.protocol?"https:":"http:",a="apn_mobile_video_placements",s="iframeVideoWrapper",l=r+"//acdn.adnxs.com/video/static/res/b2.mp4",d=5e3,c="[AutoplayHandler]",u=function(e){o.verbose(c,e)},p=function(e){o.error(c,e)},h=function(e){o.warn(c,e)},m=function(e){o.info(c,e)},v=!1,f=r+"//acdn.adnxs.com/video/static/res/av2.mp4",g={},y={stopMediaWithSound:1,neverAutoplay:2,allowAutoplay:3},A=n(18)(),b=function(){var e="safari";try{var t=navigator.platform,n=navigator.userAgent,i=navigator.appVersion;if(/CriOS/.test(n)&&(e="chrome"),/iP(hone|od|ad)/.test(t)){var o=i.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(o[1],10),parseInt(o[2],10),parseInt(o[3]||0,10),e]}return[0,0,0,e]}catch(r){return p(r),[0,0,0,e]}},k=function(){return/iphone/i.test(navigator.userAgent.toLowerCase())||/ipad/i.test(navigator.userAgent.toLowerCase())},T=function(){var e=-1;if(k())try{var t=navigator.userAgent.match(/CriOS\/([0-9]+)\./);t&&Array.isArray(t)&&t.length>1&&(e=parseInt(t[1]))}catch(n){u(n)}return e},w=function(){var e=b();if(e&&Array.isArray(e)&&e.length>=4){var t=e[0],n=e[3];return"chrome"===n&&10===t&&53===T()}},E=function(e,t,n,i){var o=e.length,r=0,s=function(e){r===o&&"function"==typeof n&&(v=!0,h("set hasDoneFakingAutoStartForAndroid = true by "+e),n())},d=function(e,t,n){v||(h("successfully performed autoplay trick by "+t),n[a]=e,r++,s(t))},c=function(e,t,n){h("removing failed iframe #"+(t+1)+" by "+n),document.getElementById(i).removeChild(e)},p=function(e,t,n){try{var i=e.contentWindow;if(!i[a]){var o,p;o=i.document.createElement("video"),i.document.body.appendChild(o),o.src=l,o.muted=!0,p=o.play(),o.pause(),void 0!==p&&p.then(function(){u("video promise done successfully by "+n),r++,s("promise done")})["catch"](function(a){var s={code:a.code,name:a.name,message:a.message};0===s.code?(h("playback failed : "+s.code+","+s.name+","+s.message+" by "+n),c(e,t,n)):(h("waterfall steps #"+(Number(r)+1)+" by "+n+" : autoplay trick's possible due to video promise be caught with "+a.name),d(o,n,i))})}}catch(m){u(m)}};e.forEach(function(e,n){p(e,n,t)})},S=function(){var e=navigator.appVersion.indexOf("Mobile"),t=navigator.appVersion.indexOf("Android");return e>-1||t>-1},I=function(){return/android/i.test(navigator.userAgent.toLowerCase())},C=function(){var e=-1;if(I())try{var t=navigator.userAgent.match(/Chrome\/([0-9]+)\./);t&&Array.isArray(t)&&t.length>1&&(e=parseInt(t[1]))}catch(n){u(n)}return e},P=function(e,t,n,i){if(I()===!1)return!1;var o=e&&"auto"===e,r=t&&"on"===t;return C()>=53?!(!r||!o||n)||!(!o||!i||n):C()<=52?!(!o||n):void 0},j=function(e){m("Start to detect Android Data Saver option in this device");var t,n=window.document.createElement("video"),i=function(e){try{e&&document.body.removeChild(e)}catch(t){u(t)}};try{n.src=l,n.muted=!0,document.body.appendChild(n),t=n.play(),void 0!==t&&t.then(function(){m("Android Data Saver option isn't detected in this device"),i(n),e(!1)})["catch"](function(){m("Android Data Saver option is detected in this device, so auto-play will be initiated by user's activity like touch"),i(n),e(!0)})}catch(o){u(o),m("failed to detect Android Data Saver option in this device, so auto-play will be initiated by user's activity like touch"),i(n),e(!0)}},x=function(e){var t;try{t=b()[0]>=8&&e===!0}catch(n){p(n)}return t},_=function(e,t,n,i,o){if(!v){u("create iframes for Android autoplay by "+e);var r=1;r=n&&n!==-1?n+1:i,u("total "+r+" iframes will be made by waterfall structure with "+e+" event");for(var a=[],l=0;l=1&&"general"!==e?E(a,e,t,o):"function"==typeof t&&t()}},V=function(e){try{var t=e.targetElementId,n=e.windowForPublisher,i=e.callbackAdUnitEntryPoint,o=e.callbackPatchForIOSChrome,r=e.waterfallSteps,a=e.maxWaterfallIframes,s=e.initialPlayback,l=e.initialAudio,d=e.automatedTestingOnlyAndroidSkipTouchStart,c=e.androidDSOverride,p=function(e){var o=e;if(c===!1&&e&&C()<=55&&"on"===l&&"auto"===s)return void i(!1,!0);if(c===!1&&(e=!1),C()<56&&P(s,l,d,e)){var u=function(e){_(e,function(){i(!1,!1)},r,a,t)};n.addEventListener("touchstart",function(){u("touchstart")},{passive:!0}),n.addEventListener("touchend",function(){setTimeout(function(){u("touchend")},1)},{passive:!0})}else{var p,h;C()>=56?(p="on"===l&&"auto"===s&&o===!1,h="auto"===s&&o===!0):h="auto"===s&&o===!0,_("general",function(){i(p,h)},r,a,t)}};S()?I()?(u("intialize for Android"),j(p)):(u("intialize for iOS and etc"),i(!1),w()&&o&&"function"==typeof o&&n.addEventListener("touchstart",o)):(u("initialize for general html5 browsers"),i(!1))}catch(h){u(h),e.callbackAdUnitEntryPoint&&"function"==typeof e.callbackAdUnitEntryPoint&&e.callbackAdUnitEntryPoint(!1)}},D=function(e,t,n,o){var r,a=A.browser.name.toLowerCase(),s=!(!A.os||"Android"!==A.os.name||!parseInt||"function"!=typeof parseInt||5!==parseInt(A.os.version));if(u("hasMaxLimitOnVideo: "+s),k())return g[o]=!0,void t(n);if("firefox"===a)i=document.createElement("video"),i.style.width="1px",i.style.height="1px",i.src=e,i.id=o,i.setAttribute("playsinline",""),document.body.appendChild(i);else{var l=document.createElement("iframe");l.style.display="none",l.id="iframe_"+o,document.body.appendChild(l),s?i||(i=document.createElement("video")):i=document.createElement("video"),i.style.width="1px",i.style.height="1px",i.src=e,i.id=o,i.setAttribute("playsinline",""),l.contentWindow.document.body.appendChild(i)}i.muted=n,n===!1&&i.volume&&(i.volume=.001),r=i.play(),void 0!==r?r.then(function(){g[o]=!0,u("video promise succeeded: "+o+", muted="+n),t(!0)})["catch"](function(e){var i={code:e.code,name:e.name,message:e.message};u("video promise failed: "+o+", muted="+n+","+i.code+","+i.name+","+i.message),g[o]=!0,t(!1)}):(g[o]=!0,t(!0))},M=function(e,t){var n,i;"undefined"==typeof t&&(t=!1),n="videoPlacementTest_"+(new Date).getTime()+Math.floor(1e4*Math.random()),i="videoPlacementTest_"+(new Date).getTime()+Math.floor(1e4*Math.random()),g={},g[n]=!1,g[i]=!1,t?D(f,function(t){t===!0?(u("decided to allowAutoplay"),e(y.allowAutoplay)):D(f,function(t){t===!0?(u("decided to stopMediaWithSound"),e(y.stopMediaWithSound)):(u("decided to neverAutoplay"),e(y.neverAutoplay))},!0,i)},!1,n):D(f,function(t){t===!0?(u("decided to stopMediaWithSound"),e(y.stopMediaWithSound)):(u("decided to neverAutoplay"),e(y.neverAutoplay))},!0,i);var o=function(){document.removeEventListener("onFocus",o),setTimeout(function(){var o=document,r=document.getElementById("iframe_"+n);r&&(o=r.contentWindow.document);var a=o.getElementById(n),s=o.getElementById(i);a&&a.parentNode&&(a.parentNode.removeChild(a),u("remove test video placement :"+n)),s&&s.parentNode&&(s.parentNode.removeChild(s),u("remove test video placement for sound on case :"+i)),t?g[n]===!1&&g[i]===!1&&(u("timeout video test"),u("decided to neverAutoplay"),e(y.neverAutoplay)):g[i]===!1&&(u("timeout video test"),u("decided to neverAutoplay"),e(y.neverAutoplay))},d)};document.hasFocus()?o():document.addEventListener("onFocus",o)};e.exports={APN_MOBILE_VIDEO_PLACEMENT_ID:a,APN_MOBILE_IFRAME_NAME:s,initialize:V,iOSversion:b,isIOS:k,isIosInlineRequired:x,isRequiredFakeAndroidAutoStart:P,isMobile:S,testDataSaverForAndroid:j,getAutoplayPolicy:M,videoPolicy:y}},function(e,t,n){var i=n(59),o=n(26),r=n(66),a=n(25),s=n(28),l=n(29),d=15e3,c="https://rb.adnxs.com/pack?log=log_rb_video_waterfall_events&format=json",u=function(e){s.debug(e,"AdHandler")},p=1,h=2,m=3,v=4,f=5,g=6,y=7,A=8,b=9,k=10,T=11,w={STEP_START:0,STEP_END:1,STEP_NOT_ATTEMPTED:2,DISABLED:3},E={AD_DELIVERED:0,AD_ERROR:1,WATERFALL_TIMEOUT:2,MAX_WATERFALL_STEPS_REACHED:3,PREVIOUS_AD_DELIVERED:4,NON_WATERFALL_TIMEOUT:5,PUBLISHER_DISABLED:11,INCOMPATIBILITY_DISABLED:12};e.exports=function(e,t,n){t._vastObjArr&&Array.isArray(t._vastObjArr)||(t._vastObjArr=[]);var s,S,I,C,P,j=900,x=1,_=!1,V=3e3,D="2.0",M=(new Date).getTime()+Math.floor(1e4*Math.random()),N=!1,O=!1,R=t.waterfallTimeout,U=!1,L=0,F=0,B=0,$=t.waterfallSteps,H=t.disableCollapse&&void 0!==t.disableCollapse.replay,W="",z=!1,q=!1;H&&(P=t.disableCollapse.replay);var J=function(e){n.cbWhenWaterfall&&n.cbWhenWaterfall(e)},G=n.cbWhenVideoComplete,Q=n.cbWhenAudio,X=n.cbWhenQuartile,Y=n.cbWhenClickOpenUrl,K=n.cbWhenDestroy,Z=n.cbWhenImpression,ee=n.cbCoreVideoEvent,te={loaded:"loaded","creative-view":"creativeView","video-start":"start","video-mid":"midpoint","video-first-quartile":"firstQuartile","video-third-quartile":"thirdQuartile","video-complete":"complete","audio-mute":"mute","audio-unmute":"unmute","video-pause":"pause",rewind:"rewind","video-resume":"resume","video-fullscreen":"fullscreen","ad-expand":"expand","ad-collapse":"collapse","video-stopped":"close","video-exit-fullscreen":"exitFullscreen","video-skip":"skip","ad-progress":"progress",acceptInvitation:"acceptInvitation",acceptInvitationLinear:"acceptInvitationLinear",closeLinear:"closeLinear",impression:"impression",error:"error","video-failed":"error","ad-click":"ClickTracking","volume-change":"volumeChange"},ne=!1,ie=[],oe=[],re=null,ae=null,se=!!(t&&t.viewability&&t.viewability.config),le=function(){var e=/iphone/i.test(navigator.userAgent.toLowerCase());return e},de=function(){var e=le()||/ipad/i.test(navigator.userAgent.toLowerCase());return e},ce=function(e){q=!0;var n=t._vastObjArr.slice(0);if(s&&n.push(s),n.length)for(var i=0;i0)for(i=0;i0)for(i=0;irequesting - dispatch : "+e.name);var i=e.name,o={video_start:"video-start",video_impression:"impression",video_mute:"audio-mute",video_click:"video-click",video_complete:"video-complete",video_fullscreen:"video-fullscreen",quartile_event:"quartile-event",video_pause:"video-pause",video_unmute:"audio-unmute",video_failed:"video-failed",video_time:"video-time",video_resume:"video-resume",video_stopped:"video-stopped","video-first-quartile":"video-first-quartile","video-mid":"video-mid","video-third-quartile":"video-third-quartile",fullscreenchange:"video-fullscreen",video_click_open_url:"video-click-open-url",video_skip:"video-skip"},s=o[i],l=!1;if(ne&&ie.indexOf(s)!==-1&&(l=!0),"quartile-event"===s)switch(e.quartile){case 1:s="video-first-quartile";break;case 2:s="video-mid";break;case 3:s="video-third-quartile"}if("video-fullscreen"===s&&"3.0"===D)switch(e.fullscreenStatus){case"enter":s="video-fullscreen";break;case"exit":s="video-exit-fullscreen";break;default:s="video-fullscreen"}void 0===s&&(s=i),e.player&&r.setPlayer(e.player),e&&e.name&&"ad-click"===e.name&&!e.trackClick||(n||(l?oe.push(s):r.requestTracking(s,M)),t.hasOwnProperty("cbNotification")&&("AdUnit"===e.eventType?t.cbNotification(e.eventType,s,t.targetId,e.obj):he(s,e.obj)),t.cbApnVastPlayer&&t.cbApnVastPlayer(s),"canplay"===s&&e.companionAds&&(ae.companionAds=a.parse(e.companionAds)),"impression"===s&&(N=!0,Z&&"function"==typeof Z&&Z(),O?(I&&clearTimeout(I),pe(!1,!0),r.requestTracking("notifyurl",M)):t.overlayPlayer&&r.requestTracking("notifyurl",M),ae.hasOwnProperty("companionAds")&&ae.companionAds.companions.length>0&&t.hasOwnProperty("companionContainers")&&(re=a.renderCompanions(ae.companionAds,t,me))),"video-first-quartile"!==s&&"video-mid"!==s&&"video-third-quartile"!==s||X&&"function"==typeof X&&X(s),"video-complete"===s&&G&&"function"==typeof G&&G(s),"audio-mute"!==s&&"audio-unmute"!==s||Q&&"function"==typeof Q&&Q(s),"video-click-open-url"===s&&Y(e))},fe=function(e,t){if(ne=e)ie=t;else{for(var n=0;n0)for(var i=0;i0&&n.push("IconViewTracking_"+o.program),o&&o.IconClickTracking&&o.IconClickTracking.length>0&&n.push("IconClickTracking_"+o.program)}r.init(n,M),r.addTrackingEvents(e.trackingUrls,M);var a,s,l=e.clickTrackingUrls;for(a=0;a0)for(var h=0;h0)for(var v=0;v0)for(var g=0;g=0&&(s[l]=null);t.data.vastProgressEvent=s,a.maintainAspectRatio&&void 0!==a.maintainAspectRatio?(t.video.maintainAspectRatio=a.maintainAspectRatio,t.maintainAspectRatio=a.maintainAspectRatio):(t.video.maintainAspectRatio=!0,t.maintainAspectRatio=!0),a.scalable&&void 0!==a.scalable?(t.video.scalable=a.scalable,t.canScale=a.scalable):(t.video.scalable=!0,t.canScale=!0),t.video.apiFramework=a.apiFramework,t.video.type=a.type,t.requiredPlayer=a.requiredPlayer,t.videoUrl=a.url,t.clickUrls=i.clickUrls,t.adParameters=i.adParameters,t.extensions=i.extensions,t.data.vastDurationMsec=i.durationMsecs,t.endCard&&t.endCard.showCompanion&&i.companionAds&&(t.endCard.companionAds=i.companionAds.companions,t.endCard.companionCallback=me),t.video.apiFramework&&t.video.apiFramework.toLowerCase().indexOf("vpaid")>=0?t.vpaid=!0:t.vpaid=!1,H&&(t.disableCollapse.replay=!t.vpaid&&P),t.targetElement=e,n.cbForHandlingDispatchedEvent=ve,n.cbDelayEventsTracking=fe;var d=n.cbWhenReady;return n.cbWhenReady=function(e){e.setVastAttribute(),e.test("VIDLA163",e.options.data),ve({name:"loaded",player:e}),d(e)},n.cbRenderVideo(n,t,ye),_=!0,void(ae=i)}return _=!0,void n.cbWhenDestroy({type:1,code:a.errorCode,message:"Unable to select rendition"})}catch(c){u(c),r="Exception error: "+c}_=!0,n.cbWhenDestroy({type:0,code:0,message:r})},be=function(e){_=!1,e&&Ae(e)},ke=function(){var e=null;return s&&(e=s,s=null),e},Te=function(e){var n=null;return L0&&p.expires0&&(r.addTrackingEvent("notifyurl",l,i),r.requestTracking("notifyurl",i));var h="Vast Parser error ("+o+")";a&&a.length>0?(a.forEach(function(e){u("register errorUrls : "+e),r.addTrackingEvent("error",e,M)}),n.cbWhenDestroy({type:x,code:j,message:h})):n.cbWhenDestroy({type:0,code:0,message:h})}};n.cbWhenDestroy=function(e,n,i){if(i||(i=t),i.stopWaterfall&&(O&&!i.isWaterfall&&ue(S,b,L),O=i.isWaterfall),O){if(i&&i.waterfallStepId!==t.waterfallStepId)return;t=i,pe(!1,!1,e)}if(O&&!N&&!U){var o=we();if(o)return void be(o)}if(e&&"undefined"!=typeof e.type)if(u("requesting error in whenDestroy callback : "+e.code+","+e.type+","+e.message),N)u("not requesting error tracker because the Ad Impression was already reported");else if(t.overlayWaterfall||(O||i.stopWaterfall)&&r.requestTracking("notifyurl",M),t.overlayPlayer){var s=r.requestErrorTrackingUrls(e.code,e.type,e.message,M);e.errorUrls=s}else r.requestErrorTracking(e.code,e.type,e.message,M);else u("requesting error in whenDestroy callback : "+e+","+!!e);re&&(a.stopCompanions(re),re=null),"function"==typeof K&&K(!!e&&e,n)},void 0!==t&&t&&t.vastXml&&(setTimeout(function(){_||n.cbWhenDestroy({type:0,code:0,message:"VAST Parser didn't answer until timeout"})},V),u("Ad XML : "+t.vastXml),i.parse(t.vastXml,function(e,n,i,o,r){t.finalVastXml=i&&i.vastXml?i.vastXml:"",Ee(e,n,i,o,r)},null,2e3,null,null,t)),void 0!==t&&t&&t.useAdObj&&t.adObj&&Ae(t.adObj)}},function(e,t,n){var i=n(60),o=n(61),r=n(62),a=n(18),s=a(),l=function(e,t,a){function l(e){var t="unknown";return e&&(t=ft.getNodeAttributeValue(e,"version"),t=t.trim(),t.length>3&&(t=t.substr(0,3))),t}function d(e,t){if(e&&e.length>0)for(var n=0;n0&&(o=" -> "+o),o=a+o}n=Tt[n].parentIdx}Ve.info(De,i+o)}function p(e){var t=ft.getSubNodes(e,"Extension"); -if(t&&t.length>0)for(var n=0;n0))return i=parseInt(i)}return-1}function h(e){Pe=null;var t=ft.getSubNode(e,"VASTAdTagURI");if(!t)return u(wt,"INVALID WRAPPER NODE"),void(0===Tt.length?N(_e.WRAPPER_GENERAL,"invalid wrapper node"):R(_e.WRAPPER_GENERAL));var i=ft.getNodeValues(t);if(!i||0===i.length)return u(wt,"EMPTY VASTAdTagURI"),void(0===Tt.length?N(_e.WRAPPER_GENERAL,"Invalid VASTAdTagURI node value"):R(_e.WRAPPER_GENERAL));if(Et)return u(wt,"terminated"),void Me(!1,Le,"terminated",null,_t);yt=!0;var o;At>="4.0"&&(o=ft.getNodeAttributeBooleanValue(e,"followAdditionalWrappers",!0),Tt[wt].state.followAdditionalWrappers=o,o=ft.getNodeAttributeBooleanValue(e,"allowMultipleAds",!1),Tt[wt].state.allowMultipleAds=o);var r=p(e);r>=0&&(o=ft.getNodeAttributeValue(e,"fallbackOnNoAd"),""!==o?(Pe=ft.getNodeAttributeBooleanValue(e,"fallbackOnNoAd"),Tt[wt].state.fallback.enabled=Pe):Tt[wt].state.fallback.enabled=!1,Tt[wt].state.fallback.index=r,It=!0,Ct=!0),Bt=i;var a;a=Ne.overlayPlayer?1:Ne.expandable?3:-1,i=ft.resolveMacros(i,!1,{BLOCKEDADCATEGORIES:pt?pt.toString():-1,ADTYPE:kt,ADCOUNT:1,PLACEMENTTYPE:a,INVENTORYSTATE:c()});var s=n(29);s.load(i,function(e,t){return Et?(u(wt,"terminated"),void Me(!1,Le,"terminated",null,_t)):void(e||0===t.length?"Timeout"===e?(u(wt,"VASTAdTagURI TIMED OUT: "+i),0===Tt.length?N(_e.WRAPPER_TIMEOUT,"Timeout of VAST URI provided in wrapper element"):R(_e.WRAPPER_TIMEOUT)):(u(wt,"No response for VASTAdTagURI: "+i),0===Tt.length?N(_e.WRAPPER_NO_RESPONSE,"No VAST response for VAST URI provided in wrapper element"):R(_e.WRAPPER_NO_RESPONSE)):(jt=!1,W(t)))},Ne.adServerTimeout?Ne.adServerTimeout:Fe)}function m(e,t){for(var n=0;n0?Tt[t].state.sExtensions=Tt[t].state.sExtensions+n.innerHTML.toString():n&&n.textContent&&n.textContent.length>0&&(Tt[t].state.sExtensions=Tt[t].state.sExtensions+n.textContent.toString())}}function A(e,t){if(e){var n=ft.getSubNode(e,"CompanionAds");n&&(n.innerHTML&&n.innerHTML.length>0||n.textContent&&n.textContent.length>0)&&o.parse(Tt[t].state.companions,n,ft)}}function b(e,t){if(e){var n=ft.getSubNode(e,"Icons");n&&(n.innerHTML&&n.innerHTML.length>0||n.textContent&&n.textContent.length>0)&&r.parse(Tt[t].state.icons,n,ft)}}function k(e,t,n,i){if(e){var o=ft.getSubNode(e,"Linear",0);if(o){var r=null,a=ft.getSubNode(o,"VideoClicks");if(a){var s=ft.getSubNode(a,"ClickThrough");s&&(r=ft.getNodeValues(s),r&&!m(t,r)&&t.push(r));var l,d=ft.getSubNodes(a,"ClickTracking");if(d)for(l=0;l0)for(i=0;i0)for(i=0;i0)for(i=0;i0&&n.forEach(function(e){t.push(e)})}}function E(e,t){var n=e.indexOf("%");if(n>0)return t&&t>0?Number(e.substring(0,n)):0;n=e.indexOf(".");var i=n>0?Number(e.substring(n+1)):0;n>0&&(e=e.substring(0,n));var o=e.split(":");return 3===o.length?1e3*(3600*Number(o[0])+60*Number(o[1])+Number(o[2]))+i:0}function S(e,t){return St.canPlay(e,t)}function I(e){return"video/x-flv"===e||"video/x-f4v"===e||"video/f4v"===e||"application/x-shockwave-flash"===e}function C(e){return"video/webm"===e||"video/ogg"===e||"application/javascript"===e||"application/x-javascript"===e}function P(e){return"application/x-shockwave-flash"===e||"application/javascript"===e||"application/x-javascript"===e}function j(e){if(Ne.playerTechnology&&Array.isArray(Ne.playerTechnology)&&Ne.playerTechnology.length>0){for(var t=!1,n=0;n0&&(r=r.trim(),r=r.length>2?r:"",r.length>0&&(o.codec=r)),!S(o.type,r))return null;if(Ne&&!j(o.type))return null;o.url=t,o.variation="Media#"+n,o.delivery=ft.getNodeAttributeValue(e,"delivery");var a=ft.getNodeAttributeNumberValue(e,"bitrate",-1);a!==-1?o.bitrate=a:(a=ft.getNodeAttributeNumberValue(e,"minBitrate",-1),a!==-1&&(o.minBitrate=a),a=ft.getNodeAttributeNumberValue(e,"maxBitrate",-1),a!==-1&&(o.maxBitrate=a)),o.width=ft.getNodeAttributeNumberValue(e,"width"),o.height=ft.getNodeAttributeNumberValue(e,"height");var s=ft.getNodeAttributeValue(e,"scalable");s.length>0&&(o.scalable=ft.getNodeAttributeBooleanValue(e,"scalable",!0)),s=ft.getNodeAttributeValue(e,"maintainAspectRatio"),s.length>0&&(o.maintainAspectRatio=ft.getNodeAttributeBooleanValue(e,"maintainAspectRatio",!0));var l=ft.getNodeAttributeValue(e,"apiFramework");l&&l.length>0&&(o.apiFramework=l.toUpperCase());var d=ft.getNodeAttributeValue(e,"id");d&&d.length>0&&(o.id=d);var c=ft.getNodeAttributeNumberValue(e,"fileSize",-1);c!==-1&&(o.fileSize=c);var u=ft.getNodeAttributeNumberValue(e,"mediaType",-1);u!==-1&&(o.mediaType=u)}return o}function _(e){et=0,tt="",Ze="",Be=[],$e=null,He=[],We=[];var t=null,n=[];if(e){var i=ft.getSubNode(e,"Linear",0);if(i){var o=ft.getSubNode(i,"Duration");if(o){var r=ft.getNodeValue(o);et=E(r,-1)}var a=ft.getNodeAttributeValue(i,"skipoffset");tt=a,Ze="";var s=ft.getSubNode(i,"AdParameters");if(s){Ze=ft.getNodeValues(s);var l=ft.getNodeAttributeBooleanValue(s,"xmlEncoded",!1);if(l){var d=document.createElement("textarea");d.innerHTML=Ze,Ze=d.value}}if(o=ft.getSubNode(i,"MediaFiles")){var c,u=ft.getSubNodes(o,"MediaFile");if(u){var p;for(p=0;p0){var h=x(o,c,p,n);h&&Be.push(h)}if(0===Be.length)t={code:_e.MEDIA_INVALID,message:"INCOMPATIBLE MEDIA TYPE, Available = "+JSON.stringify(n)};else{o=ft.getSubNode(i,"MediaFiles"),$e=ft.getSubNodeWholeValue(o,"Mezzanine","");var m=ft.getSubNodes(o,"InteractiveCreativeFile");if(m&&m.length>0)for(var v=0;v0)for(p=0;p"),t!==-1&&(n=n.substr(0,t+1)),n.trim()}function D(e){return"2.0"===e||"3.0"===e||"4.0"===e||"4.1"===e}function M(e,t){var n=Date.now(),i='',o={errorFlag:!0,vastVersion:At,errorUrls:wt>0?te(wt):e,vastXml:i,adId:Te(je&&je.parentNode?je.parentNode.id:"unknown"),sequence:Tt&&Tt.length>0?Tt[0].state.sequence:1,finalVastUri:Bt,extClickTrackingUrls:"",extClickUrls:"",extCustomClicks:"",extErrorUrls:"",extImpressionUrls:"",extTrackingUrls:""};if(o.errorUrls||(o.errorUrls=[]),t&&d(o.errorUrls,t),At.substr(0,1)>"3"){if(je){o.universalAdId=ge(je),o.adServingId=ft.getSubNode(je,"AdServingId");var r=ft.getSubNode(je,"AdSystem");r&&(o.adSystem={name:ft.getNodeValue(r),version:ft.getNodeAttributeValue(r,"version")});var a=pe(je);a&&(o.categories=a)}o.contentId=ye(),o.conditionalAd=bt}void 0!==Pe&&null!==Pe&&(o.fallbackOnNoAd=Pe),It&&_t.length>0&&(o.notifyurl=_t),Rt.length>0&&(o.creative_id=Rt),o.rtb=!0,u(wt,"SUCCESS"),o.clickTrackingUrls=[],o.clickUrls=[],o.customClicks=[],o.impressionUrls=[],Se(o),Pt.push(o),Lt++,wt===-1&&(O(),Pt.length>0&&(Pt.sort(function(e,t){return e.fallbackIndex-t.fallbackIndex}),delete Pt[Pt.length-1].fallbackOnNoAd))}function N(e,t){var n=Xe.concat(Ye);d(n,e),it&&it.length>0&&(d(it,_e.WRAPPER_NO_RESPONSE),n=n.concat(it));var i=["UNIVERSALADID","ADSERVINGID","BREAKPOSITION"],o={UNIVERSALADID:ht,ADSERVINGID:vt,BREAKPOSITION:Ne.breakPosition};n=ft.resolveMacrosArray(n,i,o,-1),Ve.error(De,"Error "+e+" - "+t),Ct?(M(n),Me(!0,Le,It?Pt:Pt[0],null)):Me(!1,Le,"vast"+e,n,_t)}function O(){for(var e=0;e1))break;Pt.splice(e,1)}}function R(e){var t=Tt[wt].state;if(t&&Array.isArray(t.arrErrorUrls)&&t.arrErrorUrls.forEach(function(e){Ye.push(e)}),wt>=0){if(Tt[wt].children[0]=null,Tt[wt].children.splice(0,1),0===Tt[wt].children.length){var n=Tt[wt].parentIdx;if(Tt.splice(wt,1),wt=n,wt===-1){if(It&&Pt.length>0)Ct?(O(),Ve.info(De,"Waterfall: Vast XML node count detected: # fallback-rtb nodes: "+Pt.length),Pt.length>0&&(Pt.sort(function(e,t){return e.fallbackIndex-t.fallbackIndex}),delete Pt[Pt.length-1].fallbackOnNoAd)):Ve.info(De,"Waterfall: Vast XML node count detected: # csm nodes: "+Ut+", # rtb nodes: "+Lt),Me(!0,Le,Pt,null);else if(Ft&&Pt.length>0)Ve.info(De,"VMAP: Ad XML node count detected: "+Pt.length),Me(!0,Le,Pt,null);else{var i=_e.UNDEFINED;e&&(i=e.toString()),1===Pt.length&&Pt[0].errorFlag?Me(!0,Le,Pt[0],null):N(i,"no Ad available")}return}return jt=0===wt,jt&&(Ct&&e&&M(Ye,e),Ct=!1),void R(e)}jt=0===wt,jt&&(Ct=!1),Re=wt,Tt[wt].state=U(),Ee(Tt[wt].children[0])}}function U(){var e={arrTrackings:{},arrImpressions:[],arrClickUrls:[],arrCustomClicks:[],arrClickTrackings:[],arrErrorUrls:[],sExtensions:"",sequence:Ft?0:1,companions:{required:"unknown",companions:[]},icons:[],arrViewableImpressions:{viewable:[],notViewable:[],undetermined:[]},arrVerifications:[],fallback:{enabled:!1,index:-1}};return e}function L(e){var t=ft.getNodeAttributeValue(e,"id");if(t.length>0){var n=ft.getNodeAttributeValue(e,"notifyurl");n&&n.length>0&&(xt[t]=n)}}function F(e){var t=ft.getNodeAttributeValue(e,"id");if(t.length>0){var n=ft.getNodeAttributeValue(e,"creativeId");n&&n.length>0&&(Ot[t]=n)}}function B(e){var t=ft.getNodeAttributeValue(e,"id");if(t.length>0){var n=ft.getNodeAttributeValue(e,"buyerMemberId");n&&n.length>0&&(Vt[t]=n)}}function $(e){var t=ft.getNodeAttributeValue(e,"id");if(t.length>0){var n=ft.getNodeAttributeValue(e,"viewabilityConfig");n&&n.length>0&&(Mt[t]=n)}}function H(){if(nt&&nt.length>0)for(var e=0;e="4.1"){var f=ft.getNodeAttributeValue(p[m],"adType");if(""!==f&&"video"!==f)continue}if(c>="4.0"&&wt>0&&!Tt[wt].state.allowMultiAds){var g=ft.getNodeAttributeValue(p[m],"sequence");if(g)continue;if(h.length>0)break}h.push(p[m]),It&&jt&&L(p[m]),jt&&(B(p[m]),F(p[m]),$(p[m]))}if(0===h.length)return H(),u(wt,"NO VALID AD NODES"),void(0===Tt.length?N(_e.UNDEFINED,"no Ad available"):R(_e.UNDEFINED));var y={parentIdx:wt,currentIdx:0,children:h,state:U()};Tt.push(y),y.currentIdx=Tt.length-1,wt=y.currentIdx,Ee(Tt[wt].children[0],c)}else u(wt,"INVALID VAST VERSION: "+c),0===Tt.length?N(_e.VAST_VERSION,"VAST version not supported"):R(_e.VAST_VERSION)}function z(e){for(var t in Tt[e].state.arrTrackings)for(var n=0;n=0;)z(t),t=Tt[t].parentIdx;return ot}function J(e){for(var t=0;t=0;)J(t),t=Tt[t].parentIdx;return rt}function Q(e){for(var t=0;t=0;)Q(t),t=Tt[t].parentIdx;return at}function Y(e){for(var t=0;t=0;)Y(t),t=Tt[t].parentIdx;return st}function Z(e){for(var t=0;t=0;)Z(t),t=Tt[t].parentIdx;return lt}function te(e){for(var t=0;t=0;)te(t),t=Tt[t].parentIdx;return dt}function ie(e){return Tt[e].state.sExtensions.length>0&&(Ke+=Tt[e].state.sExtensions),Ke}function oe(e){for(var t=e;t>=0;)ie(t),t=Tt[t].parentIdx;return Ke}function re(e){for(var t=e;t>0;){var n=Tt[t].parentIdx;o.mergeCompanions(Tt[n].state.companions,Tt[t].state.companions),t=n}return"unknown"===Tt[t].state.companions.required&&delete Tt[t].state.companions.required,Tt[t].state.companions}function ae(e){for(var t={required:"unknown",companions:[]},n=e;n>=0;)o.mergeCompanions(t,Tt[n].state.companions),n=Tt[n].parentIdx;return t}function se(e,t){for(var n=0;n0;){for(var n=Tt[t].parentIdx,i=0;i=0;){for(var i=0;i=0;r--)if(o=i[r],o.StaticResource||o.IFrameResource||o.HTMLResource){var s=!1;for(a=0;a0)for(var i=0;i0){var r=ft.getNodeAttributeValue(n[i],"authority");t.push({category:o,authority:r})}}return t.length>0?t:null}function he(e){var t;for(t=0;t=0;)he(t),t=Tt[t].parentIdx;return ct}function ve(e){var t;for(t=0;t=0;)ve(t),t=Tt[t].parentIdx;return ut}function ge(e){var t,n,i,o,r="unknown",a="unknown",s=function(){return r+" "+a};if(n=ft.getSubNodes(e,"Creative"),!n||0===n.length)return s();for(t=0;t0)for(var n=0;n0){for(var a=[],s=0;s0)return a}}return null}}return null}function be(e){var t=[],n=ft.getSubNode(e,"AdVerifications");if(n){var i=ft.getSubNodes(n,"Verification");if(i&&i.length>0)for(var o=0;o0)for(s=0;s0)for(s=0;s0)for(s=0;s0&&(E.jsResources=u),p.length>0&&(E.executableResources=p),g&&(E.viewableImpression=g),A&&(E.trackingEvents=y),w&&(E.verificationParameters=w),t.push(E)}}return t.length>0?t:null}function ke(e){pt=null;var t=ft.getSubNodes(e,"BlockedAdCategories");if(t&&t.length>0){pt=[];for(var n=0;n0&&(t=t.substring(0,n)),t}function we(){for(var e=-1,t=wt;t>=0;){var n=Tt[t].state;n.fallback.index>=0&&(e=n.fallback.index),t=Tt[t].parentIdx}return e}function Ee(e,t){je=null;var n=ft.getSubNode(e,"Wrapper"),i=null!==n;if(i||(n=ft.getSubNode(e,"InLine")),je=n,!n)return H(),u(wt,"MISSING WRAPPER / INLINE NODE"),void R("101");if(Re++,Re>Oe)return u(wt,"Reach Wrapper limit"),void R(_e.WRAPPER_LIMIT);t>At&&(At=t);var o=ft.getNodeAttributeValue(e,"id");if(xt.hasOwnProperty(o)&&(_t=xt[o]),Ot.hasOwnProperty(o)&&(Rt=Ot[o]),Vt.hasOwnProperty(o)&&(Dt=Vt[o]),Mt.hasOwnProperty(o)&&(Nt=Mt[o]),0===wt){var r=ft.getNodeAttributeValue(e,"sequence");r&&(Tt[wt].state.sequence=parseInt(r));var a=ft.getNodeAttributeValue(e,"conditionalAd");a&&(bt=ft.getNodeAttributeBooleanValue(e,"conditionalAd")),kt=ft.getNodeAttributeValue(e,"adType"),kt&&""!==kt||(kt="video")}if(v(n,Tt[wt].state.arrErrorUrls),f(n,Tt[wt].state.arrImpressions),g(n,Tt[wt].state.arrTrackings),k(n,Tt[wt].state.arrClickUrls,Tt[wt].state.arrClickTrackings,Tt[wt].state.arrCustomClicks),y(n,wt),A(n,wt),b(n,wt),T(n,Tt[wt].state.arrViewableImpressions),w(n,Tt[wt].state.arrVerifications),Ye=[],i){if(At>="4.0"&&wt>0&&Tt[wt-1].state.hasOwnProperty("followAdditionalWrappers")&&Tt[wt-1].state.followAdditionalWrappers===!1)return u(wt,"Additional Wrappers are not allowed"),void R(_e.WRAPPER_GENERAL);ke(n),h(n)}else{var s=!1,l=p(n);l>=0&&(s=!0,Tt[wt].state.fallback.enabled=!0,Tt[wt].state.fallback.index=l,It=!0,Ct=!0);var d=_(n);if((0===Be.length||null!==d)&&!s)return u(wt,d.message),void R(d.code);ot=JSON.parse(JSON.stringify(ze)),rt=qe.slice(0),at=Je.slice(0),st=Ge.slice(0),lt=Qe.slice(0),dt=Xe.slice(0),Ke="";var c=JSON.stringify(q(Tt[wt].parentIdx)),m=JSON.stringify(G(Tt[wt].parentIdx)),E=JSON.stringify(X(Tt[wt].parentIdx)),S=JSON.stringify(ee(Tt[wt].parentIdx)),I=JSON.stringify(K(Tt[wt].parentIdx)),C=JSON.stringify(ne(Tt[wt].parentIdx)),P=oe(Tt[wt].parentIdx),j=JSON.stringify(ae(Tt[wt].parentIdx)),x=JSON.stringify(ce(Tt[wt].parentIdx));Ke="";var V=re(wt);V=ue(V);var D={vastVersion:At,withWrapper:yt,mediaFiles:Be,trackingUrls:z(wt),impressionUrls:J(wt),clickUrls:Q(wt),clickTrackingUrls:Z(wt),customClicks:Y(wt),errorUrls:te(wt),durationMsecs:et,skipOffset:tt,extensions:ie(wt),adParameters:Ze,vastXml:Ue,extTrackingUrls:c,extImpressionUrls:m,extClickUrls:E,extCustomClicks:I,extClickTrackingUrls:S,extErrorUrls:C,extExtensions:P,adId:Te(o),sequence:Tt[0].state.sequence,companionAds:V,extCompanions:j,icons:de(wt),extIcons:x,finalVastUri:Bt},M=JSON.stringify(fe(Tt[wt].parentIdx)),N=ve(wt);N&&N.length>0&&(D.extVerifications=M,D.adVerifications=N);var O;if(At.substr(0,1)>"3"){ht=ge(n),D.universalAdId=ht,mt=ye(),D.contentId=mt;var U=ft.getSubNode(n,"AdServingId");U&&(vt=ft.getNodeValue(U)),D.adServingId=vt;var L=ft.getSubNode(n,"AdSystem");L&&(D.adSystem={name:ft.getNodeValue(L),version:ft.getNodeAttributeValue(L,"version")});var F=ft.getSubNode(n,"AdTitle");F&&(D.adTitle=ft.getNodeValue(F));var B=ft.getSubNode(n,"Description");B&&(D.description=ft.getNodeValue(B));var $=ft.getSubNode(n,"Advertiser");$&&(D.advertiser={name:ft.getNodeValue($),id:ft.getNodeAttributeValue($,"id")});var W=ft.getSubNode(n,"Pricing");W&&(D.pricing={price:ft.getNodeAttributeNumberValue(W,"price"),model:ft.getNodeAttributeValue(W,"model"),currency:ft.getNodeAttributeValue(W,"currency")});var se=ft.getSubNodes(n,"Survey");if(se&&se.length>0)for(D.surveys=[],O=0;O0&&(D.expires=Date.now()+1e3*be)}var Ee=Ae(n);Ee&&Ee.length>0&&(D.creativeExtensions=Ee),D.conditionalAd=bt;var Ce=pe(n);if(Ce){for(var xe=0;xe0&&(D.extViewableImpression=Ve,D.viewableImpression=De),$e&&(D.mezzanine=$e),He&&He.length>0&&(D.interactiveCreativeFiles=He),We&&We.length>0&&(D.closedCaptionFiles=We)}void 0!==Pe&&null!==Pe&&(D.fallbackOnNoAd=Pe),It&&_t.length>0&&(D.notifyurl=_t),Rt.length>0&&(D.creative_id=Rt),Dt.length>0&&(D.buyerMemberId=Dt),Nt.length>0&&(D.viewabilityConfig=Nt);var Ne=!1;if(It&&!Ct){var Fe=ft.getNodeAttributeValue(e,"rtb");Fe&&"true"===Fe&&(Ne=!0,D.rtb=!0)}if(Et)return u(wt,"terminated"),void Me(!1,Le,"terminated",null,_t);var nt=[];for(O=0;O0?Ne.wrapperLimit:5,Re=0,Ue=null,Le=e,Fe=t&&t>0?t:1e3,Be=[],$e=null,He=[],We=[],ze={},qe=[],Je=[],Ge=[],Qe=[],Xe=[],Ye=[],Ke="",Ze="",et=0,tt="",nt=null,it=[],ot={},rt=[],at=[],st=[],lt=[],dt=[],ct={viewable:[],notViewable:[],undetermined:[]},ut=[],pt=null,ht="unknown unknown",mt="unknown unknown",vt=null,ft=new i,gt=null,yt=!1,At="",bt=!1,kt="video",Tt=[],wt=-1,Et=!1,St=n(63),It=!1,Ct=null!==e&&"object"==typeof e&&(e.hasOwnProperty("fallback_index")||e.rtb&&e.rtb.video&&e.rtb.video.hasOwnProperty("fallback_index")),Pt=[],jt=!1,xt={},_t="",Vt={},Dt="",Mt={},Nt="",Ot={},Rt="",Ut=0,Lt=0,Ft=a.vmap,Bt="";Ve.always(De,"Version 3.2.2"),this.parse=function(e,t,n,i){Me=i,Ce(t,n),jt=!0,W(e)},this.terminate=function(){Et=!0}},d=n(64),c=n(65);e.exports={parse:function(e,t,n,i,o,r,a){var s=new l(n,i,a);return s.parse(e,o,r,function(e,n,i,o,r){t&&t(e,n,i,o,r),s=null}),s},getUnwrappedVastTag:function(e,t,n,i,o,r,a,s){if(!e||!e.vastXml)return null;var l=new d(e,t,n,i,o,r,a,s),c=l.addTrackers();return l=null,c},getMergedVastTag:function(e){if(!e||0===e.length)return null;var t=new c(e),n=t.getVastXml();return t=null,n}}},function(e,t){var n=function(){this.getSubNodes=function(e,t){var n=e.getElementsByTagName(t);return n.length>0?n:null},this.getSubNode=function(e,t,n){n||(n=0);var i=e.getElementsByTagName(t);return i.length>n?i[n]:null},this.getNodeValue=function(e){if(0===e.childNodes.length)return"";var t=e.childNodes[0].nodeValue;return t?t.trim():""},this.getNodeValues=function(e){if(0===e.childNodes.length)return"";for(var t="",n=0;n0&&(i=o.indexOf(".")>=0?parseFloat(o):parseInt(o)),i},this.getNodeAttributeBooleanValue=function(e,t,n){n||(n=!1);var i=n,o=this.getNodeAttributeValue(e,t);if(o.length>0){var r=o.toLowerCase().charAt(0);i="t"===r}return i},this.getSubNodeValue=function(e,t,n){n="undefined"==typeof n?"":n;var i=this.getSubNode(e,t);return null!==i?this.getNodeValue(i):n},this.getSubNodeWholeValue=function(e,t,n){ -n="undefined"==typeof n?"":n;var i=this.getSubNode(e,t);return null!==i?this.getNodeValues(i):n},this.getSubNodeBooleanValue=function(e,t,n){n="undefined"==typeof n?"false":n;var i=this.getSubNodeValue(e,t);return i.length>0&&"t"===i.toLowerCase().charAt(0)||!(i.length>0&&"f"===i.toLowerCase().charAt(0))&&n},this.returnOnlyChildren=function(e,t){var n=[];if(t&&t.length>0)for(var i=0;i=0&&(r=e.split("["+o+"]"),e=r.join(encodeURIComponent(n.hasOwnProperty(o)&&n[o]?n[o]:l)));return e}};e.exports=n},function(e,t){var n={parse:function(e,t,n){var i=n.getNodeAttributeValue(t,"required");i&&i.length>0&&(e.required=i);var o=n.getSubNodes(t,"Companion");if(o)for(var r=0;r0&&(s.assetWidth=c),c=n.getNodeAttributeNumberValue(a,"assetHeight",-1),c>0&&(s.assetHeight=c),c=n.getNodeAttributeNumberValue(a,"expandedWidth",-1),c>0&&(s.expandedWidth=c),c=n.getNodeAttributeNumberValue(a,"expandedHeight",-1),c>0&&(s.expandedHeight=c),c=n.getNodeAttributeValue(a,"apiFramework"),c&&(s.apiFramework=c),c=n.getNodeAttributeValue(a,"adSlotID"),c&&(s.adSlotID=c);var u=n.getNodeAttributeNumberValue(a,"pxratio",1);1!==u&&(s.pxratio=u),c=n.getNodeAttributeValue(a,"required"),c&&(s.required=c),c=n.getNodeAttributeValue(a,"renderingMode"),c&&(s.renderingMode=c),c=n.getSubNodeValue(a,"AltText"),c&&(s.AltText=c),c=n.getSubNodeValue(a,"AdParameters"),c&&(s.AdParameters=c);var p=n.getSubNode(a,"StaticResource");if(p&&(c=n.getNodeAttributeValue(p,"creativeType"))){var h="video/x-flv"===c||"video/x-f4v"===c||"video/f4v"===c||"application/x-shockwave-flash"===c,m=!1;if(/Android|webOS|iPhone|iPad|BlackBerry|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)&&(m=!0),m&&h)continue;var v={type:c};c=n.getNodeValues(p),c&&(v.src=c,s.StaticResource=v)}c=n.getSubNodeWholeValue(a,"IFrameResource"),c&&(s.IFrameResource=c),c=n.getSubNodeWholeValue(a,"HTMLResource"),c&&(s.HTMLResource=c),c=n.getSubNodeValue(a,"CompanionClickThrough"),c&&(s.CompanionClickThrough=c);var f,g,y,A=n.getSubNodes(a,"CompanionClickTracking");if(A)for(s.CompanionClickTracking=[],f=0;f"),t!==-1&&(n=n.substr(0,t+1)),n}function h(e){var t=p(e),n=null;if("undefined"!=typeof window.DOMParser){if(n=(new DOMParser).parseFromString(t,"text/xml"),"parsererror"===n.documentElement.nodeName){try{T.error(w,"Error reason = "+n.documentElement.childNodes[0].nodeValue)}catch(i){}return null}}else{if("undefined"==typeof window.ActiveXObject)return T.error(w,"Failed to get vast xml parser"),null;try{if(n=new window.ActiveXObject("Microsoft.XMLDOM"),n.loadXML(t),0!==n.parseError.errorCode)return T.error(w,n.parseError),null}catch(o){return T.error(w,"Failed to parse vast xml by window.ActiveXObject(Microsoft.XMLDOM)",o),null}}return n}function m(e){if(D){var t=V.getSubNode(D,"VAST");if(t){var n=D.createAttribute("version");n.value=e,t.setAttributeNode(n)}}}function v(){if(D){var e=V.getSubNode(D,"VAST");if(e){var t=V.getSubNodes(e,"Ad");if(t&&t.length>0)for(var n=0;n0)for(o=0;o0)for(o=0;o0)for(o=0;o0)for(o=0;o0)for(o=0;o0&&(I=V.getSubNode(i,"Extensions"),I?"ie"===j?I.textContent=I.textContent.toString()+x:I.innerHTML=I.innerHTML.toString()+x:(I=D.createElement("Extensions"),i.appendChild(I),"ie"===j?I.textContent=x:I.innerHTML=x)),delete E.extExtensions}if(E.hasOwnProperty("fallbackIndex")){I=V.getSubNode(i,"Extensions"),I||(I=D.createElement("Extensions"),i.appendChild(I));var N=!1,O=V.getSubNodes(I,"Extention");if(O&&O.length>0)for(o=0;o0)for(var i=0;i5){var n=JSON.parse(E.extTrackingUrls),i=V.getSubNode(e,"TrackingEvents");i||(i=D.createElement("TrackingEvents"),e.appendChild(i));for(var o in n){var a=n[o];for(t=0;t0&&(d=V.getSubNode(e,"VideoClicks"),d||(d=D.createElement("VideoClicks"),e.appendChild(d)),!V.getSubNode(d,"ClickThrough"))){var u=D.createElement("ClickThrough");f(u,c[0]),d.appendChild(u)}delete E.extClickUrls}if(E.extCustomClicks&&"string"==typeof E.extCustomClicks){var p=JSON.parse(E.extCustomClicks);if(Array.isArray(p)&&p.length>0)for(d=V.getSubNode(e,"VideoClicks"),d||(d=D.createElement("VideoClicks"),e.appendChild(d)),t=0;t0)for(d=V.getSubNode(e,"VideoClicks"),d||(d=D.createElement("VideoClicks"),e.appendChild(d)),t=0;t0){var A=V.getSubNode(e,"Icons");for(A||(A=D.createElement("Icons"),e.appendChild(A)),t=0;t0){var t=V.getSubNode(M,"CompanionAds");t||(t=D.createElement("CompanionAds"),M.appendChild(t));var n;"unknown"!==e.required&&(n=D.createAttribute("required"),n.value=e.required,t.setAttributeNode(n));for(var i=0;i")>0&&"/g,"]]]]>"),a[s].textContent="");t=(new XMLSerializer).serializeToString(D),t=t.replace(/</g,"<"),t=t.replace(/>/g,">")}else t=(new XMLSerializer).serializeToString(D);return t}};e.exports=a},function(e,t,n){var i=n(60),o=function(e){function t(e){var t=e.indexOf("<"),n=e.substr(t===-1?0:t);return t=n.lastIndexOf(">"),t!==-1&&(n=n.substr(0,t+1)),n}function o(e){var n=t(e),i=null;if("undefined"!=typeof window.DOMParser){if(i=(new DOMParser).parseFromString(n,"text/xml"),"parsererror"===i.documentElement.nodeName){try{r.error(a,"Error reason = "+i.documentElement.childNodes[0].nodeValue)}catch(o){}return null}}else{if("undefined"==typeof window.ActiveXObject)return r.error(a,"Failed to get vast xml parser"),null;try{if(i=new window.ActiveXObject("Microsoft.XMLDOM"),i.loadXML(n),0!==i.parseError.errorCode)return r.error(a,i.parseError),null}catch(s){return r.error(a,"Failed to parse vast xml by window.ActiveXObject(Microsoft.XMLDOM)",s),null}}return i}var r=n(9),a="VAST Parser",s=e,l=new i,d=o(s[0]);if(d){var c=l.getSubNode(d,"VAST"),u=d.createAttribute("apn_waterfall");u.value=!0,c.setAttributeNode(u);for(var p=[],h=0;h0)for(var g=0;g")>0&&"/g,"]]]]>"),t[n].textContent="");e=(new XMLSerializer).serializeToString(d),e=e.replace(/</g,"<"),e=e.replace(/>/g,">")}else e=(new XMLSerializer).serializeToString(d);return e}}};e.exports=o},function(e,t,n){function i(){N={}}function o(e,t){N||(N={}),t=t||_,N[t]||(N[t]={});var n={};n.isImpression=!1,n.reportOnce=!0,n.reported=!1,n.urls=[],N[t][e]=n,F("tracking data created, adId="+t+", event="+e)}function r(e){var t=e;switch(e){case"impressionUrls":t="impression";break;case"clickTrackingUrls":case"click":t="ad-click";break;case"errorUrls":t="error";break;case"imp_tracking_url":t="bid-impression";break;case"init_cb":t="ad-request";break;case"result_cb":t="ad-response";break;case"start":t="video-start";break;case"firstQuartile":t="video-first-quartile";break;case"midpoint":t="video-mid";break;case"thirdQuartile":t="video-third-quartile";break;case"thirdQuartile":t="video-third-quartile";break;case"complete":t="video-complete";break;case"unmute":t="audio-unmute";break;case"mute":t="audio-mute";break;case"pause":t="video-pause";break;case"rewind":t="rewind";break;case"resume":t="video-resume";break;case"fullscreen":t="video-fullscreen";break;case"exitFullscreen":t="video-exit-fullscreen";break;case"creativeView":t="creative-view";break;case"expand":t="ad-expand";break;case"collapse":t="ad-collapse";break;case"acceptInvitation":t="user-accept-invitation";break;case"close":t="user-close";break;case"progress":t="ad-progress";break;case"skip":t="video-skip"}return t}function a(e,t,n){n=n||_,e=r(e),N.hasOwnProperty(n)&&N[n].hasOwnProperty(e)||o(e,n),N[n][e].urls.push(t),F("Tracking added, adId="+n+", event="+e+", url="+t)}function s(e,t){var n="";return D.isNotEmpty(e)&&D.isNotEmpty(t)&&(e=r(e),n=e+"_"+t),n}function l(e,t){t=t||_;var n=!1,i=N[t][e];return i&&i.hasOwnProperty("isImpression")&&(n=i.isImpression===!0),n}function d(e,t,n){if(n=n||_,D.isNotEmpty(e)){N.hasOwnProperty(n)&&N[n].hasOwnProperty(e)||o(e,n);var i=N[n][e];i.reportOnce=t,F("setting report once, adId="+n+", event="+e+", setting="+t)}}function c(e,t,n,i){if(i=i||_,D.isNotEmpty(e)){e=r(e),D.isNotEmpty(n)&&(e=s(e,n)),N.hasOwnProperty(i)&&N[i].hasOwnProperty(e)||o(e,i);var a=N[i][e];a.reportOnce=t,F("setting report once, adId="+i+", event="+e+", setting="+t)}}function u(e,t){if(t=t||_,N&&N.hasOwnProperty(t)){var n=N[t];for(var i in n)if(l(i,t)&&!e)F("reset history skipping impression event="+i+", adId="+t);else{var o=N[t][i];o.reported=!1,F("reset history for adId= "+t+", event="+i)}}}function p(e,t,n){n=n||_,e=r(e),N.hasOwnProperty(n)&&N[n].hasOwnProperty(e)||o(e,n),N[n][e].isImpression=t}function h(e,t){L("requesting tracking for "+t+", url="+e),V.trackPixel(e,t)}function m(e,t){var n=e,i="?";return e.indexOf("?")>-1&&(i="&"),n=e+i+t}function v(e,t,n){var i=e;return e.indexOf(n)>-1&&(i=e.replace(n,t)),i}function f(e,t){if(t){var n=t.value;if(n=n&&"number"==typeof n?n.toString():n,D.isNotEmpty(n)){var i=t.macro;D.isNotEmpty(i)?e.indexOf(i)>-1&&(e=v(e,n,i)):e=m(e,n)}}return e}function g(){var e=(new Date).getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)});return t}function y(){try{return top&&top.location&&top.location.href?top.location.href:-1}catch(e){return-1}}function A(e){for(var t in $)if(e.indexOf("["+t+"]")>=0){var n=$[t];null===n&&(n=B?B.resolveMacro(t):-1),e=e.split("["+t+"]").join(encodeURIComponent(n))}return e}function b(e,t,n){n=n||_;var i=!1;if(N.hasOwnProperty(n)&&N[n].hasOwnProperty(e)){var o=N[n][e];if(o)if(o.reportOnce&&o.reported)U("Cannot report event - event has already been reported: "+e+" for adId="+n),i=!0;else{var r=o.urls;if(r){o.reported=!0;for(var a=0;a-1)s=f(s,{macro:x,value:l});else if(!o.reportOnce&&"ad-click"!==e){var d="apn_rnd="+l;s=f(s,{value:d})}s=A(s),h(s,e)}}}}}i||R("No tracking urls found for adId="+n+", event = "+e)}function k(e,t,n){n=n||_;var i=[];if(N.hasOwnProperty(n)&&N[n].hasOwnProperty(e)){var o=N[n][e];if(o){var r=o.urls;if(r)for(var a=0;a-1){var l=""+Math.floor(1e7*Math.random());s=f(s,{macro:x,value:l})}s=A(s),i.push(s)}}}}return i}function T(e,t){t=t||_;var n=[],i=!1;if(N.hasOwnProperty(t)&&N[t].hasOwnProperty(e)){var o=N[t][e];if(o){var r=o.urls;if(r)for(var a=0;a0&&(n+="&");var o=i+"="+e[i];n+=o}return t.value=n,t}function E(e,t,n,i){var o=s(e,t),r=w(n);b(o,r,i)}function S(e){return"progress>"+e}function I(e,t){if(t=t||_,N&&N.hasOwnProperty(t)){var n=N[t];for(var i in n)i.indexOf(e)>-1&&(delete N[t][i],F("Removing event: "+i+" for key="+e+" and adId="+t));0===N[t].length&&delete N[t]}}function C(e){if(e=e||_,N&&N.hasOwnProperty(e)){var t=N[e];delete N[e];for(var n in t)F("Removing event: "+n+" for adId="+e)}}var P=1,j="[ERRORCODE]",x="[CACHEBUSTING]",_="AN_DEFAULT",V=n(29),D=n(28),M="TM",N={},O=n(9),R=function(e){O.warn(M,e)},U=function(e){O.info(M,e)},L=function(e){O.log(M,e)},F=function(e){O.verbose(M,e)};F("Tracking Manager Version 1.0.14");var B=null,$={TIMESTAMP:(new Date).toISOString(),MEDIAPLAYHEAD:null,BREAKPOSITION:null,ADCOUNT:null,TRANSACTIONID:g(),PLACEMENTTYPE:null,IFA:-1,IFATYPE:-1,CLIENTUA:null,DEVICEIP:null,LATLONG:-1,PAGEURL:y(),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};e.exports={init:function(e,t){if(C(t),e)for(var n=0;n"+o),a(o,n,i)},addProgressTrackingEvent:function(e,t,n){var i=S(e);a(i,t,n)},markAsImpressionEvent:function(e,t,n){F("marking event as impression: "+e+", adId="+(n?n:_)+", value="+t),p(e,t,n)},markAsMediationImpressionEvent:function(e,t,n,i){D.isNotEmpty(n)&&(e=s(e,n)),F("marking event as impression: "+e+", adId="+(i?i:_)+", value="+t),p(e,t,i)},reportOnlyOnce:function(e,t,n){d(e,t,n)},reportMediationOnlyOnce:function(e,t,n,i){c(e,t,n,i)},resetTrackingHistory:function(e,t){u(e,t)},requestTracking:function(e,t){U("tracking requested for "+e+", adId="+(t?t:_)),b(e,null,t)},getTrackingUrls:function(e,t){return U("URLs requested for "+e+", adId="+(t?t:_)),T(e,t)},requestParamTracking:function(e,t,n){U("tracking requested for "+e+" with param="+D.objectToString(t)+", adId="+(n?n:_)),b(e,t,n)},requestMediationTracking:function(e,t,n,i){U("tracking requested for mediation event: "+e+", network="+t+" , params="+D.objectToString(n)+", adId="+(i?i:_)),E(e,t,n,i)},requestErrorTracking:function(e,t,n,i){U("error reported: "+e+", type="+t+", desc="+n,NaN+(i?i:_));var o={},r="";switch(t){case P:o.macro=j,o.value=e,r="error";break;default:o.value="error="+e,r="error"}this.requestParamTracking(r,o,i)},requestErrorTrackingUrls:function(e,t,n,i){var o={},r="";switch(t){case P:o.macro=j,o.value=e,r="error";break;default:o.value="error="+e,r="error"}return k(r,o,i)},requestProgressTracking:function(e,t){var n=S(e);U("Tracking requested for progress event, adId="+(t?t:_)+", offset="+e),this.requestTracking(n,t)},removeEvents:function(e){C(e)},removeEventsForKey:function(e,t){I(e,t)},removeAllEvents:function(){i()}}}]); -//# sourceMappingURL=http://video.devnxs.net/rel/MobileSDKVideoPlayer/1.5.1/1561462807873/MobileSDKVASTPlayer.js.map +this.trigger({type:"addtrack",track:e})},vjs.TextTrackList.prototype.removeTrack_=function(e){for(var t,n=0,i=this.length;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(),!t)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,o=e.currentTime();t.label=i.text,t.selected=i.startTime<=o&&oForeground---WhiteBlackRedGreenBlueYellowMagentaCyan---OpaqueSemi-OpaqueBackground---WhiteBlackRedGreenBlueYellowMagentaCyan---OpaqueSemi-TransparentTransparentWindow---WhiteBlackRedGreenBlueYellowMagentaCyan---OpaqueSemi-TransparentTransparentFont Size50%75%100%125%150%175%200%300%400%Text Edge StyleNoneRaisedDepressedUniformDropshadowFont FamilyDefaultMonospace SerifProportional SerifMonospace Sans-SerifProportional Sans-SerifCasualScriptSmall CapsDefaultsDone'}vjs.TextTrackSettings=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.hide(),vjs.on(this.el().querySelector(".vjs-done-button"),"click",vjs.bind(this,function(){this.saveSettings(),this.hide()})),vjs.on(this.el().querySelector(".vjs-default-button"),"click",vjs.bind(this,function(){this.el().querySelector(".vjs-fg-color > 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:n()})},vjs.TextTrackSettings.prototype.getValues=function(){var t,n,i,o,r,a,s,l,d,c,u,p;t=this.el(),r=e(t.querySelector(".vjs-edge-style select")),a=e(t.querySelector(".vjs-font-family select")),s=e(t.querySelector(".vjs-fg-color > select")),i=e(t.querySelector(".vjs-text-opacity > select")),l=e(t.querySelector(".vjs-bg-color > select")),n=e(t.querySelector(".vjs-bg-opacity > select")),d=e(t.querySelector(".window-color > select")),o=e(t.querySelector(".vjs-window-opacity > select")),p=window.parseFloat(e(t.querySelector(".vjs-font-percent > select"))),c={backgroundOpacity:n,textOpacity:i,windowOpacity:o,edgeStyle:r,fontFamily:a,color:s,backgroundColor:l,windowColor:d,fontPercent:p};for(u in c)(""===c[u]||"none"===c[u]||"fontPercent"===u&&1===c[u])&&delete c[u];return c},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=n.toFixed(2)),t(i.querySelector(".vjs-font-percent > select"),n)},vjs.TextTrackSettings.prototype.restoreSettings=function(){var e;try{e=JSON.parse(window.localStorage.getItem("vjs-text-track-settings"))}catch(t){}e&&this.setValues(e)},vjs.TextTrackSettings.prototype.saveSettings=function(){var e;if(this.player_.options().persistTextTrackSettings){e=this.getValues();try{vjs.isEmpty(e)?window.localStorage.removeItem("vjs-text-track-settings"):window.localStorage.setItem("vjs-text-track-settings",JSON.stringify(e))}catch(t){}}},vjs.TextTrackSettings.prototype.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}}(),vjs.JSON,"undefined"!=typeof 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){function walk(e,t){var n,i,o=e[t];if(o&&"object"==typeof o)for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(i=walk(o,n),void 0!==i?o[n]=i:delete o[n]);return reviver.call(e,t,o)}var j;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,o,r=document.getElementsByTagName("video"),a=document.getElementsByTagName("audio"),s=[];if(r&&r.length>0)for(i=0,o=r.length;i0)for(i=0,o=a.length;i0)for(i=0,o=s.length;i-1||t>-1},m=function(){var e=/iPad|iPhone|iPod/.test(navigator.appVersion);return e},f=function(e){return!!e.isFullscreen||!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)&&(!window.screenTop&&!window.screenY)},v=function(e){switch(e.nativeControlsForTouch=!1,e.controls=!0,e.preload="auto",e.extensions||(e.extensions=""),s.setSizeForInitialRender(e),m()&&e.sideStream&&e.sideStream.enabled===!1&&(e.nonViewableBehavior="pause"),e.initialPlayback){case"auto":e.autoplay=!1;break;case"click":e.autoplay=!1;break;case"mouseover":e.autoplay=!1}e.hasOwnProperty("disableTopBar")||(e.disableTopBar=!1),e.communicator=n.externalNameOfVideoPlayer,(l.isAndroid()||p())&&(e.controlBarPosition="below"),"flash"===n.decidePlayer(e.requiredPlayer)&&(e.controlBarPosition="over");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 i={type:"learnMore"};e.learnMore.text&&(i.text=e.learnMore.text),t.buttons.push(i)}return e};c=v(c),"off"===c.initialAudio&&(n.isMuted=!0),c.flash=c.flash?c.flash:{swf:"http://video.devnxs.net/players/flash/AppnexusFlashPlayer.swf"},n.options=c;var g=function(e,t){if(c.playOnMouseover===!0){var i=function(){n.isDoneInitialPlay===!0&&!n.explicitPaused&&n.isViewable&&n.isPlayingVideo===!1&&n.play()},o=function(){n.pause()};e.addEventListener("mouseenter",i),e.addEventListener("mouseleave",o)}if(c.audioOnMouseover!==!1){var r,a=0;"number"==typeof c.audioOnMouseover&&(a=c.audioOnMouseover);var s=function(){!n.isFullscreen&&n.isDoneInitialPlay&&(clearTimeout(r),n.mute(),e.removeEventListener("mouseleave",s))},l=function(){n.isFullscreen||!n.isDoneInitialPlay||n.mutedByViewability||(r=setTimeout(function(){n.unmute(),u("unmute by mouseover")},a)),e.addEventListener("mouseleave",s,!1)};p()||(d=setInterval(function(){n&&n.isFullscreen&&s&&e&&e.removeEventListener("mouseleave",s)},500),e.addEventListener("mouseenter",l,!1))}if(c.autoInitialSize&&!h()&&window.addEventListener("resize",function(){if(f(n)!==!0){var e=!(!n.options.sideStreamObject||"function"!=typeof n.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated)&&n.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated();e||c.targetElement&&c.targetElement.style&&c.targetElement.style.height&&0===Number(c.targetElement.style.height.replace("px",""))||setTimeout(function(){if(c.disableCollapse.enabled||!n.isSkipped&&!n.isCompleted){c.width=c.targetElement.offsetWidth;var e=/android/i.test(navigator.userAgent.toLowerCase());e?c.targetElement.style.webkitTransition="height 0s ease":c.targetElement.style.transition="height 0s ease",n.resizeVideo(-1),c.targetElement.style.height=c.height+"px";var t=document.getElementById(n.videoObjectId);t&&void 0!==typeof t&&(t.style.width=c.width,t.style.height=c.height),setTimeout(function(){var t=function(e){return e<0?0:e/1e3},n=t(c.expandTime);n=n<=0?.001:n,e?c.targetElement.style.webkitTransition="height "+n+"s ease":c.targetElement.style.transition="height "+n+"s ease"},500)}},0)}}),"flash"===n.decidePlayer(c.requiredPlayer)&&(e.addEventListener("mouseenter",function(){n.mouseIn()}),e.addEventListener("mouseleave",function(){n.mouseOut()})),e.style.cursor="pointer",t&&void 0!==t){if(m()){var v=!1;t.ontouchmove=function(){v=!0},t.ontouchend=function(e){return v?void(v=!1):void g(e)}}else t.onclick=function(e){g(e)};var g=function(){"html5"!==n.decidePlayer(c.requiredPlayer)||c.vpaid||(c.learnMore.enabled===!0?c.learnMore.clickToPause===!0&&(n.isPlayingVideo?n.explicitPause():n.explicitPlay()):n.click())}}var y=n.options&&n.options.playerSkin&&n.options.playerSkin.customPlayerSkin;m()&&n.overlayPlayer&&n.options&&n.options.enableInlineVideoForIos===!1&&y&&(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(c.requiredPlayer)){case"html5":p()?new o(n,g).start():new i(n,g).start();break;case"flash":r(n,g)}a.sharedInstance().run(t)};e.exports=p},function(e,t,n){var i=n(8),o=n(9),r=function(e){o.info("Video Player: "+e)};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(10)(o,e).init,this.UIController=n(16)(o,e,t).init,this.displayVolumeControls=n(42)(o).displayVolumeControls,this.start=function(){r("WE ARE USING HTML5 PLAYER");var t=(new Date).getTime()+Math.floor(1e4*Math.random());o.options.techOrder=["html5"],o.options.iframeVideoWrapperId="iframeVideoWrapper_"+t;var n="an_video_ad_player_"+t,i="an_video_ad_player_"+t+"_html5_api";o.an_video_ad_player_id=n,o.an_video_ad_player_html5_api_id=i,e.divIdForVideo=n,e.videoId=i,o.targetElement=o.options.targetElement,o.initializeIframeAndVideo(o.UIController)}}},function(e,t,n){function i(e,t){if(!(e&&t&&e.getBoundingClientRect&&t.getBoundingClientRect))return s("Utils.elementsOverlap expects two html elements"),!1;var n=e.getBoundingClientRect(),i=t.getBoundingClientRect();return!(n.righti.right||n.bottomi.bottom)}var o="PlayerManager_Utils",r=n(9),a=function(e){r.verbose(e,o)},s=function(e){r.info(e,o)},l=function(){var e=/iphone/i.test(navigator.userAgent.toLowerCase());return e},d=function(){var e=l()||/ipad/i.test(navigator.userAgent.toLowerCase());return e},c=function(){return/android/i.test(navigator.userAgent.toLowerCase())},u=function(){return navigator.appVersion.indexOf("Mobile")>-1||navigator.appVersion.indexOf("Android")>-1},p=function(){var e=navigator.userAgent.match(/OS (\d+)_/i);if(e&&e[1])return e[1]},h=function(e,t){!t.isSkipped&&t.isExpanded&&(e.autoInitialSize&&!e.shouldResizeVideoToFillMobileWebview&&(e.width=e.targetElement.offsetWidth),t.resizeVideo(-1,u()),e.targetElement.style.height=e.height+"px")},m=function(e){d()&&e.options.enableInlineVideoForIos&&setTimeout(function(){var t=document.getElementById(e.options.iframeVideoWrapperId);t.style.width="",t.style.height=""},0)},f=function(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),n.eventName=t,e.dispatchEvent(n)},v=function(){this.queue=[],this.id="",this.isSuppress=!1,this.isPaused=!1,this.isCompleted=!1;var e=100,t=!1;this.push=function(e){return this.isSuppress===!1&&"function"==typeof e?void e():t?void(t=!1):void(this.isPaused===!1&&this.queue.push(e))},this.start=function(){a("delay event starts");var t=this,n=function(){if(t.isSuppress===!1){var i=t.queue.shift();i&&"function"==typeof i&&i()}setTimeout(function(){t.isCompleted===!1&&n()},e)};n()},this.ImmediateStop=function(){this.isCompleted=!0},this.lazyTerminate=function(){var e=this,t=function(){e.ImmediateStop()};this.queue.push(t)},this.suppress=function(e){this.isSuppress=e},this.clearQueue=function(){this.queue=[]},this.ignoreNextQueue=function(){t=!0}},g=function(e){return"undefined"==typeof e||""===e||e===!1||null===e},y=function(e){if(null===e||void 0===e)return!0;if(0===e.length)return!0;if(""===e)return!0;if("object"!=typeof e)return!1;if(e.length>0)return!1;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},A=function(){var e={};return{pushAndCheck:function(t,n){var i=t+"_"+n;return!e[i]&&(e[i]=!0,!0)}}},b=function(e){var t=!1;try{t=!isNaN(parseFloat(e))&&isFinite(e)}catch(n){a(n)}return t},k=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}n=e.indexOf(".");var o=n>0?Number(e.substring(n+1).substr(0,3)):0;n>0&&(e=e.substring(0,n));var r=e.split(":");if(3===r.length){for(var s=0;s0&&(i+=n+">"),i+=t,c(e)&&console.log(i)}catch(o){c(e)&&console.log(o)}}var p=0,h=1,m=2,f=3,v=4,g=5,y=6,A=6,b="AppNexus_Page_Debug_Log_Level",k=y,T=p,w=T,E=T,S=T,I=T;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(n){}},always:function(){try{o.call(this,h,Array.prototype.slice.call(arguments))}catch(e){}},error:function(){try{o.call(this,m,Array.prototype.slice.call(arguments))}catch(e){}},log:function(){try{o.call(this,g,Array.prototype.slice.call(arguments))}catch(e){}},warn:function(){try{o.call(this,f,Array.prototype.slice.call(arguments))}catch(e){}},info:function(){try{o.call(this,v,Array.prototype.slice.call(arguments))}catch(e){}},debug:function(){try{o.call(this,y,Array.prototype.slice.call(arguments))}catch(e){}},verbose:function(){try{o.call(this,A,Array.prototype.slice.call(arguments))}catch(e){}},handleLogDebugLegacySupport:function(e,t){try{u(g,e,t)}catch(n){}},setDebugLevel:function(e){try{d(e)}catch(t){}},isTraceLevelActive:function(e){try{return c(e)}catch(t){return!1}},TRACE_LEVEL_ALWAYS:h,TRACE_LEVEL_ERROR:m,TRACE_LEVEL_WARN:f,TRACE_LEVEL_INFO:v,TRACE_LEVEL_LOG:g,TRACE_LEVEL_DEBUG:y,TRACE_LEVEL_VERBOSE:A},l()},function(e,t,n){var i="[PlayerManager_InitializeElements]",o=n(9),r=n(11),a=function(e){o.verbose(i,e)},s=function(e){o.debug(i,e)},l=function(e){o.log(i,e)};e.exports=function(e,t){return{init:function(n){l("init");var i,o=!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;c-1;v&&t.overlayPlayer===!1?(i.onload=function(){m(),f=!0},setTimeout(function(){f===!1&&(a("destroying due to an error in firefox"),t.destroyWithoutSkip(!0,e.CONST_MESSAGE_GENERAL_ERROR,null,900))},e.options.vpaidTimeout)):m()}}}},function(e,t,n){var i=(n(12),n(14)),o=n(15),r=o.OmidSessionClient.AdSession,a=o.OmidSessionClient.Partner,s=o.OmidSessionClient.Context,l=o.OmidSessionClient.VerificationScriptResource,d=o.OmidSessionClient.AdEvents,c=o.OmidSessionClient.VideoEvents,u="[PlayerManager_Verifications]",p=n(9);e.exports=function(e,t){var n,o,h,m=e,f=t,v=[],g=new i(e,t.player),y=function(e){p.debug(u,"OMID sessionObserver");try{"sessionStart"===e.type?(p.debug(u,"OMID sessionStart"),""!==OMIDVideoEvents().position&&h.loaded({isSkippable:OMIDVideoEvents().isSkippable,isAutoPlay:OMIDVideoEvents().isAutoPlay,position:OMIDVideoEvents().position}),o.impressionOccurred()):"sessionError"===event.type?p.debug(u,"OMID sessionError"):"sessionFinish"===event.type&&p.debug(u,"OMID sessionFinish")}catch(t){p.debug(u,"Failed OMID sessionStart "+t)}};return{init:function(){p.debug(u,"init verifications");for(var e=0;e0)try{if(""!==getOMIDPartner().name&&""!==getOMIDPartner().version){var E=new a(getOMIDPartner().name,getOMIDPartner().version),S=new s(E,v);p.debug(u,"BuildTest::"+f.videoElement),S.setVideoElement(f.videoElement),n=new r(S),o=new d(n),h=new c(n),n.registerSessionObserver(y),p.debug(u,"OMID _adSession"),p.debug(u,n),p.debug(u,h)}}catch(w){p.debug(u,"Failed OMID registerSessionObserver "+w)}},start:function(){p.debug(u,"start verifications")},dispatchEvent:function(e,t){p.debug(u,"try to dispatch OMID event: "+e+", data: ",t);try{"start"===e?h.start(t.duration,t.videoPlayerVolume):"firstQuartile"===e?h.firstQuartile():"thirdQuartile"===e?h.thirdQuartile():"midpoint"===e?h.midpoint():"complete"===e?h.complete():"volumeChange"===e?h.volumeChange(t.videoPlayerVolume):"adUserInteraction"===e?h.adUserInteraction(t.interactionType):"resume"===e?h.resume():"pause"===e?h.pause():"playerStateChange"===e?h.playerStateChange(t.state):"skipped"===e&&h.skipped()}catch(n){p.debug(u,"Failed OMID Video Events "+n)}},destroy:function(){p.debug(u,"destroy verifications")}}}},function(e,t,n){var i=n(13),o="[PlayerManager_Verification_OMID]",r=n(9),a=function(e){r.debug(o,e)};e.exports=function(e,t){function n(){var e=(new Date).getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)});return t}function s(e,t){p=e,h=t,v&&u()}function l(e,t){y&&y.addListener(e,t)}function d(){var e={apiVersion:"1.0",environment:"web",accessMode:"full",videElement:f.videoElement,adSessionType:"html",adCount:1,omidJsInfo:{omidImplementer:"videoads-ad-video-player-manager",serviceVersion:"3.5.19"}};return m.adServingId&&(e.adServingId=m.adServingId),e}function c(e){return e===m.vendor?m.verificationParams:null}function u(){r.debug(o,"start OMID session");var e={adSessionId:g,type:"sessionStart",timestamp:Date.now(),data:{context:d()}},t=c(h);t&&(e.data.verificationParameters=t),y=new i(g,p),p(e)}var p,h,m=e,f=t,v=!1,g=n(),y=null,A=[];return{init:function(){r.debug(o,"expose OMID interface"),f.frameWin.omid3p={registerSessionObserver:s,addEventListener:l}},start:function(){v=!0,p&&u()},dispatchEvent:function(e,t){y?(A.length>0&&(A.forEach(function(t){a("dispatch from cache OMID event "+e),y.fireEvent(t.eventName,t.data)}),A=[]),r.debug(o,"dispatch OMID event "+e),y.fireEvent(e,t)):(r.debug(o,"save in cache OMID event "+e),A.push({event:e,data:t}))},destroy:function(){if(r.debug(o,"terminate OMID session"),p&&v){var e={adSessionId:g,type:"sessionFinish",timestamp:Date.now()};p(e)}}}}},function(e,t){e.exports=function(e,t){function n(e,t){return!!e.find(function(e){return t===e})}function i(e){return n(u,e)||n(p,e)||n(h,e)||n(m,e)||n(f,e)}function o(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={},n.mediaType="video";break;case"loaded":n={},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={},n.duration=t.duration,n.videoPlayerVolume=t.volume;break;case"volumeChange":n={},n.videoPlayerVolume=t.volume;break;case"playerStateChange":n={},n.state=t.state;break;case"adUsetInteraction":n={},n.interactionType=t.interactionType}return n}function r(e,t){var n={adSessionId:l,type:e,timestamp:Date.now()},i=o(e,t);return i&&(n.data=i),n}function a(e){return"sessionError"===e}function s(e,t){c.hasOwnProperty(e)||(c[e]=[]),c[e].push(t)}var l=e,d=t,c={},u=["sessionStart","sessionError","sessionFinish"],p=["impression"],h=["loaded","start","firstQuartile","midpoint","thirdQuartile","complete","pause","resume","bufferStart","bufferFinish","skipped","volumeChange","playerStateChange","adUserInteraction"],m=["geometryChange"],f=["video"];return{addListener:function(e,t){i(e)&&(n(f,e)?h.forEach(function(e){s(e,t)}):s(e,t))},fireEvent:function(e,t){if(c.hasOwnProperty(e)){var n=r(e,t);a(e)?d(n):c[e].forEach(function(e){e(n)})}}}}},function(e,t,n){var i="[PlayerManager_Verification_Tracking]",o=n(9);e.exports=function(e,t){function n(e,t){var n=e;if(t)for(var i in t)n=n.split("["+i.toUpperCase()+"]").join(encodeURIComponent(t[i]));return n=a(n)}function r(){var e=(new Date).getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)});return t}function a(e){for(var n in c)if(e.indexOf("["+n+"]")>=0){var i=c[n];null===i&&(i=t?t.resolveMacro(n):-1),e=e.split("["+n+"]").join(encodeURIComponent(i))}return e}for(var s={},l=0;li)throw Error("Value for "+e+" is outside the range ["+n+","+i+"]")},assertFunction:function(e,t){if(!t)throw Error(e+" must not be truthy.")},assertPositiveNumber:function(e,t){if((0,module$exports$omid$common$argsChecker.assertNumber)(e,t),0>t)throw Error(e+" must be a positive number.")}},module$exports$omid$common$exporter={};module$exports$omid$common$exporter.packageExport=function(e,t,n){(n=void 0===n?module$contents$omid$common$exporter_getOmidExports():n)&&(e=e.split("."),e.slice(0,e.length-1).reduce(module$contents$omid$common$exporter_getOrCreateName,n)[e[e.length-1]]=t)};var module$exports$omid$sessionClient$Partner=function(e,t){module$exports$omid$common$argsChecker.assertTruthyString("Partner.name",e),module$exports$omid$common$argsChecker.assertTruthyString("Partner.version",t),this.name=e,this.version=t};(0,module$exports$omid$common$exporter.packageExport)("OmidSessionClient.Partner",module$exports$omid$sessionClient$Partner);var module$exports$omid$sessionClient$VerificationScriptResource=function(e,t,n){module$exports$omid$common$argsChecker.assertTruthyString("VerificationScriptResource.resourceUrl",e),this.resourceUrl=e,this.vendorKey=t,this.verificationParameters=n};(0,module$exports$omid$common$exporter.packageExport)("OmidSessionClient.VerificationScriptResource",module$exports$omid$sessionClient$VerificationScriptResource);var module$exports$omid$sessionClient$Context=function(e,t){module$exports$omid$common$argsChecker.assertNotNullObject("Context.partner",e),this.partner=e,this.verificationScriptResources=t,this.videoElement=this.slotElement=null};module$exports$omid$sessionClient$Context.prototype.setVideoElement=function(e){module$exports$omid$common$argsChecker.assertNotNullObject("Context.videoElement",e),this.videoElement=e},module$exports$omid$sessionClient$Context.prototype.setSlotElement=function(e){module$exports$omid$common$argsChecker.assertNotNullObject("Context.slotElement",e),this.slotElement=e},(0,module$exports$omid$common$exporter.packageExport)("OmidSessionClient.Context",module$exports$omid$sessionClient$Context);var module$exports$omid$common$OmidGlobalProvider={},module$contents$omid$common$OmidGlobalProvider_globalThis=eval("this");module$exports$omid$common$OmidGlobalProvider.omidGlobal=module$contents$omid$common$OmidGlobalProvider_getOmidGlobal();var module$contents$omid$sessionClient$OmidJsSessionInterface_ExportedNodeKeys={ROOT:"omidSessionInterface",AD_EVENTS:"adEvents",VIDEO_EVENTS:"videoEvents"},module$contents$omid$sessionClient$OmidJsSessionInterface_MethodNameMap={sessionError:"reportError"},module$contents$omid$sessionClient$OmidJsSessionInterface_VideoEventMethodNames=Object.keys(module$exports$omid$common$constants.VideoEventType).map(function(e){return module$exports$omid$common$constants.VideoEventType[e]}),module$contents$omid$sessionClient$OmidJsSessionInterface_AdEventMethodNames=["impressionOccurred"],module$exports$omid$sessionClient$OmidJsSessionInterface=function(e){e=void 0===e?module$exports$omid$common$OmidGlobalProvider.omidGlobal:e,this.interfaceRoot_=e[module$contents$omid$sessionClient$OmidJsSessionInterface_ExportedNodeKeys.ROOT]};module$exports$omid$sessionClient$OmidJsSessionInterface.prototype.isSupported=function(){return null!=this.interfaceRoot_},module$exports$omid$sessionClient$OmidJsSessionInterface.prototype.sendMessage=function(e,t,n){if("registerSessionObserver"==e&&(n=[t]),module$contents$omid$sessionClient$OmidJsSessionInterface_MethodNameMap[e]&&(e=module$contents$omid$sessionClient$OmidJsSessionInterface_MethodNameMap[e]),t=this.interfaceRoot_,0<=module$contents$omid$sessionClient$OmidJsSessionInterface_AdEventMethodNames.indexOf(e)&&(t=t[module$contents$omid$sessionClient$OmidJsSessionInterface_ExportedNodeKeys.AD_EVENTS]),0<=module$contents$omid$sessionClient$OmidJsSessionInterface_VideoEventMethodNames.indexOf(e)&&(t=t[module$contents$omid$sessionClient$OmidJsSessionInterface_ExportedNodeKeys.VIDEO_EVENTS]),t=t[e],!t)throw Error("Unrecognized method name: "+e+".");t.apply(null,$jscomp.arrayFromIterable(n))};var module$exports$omid$common$Rectangle=function(e,t,n,i){this.x=e,this.y=t,this.width=n,this.height=i},module$exports$omid$common$logger={error:function(e){for(var t=[],n=0;no)break;if(i'))))},appendPresenceIframe_:function(e){var t=e.document.createElement("iframe");t.id=module$exports$omid$common$DetectOmid.OMID_PRESENT_FRAME_NAME,t.name=module$exports$omid$common$DetectOmid.OMID_PRESENT_FRAME_NAME,t.style.display="none",e.document.body.appendChild(t)},isMutationObserverAvailable_:function(e){return"MutationObserver"in e},registerMutationObserver_:function(e){var t=new MutationObserver(function(n){n.forEach(function(n){"BODY"===n.addedNodes[0].nodeName&&(module$exports$omid$common$DetectOmid.appendPresenceIframe_(e),t.disconnect())})});t.observe(e.document.documentElement,{childList:!0})}},module$exports$omid$common$serviceCommunication={},module$contents$omid$common$serviceCommunication_EXPORTED_SESSION_COMMUNICATION_NAME=["omid","v1_SessionServiceCommunication"],module$contents$omid$common$serviceCommunication_EXPORTED_VERIFICATION_COMMUNICATION_NAME=["omid","v1_VerificationServiceCommunication"],module$contents$omid$common$serviceCommunication_EXPORTED_SERVICE_WINDOW_NAME=["omid","serviceWindow"];module$exports$omid$common$serviceCommunication.isCrossOrigin=function(e){if(e===module$exports$omid$common$OmidGlobalProvider.omidGlobal)return!1; +try{if("undefined"==typeof e.location.hostname)return!0;module$contents$omid$common$serviceCommunication_isSameOriginForIE(e)}catch(t){return!0}return!1},module$exports$omid$common$serviceCommunication.resolveGlobalContext=function(e){return"undefined"==typeof e&&"undefined"!=typeof window&&window&&(e=window),module$contents$omid$common$serviceCommunication_isValidWindow(e)?e:module$exports$omid$common$OmidGlobalProvider.omidGlobal},module$exports$omid$common$serviceCommunication.startSessionServiceCommunication=function(e,t,n){n=void 0===n?module$exports$omid$common$DetectOmid.isOmidPresent:n;var i=[e,module$contents$omid$common$serviceCommunication_resolveTopWindowContext(e)];return t&&i.unshift(t),module$contents$omid$common$serviceCommunication_startServiceCommunicationFromCandidates(e,i,module$contents$omid$common$serviceCommunication_EXPORTED_SESSION_COMMUNICATION_NAME,n)},module$exports$omid$common$serviceCommunication.startVerificationServiceCommunication=function(e,t){t=void 0===t?module$exports$omid$common$DetectOmid.isOmidPresent:t;var n=[],i=module$contents$omid$common$serviceCommunication_getValueForKeypath(e,module$contents$omid$common$serviceCommunication_EXPORTED_SERVICE_WINDOW_NAME);return i&&n.push(i),n.push(module$contents$omid$common$serviceCommunication_resolveTopWindowContext(e)),module$contents$omid$common$serviceCommunication_startServiceCommunicationFromCandidates(e,n,module$contents$omid$common$serviceCommunication_EXPORTED_VERIFICATION_COMMUNICATION_NAME,t)};var module$contents$omid$sessionClient$AdSession_SESSION_CLIENT_VERSION=module$exports$omid$common$version.Version,module$exports$omid$sessionClient$AdSession=function(e,t,n){module$exports$omid$common$argsChecker.assertNotNullObject("AdSession.context",e),this.context_=e,this.impressionOccurred_=!1,this.communication_=t||(0,module$exports$omid$common$serviceCommunication.startSessionServiceCommunication)((0,module$exports$omid$common$serviceCommunication.resolveGlobalContext)()),this.sessionInterface_=n||new module$exports$omid$sessionClient$OmidJsSessionInterface,this.isSessionRunning_=this.hasVideoEvents_=this.hasAdEvents_=!1,this.callbackMap_={},this.communication_&&(this.communication_.onMessage=this.handleInternalMessage_.bind(this)),this.setClientInfo_(),this.injectVerificationScripts_(e.verificationScriptResources),this.sendSlotElement_(e.slotElement),this.sendVideoElement_(e.videoElement),this.watchSessionEvents_()};module$exports$omid$sessionClient$AdSession.prototype.isSupported=function(){return!!this.communication_||this.sessionInterface_.isSupported()},module$exports$omid$sessionClient$AdSession.prototype.isSendingElementsSupported_=function(){return this.communication_?this.communication_.isDirectCommunication():this.sessionInterface_.isSupported()},module$exports$omid$sessionClient$AdSession.prototype.registerSessionObserver=function(e){this.sendMessage("registerSessionObserver",e)},module$exports$omid$sessionClient$AdSession.prototype.error=function(e,t){this.sendOneWayMessage("sessionError",e,t)},module$exports$omid$sessionClient$AdSession.prototype.registerAdEvents=function(){if(this.hasAdEvents_)throw Error("AdEvents already registered.");this.hasAdEvents_=!0,this.sendOneWayMessage("registerAdEvents")},module$exports$omid$sessionClient$AdSession.prototype.registerVideoEvents=function(){if(this.hasVideoEvents_)throw Error("VideoEvents already registered.");this.hasVideoEvents_=!0,this.sendOneWayMessage("registerVideoEvents")},module$exports$omid$sessionClient$AdSession.prototype.sendOneWayMessage=function(e,t){for(var n=[],i=1;i0?e.click(o.url):e.click():t({name:"ad-click",trackClick:!0}):r[i]&&t({name:r[i]}),e.notifyVpaidEvent(i),"AdVideoComplete"===i&&e.adVideoPlayer.trigger("customDestroy")},k=i.isIos()||i.isAndroid(),T=this;e.options.overlayPlayer&&e.resizeVideo();var w=T.vastClient({url:"",jsVpaidUrl:m,playAdAlways:!0,adCancelTimeout:r,adsEnabled:!0,adParameters:n.adParameters,clickUrl:n.clickUrls[0],delayExpandUntilVPAIDInit:n.delayExpandUntilVPAIDInit,terminateUnresponsiveVPAIDCreative:n.terminateUnresponsiveVPAIDCreative,disableControlsOnMouseover:k,initialAudio:n.initialAudio,loggerCallback:y,vpaidEventCallback:b,delayExpandUntilVPAIDImpression:n.delayExpandUntilVPAIDImpression,vpaidEnvironmentVars:n.vpaidEnvironmentVars,overlayPlayer:n.overlayPlayer,mobileSDK:n.mobileSDK,initialPlayback:n.initialPlayback,controlBarPosition:n.controlBarPosition}),E=function(){if(e.options.overlayPlayer){var t=T,n=i.isAndroid()?1e3:500;setTimeout(function(){t.paused()&&t.tech&&t.tech.el()&&t.tech.el().src&&t.trigger("pause")},n)}};if(T.on("reset",function(){T.options().plugins["ads-setup"].adsEnabled?w.enable():w.disable()}),T.on("vast.adError",function(t){if(g!==!0){g=!0,T.loadingSpinner.hide(),e.destroyWithoutSkip(!0,a,!1,901);var n=t.error;n&&n.message&&p("JS-VPAID Error (vast.adError)"+n.message)}}),T.on("vpaid.AdVideoStart",function(){var t=e&&e.adVideoPlayer&&e.adVideoPlayer.player?e.adVideoPlayer.player().duration():0;if(e.test("VIDLA509",t),t&&t>0)e.setVastAttribute();else{var n=!1;T.one("loadedmetadata",function(){if(n=!0,t=e&&e.adVideoPlayer&&e.adVideoPlayer.player?e.adVideoPlayer.player().duration():0,e.test("VIDLA509",t),t&&t>0)e.setVastAttribute();else{var i=e.options.data.vastDurationMsec;i=i&&i>0?Math.round(i/1e3):0,e.test("VIDLA509-2",i),e.setVastAttribute(i)}}),setTimeout(function(){if(n===!1){var t=e.options.data.vastDurationMsec;t=t&&t>0?Math.round(t/1e3):0,e.test("VIDLA509-2",t),e.setVastAttribute(t)}},3e3)}}),T.on("vast.adTimeout",function(){T.loadingSpinner.hide(),e.destroyWithoutSkip(!0,s,!0,901)}),T.on("vpaid.AdError",function(t){if(g!==!0){g=!0,T.loadingSpinner.hide(),e.destroyWithoutSkip(!0,s,!1,901);var n=t.error;n&&n.message&&p("JS-VPAID Error (vpaid.AdError) "+n.message)}}),T.on("vast.adSkip",function(){e.destroy(),p("vast.adSkip")}),T.on("vpaid.AdSkipped",function(){e.destroy(),p("vpaid.AdSkipped")}),T.on("vpaid.AdIcons",function(t){t&&t.hasOwnProperty("adIcons")&&t.adIcons||(e.options.showVpaidIcons=!0)}),T.on("vast.adsCancel",function(){g||(g=!0,e.destroyWithoutSkip(),p("adsCancel"))}),T.on("vpaid.AdStopped",function(){return p("vpaid.AdStopped"),n.disableCollapse.replay===!0?void e.resetVpaid():(T.loadingSpinner.hide(),T.controlBar.hide(),T.bigPlayButton.hide(),void(e.isCompleted||(n.disableCollapse.enabled||e.destroyWithoutSkip(),e.isCompleted=!0)))}),T.one("vpaid.AdStarted",function(){E(),v&&n.overlayPlayer&&("edge"===A||"ie"===A?v.style.visibility="visible":v.style.display="block"),T.loadingSpinner.hide()}),T.one("vpaid.AdImpression",function(){E(),T.controlBar.show(),n.showBigPlayButton&&T.bigPlayButton.show()}),f.cbWhenReady){var S=function(){e.test("VIDLA509-1",""),p("callcbWhenReady (Impression, AdStarted are delivered"),e.isReadyToExpandForMobile=!0,T.tech.removeControlsListeners();var t=e.options.width/e.options.height;e.resizeVideo(t,i.isMobile()),n.isWaterfall&&n.firstAdAttempted&&n.delayExpandUntilVPAIDInit&&!n.isExpanded&&"auto"!==n.initialPlayback&&T.bigPlayButton.show(),"function"==typeof f.cbWhenReady&&f.cbWhenReady(e)},I=function(){var t=!1,n=T.volume(),o=!1,r=!1,a=!1,s=!1,l=100,d=function(){o&&r&&a&&t===!1&&(t=!0,setTimeout(S,500))};if(i.isIos()){T.on("timeupdate",function(){var t=T.player().currentTime();t>0&&s===!1&&e.isAlreadyPlaingForVPAID===!1&&(s=!0,a=!0,T.pause(),d(),p("pause by timeupdate when delayExpandUntilVPAIDImpression is true"))});var c=function(){var n=T.player().currentTime();n>0&&s===!1&&e.isAlreadyPlaingForVPAID===!1&&(s=!0,a=!0,T.pause(),d(),p("pause by timer when delayExpandUntilVPAIDImpression is true")),t||setTimeout(c,l)};setTimeout(c,l)}else T.one("vpaid.AdVideoStart",function(){e.isAlreadyPlaingForVPAID===!1&&T.pause(),T.volume(n),a=!0,d()});T.one("vpaid.AdStarted",function(){o=!0,d()}),T.one("vpaid.AdImpression",function(){r=!0,d()}),T.volume(0),e.delayEventHandler.ignoreNextQueue(),i.isIos()?(e.adVideoPlayer.trigger("play"),e.isDoneInitialPlay=!0):T.play()},C=function(){n.delayExpandUntilVPAIDImpression?I():S()};n.isWaterfall&&n.firstAdAttempted?T.one("an.doneInitialize",C):n.delayExpandUntilVPAIDInit?T.one("an.readytogovpaid",C):T.one("an.doneInitialize",C)}})};e.exports=m},function(e,t,n){var i="UserAgentParser",o=n(9);o.always(i,"Version 0.0.1");var r=function(e,t){var n="",i="?",o="function",a="object",s="string",l="model",d="name",c="type",u="vendor",p="version",h="console",m="mobile",f="tablet",v="smarttv",g="wearable",y={extend:function(e,t){var n={};for(var i in e)t[i]&&t[i].length%2===0?n[i]=t[i].concat(e[i]):n[i]=e[i];return n},has:function(e,t){return"string"==typeof e&&t.toLowerCase().indexOf(e.toLowerCase())!==-1},lowerize:function(e){return e.toLowerCase()},major:function(e){return typeof e===s?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},A={rgx:function(){var e,t,n,i,r,s,l={},d=0,c=arguments;for(n=0;n0?2===i.length?typeof i[1]===o?l[i[0]]=i[1].call(this,s):l[i[0]]=i[1]:3===i.length?typeof i[1]!==o||i[1].exec&&i[1].test?l[i[0]]=s?s.replace(i[1],i[2]):void 0:l[i[0]]=s?i[1].call(this,s,i[2]):void 0:4===i.length&&(l[i[0]]=s?i[3].call(this,s.replace(i[1],i[2])):void 0):l[i]=s?s:void 0;d+=2}return l},str:function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var o=0;o0&&t.explicitUnmute():t.explicitMute()};n.controlBar.muteToggle.on("click",l),n.controlBar.muteToggle.on("touchend",l)}else s("removing mute button"),n.controlBar.muteToggle.dispose();if(e.options.showVolume===!0&&e.displayVolumeControls()&&n.controlBar.volumeControl.volumeBar.on("mousedown",function(){var e=n.volume();e<=0&&!t.isMuted&&(s("muting from volume scrubber"),t.explicitMute()),e>0&&t.isMuted&&(s("unmuting from volume scrubber"),t.explicitUnmute())}),i.isIos()&&e.options.enableNativeInline&&parseInt(i.getIOSVersion())>9&&"click"!==e.options.initialPlayback&&(n.muted(!0),n.controlBar.muteToggle.update()),"boolean"==typeof e.options.customButton.enabled&&e.options.customButton.enabled===!0){var d=e.options.playerSkin.controlBarHeight||30,c=Math.min(50,e.options.customButton.imgWidth),u=Math.min(d,e.options.customButton.imgHeight),p=Math.floor((d-u)/2),h="a";e.isMobile()&&(h="span");var m=e.videojsOrigin.createEl("div",{innerHTML:"<"+h+' href="'+e.options.customButton.url+'" target="_blank">'+h+">", +role:"button","aria-live":"polite",tabindex:"0"});m.style.cssText="float:right;font-family:VideoJS;font-size:1.5em;line-height:2;width:50px;height:100%;text-align:center",n.controlBar.addChild("button",{el:m}),n.controlBar.el().insertBefore(m,n.controlBar.fullscreenToggle.el())}n.controlBar.progressControl.seekBar.seekHandle.hide(),n.controlBar.progressControl.seekBar.el_.style.pointerEvents="none","boolean"==typeof e.options.showProgressBar?(e.options.showProgressBar===!1&&(s("removing progress bar"),n.controlBar.currentTimeDisplay.hide(),n.controlBar.timeDivider.hide(),n.controlBar.durationDisplay.hide()),n.controlBar.progressControl.seekBar.hide()):"text"===e.options.showProgressBar?(s("removing progress text"),n.controlBar.progressControl.seekBar.hide()):"bar"===e.options.showProgressBar&&(s("removing progress bar"),n.controlBar.currentTimeDisplay.hide(),n.controlBar.timeDivider.hide(),n.controlBar.durationDisplay.hide()),e.options.allowFullscreen===!1&&(s("removing fullscreen toggle"),n.controlBar.fullscreenToggle.addClass("vjs-hidden")),e.isMobile()&&e.options.allowFullscreen===!0&&e.options.showMute===!0&&(n.controlBar.fullscreenToggle.el().style.visibility="hidden",n.controlBar.muteToggle.el().style.visibility="hidden"),e.options.targetElement.addEventListener("outstream-impression",function(){e.isMobile()&&e.options.allowFullscreen===!0&&e.options.showMute===!0&&(n.controlBar.fullscreenToggle.el().style.visibility="visible",n.controlBar.muteToggle.el().style.visibility="visible")}),e.options.targetElement.addEventListener("vastplayer-impression",function(){e.isMobile()&&e.options.allowFullscreen===!0&&e.options.showMute===!0&&(n.controlBar.fullscreenToggle.el().style.visibility="visible")})}}}},function(e,t,n){var i="[PlayerManager_AdIndicator]",o=n(9),r=function(e){o.verbose(i,e)};e.exports=function(e,t){return{init:function(n,i,o,a,s){r("init"),o.id="ad_indicator_text",o.innerHTML=e.adIndicatorTextContent,o.className="top-bar-text",o.role="button";var l="3em";if(e.isMobile()&&(l="5em"),o.style["text-align"]="right",o.style["margin-right"]="1em",o.style["margin-left"]="1em",o.style["font-size"]="1em",o.style.right="0px",o.style.left="",o.style["line-height"]="24px",o.style.outline="0",o.style.position="absolute",o.style.padding="0",o.style.height="auto",o.style.width="auto",o.style["max-width"]="35%",o.style["white-space"]="nowrap",o.style.overflow="hidden",o.style["text-overflow"]="ellipsis",s?o.style.cursor="pointer":o.style["pointer-events"]="none",a.style["text-align"]="right",a.style["margin-right"]="1em",a.style["margin-left"]="1em",a.style["font-size"]="1em",a.style.right="0px",a.style.left="",a.style["line-height"]="3em",a.style.outline="0",a.style.position="absolute",a.style.padding="0",a.style.height=l,a.style["max-width"]="35%",a.style.width="auto",a.style["text-overflow"]="ellipsis",a.style["white-space"]="nowrap",a.style.overflow="hidden",a.style.display="none",s){a.style.cursor="pointer";var d=function(n){t.click(),e.isMobile()&&(n.stopPropagation(),n.preventDefault())};o.addEventListener("touchend",d),a.addEventListener("touchend",d),o.addEventListener("click",d),a.addEventListener("click",d)}else a.style["pointer-events"]="none";n.addChild("button",{el:a})}}}},function(e,t,n){var i="[PlayerManager_Skip]",o=n(9),r=n(8),a=function(e){o.debug(i,e)},s=function(e){o.verbose(i,e)};e.exports=function(e,t){return{init:function(n,i,o,l,d){a("init");var c,u;if(e.options.skippable.enabled===!0){s("creating and styling skip buttons and skip texts");var p=e.options.skippable.videoThreshold,h=e.options.skippable.skipText,m=e.options.skippable.skipButtonText;c=d.contentWindow.document.createElement("div"),c.id="skip_button",c.innerHTML=m,c.className="top-bar-text",c.role="button";var f="";e.isMobile()&&(f="5.0em"),c.style.display="none",c.style.cursor="pointer",c.style["font-weight"]="bold",c.style["margin-right"]="1em",c.style["margin-left"]="1em",c.style["font-size"]="1em",c.style.right="",c.style.left="0px",c.style["line-height"]="24px",c.style.outline="0",c.style.position="absolute",c.style.padding="0",c.style.height=f,c.style.width="auto",c.style["min-width"]="5em",c.style["text-align"]="left",e.floatingSkipButton=e.videojsOrigin.createEl("div",{className:"top-bar-text",role:"button",innerHTML:m}),e.floatingSkipButton.style.display="none",e.floatingSkipButton.style.cursor="pointer",e.floatingSkipButton.style["font-weight"]="bold",e.floatingSkipButton.style["margin-right"]="1em",e.floatingSkipButton.style["margin-left"]="1em",e.floatingSkipButton.style["font-size"]="1em",e.floatingSkipButton.style.right="",e.floatingSkipButton.style.left="0px",e.floatingSkipButton.style["line-height"]="3em",e.floatingSkipButton.style.outline="0",e.floatingSkipButton.style.position="absolute",e.floatingSkipButton.style.padding="0",e.floatingSkipButton.style.height=f,e.floatingSkipButton.style["min-width"]="5em",e.floatingSkipButton.style.width="auto",e.floatingSkipButton.style.display="none",e.floatingSkipButton.style["text-align"]="left",l.addChild("button",{el:e.floatingSkipButton});var v=function(n){return a("SKIP clicked, destroying player"),e.options.vpaid?(l.trigger("skip"),void(e.isMobile()&&(n.stopPropagation(),n.preventDefault(),e.options.overlayPlayer&&t.destroy()))):(t.destroy(),void(e.isMobile()&&(n.stopPropagation(),n.preventDefault(),t.isCompleted=!0)))};switch(e.isMobile()&&(c.addEventListener("touchend",v),e.floatingSkipButton.addEventListener("touchend",v),e.floatingSkipButton.addEventListener("mousedown",function(e){e.preventDefault()})),c.addEventListener("click",v),e.floatingSkipButton.addEventListener("click",v),e.floatingAdSkipText=e.videojsOrigin.createEl("div",{className:"top-bar-text",role:"button",innerHTML:""}),e.floatingAdSkipText.style["margin-left"]="1em",e.floatingAdSkipText.style["margin-right"]="1em",e.floatingAdSkipText.style.right="",e.floatingAdSkipText.style.left="0px",e.floatingAdSkipText.style["font-size"]="1em",e.floatingAdSkipText.style["line-height"]="3em",e.floatingAdSkipText.style.outline="0",e.floatingAdSkipText.style.position="absolute",e.floatingAdSkipText.style["text-align"]="left",e.floatingAdSkipText.style.padding="0",e.floatingAdSkipText.style.height="3em",e.floatingAdSkipText.style.width="auto",e.floatingAdSkipText.style["pointer-events"]="none",e.floatingAdSkipText.style.display="none",l.addChild("button",{el:e.floatingAdSkipText}),u=d.contentWindow.document.createElement("div"),u.id="ad_skip_text",u.innerHTML=m,u.className="top-bar-text",u.role="button",u.style["margin-left"]="1em",u.style["margin-right"]="1em",u.style.right="",u.style.left="0px",u.style["font-size"]="1em",u.style["line-height"]="24px",u.style.outline="0",u.style.position="absolute",u.style["text-align"]="left",u.style.padding="0",u.style.height="3em",u.style.width="auto",u.style["pointer-events"]="none",u.style.display="none",e.options.skippable.skipLocation){case"top-right":c.style.right="0px",c.style.left="",c.style["text-align"]="right",u.style.right="0px",u.style.left="",e.floatingSkipButton.style.right="0px",e.floatingSkipButton.style.left="",e.floatingSkipButton.style["text-align"]="right",e.floatingAdSkipText.style.right="0px",e.floatingAdSkipText.style.left=""}var g=!1,y=!1,A=!1,b={},k=function(){var n,i=Math.round(l.player().currentTime()),a=Math.round(l.player().duration());n=t.options.skippable.allowOverride?Math.round(e.options.data.skipOffsetMsec/1e3):e.options.skippable.videoOffset;var s=n-i,d=!e.options.skippable.allowOverride||e.options.data.isVastVideoSkippable;d=!(n>a)&&d,t.test("VIDLA163_needToShowSkip",d),p0&&!t.startedReplay&&!t.isEnded?(e.floatingAdSkipText.innerHTML=h.replace("%%TIME%%",s),c.style.display="none",u.innerHTML=h.replace("%%TIME%%",s),u.style.display="block",r.elementsOverlap(u,o)&&(u.style.display="none")):(e.readyForSkip||(t.test("log",i),t.test("VIDLA163_skip",i)),e.readyForSkip=!0,t.isFullscreen&&!e.pendingFullscreenExit&&(e.floatingAdSkipText.style.display="none",e.floatingSkipButton.style.display="block"),u.style.display="none",c.style.display="block"))};l.on("resize",function(){k()}),l.on("timeupdate",function(){var n=t.options.data.vastProgressEvent;if(!e.options.isWaterfall||!e.options.vpaid||e.options.vpaidImpressionFired){var i=Math.round(l.player().currentTime()),o=1e3*i;if(n&&"object"==typeof n){var r=function(){t.test("VIDLA163_Tracking",b)};for(var a in n){var s=n[a];if("number"==typeof s&&s>=0&&o>=s&&Object.keys(b).indexOf(a)===-1){b[a]=s;var d={};d.name=a,d.name&&t.dispatchEventToAdunit(d,r)}}}k()}})}if(e.options.skippable&&e.options.skippable.skipLocation)switch(e.options.skippable.skipLocation){case"top-right":o.style.right="",o.style.left="0px",i.style.right="",i.style.left="0px"}!e.options.disableTopBar&&n&&(e.options.skippable.enabled===!0&&(n.appendChild(c),n.appendChild(u)),n.appendChild(o)),l.on("timeupdate",function(){if(!e.options.vpaid){var t=Math.round(l.player().currentTime()),n=l.player().duration();if(n){var i=n/4,o=n/4*2,r=n/4*3;!g&&t>=i&&t=o&&t=r&&(e.dispatchEventToAdunit({name:"video-third-quartile"}),A=!0)}}})}}}},function(e,t,n){var i="[PlayerManager_EndCardSetup]",o=n(9),r=function(e){o.debug(i,e)},a=n(24);e.exports=function(e,t){return{init:function(n){if(r("init"),e.options.endCard.enabled){var i=e.options.endCard;if(i.showDefaultButtons){for(var o=-1,s=0;s=0&&i.buttons.splice(o,1)}r("Creating EndCard."),t.endCard=new a(i,n,t)}}}}},function(e,t,n){var i="[EndCard]",o=n(25),r=n(9),a=function(e){r.debug(i,e)},s=function(e){r.verbose(i,e)},l=function(e,t,n){this.layers=[],this.buttons=[],this.options=e,this.vjsPlayer=t,this.playerManager=n,this.firedCreativeView=!1,this.onLayerClick=function(e){e.stopPropagation(),e.target===e.currentTarget&&n.click()},e.layers=[{type:"videoAd"}],e.layers.push({type:"color",width:"100%",height:"100%",color:e.color}),e.layers.push({type:"companionAd"}),e.layers.push({type:"image",width:e.imageWidth,height:e.imageHeight,imageUrl:e.imageUrl}),this.createEndCardContainer(t.player().el_),this.createLayers(),this.createButtons()};l.prototype.styleForCentering=function(e,t,n){e.style.display="block",e.style.position="absolute",e.style.top=0,e.style.bottom=0,e.style.left=0,e.style.right=0,e.style.margin="auto",e.style.maxWidth=t||"100%",e.style.maxHeight=n||"100%",t&&(e.style.width=t),n&&(e.style.height=n)},l.prototype.styleSizeLimitScaleDown=function(e,t,n){var i=this,o=e.elem,r=function(){t=t||i.endCardElem.offsetWidth,n=n||i.endCardElem.offsetHeight;var a=o.offsetWidth,s=o.offsetHeight;if(!(t&&n&&a&&s))return void setTimeout(r,5);var l,d=t/n,c=a/s;if(dt&&(s=t/c,c*=s,u*=s),u>n&&(s=n/u,c*=s,u*=s);else if(c>t||u>n){a("xxx Skipping Companion: ["+h+"] - Companion size ("+c+"x"+u+") won't fit in ad unit.");continue}d=Math.abs(c*u-i),de||i.companionAd.height>t?i.elem.style.display="none":i.elem.style.display="block"):"image"===i.type&&"block"===i.elem.style}},l.prototype.saveSetStyle=function(e,t,n){void 0!==n&&(e.styleSave||(e.styleSave={}),e.elem&&(void 0===e.styleSave[t]&&(e.styleSave[t]=e.elem.style[t]),e.elem.style[t]=n))},l.prototype.restoreStyle=function(e){if(e.styleSave){if(e.elem)for(var t in e.styleSave)e.elem.style[t]=e.styleSave[t];delete e.styleSave}},l.prototype.createEndCardContainer=function(e){this.endCardElem||(this.endCardElem=e.ownerDocument.createElement("div"),e.appendChild(this.endCardElem),this.endCardElem.className="video-js vjs-default-skin vjs-controls-enabled vjs-big-play-centered vjs-has-started vjs-paused vjs-ended vjs-user-active",this.playerManager.isIosInlineRequired()?(this.endCardElem.style["background-color"]="",this.endCardElem.style.background=this.playerManager.options.playerSkin.videoBackgroundColor,this.endCardElem.style.opacity=1):this.endCardElem.style["background-color"]="rgba(0,0,0,0)",this.endCardElem.setAttribute("name","endCardContainer"),this.endCardElem.style.width="100%",this.endCardElem.style.height="100%",this.endCardElem.style.display="none",this.endCardElem.style.cursor=this.options.clickable?"pointer":"default",this.endCardElem.style.position="relative",this.endCardElem.style["text-align"]="center",this.options.clickable&&(this.endCardElem.onclick=this.onLayerClick))},l.prototype.createImageLayer=function(e,t){var n={},i=e.ownerDocument.createElement("img");e.appendChild(i),i.setAttribute("name","ecImageLayer"),i.id=t.id||"endCardImageLayer",i.setAttribute("src",t.imageUrl||""),i.style.cursor=this.options.clickable?"pointer":"default",this.styleForCentering(i,t.width,t.height),i.style.display="none",n.elem=i,n.opts=t,this.layers.push(n)},l.prototype.createColorLayer=function(e,t){var n={},i=e.ownerDocument.createElement("div");e.appendChild(i),i.setAttribute("name","ecColorLayer"),i.id=t.id||"endCardColorLayer",i.style["background-color"]=t.color||"black",i.style.cursor=this.options.clickable?"pointer":"default",this.styleForCentering(i,t.width||"100%",t.height||"100%"),t.color||(i.style.display="none"),n.elem=i,n.opts=t,this.layers.push(n)},l.prototype.createAdVideoLayer=function(e,t){if(void 0===this.videoLayer){var n={};n.elem=e,n.opts=t,e&&this.playerManager.isIosInlineRequired()&&(n.videoParent=e.parentElement,n.videoSibling=e.nextSibling),this.videoLayer=this.layers.length,this.layers.push(n)}else a("Can't create new video layer because one already exists!")},l.prototype.createCompanionLayer=function(e,t){var n={},i=e.ownerDocument.createElement("div");e.appendChild(i),i.setAttribute("name","ecCompanionLayer"),i.id="endCardCompanionLayer",i.style.position="absolute",i.style.width=t.width||"100%",i.style.height=t.height||"100%",this.styleForCentering(i),i.style["background-color"]="rgba(0,0,0,0)",n.elem=i,n.opts=t,this.layers.push(n)},l.prototype.show=function(){if(this.vjsPlayer&&this.vjsPlayer.controlBar&&this.vjsPlayer.controlBar.hide(),void 0!==this.videoLayer){var e=this.layers[this.videoLayer],t=this.options.layers[this.videoLayer];e.elem&&(e.videoParent&&(this.videoLayer0?i.elem.style.display="none":i.opts.imageUrl&&(n.styleSizeLimitScaleDown(i),i.elem.style.display="block")),n.options.clickable&&i.elem&&(i.elem.addEventListener("click",n.onLayerClick),i.elem.style.cursor="pointer"))}}),this.endCardElem.style.display="block"},l.prototype.hide=function(){if(void 0!==this.videoLayer){var e=this.layers[this.videoLayer];this.restoreStyle(e),e.videoParent&&e.videoParent.insertBefore(e.elem,e.videoSibling)}for(var t=0;t ",a=function(e,t,i,o,r){var a=e,s=o,l=r,d={width:t,height:i},c=(new Date).getTime()+Math.floor(1e4*Math.random());l({command:"addTrackingEvents",uniqueId:c,data:s});var u=function(){s.CompanionClickTracking&&l({command:"requestTracking",uniqueId:c,data:"companion-click"}),s.hasOwnProperty("StaticResource")&&s.CompanionClickThrough&&window.open(s.CompanionClickThrough)},p=function(){s.TrackingEvents&&s.TrackingEvents.length>0&&l({command:"requestTracking",uniqueId:c,data:"creative-view"})},h=!0;if(s.hasOwnProperty("StaticResource")){var m=s.StaticResource.type;if("application/x-javascript"===m){var f=document.createElement("script");f.src=s.StaticResource.src,f.onload=p(),a.appendChild(f)}else if(0===m.indexOf("image")){var v=document.createElement("img");v.src=s.StaticResource.src,v.style.maxWidth="100%",v.style.maxHeight="100%",v.style.width="auto",v.style.height="auto",v.style.margin="auto",v.style.display="block",v.style.top=0,v.style.bottom=0,v.style.left=0,v.style.right=0,v.style.position="absolute",v.onload=p(),v.onclick=u,h=!1,v.style.cursor="pointer",a.innerHTML="",a.style.position="relative",a.appendChild(v)}}else if(s.hasOwnProperty("IFrameResource")){var g=document.createElement("iframe");g.src=s.IFrameResource,g.scrolling="no",g.style.width="100%",g.style.height="100%",g.style.border="none",g.style.overflow="hidden",g.onload=p(),h=!1,a.appendChild(g)}else if(s.hasOwnProperty("HTMLResource"))if(0===s.HTMLResource.indexOf("http")){var y=n(29);y.load(s.HTMLResource,function(e,t){e||0===t.length||(a.style.display="inline-block",a.style.position="relative",a.innerHTML=t,p())})}else a.style.display="inline-block",a.style.position="relative",a.innerHTML=s.HTMLResource,p();h&&(s.hasOwnProperty("StaticResource")&&s.CompanionClickThrough&&(a.style.cursor="pointer"),a.onclick=u),this.stop=function(){"concurrent"===s.renderingMode&&(a.innerHTML="")},this.getData=function(){var e={container:a,companionData:s,size:d};return e}},s=function(e,t,n){var s=e,l=t,d=n,c=[];o.always(r,"Version: 0.1.11");for(var u=[],p=0;p"),t!==-1&&(n=n.substr(0,t+1)),n.trim()},d=function(e){if(0===e.length)return o.warn(r,"parseCompanions > empty companions xml"),null;e=l(e),""+e+"");var t=null;if("undefined"!=typeof window.DOMParser){if(t=(new DOMParser).parseFromString(e,"text/xml"),"parsererror"===t.documentElement.nodeName){try{o.error(r,"parseCompanions > Error reason = "+t.documentElement.childNodes[0].nodeValue)}catch(i){}return o.warn(r,"parseCompanions > invalide xml structure"),null}}else{if("undefined"==typeof window.ActiveXObject)return o.error(r,"parseCompanions > Failed to parse vast xml by window.ActiveXObject(Microsoft.XMLDOM)"),null;try{if(t=new window.ActiveXObject("Microsoft.XMLDOM"),t.loadXML(e),0!==t.parseError.errorCode)return o.error(r,t.parseError),null}catch(a){return o.error(r,"parseCompanions > Failed to parse vast xml by window.ActiveXObject(Microsoft.XMLDOM)",a),null}}if(!t)return o.error(r,"parseCompanions > invalid xml structure"),null;var s=n(30),d=s.parse(t);return d};e.exports={renderCompanions:function(e,t,n){o.log(r,"renderCompanions called.");var i=new s(e,t,n);return i},stopCompanions:function(e){e&&e.stop()},parse:function(e){return d(e)}}},function(e,t,n){function i(e){for(var t=[],n=0;n=e&&(i===-1||i>=E[o].width-e)&&(i>E[o].width-e&&(n.length=0),n.push(E[o]),i=E[o].width-e);if(n.length>0)E.length=0,E=n.slice();else{for(o=0;o=e-E[o].width)&&(i>e-E[o].width&&(n.length=0),n.push(E[o]),i=e-E[o].width);n.length>0&&(E.length=0,E=n.slice())}if(1!==E.length){for(n.length=0,i=-1,o=0;o=t&&(i===-1||i>=E[o].height-t)&&(i>E[o].height-t&&(n.length=0),n.push(E[o]),i=E[o].height-t);if(n.length>0)E.length=0,E=n.slice();else{for(o=0;o=t-E[o].height)&&(i>t-E[o].height&&(n.length=0),n.push(E[o]),i=t-E[o].height);n.length>0&&(E.length=0,E=n.slice())}}}function d(e){return 0===S||(1!==S||!o(e))&&(3!==S||!r(e))}function c(e){for(var t=[],n=-1,i=0;i=e-E[i].bitrate)&&(n>e-E[i].bitrate&&(t.length=0),n=e-E[i].bitrate,t.push(E[i]));if(t.length>0)E.length=0,E=t.slice();else for(i=0;i=e&&(n===-1||n>=E[i].bitrate-e)&&(n>E[i].bitrate-e&&(t.length=0),n=E[i].bitrate-e,t.push(E[i]));if(1===t.length||0===S)return t[0];if(1===S||3===S){for(i=0;i0){if(1===E.length)return E[0];l(e,t),i=1===E.length?E[0]:c(n)}return null===i&&(E=o.slice()),i}function p(e){S=2,e&&e.playerTechnology&&Array.isArray(e.playerTechnology)&&e.playerTechnology.length>0&&(1===e.playerTechnology.length?S="html5"===e.playerTechnology[0]?1:3:"flash"===e.playerTechnology[0]&&(S=4))}function h(e){S=2,e&&e.playerTechnology&&Array.isArray(e.playerTechnology)&&e.playerTechnology.length>0&&1===e.playerTechnology.length&&(S="html5"===e.playerTechnology[0]?1:3)}function m(e){return e?(1===S?e.requiredPlayer=1:3===S?e.requiredPlayer=2:o(e.type.toLowerCase())?e.requiredPlayer=2:r(e.type.toLowerCase())?e.requiredPlayer=1:e.requiredPlayer=0,e.success=!0,C.info(P,"Selected rendition: ",e),e):(C.error(P,"Failed to select rendition"),{success:!1,errorCode:403})}function f(e){if(e&&e>0)return C.info(P,"Selected bitrate (not from cache): "+e),e;var t=1;try{var n=I.getGenericData("anxBandwidth");n?(t=n,C.info(P,"Selected bitrate (from cache): "+t)):C.info(P,"No bitrate data present in cache (use bitrate 1)")}catch(i){C.warn(P,"Exception during getting bitrate from cache (use bitrate 1)")}return t}function v(e){return e&&e.playerTechnology&&Array.isArray(e.playerTechnology)&&2===e.playerTechnology.length&&"flash"===e.playerTechnology[0]&&"html5"===e.playerTechnology[1]&&(e.playerTechnology=["html5","flash"]),e}function g(){return navigator.appVersion.indexOf("Mobile")>-1||navigator.appVersion.indexOf("Android")>-1}function y(e,t,n,i){var o=u(e,t,n);return o&&d(o.type.toLowerCase())?(C.info(P,"VPAID selected"),o):(h(i),0===E.length?null:1===E.length?d(E[0].type.toLowerCase())?E[0]:null:(l(e,t),1===E.length?(C.log(P,"Rendition selected by size"),d(E[0].type.toLowerCase())?E[0]:null):(C.log(P,"Try select rendition by bitrate"),c(n))))}function A(e,t,n,i){i=v(i),p(i),s();var r=f(n),a=E.slice();E.length=0;for(var l=0;l0;n++){var l=t[n];if(E.length=0,E=s.slice(),b(l.width,l.height),1!==E.length)if(0!==E.length){for(var d=!1,c=0;c ";e.exports={init:function(e){E=i(e)},getUrl:function(e,t,n,i){return A(e,t,n,i)},selectCompanionsForContainers:function(e,t){T(e,t)}}},function(e,t,n){function i(e,t,n){switch(w){case 0:a(e,t);break;case 1:d(e,t,n);break;default:case 2:p(e,t)}}function o(e){switch(w){case 0:return s(e);case 1:return c(e);default:case 2: +return h(e)}}function r(e){switch(w){case 0:l(e);break;case 1:u(e);break;default:case 2:m(e)}}function a(e,t){localStorage&&localStorage.setItem(e,t)}function s(e){if(localStorage)return localStorage.getItem(e)}function l(e){localStorage&&localStorage.removeItem(e)}function d(e,t,n){D.setItem(e,t,n?1/0:new Date(Date.now()+j).toUTCString())}function c(e){return D.getItem(e)}function u(e){D.removeItem(e)}function p(e,t){V&&(V[e]=t)}function h(e){if(V)return V[e]}function m(e){V&&delete V[e]}function f(){try{if(localStorage){var e="apntestls"+Math.random();try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(t){}}}catch(t){}return!1}function v(){try{if(document&&document.cookie){var e="apntestcookie"+Math.random();try{D.setItem(e,e,1/0);var t=D.hasItem(e)&&D.getItem(e)===e;return D.removeItem(e),t}catch(n){}}}catch(n){}return!1}function g(e,t){var n={};n.timestamp=(new Date).getTime(),n.ad=e;try{i(t,JSON.stringify(n))}catch(o){}}function y(e){var t,n=(new Date).getTime();try{var i=o(e);t=i&&JSON.parse(i),r(e)}catch(a){}if(t&&t.timestamp&&t.timestamp>0){var s=n-t.timestamp;if(s<=j)return t.ad}return null}function A(e){try{r(e)}catch(t){}}function b(e){j=e*C}function k(){var e,t;return t=o(_),e=t?parseInt(t):0,i(_,e+=1,!0),e}function T(e){return"apn_"+e}var w,E=n(28),S="Cache Manager",I=40,C=6e4,P=I*C,j=P,x="___appnexus_video_cachemanager_generic_data___",_="___appnexus_video_cachemanager_ad_token___",V={};w=f()?0:v()?1:2,E.debug("Using Cache Method "+w,S);var D={getItem:function(e){return e?decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null:null},setItem:function(e,t,n,i,o,r){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;var a="";if(n)switch(n.constructor){case Number:a=n===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+n;break;case String:a="; expires="+n;break;case Date:a="; expires="+n.toUTCString()}return document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+a+(o?"; domain="+o:"")+(i?"; path="+i:"")+(r?"; secure":""),!0},removeItem:function(e,t,n){return!!this.hasItem(e)&&(document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(n?"; domain="+n:"")+(t?"; path="+t:""),!0)},hasItem:function(e){return!!e&&new RegExp("(?:^|;\\s*)"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(document.cookie)},keys:function(){for(var e=document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g,"").split(/\s*(?:\=[^;]*)?;\s*/),t=e.length,n=0;n0),t},objectToString:function(e,t){var n="null";if(t="undefined"!=typeof t?t:0,null!==e){n="OBJ[";var i="";for(var o in e){var a=e[o];if("object"==typeof a)if(t++,t0&&(i+=","),i+=o+"="+a}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 r in e)n.push(e[r].responseURL);var a=e[e.length-1];if(a){var s=i(a),l=a.responseURL;o.info(t,"Tag load chain:",n,"\n","Final Tag URL: ",l,"\n","Final Tag: ",s)}}}else{var d=i(e);o.info(t,"Tag URL:",e.responseURL,"\n","Tag:",d)}}catch(c){}}}},function(e,t,n){function i(e,t,o,r,a,s){var l,d=0,c=0,u=!1,p=n(28),h=n(27),m=!0,f=function(e){p.logDebug(e,"URL Loader")};if(a&&"undefined"!=typeof a.withCredentials&&(m=a.withCredentials),window.XMLHttpRequest)l=new XMLHttpRequest;else if(window.ActiveXObject)try{l=new ActiveXObject("Msxml2.XMLHTTP")}catch(v){try{l=new ActiveXObject("Microsoft.XMLHTTP")}catch(g){}}return l?(l.onreadystatechange=function(){if(4===l.readyState)if(200===l.status){if(o&&o.call(this,void 0,l.responseText,l),f("duration: "+c+", response length: "+l.responseText.length),u&&l.responseText&&l.responseText.length>2048){var e=8*l.responseText.length*1e3/(1024*Math.max(1,c)),t=parseInt(e.toString());f("Bandwidth: "+t);try{h.setGenericData("anxBandwidth",t)}catch(n){}}}else l.status>=400&&l.status<600&&o&&o.call(this,l.status,"",l);else 2===l.readyState?d=(new Date).getTime():3===l.readyState&&d>0&&(u=!0,c=(new Date).getTime()-d)},l.onerror=function(){if(m){var n=a?a:{};n.withCredentials=!1,i(e,t,o,r,n,s)}else if(o){var d=0===l.status?"404":l.status.toString();o.call(this,d,"",l)}},l.ontimeout=function(){o&&o.call(this,"Timeout","",l)},l.open(s,e),r&&(l.timeout=r),l.withCredentials=m,d=0,void("POST"===s?l.send(t):l.send())):void(o&&o.call(this,"406",""))}function o(e,t){r.log("Logging Event: "+t+" at url:"+e),new Image(1,1).src=e}var r=n(9);e.exports={load:function(e,t,n){i(e,null,t,n,{withCredentials:!0},"GET")},loadPost:function(e,t,n,o){i(e,t,n,o,{withCredentials:!0},"POST")},trackPixel:function(e,t){o(e,t)}}},function(e,t){var n={parse:function(e){var t={companions:[]},n=function(){this.getSubNodes=function(e,t){var n=e.getElementsByTagName(t);return n.length>0?n:null},this.getSubNode=function(e,t,n){n||(n=0);var i=e.getElementsByTagName(t);return i.length>n?i[n]:null},this.getNodeValue=function(e){if(0===e.childNodes.length)return"";var t=e.childNodes[0].nodeValue;return t.trim()},this.getNodeValues=function(e){if(0===e.childNodes.length)return"";for(var t="",n=0;n0&&(i=o.indexOf(".")>=0?parseFloat(o):parseInt(o)),i},this.getNodeAttributeBooleanValue=function(e,t,n){n||(n=!1);var i=n,o=this.getNodeAttributeValue(e,t);if(o.length>0){var r=o.toLowerCase().charAt(0);i="t"===r}return i},this.getSubNodeValue=function(e,t,n){n="undefined"==typeof n?"":n;var i=this.getSubNode(e,t);return null!==i?this.getNodeValue(i):n},this.getSubNodeWholeValue=function(e,t,n){n="undefined"==typeof n?"":n;var i=this.getSubNode(e,t);return null!==i?this.getNodeValues(i):n},this.getSubNodeBooleanValue=function(e,t,n){n="undefined"==typeof n?"false":n;var i=this.getSubNodeValue(e,t);return i.length>0&&"t"===i.toLowerCase().charAt(0)||!(i.length>0&&"f"===i.toLowerCase().charAt(0))&&n}},i=new n,o=i.getSubNode(e,"CompanionAds"),r=i.getNodeAttributeValue(o,"required");r&&r.length>0&&(t.required=r);var a=i.getSubNodes(o,"Companion");if(a)for(var s=0;s0&&(d.assetWidth=p),p=i.getNodeAttributeNumberValue(l,"assetHeight",-1),p>0&&(d.assetHeight=p),p=i.getNodeAttributeNumberValue(l,"expandedWidth",-1),p>0&&(d.expandedWidth=p),p=i.getNodeAttributeNumberValue(l,"expandedHeight",-1),p>0&&(d.expandedHeight=p),p=i.getNodeAttributeValue(l,"apiFramework"),p&&(d.apiFramework=p),p=i.getNodeAttributeValue(l,"adSlotId"),p&&(d.adSlotId=p),p=i.getNodeAttributeValue(l,"required"),p&&(d.required=p),p=i.getNodeAttributeValue(l,"renderingMode"),p&&(d.renderingMode=p),p=i.getSubNodeValue(l,"AltText"),p&&(d.AltText=p),p=i.getSubNodeValue(l,"AdParameters"),p&&(d.AdParameters=p);var h=i.getSubNode(l,"StaticResource");if(h&&(p=i.getNodeAttributeValue(h,"creativeType"))){var m="video/x-flv"===p||"video/x-f4v"===p||"video/f4v"===p||"application/x-shockwave-flash"===p;if(m)continue;var f={type:p};p=i.getNodeValues(h),p&&(f.src=p,d.StaticResource=f)}p=i.getSubNodeWholeValue(l,"IFrameResource"),p&&(d.IFrameResource=p),p=i.getSubNodeWholeValue(l,"HTMLResource"),p&&(d.HTMLResource=p),p=i.getSubNodeValue(l,"CompanionClickThrough"),p&&(d.CompanionClickThrough=p);var v,g,y,A=i.getSubNodes(l,"CompanionClickTracking");if(A)for(d.CompanionClickTracking=[],v=0;v\n*/\n.vjs-default-skin {\n color: #CCCCCC;\n}\n/* Custom Icon Font\n--------------------------------------------------------------------------------\nThe control icons are from a custom font. Each icon corresponds to a character\n(e.g. "\\e001"). Font icons allow for easy scaling and coloring of icons.\n*/\n@font-face {\n font-family: \'VideoJS\';\n src: url(\'font/vjs.eot\');\n src: url(data:application/font-woff;base64,d09GRgABAAAAABG0AAsAAAAAEWgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIHUGNtYXAAAAFoAAAAfAAAAHyz47CpZ2FzcAAAAeQAAAAIAAAACAAAABBnbHlmAAAB7AAADTwAAA08MPTaTGhlYWQAAA8oAAAANgAAADYP2gkbaGhlYQAAD2AAAAAkAAAAJAkgBThobXR4AAAPhAAAAGQAAABkW54DGGxvY2EAAA/oAAAANAAAADQeIiIQbWF4cAAAEBwAAAAgAAAAIAAiAIluYW1lAAAQPAAAAVYAAAFWUqTEiXBvc3QAABGUAAAAIAAAACAAAwAAAAMD/AGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA6ioDwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEAGAAAAAUABAAAwAEAAEAIOAO4B/mAOkm6YTqKv/9//8AAAAAACDgAOAe5gDpJumE6ir//f//AAH/4yAEH/UaFRbwFpMV7gADAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAPAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAIAAP/ABAADwAAGAA0AAAERJwcnNycDBxchERc3BACgwGDAoKDAoP5goMADwP5goMBgwKD9YMCgAaCgwAAAAAABAMAAQANAA0AAAgAAEwkBwAKA/YADQP6A/oAAAgCAAEADgANAAAMABwAAEyERIQEhESGAAUD+wAHAAUD+wANA/QADAP0AAAABAAAADwHAA3EACwAAATYWFREUBi8BIxEzAZEUGxsU8aCgA3EUDBv8xBsMFPEBgAACAAAADwJHA3EAGAAkAAAlIiYnJjQ3PgE0JicmNDc2MhceARQGBw4BAzYWFREUBi8BIxEzAiUJEgcODh4fHx4ODg4oDiwtLSwHEp0UGxsU8aCg2wcHDigOHk1QTR4OKA4ODixxdHEsBwcClhQMG/zEGwwU8QGAAAADAAAADwNwA3EAHQA2AEIAACUiJicmNDc+ATQmJyY0NzYyFx4DFRQOAgcOASciJicmNDc+ATQmJyY0NzYyFx4BFAYHDgEDNhYVERQGLwEjETMC0AoRBw4OMTExMQ4ODicOHy8gEREgLx8HEbQJEgcODh4fHx4ODg4oDiwtLSwHEp0UGxsU8aCggAcIDicOMnuCezIOJw4PDx5HTVQrK1RNRx4IB1sHBw4oDh5NUE0eDigODg4scXRxLAcHApYUDBv8xBsMFPEBgAAAAAAEAAAADwRAA3EAIwBBAFoAZgAAJSImJyY0Nz4DNTQuAicmNDc2MhceAxUUDgIHDgEjJyImJyY0Nz4BNCYnJjQ3NjIXHgMVFA4CBw4BJyImJyY0Nz4BNCYnJjQ3NjIXHgEUBgcOAQM2FhURFAYvASMRMwN6CRIHDg4hMyISEiIzIQ4ODigOKD0pFhYpPSgHEgmqChEHDg4xMTExDg4OJw4fLyARESAvHwcRtAkSBw4OHh8fHg4ODigOLC0tLAcSnRQbGxTxoKAmBwcOKA4hTFNaLi5aU0whDigODg4oW2VsODhsZVsoBwdaBwgOJw4ye4J7Mg4nDg8PHkdNVCsrVE1HHggHWwcHDigOHk1QTR4OKA4ODixxdHEsBwcClhQMG/zEGwwU8QGAAAEAwP/AA0ADwAADAAAJAwIA/sABQAFAA8D+AP4AAgAABAAA/7oFXgPAAAMALwBSAHUAABMhESEBLgEnLgEnLgMjIg4CBw4BBw4BBx4BFx4BFx4DFz4DNz4BNz4BJS4DIyIOAhUUHgIzMj4CNyMOASMiJjU0NjMyFhczIS4DIyIOAhUUHgIzMj4CNyMOASMiJjU0NjMyFhczAAVe+qIE3QESIAUUCRBVfZxWVZ+AWBAJFAcfEQICER8HFAkQWICfVVacfVUQCRQFIBL9ugQgOE4yLlA7IiA8VjcrSTYjBIoEIyM2ICsmIikDiAHeBCE3TjMtUDsiIDxWNixJNiIFigQjIzcfKyYhKQSIA8D7+gIHh4opCQwHCxAKBAQKEAsHDAkpioeHiSoJDAYMEAoFAQEFChAMBgwJKom2NVM5HyhLa0JDa0soHzpUNSc1WzpPUS8rNVM5HyhLa0JDa0soHzpUNSc1WzpPUS8rAAABAIAAQAOAA0AAAwAAEyERIYADAP0AA0D9AAAACAA4AAADwAPAAAsAFwAjAC8ASABhAHoAhgAAARQWMzI2NTQmIyIGBRQWMzI2NTQmIyIGExQWMzI2NTQmIyIGAxQWMzI2NTQmIyIGBTgBMRQWMzI2NTgBMTgBMTQmIyIGFRQ0MSU4ATEUFjMyNjU4ATE4ATE0JiMiBhUUNDEDOAExFBYzMjY1OAExOAExNCYjIgYVFDQxAxQWMzI2NTQmIyIGAYBLNTVLSzU1SwEQSzU1S0s1NUuwJRsbJSUbGyVwJRsaJiYaGyX+8CUbGyUlGxsl/vAmGhslJRsaJiA5Jyg4OCgnOVgqHh4qKh4eKgNANUtLNTVLS6U1S0s1NUtL/rsbJSUbGyUl/tUaJiYaGyUlixslJRsbJSUbGxtwGiYmGhslJRsaGgIgKDg4KCc5OScoKP7wHioqHh4qKgAAAAACAAD/wAQAA8AABgANAAABEScHJzcnAQcXIREXNwHAoMBgwKAD4MCg/mCgwAGA/mCgwGDAoAHgwKABoKDAAAAAAQAA/8AEAAOAACIAAAEyHgIVFA4CIyImJw4DBzU+ATU0JicuAzU0PgICAGq7i1BQi7tqFCgUKVpdYDAzTQEBLEYxG1CLuwOAQXGYVlaYcUEDAikzHQoCGxpXNAcPBxxIUlwxVphxQQADAAD/wAQAA8AAEwAnAFoAAAEiDgIVFB4CMzI+AjU0LgIDMh4CFRQOAiMiLgI1ND4CAQ4DIyIuAicuAzU0PgI3FzgBMQ4BFBYXHgEzMjY3PgE0Jic3HgMVFA4CAgBqu4tQUIu7amq7i1BQi7tqNV1GKChGXTU1XUYoKEZdAWYeR01UKytUTUceHy8gEREgLx9DMTExMTB7Q0N7MDExMTFDHy8gEREgLwPAUIu7amq7i1BQi7tqaruLUP8AKEZdNTVdRigoRl01NV1GKP3PHy8gEREgLx8eR01UKytUTUceQzJ7gnsyLzMzLzJ7gnsyQx5HTVQrK1RNRwAAAAABAAD/wAQAA8AAMwAAASIGByU+ATU0JiclHgEzMjY1NCYjIgYVFBYXBS4BIyIGFRQWMzI2NwUOARUUFjMyNjU0JgNgIjsW/lEBAQEBAa8WOyJCXl5CQl4BAf5RFjsiQl5eQiI7FgGvAQFeQkJeXgEAGhfYBg0GBg0G2BcaXkJCXl5CBg0G2BcaXkJCXhoX2AYNBkJeXkJCXgAAAAACACD/8AQAA7AAOgByAAABLgEnLgEnLgEnLgEHDgEHDgEHDgEHDgEXHgEXHgEXHgEXHgE3PgE3PgE3PgE3PgE3OgEzMjY1PAE1MQcOAQcOAQcOAScuAScuAScuAScuATc+ATc+ATc+ATc+ARceARceARceARceAQcxHAEVFBYXDgEHBAABFRUUOSQjVC4tYTExXywtTyEhNBESEAEBFBMTNiEiTisrWi4uWSkpSx4fMRAJDgMBAgEbJWYRMx8fSSgoVSoqUycmRR0dLA8PDgEBEhARLh0eQyUlTycnTSQjQBobKQ4NDQEhGAUPCwHAMmMtLlIiIzUSEhEBARUTFDcjIlEtLF4vL1wrK00gIDIQERABARQSEjQhIEwpGTQbJRsBAwGqKEceHi4QDw8BARIRETEeHkcmJ1EpKVAlJUIcGysODw0BAREQEC0cHEEkI0smAQMBGSQDGjMYAAACAAD/wAQAA8AAGQAzAAABIg4CBz4DMzIeAhUUFjMyNjU0LgIDMj4CNw4DIyIuAjU0JiMiBhUUHgICAGm4ilIDAkNxlVVWmHFBOCgoOFCLu2ppuIpSAwJDcZVVVphxQTgoKDhQi7sDwE6Itmhbn3ZERnqjXSg4OChqu4tQ/ABOiLZoW592REZ6o10oODgoaruLUAAAAgAA/8AEAAPAADAAPAAAATUnLgEnNycHLgEvASMHDgEHJwcXDgEPARUXHgEXBxc3HgEfATM3PgE3FzcnPgE/AQUiJjU0NjMyFhUUBgQAkwQLBlaIeQwbDhjAGA4bDHmIVgYLBJOTBQoHV4h6DBoNGcAZDRoMeohXBwoFk/4ANUtLNTVLSwFgwBkNGg15iFYGCwWSkgULBlaIeQ0aDRnAGQ0aDXmIVwYLBZOTBQsGV4h5DRoNGSBLNTVLSzU1SwAABgBA/8ADwAPAABkAIQA3AEUAUwBhAAABLgEnLgEnLgEjISIGFREUFjMhMjY1ETQmJyceARcjNR4BExQGIyEiJjURNDYzMDoCMRUUFjsBAyEiJjU0NjMhMhYVFAYnISImNTQ2MyEyFhUUBichIiY1NDYzITIWFRQGA5YRLRkaMxcnKQv+ECEvLyEC4CEvDhyFFyUNmhEphgkH/SAHCQkHm7qbEw3goP5ADRMTDQHADRMTDf5ADRMTDQHADRMTDf5ADRMTDQHADRMTAtsXMxoZLREcDi8h/KAhLy8hAnALKSc2FykRmg0l/OgHCQkHA2AHCeANE/4AEw0NExMNDROAEw0NExMNDROAEw0NExMNDRMAAAAAAQAA/8AEAAPAAC0AAAEhNy4BIyIGBw4BFRQWFx4BMzI2Nz4BNxcOAyMiLgI1ND4CMzIeAhc3BAD+gJA3jE1NjDc2Ojo2N4xNTYw3BAkEYCNWYmw6aruLUFCLu2o1ZFxSI5YCQJA2Ojo2N4xNTYw3Njo6NgUJBVQoQS0ZUIu7amq7i1AVJzcjlgAAAAACAAAAAAPAA34ADwAqAAABFSMnByM1Nyc1Mxc3MxUHASImLwEjIiY1ETQ2OwE3PgEXHgEVERQGBw4BA8BVa2tVa2tVa2tVa/5LBgwF9nMNExMNc/YHEwkJCwsJAwYBVVVra1Vra1Vra1Vr/kAFBPcTDQFADRP3BgQDBBAK/MAKEAQBAQABAAAAAQAAi1igY18PPPUACwQAAAAAANWuYlIAAAAA1a5iUgAA/7oFXgPAAAAACAACAAAAAAAAAAEAAAPA/8AAAAVeAAAAAAVeAAEAAAAAAAAAAAAAAAAAAAAZBAAAAAAAAAAAAAAAAgAAAAQAAAAEAADABAAAgAQAAAAEAAAABAAAAARAAAAEAADABV4AAAQAAIAEAAA4BAAAAAQAAAAEAAAABAAAAAQAACAEAAAABAAAAAQAAEAEAAAABAAAAAAAAAAACgAUAB4APgBMAGIAegC2ARwBsAHAAmYCdAMUAzQDaAPmBDQE4gUsBYwGFgZcBp4AAQAAABkAhwAIAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAMAAAABAAAAAAACAAcAPAABAAAAAAADAAMAKgABAAAAAAAEAAMAUQABAAAAAAAFAAsACQABAAAAAAAGAAMAMwABAAAAAAAKABoAWgADAAEECQABAAYAAwADAAEECQACAA4AQwADAAEECQADAAYALQADAAEECQAEAAYAVAADAAEECQAFABYAFAADAAEECQAGAAYANgADAAEECQAKADQAdHZqcwB2AGoAc1ZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMHZqcwB2AGoAc3ZqcwB2AGoAc1JlZ3VsYXIAUgBlAGcAdQBsAGEAcnZqcwB2AGoAc0ZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=) format("woff"), url(\'font/vjs.eot?#iefix\') format(\'embedded-opentype\'), url(\'font/vjs.ttf\') format(\'truetype\'), url(\'font/vjs.svg#icomoon\') format(\'svg\');\n font-weight: normal;\n font-style: normal;\n}\n/* Base UI Component Classes\n--------------------------------------------------------------------------------\n*/\n/* Slider - used for Volume bar and Seek bar */\n.vjs-default-skin .vjs-slider {\n /* Replace browser focus highlight with handle highlight */\n outline: 0;\n position: relative;\n cursor: pointer;\n padding: 0;\n /* background-color-with-alpha */\n background-color: #333333;\n background-color: rgba(51, 51, 51, 0.9);\n}\n.vjs-default-skin .vjs-slider:focus {\n /* box-shadow */\n -webkit-box-shadow: 0 0 2em #fff;\n -moz-box-shadow: 0 0 2em #fff;\n box-shadow: 0 0 2em #fff;\n}\n.vjs-default-skin .vjs-slider-handle {\n position: absolute;\n /* Needed for IE6 */\n left: 0;\n top: 0;\n}\n.vjs-default-skin .vjs-slider-handle:before {\n content: "\\e009";\n font-family: VideoJS;\n font-size: 1em;\n line-height: 1;\n text-align: center;\n text-shadow: 0em 0em 1em #fff;\n position: absolute;\n top: 0;\n left: 0;\n /* Rotate the square icon to make a diamond */\n /* transform */\n -webkit-transform: rotate(-45deg);\n -moz-transform: rotate(-45deg);\n -ms-transform: rotate(-45deg);\n -o-transform: rotate(-45deg);\n transform: rotate(-45deg);\n}\n/* Control Bar\n--------------------------------------------------------------------------------\nThe default control bar that is a container for most of the controls.\n*/\n.vjs-default-skin .vjs-control-bar {\n /* Start hidden */\n display: none;\n position: absolute;\n /* Place control bar at the bottom of the player box/video.\n If you want more margin below the control bar, add more height. */\n bottom: 0;\n /* Use left/right to stretch to 100% width of player div */\n left: 0;\n right: 0;\n /* Height includes any margin you want above or below control items */\n height: 3.0em;\n /* background-color-with-alpha */\n background-color: #07141E;\n background-color: rgba(7, 20, 30, 0.7);\n}\n/* Show the control bar only once the video has started playing */\n.vjs-default-skin.vjs-has-started .vjs-control-bar {\n display: block;\n /* Visibility needed to make sure things hide in older browsers too. */\n visibility: visible;\n opacity: 1;\n /* transition */\n -webkit-transition: visibility 0.1s, opacity 0.1s;\n -moz-transition: visibility 0.1s, opacity 0.1s;\n -o-transition: visibility 0.1s, opacity 0.1s;\n transition: visibility 0.1s, opacity 0.1s;\n}\n/* Hide the control bar when the video is playing and the user is inactive */\n.vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {\n display: block;\n visibility: hidden;\n opacity: 0;\n /* transition */\n -webkit-transition: visibility 0.5s, opacity 0.5s;\n -moz-transition: visibility 0.5s, opacity 0.5s;\n -o-transition: visibility 0.5s, opacity 0.5s;\n transition: visibility 0.5s, opacity 0.5s;\n}\n.vjs-default-skin.vjs-controls-disabled .vjs-control-bar {\n display: none;\n}\n.vjs-default-skin.vjs-using-native-controls .vjs-control-bar {\n display: none;\n}\n/* The control bar shouldn\'t show after an error */\n.vjs-default-skin.vjs-error .vjs-control-bar {\n display: none;\n}\n/* Don\'t hide the control bar if it\'s audio */\n.vjs-audio.vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {\n opacity: 1;\n visibility: visible;\n}\n/* IE8 is flakey with fonts, and you have to change the actual content to force\nfonts to show/hide properly.\n - "\\9" IE8 hack didn\'t work for this\n - Found in XP IE8 from http://modern.ie. Does not show up in "IE8 mode" in IE9\n*/\n@media \\0screen {\n .vjs-default-skin.vjs-user-inactive.vjs-playing .vjs-control-bar :before {\n content: "";\n }\n}\n/* General styles for individual controls. */\n.vjs-default-skin .vjs-control {\n outline: none;\n position: relative;\n float: left;\n text-align: center;\n margin: 0;\n padding: 0;\n height: 3.0em;\n width: 4em;\n}\n/* Font button icons */\n.vjs-default-skin .vjs-control:before {\n font-family: VideoJS;\n font-size: 1.5em;\n line-height: 2;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n text-align: center;\n text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);\n}\n/* Replacement for focus outline */\n.vjs-default-skin .vjs-control:focus:before,\n.vjs-default-skin .vjs-control:hover:before {\n text-shadow: 0em 0em 1em #ffffff;\n}\n.vjs-default-skin .vjs-control:focus {\n /* outline: 0; */\n /* keyboard-only users cannot see the focus on several of the UI elements when\n this is set to 0 */\n}\n/* Hide control text visually, but have it available for screenreaders */\n.vjs-default-skin .vjs-control-text {\n /* hide-visually */\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n}\n/* Play/Pause\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-play-control {\n width: 5em;\n cursor: pointer;\n}\n.vjs-default-skin .vjs-play-control:before {\n content: "\\e001";\n}\n.vjs-default-skin.vjs-playing .vjs-play-control:before {\n content: "\\e002";\n}\n/* Playback toggle\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-playback-rate .vjs-playback-rate-value {\n font-size: 1.5em;\n line-height: 2;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n text-align: center;\n text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);\n}\n.vjs-default-skin .vjs-playback-rate.vjs-menu-button .vjs-menu .vjs-menu-content {\n width: 4em;\n left: -2em;\n list-style: none;\n}\n/* Volume/Mute\n-------------------------------------------------------------------------------- */\n.vjs-default-skin .vjs-mute-control,\n.vjs-default-skin .vjs-volume-menu-button {\n cursor: pointer;\n float: right;\n}\n.vjs-default-skin .vjs-mute-control:before,\n.vjs-default-skin .vjs-volume-menu-button:before {\n content: "\\e006";\n}\n.vjs-default-skin .vjs-mute-control.vjs-vol-0:before,\n.vjs-default-skin .vjs-volume-menu-button.vjs-vol-0:before {\n content: "\\e003";\n}\n.vjs-default-skin .vjs-mute-control.vjs-vol-1:before,\n.vjs-default-skin .vjs-volume-menu-button.vjs-vol-1:before {\n content: "\\e004";\n}\n.vjs-default-skin .vjs-mute-control.vjs-vol-2:before,\n.vjs-default-skin .vjs-volume-menu-button.vjs-vol-2:before {\n content: "\\e005";\n}\n.vjs-default-skin .vjs-volume-control {\n width: 5em;\n float: right;\n}\n.vjs-default-skin .vjs-volume-bar {\n width: 5em;\n height: 0.6em;\n margin: 1.1em auto 0;\n}\n.vjs-default-skin .vjs-volume-level {\n position: absolute;\n top: 0;\n left: 0;\n height: 0.5em;\n /* assuming volume starts at 1.0 */\n width: 100%;\n background: #66A8CC url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat;\n}\n.vjs-default-skin .vjs-volume-bar .vjs-volume-handle {\n width: 0.5em;\n height: 0.5em;\n /* Assumes volume starts at 1.0. If you change the size of the\n handle relative to the volume bar, you\'ll need to update this value\n too. */\n left: 4.5em;\n}\n.vjs-default-skin .vjs-volume-handle:before {\n font-size: 0.9em;\n top: -0.2em;\n left: -0.2em;\n width: 1em;\n height: 1em;\n}\n/* The volume menu button is like menu buttons (captions/subtitles) but works\n a little differently. It needs to be possible to tab to the volume slider\n without hitting space bar on the menu button. To do this we\'re not using\n display:none to hide the slider menu by default, and instead setting the\n width and height to zero. */\n.vjs-default-skin .vjs-volume-menu-button .vjs-menu {\n display: block;\n width: 0;\n height: 0;\n border-top-color: transparent;\n}\n.vjs-default-skin .vjs-volume-menu-button .vjs-menu .vjs-menu-content {\n height: 0;\n width: 0;\n}\n.vjs-default-skin .vjs-volume-menu-button:hover .vjs-menu,\n.vjs-default-skin .vjs-volume-menu-button .vjs-menu.vjs-lock-showing {\n border-top-color: rgba(7, 40, 50, 0.5);\n /* Same as ul background */\n}\n.vjs-default-skin .vjs-volume-menu-button:hover .vjs-menu .vjs-menu-content,\n.vjs-default-skin .vjs-volume-menu-button .vjs-menu.vjs-lock-showing .vjs-menu-content {\n height: 2.9em;\n width: 10em;\n}\n/* Progress\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-progress-control {\n position: absolute;\n left: 0;\n right: 0;\n width: auto;\n font-size: 0.3em;\n height: 1.2em;\n /* Increase default height of progress bar by a decision for VIDLA-1692 */\n /* Set above the rest of the controls. */\n top: -1em;\n /* Shrink the bar slower than it grows. */\n /* transition */\n -webkit-transition: all 0.4s;\n -moz-transition: all 0.4s;\n -o-transition: all 0.4s;\n transition: all 0.4s;\n}\n/* On hover, make the progress bar grow to something that\'s more clickable.\n This simply changes the overall font for the progress bar, and this\n updates both the em-based widths and heights, as wells as the icon font */\n.vjs-default-skin:hover .vjs-progress-control {\n /* commented out by a decision for VIDLA-1692 */\n /* font-size: .9em; */\n /* Even though we\'re not changing the top/height, we need to include them in\n the transition so they\'re handled correctly. */\n /* .transition(all 0.2s); */\n}\n/* Box containing play and load progresses. Also acts as seek scrubber. */\n.vjs-default-skin .vjs-progress-holder {\n height: 100%;\n}\n/* Progress Bars */\n.vjs-default-skin .vjs-progress-holder .vjs-play-progress,\n.vjs-default-skin .vjs-progress-holder .vjs-load-progress,\n.vjs-default-skin .vjs-progress-holder .vjs-load-progress div {\n position: absolute;\n display: block;\n height: 100%;\n margin: 0;\n padding: 0;\n /* updated by javascript during playback */\n width: 0;\n /* Needed for IE6 */\n left: 0;\n top: 0;\n}\n.vjs-default-skin .vjs-play-progress {\n /*\n Using a data URI to create the white diagonal lines with a transparent\n background. Surprisingly works in IE8.\n Created using http://www.patternify.com\n Changing the first color value will change the bar color.\n Also using a paralax effect to make the lines move backwards.\n The -50% left position makes that happen.\n */\n background: #66A8CC url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat;\n}\n.vjs-default-skin .vjs-load-progress {\n background: #646464 /* IE8- Fallback */;\n background: rgba(255, 255, 255, 0.2);\n}\n/* there are child elements of the load progress bar that represent the\n specific time ranges that have been buffered */\n.vjs-default-skin .vjs-load-progress div {\n background: #787878 /* IE8- Fallback */;\n background: rgba(255, 255, 255, 0.1);\n}\n.vjs-default-skin .vjs-seek-handle {\n width: 1.5em;\n height: 100%;\n}\n.vjs-default-skin .vjs-seek-handle:before {\n padding-top: 0.1em /* Minor adjustment */;\n}\n/* Live Mode\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin.vjs-live .vjs-time-controls,\n.vjs-default-skin.vjs-live .vjs-time-divider,\n.vjs-default-skin.vjs-live .vjs-progress-control {\n display: none;\n}\n.vjs-default-skin.vjs-live .vjs-live-display {\n display: block;\n}\n/* Live Display\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-live-display {\n display: none;\n font-size: 1em;\n line-height: 3em;\n}\n/* Time Display\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-time-controls {\n font-size: 1em;\n /* Align vertically by making the line height the same as the control bar */\n line-height: 3em;\n}\n.vjs-default-skin .vjs-current-time {\n float: left;\n}\n.vjs-default-skin .vjs-duration {\n float: left;\n}\n/* Remaining time is in the HTML, but not included in default design */\n.vjs-default-skin .vjs-remaining-time {\n display: none;\n float: left;\n}\n.vjs-time-divider {\n float: left;\n line-height: 3em;\n}\n/* Fullscreen\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-fullscreen-control {\n width: 3.8em;\n cursor: pointer;\n float: right;\n}\n.vjs-default-skin .vjs-fullscreen-control:before {\n content: "\\e000";\n}\n/* Switch to the exit icon when the player is in fullscreen */\n.vjs-default-skin.vjs-fullscreen .vjs-fullscreen-control:before {\n content: "\\e00b";\n}\n/* Big Play Button (play button at start)\n--------------------------------------------------------------------------------\nPositioning of the play button in the center or other corners can be done more\neasily in the skin designer. http://designer.videojs.com/\n*/\n.vjs-default-skin .vjs-big-play-button {\n left: 0.5em;\n top: 0.5em;\n font-size: 3em;\n display: block;\n z-index: 2;\n position: absolute;\n width: 4em;\n height: 2.6em;\n text-align: center;\n vertical-align: middle;\n cursor: pointer;\n opacity: 1;\n /* Need a slightly gray bg so it can be seen on black backgrounds */\n /* background-color-with-alpha */\n background-color: #07141E;\n background-color: rgba(7, 20, 30, 0.7);\n border: 0.1em solid #3b4249;\n /* border-radius */\n -webkit-border-radius: 0.8em;\n -moz-border-radius: 0.8em;\n border-radius: 0.8em;\n /* box-shadow */\n -webkit-box-shadow: 0px 0px 1em rgba(255, 255, 255, 0.25);\n -moz-box-shadow: 0px 0px 1em rgba(255, 255, 255, 0.25);\n box-shadow: 0px 0px 1em rgba(255, 255, 255, 0.25);\n /* transition */\n -webkit-transition: all 0.4s;\n -moz-transition: all 0.4s;\n -o-transition: all 0.4s;\n transition: all 0.4s;\n}\n/* Optionally center */\n.vjs-default-skin.vjs-big-play-centered .vjs-big-play-button {\n /* Center it horizontally */\n left: 50%;\n margin-left: -2.1em;\n /* Center it vertically */\n top: 50%;\n margin-top: -1.4em;\n}\n/* Hide if controls are disabled */\n.vjs-default-skin.vjs-controls-disabled .vjs-big-play-button {\n display: none;\n}\n/* Hide when video starts playing */\n.vjs-default-skin.vjs-has-started .vjs-big-play-button {\n display: none;\n}\n/* Hide on mobile devices. Remove when we stop using native controls\n by default on mobile */\n.vjs-default-skin.vjs-using-native-controls .vjs-big-play-button {\n display: none;\n}\n.vjs-default-skin:hover .vjs-big-play-button,\n.vjs-default-skin .vjs-big-play-button:focus {\n outline: 0;\n border-color: #fff;\n /* IE8 needs a non-glow hover state */\n background-color: #505050;\n background-color: rgba(50, 50, 50, 0.75);\n /* box-shadow */\n -webkit-box-shadow: 0 0 3em #fff;\n -moz-box-shadow: 0 0 3em #fff;\n box-shadow: 0 0 3em #fff;\n /* transition */\n -webkit-transition: all 0s;\n -moz-transition: all 0s;\n -o-transition: all 0s;\n transition: all 0s;\n}\n.vjs-default-skin .vjs-big-play-button:before {\n content: "\\e001";\n font-family: VideoJS;\n /* In order to center the play icon vertically we need to set the line height\n to the same as the button height */\n line-height: 2.6em;\n text-shadow: 0.05em 0.05em 0.1em #000;\n text-align: center /* Needed for IE8 */;\n position: absolute;\n left: 0;\n width: 100%;\n height: 100%;\n}\n.vjs-error .vjs-big-play-button {\n display: none;\n}\n/* Error Display\n--------------------------------------------------------------------------------\n*/\n.vjs-error-display {\n display: none;\n}\n.vjs-error .vjs-error-display {\n display: block;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n}\n.vjs-error .vjs-error-display:before {\n content: \'X\';\n font-family: Arial;\n font-size: 4em;\n color: #666666;\n /* In order to center the play icon vertically we need to set the line height\n to the same as the button height */\n line-height: 1;\n text-shadow: 0.05em 0.05em 0.1em #000;\n text-align: center /* Needed for IE8 */;\n vertical-align: middle;\n position: absolute;\n left: 0;\n top: 50%;\n margin-top: -0.5em;\n width: 100%;\n}\n.vjs-error-display div {\n position: absolute;\n bottom: 1em;\n right: 0;\n left: 0;\n font-size: 1.4em;\n text-align: center;\n padding: 3px;\n background: #000000;\n background: rgba(0, 0, 0, 0.5);\n}\n.vjs-error-display a,\n.vjs-error-display a:visited {\n color: #F4A460;\n}\n/* Loading Spinner\n--------------------------------------------------------------------------------\n*/\n.vjs-loading-spinner {\n /* Should be hidden by default */\n display: none;\n position: absolute;\n top: 50%;\n left: 50%;\n font-size: 4em;\n line-height: 1;\n width: 1em;\n height: 1em;\n margin-left: -0.5em;\n margin-top: -0.5em;\n opacity: 0.75;\n}\n/* Show the spinner when waiting for data and seeking to a new time */\n.vjs-waiting .vjs-loading-spinner,\n.vjs-seeking .vjs-loading-spinner {\n display: block;\n /* only animate when showing because it can be processor heavy */\n /* animation */\n -webkit-animation: spin 1.5s infinite linear;\n -moz-animation: spin 1.5s infinite linear;\n -o-animation: spin 1.5s infinite linear;\n animation: spin 1.5s infinite linear;\n}\n/* Errors are unrecoverable without user interaction so hide the spinner */\n.vjs-error .vjs-loading-spinner {\n display: none;\n /* ensure animation doesn\'t continue while hidden */\n /* animation */\n -webkit-animation: none;\n -moz-animation: none;\n -o-animation: none;\n animation: none;\n}\n.vjs-default-skin .vjs-loading-spinner:before {\n content: "\\e01e";\n font-family: VideoJS;\n position: absolute;\n top: 0;\n left: 0;\n width: 1em;\n height: 1em;\n text-align: center;\n text-shadow: 0em 0em 0.1em #000;\n}\n@-moz-keyframes spin {\n 0% {\n -moz-transform: rotate(0deg);\n }\n 100% {\n -moz-transform: rotate(359deg);\n }\n}\n@-webkit-keyframes spin {\n 0% {\n -webkit-transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n }\n}\n@-o-keyframes spin {\n 0% {\n -o-transform: rotate(0deg);\n }\n 100% {\n -o-transform: rotate(359deg);\n }\n}\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(359deg);\n }\n}\n/* Menu Buttons (Captions/Subtitles/etc.)\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-menu-button {\n float: right;\n cursor: pointer;\n}\n.vjs-default-skin .vjs-menu {\n display: none;\n position: absolute;\n bottom: 0;\n left: 0em;\n /* (Width of vjs-menu - width of button) / 2 */\n width: 0em;\n height: 0em;\n margin-bottom: 3em;\n border-left: 2em solid transparent;\n border-right: 2em solid transparent;\n border-top: 1.55em solid #000000;\n /* Same width top as ul bottom */\n border-top-color: rgba(7, 40, 50, 0.5);\n /* Same as ul background */\n}\n/* Button Pop-up Menu */\n.vjs-default-skin .vjs-menu-button .vjs-menu .vjs-menu-content {\n display: block;\n padding: 0;\n margin: 0;\n position: absolute;\n width: 10em;\n bottom: 1.5em;\n /* Same bottom as vjs-menu border-top */\n max-height: 15em;\n overflow: auto;\n left: -5em;\n /* Width of menu - width of button / 2 */\n /* background-color-with-alpha */\n background-color: #07141E;\n background-color: rgba(7, 20, 30, 0.7);\n /* box-shadow */\n -webkit-box-shadow: -0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2);\n -moz-box-shadow: -0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2);\n box-shadow: -0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2);\n}\n.vjs-default-skin .vjs-menu-button:hover .vjs-control-content .vjs-menu,\n.vjs-default-skin .vjs-control-content .vjs-menu.vjs-lock-showing {\n display: block;\n}\n/* prevent menus from opening while scrubbing (FF, IE) */\n.vjs-default-skin.vjs-scrubbing .vjs-menu-button:hover .vjs-control-content .vjs-menu {\n display: none;\n}\n.vjs-default-skin .vjs-menu-button ul li {\n list-style: none;\n margin: 0;\n padding: 0.3em 0 0.3em 0;\n line-height: 1.4em;\n font-size: 1.2em;\n text-align: center;\n text-transform: lowercase;\n}\n.vjs-default-skin .vjs-menu-button ul li.vjs-selected {\n background-color: #000;\n}\n.vjs-default-skin .vjs-menu-button ul li:focus,\n.vjs-default-skin .vjs-menu-button ul li:hover,\n.vjs-default-skin .vjs-menu-button ul li.vjs-selected:focus,\n.vjs-default-skin .vjs-menu-button ul li.vjs-selected:hover {\n outline: 0;\n color: #111;\n /* background-color-with-alpha */\n background-color: #ffffff;\n background-color: rgba(255, 255, 255, 0.75);\n /* box-shadow */\n -webkit-box-shadow: 0 0 1em #ffffff;\n -moz-box-shadow: 0 0 1em #ffffff;\n box-shadow: 0 0 1em #ffffff;\n}\n.vjs-default-skin .vjs-menu-button ul li.vjs-menu-title {\n text-align: center;\n text-transform: uppercase;\n font-size: 1em;\n line-height: 2em;\n padding: 0;\n margin: 0 0 0.3em 0;\n font-weight: bold;\n cursor: default;\n}\n/* Subtitles Button */\n.vjs-default-skin .vjs-subtitles-button:before {\n content: "\\e00c";\n}\n/* Captions Button */\n.vjs-default-skin .vjs-captions-button:before {\n content: "\\e008";\n}\n/* Chapters Button */\n.vjs-default-skin .vjs-chapters-button:before {\n content: "\\e00c";\n}\n.vjs-default-skin .vjs-chapters-button.vjs-menu-button .vjs-menu .vjs-menu-content {\n width: 24em;\n left: -12em;\n}\n/* Replacement for focus outline */\n.vjs-default-skin .vjs-captions-button:focus .vjs-control-content:before,\n.vjs-default-skin .vjs-captions-button:hover .vjs-control-content:before {\n /* box-shadow */\n -webkit-box-shadow: 0 0 1em #ffffff;\n -moz-box-shadow: 0 0 1em #ffffff;\n box-shadow: 0 0 1em #ffffff;\n}\n/*\nREQUIRED STYLES (be careful overriding)\n================================================================================\nWhen loading the player, the video tag is replaced with a DIV,\nthat will hold the video tag or object tag for other playback methods.\nThe div contains the video playback element (Flash or HTML5) and controls,\nand sets the width and height of the video.\n\n** If you want to add some kind of border/padding (e.g. a frame), or special\npositioning, use another containing element. Otherwise you risk messing up\ncontrol positioning and full window mode. **\n*/\n.video-js {\n background-color: #000;\n position: relative;\n padding: 0;\n /* Start with 10px for base font size so other dimensions can be em based and\n easily calculable. */\n font-size: 10px;\n /* Allow poster to be vertically aligned. */\n vertical-align: middle;\n /* display: table-cell; */\n /*This works in Safari but not Firefox.*/\n /* Provide some basic defaults for fonts */\n font-weight: normal;\n font-style: normal;\n /* Avoiding helvetica: issue #376 */\n font-family: Arial, sans-serif;\n /* Turn off user selection (text highlighting) by default.\n The majority of player components will not be text blocks.\n Text areas will need to turn user selection back on. */\n /* user-select */\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n/* Playback technology elements expand to the width/height of the containing div\n or */\n.video-js .vjs-tech {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n/* Fix for Firefox 9 fullscreen (only if it is enabled). Not needed when\n checking fullScreenEnabled. */\n.video-js:-moz-full-screen {\n position: absolute;\n}\n/* Fullscreen Styles */\nbody.vjs-full-window {\n padding: 0;\n margin: 0;\n height: 100%;\n /* Fix for IE6 full-window. http://www.cssplay.co.uk/layouts/fixed.html */\n overflow-y: auto;\n}\n.video-js.vjs-fullscreen {\n position: fixed;\n overflow: hidden;\n z-index: 1000;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n width: 100% !important;\n height: 100% !important;\n /* IE6 full-window (underscore hack) */\n _position: absolute;\n}\n.video-js:-webkit-full-screen {\n width: 100% !important;\n height: 100% !important;\n}\n.video-js.vjs-fullscreen.vjs-user-inactive {\n cursor: none;\n}\n/* Poster Styles */\n.vjs-poster {\n background-repeat: no-repeat;\n background-position: 50% 50%;\n background-size: contain;\n background-color: #000000;\n cursor: pointer;\n margin: 0;\n padding: 0;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.vjs-poster img {\n display: block;\n margin: 0 auto;\n max-height: 100%;\n padding: 0;\n width: 100%;\n}\n/* Hide the poster after the video has started playing */\n.video-js.vjs-has-started .vjs-poster {\n display: none;\n}\n/* Don\'t hide the poster if we\'re playing audio */\n.video-js.vjs-audio.vjs-has-started .vjs-poster {\n display: block;\n}\n/* Hide the poster when controls are disabled because it\'s clickable\n and the native poster can take over */\n.video-js.vjs-controls-disabled .vjs-poster {\n display: none;\n}\n/* Hide the poster when native controls are used otherwise it covers them */\n.video-js.vjs-using-native-controls .vjs-poster {\n display: none;\n}\n/* Text Track Styles */\n/* Overall track holder for both captions and subtitles */\n.video-js .vjs-text-track-display {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 3em;\n right: 0;\n pointer-events: none;\n}\n/* Captions Settings Dialog */\n.vjs-caption-settings {\n position: relative;\n top: 1em;\n background-color: #000;\n opacity: 0.75;\n color: #FFF;\n margin: 0 auto;\n padding: 0.5em;\n height: 15em;\n font-family: Arial, Helvetica, sans-serif;\n font-size: 12px;\n width: 40em;\n}\n.vjs-caption-settings .vjs-tracksettings {\n top: 0;\n bottom: 2em;\n left: 0;\n right: 0;\n position: absolute;\n overflow: auto;\n}\n.vjs-caption-settings .vjs-tracksettings-colors,\n.vjs-caption-settings .vjs-tracksettings-font {\n float: left;\n}\n.vjs-caption-settings .vjs-tracksettings-colors:after,\n.vjs-caption-settings .vjs-tracksettings-font:after,\n.vjs-caption-settings .vjs-tracksettings-controls:after {\n clear: both;\n}\n.vjs-caption-settings .vjs-tracksettings-controls {\n position: absolute;\n bottom: 1em;\n right: 1em;\n}\n.vjs-caption-settings .vjs-tracksetting {\n margin: 5px;\n padding: 3px;\n min-height: 40px;\n}\n.vjs-caption-settings .vjs-tracksetting label {\n display: block;\n width: 100px;\n margin-bottom: 5px;\n}\n.vjs-caption-settings .vjs-tracksetting span {\n display: inline;\n margin-left: 5px;\n}\n.vjs-caption-settings .vjs-tracksetting > div {\n margin-bottom: 5px;\n min-height: 20px;\n}\n.vjs-caption-settings .vjs-tracksetting > div:last-child {\n margin-bottom: 0;\n padding-bottom: 0;\n min-height: 0;\n}\n.vjs-caption-settings label > input {\n margin-right: 10px;\n}\n.vjs-caption-settings input[type="button"] {\n width: 40px;\n height: 40px;\n}\n/* Hide disabled or unsupported controls */\n.vjs-hidden {\n display: none !important;\n}\n.vjs-lock-showing {\n display: block !important;\n opacity: 1;\n visibility: visible;\n}\n/* In IE8 w/ no JavaScript (no HTML5 shim), the video tag doesn\'t register.\n The .video-js classname on the video tag also isn\'t considered.\n This optional paragraph inside the video tag can provide a message to users\n about what\'s required to play video. */\n.vjs-no-js {\n padding: 2em;\n color: #ccc;\n background-color: #333;\n font-size: 1.8em;\n font-family: Arial, sans-serif;\n text-align: center;\n width: 30em;\n height: 15em;\n margin: 0 auto;\n}\n.vjs-no-js a,\n.vjs-no-js a:visited {\n color: #F4A460;\n}\n/* -----------------------------------------------------------------------------\nThe original source of this file lives at\nhttps://github.com/videojs/video.js/blob/master/src/css/video-js.less */\n'; +},function(e,t,n){var i="[PlayerManager_Fullscreen]",o=n(9),r=function(e){o.debug(i,e)},a=function(e){o.verbose(i,e)};e.exports=function(e,t){return{init:function(n,i,o){r("init"),e.isMobile()===!1&&n.controlBar.fullscreenToggle.on("click",function(){t.isFullscreenToggled||(t.isFullscreenToggled=!0)}),n.on("fullscreenchange",function(){if(a("fullscreenchange"),e.isIos()&&t.isFullscreen&&t.play(),t.isFullscreen){e.pendingFullscreenExit=!0,e.isIos()&&!e.options.fixedSizePlayer?(n.controlBar.el().style.bottom="0.0em",e.options.disableTopBar||(i.style.display="block",e.floatingSkipButton&&(e.readyForSkip?(e.floatingSkipButton.style.display="block",e.floatingAdSkipText.style.display="none"):(e.floatingSkipButton.style.display="none",e.floatingAdSkipText.style.display="block")))):(n.controlBar.el().style.bottom="",e.options.disableTopBar||(o.style.display="block",i.style.display="none",e.floatingSkipButton&&(e.floatingSkipButton.style.display="none",e.floatingAdSkipText.style.display="none")));var r;r=e.isMobile()===!1?1e3:0,setTimeout(function(){e.pendingFullscreenExit=!1,t.isFullscreen=!1,t.isFullscreenToggled=!1,e.dispatchEventToAdunit({name:"fullscreenchange",fullscreenStatus:"exit"}),t.callbackForAdUnit.cbCoreVideoEvent("AdHandler","video_fullscreen_exit")},r)}else t.isFullscreen=!t.isFullscreen,n.controlBar.el().style.bottom="0.0em",e.options.disableTopBar||(i.style.display="block",o.style.display="none",e.floatingSkipButton&&(e.readyForSkip?(e.floatingSkipButton.style.display="block",e.floatingAdSkipText.style.display="none"):(e.floatingSkipButton.style.display="none",e.floatingAdSkipText.style.display="block"))),e.dispatchEventToAdunit({name:"fullscreenchange",fullscreenStatus:"enter"}),t.callbackForAdUnit.cbCoreVideoEvent("AdHandler","video_fullscreen_enter")})}}}},function(e,t,n){var i="[PlayerManager_Controls]",o=n(9),r=function(e){o.debug(i,e)};e.exports=function(e){return{init:function(t){r("init"),t.on("concealControls",function(){var e=t.player().controlBar;e&&!e.concealed&&(e.currentTimeDisplay&&e.currentTimeDisplay.hide(),e.durationDisplay&&e.durationDisplay.hide(),e.timeDivider&&e.timeDivider.hide(),e.muteToggle&&e.muteToggle.hide(),e.playToggle&&e.playToggle.hide(),e.fullscreenToggle&&e.fullscreenToggle.hide(),e.progressControl&&e.progressControl.hide(),e.volumeControl&&e.volumeControl.hide(),e.concealed=!0)}),t.on("revealControls",function(){var n=t.player().controlBar;n&&n.concealed&&("bar"!==e.options.showProgressBar&&e.options.showProgressBar!==!1&&(n.currentTimeDisplay&&n.currentTimeDisplay.show(),n.durationDisplay&&n.durationDisplay.show(),n.timeDivider&&n.timeDivider.show()),n.muteToggle&&e.options.showMute&&n.muteToggle.show(),n.playToggle&&e.options.showPlayToggle&&n.playToggle.show(),n.fullscreenToggle&&e.options.allowFullscreen&&n.fullscreenToggle.show(),e.options.showProgressBar!==!1&&"text"!==e.options.showProgressBar&&n.progressControl&&n.progressControl.show(),n.volumeControl&&e.options.showVolume&&e.displayVolumeControls()&&n.volumeControl.show(),n.concealed=!1)})}}}},function(e,t,n){var i="[PlayerManager_Orientation]",o=n(9),r=function(e){o.debug(i,e)};e.exports=function(e,t){return{init:function(){r("init");var n=e.options.isWaterfall?e.options.waterfallStepId:null;window.addEventListener("orientationchange",function(){if(!e.options.overlayPlayer&&t.isReadyToExpandForMobile){if(n&&n!==e.options.waterfallStepId)return;var i=!(!e.options.sideStreamObject||"function"!=typeof e.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated)&&e.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated();if(i)return;e.refreshVideoLookAndFeel(e.options,t)}}),window.addEventListener("resize",function(){if(t.options.shouldResizeVideoToFillMobileWebview){var e=window.innerWidth&&document.documentElement.clientWidth?Math.max(window.innerWidth,document.documentElement.clientWidth):window.innerWidth||document.documentElement.clientWidth||document.getElementsByTagName("body")[0].clientWidth,n=window.innerHeight&&document.documentElement.clientHeight?Math.max(window.innerHeight,document.documentElement.clientHeight):window.innerHeight||document.documentElement.clientHeight||document.getElementsByTagName("body")[0].clientHeight;t.options.width=e,t.options.height=n,t.resizeVideo(t.options.aspectRatio,!0)}})}}}},function(e,t,n){var i="[PlayerManager_BigPlayButton]",o=n(9),r=function(e){o.debug(i,e)},a=function(e){o.verbose(i,e)};e.exports=function(e,t){return{init:function(n){r("init");var i=function(){t.explicitPlay(),t.isEnded===!0&&(t.replay(),n.player().bigPlayButton.removeClass("vjs-big-play-button-replay"),e.options.showBigPlayButton===!1&&n.bigPlayButton&&n.bigPlayButton.hide()),setTimeout(function(){t.unmute()},e.bigbuttonUnmuteTimeout)};n.player().bigPlayButton.on("click",function(){a("big play button click"),i()}),n.player().bigPlayButton.on("touchend",function(){a("big play button touchend"),i()})}}}},function(e,t,n){var i="[PlayerManager_VideoPlay]",o=n(9),r=n(18)(),a=n(8),s=function(e){o.debug(i,e)},l=function(e){o.verbose(i,e)};e.exports=function(e,t){return{init:function(n){s("init"),n.controlBar.playToggle.on("click",function(){l("play button click"),t.explicitPaused=!t.explicitPaused}),n.controlBar.playToggle.on("touchend",function(){l("play button touchend"),t.explicitPaused=!t.explicitPaused}),n.on("durationchange",function(){e.dispatchEventToAdunit({name:"durationchange"})}),n.on("firstplay",function(){e.dispatchEventToAdunit({name:"firstplay"}),n.controlBar.muteToggle&&n.controlBar.muteToggle.update(),n.controlBar.volumeControl&&n.controlBar.volumeControl.volumeBar&&n.controlBar.volumeControl.volumeBar.update(),i()});var i=function(){e.dispatchEventToAdunit({name:"volume-change",obj:{volume:t.isMuted?0:n.volume()},eventType:"AdUnit"})};n.on("volumechange",i),n.controlBar.playToggle.on("click",function(){l("play button click"),t.isPlayingVideo===!0?t.explicitPause():(t.explicitPlay(),t.unmute())}),n.controlBar.playToggle.on("touchend",function(){l("play button touchend"),t.isPlayingVideo===!0?t.explicitPause():(t.explicitPlay(),t.unmute())}),n.on("loadstart",function(){e.dispatchEventToAdunit({name:"loadstart"})}),n.on("pause",function(){e.options.overlayPlayer&&Math.abs(n.player().duration()-n.player().currentTime())<.5?(l("hiding big play button for overlay player at the end of the video"),n.player().bigPlayButton.el().style.display="none"):(l("showing big play button"),n.player().bigPlayButton.el().style.display="block"),t.isPlayingVideo=!1,e.options.hasOwnProperty("overlayPlayer")&&(a.isIphone()&&parseInt(a.getIOSVersion())<10||a.isIos()&&n.isFullscreen())&&e.dispatchEventToAdunit({name:"video_pause"})}),n.on("play",function(){if(n.player().bigPlayButton.el().style.display="",t.options.shouldResizeVideoToFillMobileWebview){var i=window.innerWidth&&document.documentElement.clientWidth?Math.max(window.innerWidth,document.documentElement.clientWidth):window.innerWidth||document.documentElement.clientWidth||document.getElementsByTagName("body")[0].clientWidth,o=window.innerHeight&&document.documentElement.clientHeight?Math.max(window.innerHeight,document.documentElement.clientHeight):window.innerHeight||document.documentElement.clientHeight||document.getElementsByTagName("body")[0].clientHeight;t.options.width=i,t.options.height=o,t.resizeVideo(t.options.aspectRatio,!0)}t.isPlayingVideo=!0,e.options.hasOwnProperty("overlayPlayer")&&(a.isIphone()&&parseInt(a.getIOSVersion())<10||a.isIos()&&n.isFullscreen())&&e.dispatchEventToAdunit({name:"video_resume"})}),n.on("error",function(n){s("error in video js");var i=r.browser.name.toLowerCase(),o=n&&n.target&&e.options&&(e.options.vpaid||"ie"===i&&e.options.isWaterfall);o&&(n.target.toString().indexOf('poster="null"')>0||"video"===n.target.nodeName.toLowerCase()&&n.target.networkState<=2||"div"===n.target.nodeName.toLowerCase())||(l("destroying due to error in video js"),t.destroyWithoutSkip(!0,e.CONST_MESSAGE_GENERAL_ERROR,null,900))}),e.options.vpaid===!1&&n.one("loadedmetadata",function(i){var o=i.currentTarget;t.videoObjectId=o.id,t.isReadyToExpandForMobile=!0,s("loadedmetadata video.js is ready to play"),n.tech.removeControlsListeners();var r=o.videoWidth,a=o.videoHeight,l=r/a;r>0?(t.resizeVideo(l),"function"==typeof e.callbackForAdUnit.cbWhenReady&&e.callbackForAdUnit.cbWhenReady(t)):(t.resizeVideo(0),e.callbackForAdUnit.cbWhenReady(t))})}}}},function(e,t,n){var i="[PlayerManager_PostProcess]",o=n(9),r=function(e){o.debug(i,e)};e.exports=function(e,t){return{init:function(i,o,a){r("init"),n(40)(e,t).init(i,o,a),e.isMobile()&&e.options.hasOwnProperty("overlayPlayer")&&("click"===e.options.initialPlayback||"mouseover"===e.options.initialPlayback)?i&&(i.controlBar.el_.style.setProperty("display","none","important"),e.options.hiddenControls=!0):e.options.hasOwnProperty("overlayPlayer")&&e.isIos()&&parseInt(o.getIOSVersion())<10&&"auto"===e.options.initialPlayback&&i&&(i.controlBar.el_.style.setProperty("display","none","important"),e.options.hiddenControls=!0)}}}},function(e,t,n){var i="[PlayerManager_SettingAdIcons]",o=n(9),r=n(41),a=function(e){o.debug(i,e)};e.exports=function(e,t){return{init:function(n,i,o){a("init");var s=t.options.playerSkin.controlBarHeight,l=new r;l.init(t.options.data.adIcons);var d=l.getIcons();if(d&&(!d||0!==d.length)){var c=t.options.disableTopBar?0:o,u=i.isMobile()||"below"===t.options.controlBarPosition?s:0;if(n.controlBar.el_.style.zIndex=10,t.test("adIconOffset",l),!i.isMobile()){var p=document.getElementById(e.options.iframeVideoWrapperId).contentWindow.document.getElementById(e.an_video_ad_player_id),h=function(){if(t.isExpanded&&"below"!==t.options.controlBarPosition){var e=t.getFinalSize(),n=e.height-o-s-10,i=0;l.redraw(i,n)}},m=function(){if(t.isExpanded&&"below"!==t.options.controlBarPosition){var e=t.getFinalSize(),n=e.height-o-s-10;l.redraw(s,n)}};n.on("useractive",function(){m()}),n.on("userinactive",function(){n.paused()===!1&&h()}),n.on("handleManualUserActive",function(){m()}),n.on("handleManualUserInActive",function(){n.paused()===!1&&h()}),p.addEventListener("mouseenter",function(){m()}),p.addEventListener("mousemove",function(){m()})}n.on("timeupdate",function(){if(!t.options.vpaid||t.options.showVpaidIcons){var e=Math.round(n.player().currentTime()),i=1e3*e,o=Math.round(n.player().duration()),r=1e3*o;d&&d.length>0&&l.renderIcons(function(e){var n={};n.name=e,t.dispatchEventToAdunit(n)},function(e){t.click(e,!1)},n.player().el_,c,u,i,r)}})}}}}},function(e,t,n){var i="[AdIcon]",o=n(8),r=n(9),a=function(e){r.debug(i,e)},s=function(){var e=5,t=function(e){for(var t=0;t=0&&(e[t].content=""),i.indexOf(o.type.toLowerCase())>=0&&(e[t].content=""),e[t].isDisplay=!1}}return e};this.icons=[],this.init=function(e){a("initalize ad icon"),e&&(this.icons=t(e))},this.getIcons=function(){return this.icons},this.renderIcons=function(t,n,i,r,s,l,d){var c=this.getIcons(),u=this;if(s=0!==s?s+e:s,c&&!(c.length<1)){var p,h=function(e){return function(){n(e.IconClickThrough),t("IconClickTracking_"+e.program),a("fire IconClickTracking for "+e.program)}},m=function(e){setTimeout(function(){u.resolveCollision(e),a("start to check a collision of ad icon")},500)};for(p=0;p0&&l>=d){for(A=0;Av+f&&g.isDisplay&&y)y.style.display="none";else if(!g.isDisplay){var T="left",w=Number(w)<0?0:w,E="top",S=Number(w)<0?0:w,I=Number(r)>0?r:0,C=Number(s)>0?s:0;g&&"left"===g.xPosition&&(T="left",w=0),g&&"right"===g.xPosition&&(T="right",w=0),g&&Number(g.xPosition)>=0&&(T="left",w=Number(g.xPosition)),g&&"bottom"===g.yPosition&&(E="bottom",S=0,S+=C),g&&"top"===g.yPosition&&(E="top",S=0,S+=I),g&&Number(g.yPosition)>=0&&(E="top",S=Number(g.yPosition),S+=I);var P;y?(P=y,a("reuse ad icon for "+g.program)):(P=i.ownerDocument.createElement("div"),a("create ad icon for "+g.program)),i.appendChild(P),P.setAttribute("name","adicon"),P.id="adicon_"+g.program,P.innerHTML=g.content,P.style.position="fixed",P.style.cursor="hand",P.style[T]=w+"px",P.style[E]=S+"px",P.style.zIndex=2147483647,P.style.display="block",P.style.width=g.width+"px",P.style.height=g.height+"px",g.isDisplay=!0,g.htmlReference=P,g.document=i.ownerDocument,g.originalStyle={},g.originalStyle[T]=w,g.originalStyle[E]=S,g.clickRegisterd||(P.addEventListener("click",h(g)),g.clickRegisterd=!0,a("ad icon click handler registered for "+g.program)),c[p]=g,t&&"function"==typeof t&&(t("IconViewTracking_"+g.program),a("check and fire IconViewTracking for "+g.program)),p===c.length-1&&m(c)}}}}},this.elementsFromPoint=function(e,t,n){try{if(n.elementsFromPoint)return n.elementsFromPoint(e,t);var i=[],o=void 0;do o!==n.elementFromPoint(e,t)?(o=n.elementFromPoint(e,t),i.push(o),o&&o.style&&(o.style.pointerEvents="none")):o=!1;while(o);return i.forEach(function(e){var t;return e&&e.style&&(t=e.style.pointerEvents="all"),t}),i}catch(r){return a(r),null}};var n=function(e){var t=0;return e&&Number(e)>=0&&(t=Number(e)),e&&"string"==typeof e&&e.toLowerCase()&&e.indexOf("px")&&(t=Number(e.replace("px","")),t=t>0?t:0),t};this.resolveCollision=function(e){var t,i=this,o=function(e,t){var i;for(i=0;i=0&&(a("collision resolved by moving icon to left for ad icon program - "+k),s.htmlReference.style.left=I.next_left+"px",S=!0),I=r("right",d,u,c,p,T,w,s.document,s.htmlReference),S===!1&&I.newSpaceOwner_topLeft.result===!1&&I.newSpaceOwner_topRight.result===!1&&I.newSpaceOwner_bootomRight.result===!1&&I.newSpaceOwner_bootomLeft.result===!1&&(a("collision resolved by moving icon to right for ad icon program - "+k),s.htmlReference.style.left=I.next_left+"px",S=!0),S===!1&&(a("hide ad-icon due to no way to avoid collision for ad icon program - "+k),s.htmlReference.style.display="none"),a("collision detection end for ad icon program - "+k)}}}},this.redraw=function(e){var t;for(t=0;tr?0:o,O=t,i/=1e3,W(i);var l=n.currentTime,d=n.duration;if(l>=d){if(a("close checking by iOSInlinePlayer"),v!==!1)return a("closed by iOSInlinePlayer"),w(),N=!1,void window.cancelAnimationFrame(p);var c=s.currentTime,u=s.duration;if(c>=u)return a("closed with audio by iOSInlinePlayer"),w(),N=!1,void window.cancelAnimationFrame(p)}f===!1?p=window.requestAnimationFrame(e):(N=!1,window.cancelAnimationFrame(p))}var t,n,i,s,l,d,c,u,p,h,m,f,v,g,y,A,b,k,T,w,E,S,I,C,P,j,x,_,V,D,M=!1,N=!1,O=0,R={keepWidth:null,keepHeight:null};this.setPubOptions=function(e){D=e};var U=function(){var e=navigator.appVersion.indexOf("Mobile");return e>-1};this.renderVideo=function(e,r){return o("renderVideo"),U()?(V=e.cbTimeUpdate,d=e.mediaUrl,E=e.divArea,w=e.cbWhenVideoComplete,S=e.targetElement,C=e.iframeVideoWrapper,j=e.el_wholeArea,a("generating initial canvas object"),t=document.createElement("canvas"),t.style["image-rendering"]="auto",E.appendChild(t),E.style.width="100%",E.style.height="100%",R.keepWidth=t.style.width,R.keepHeight=t.style.height,"undefined"!=typeof e.videoElement?n=e.videoElement:(a("creating video tag"),n=document.createElement("video"),i=document.createElement("source"),n.style.display="none",n.autoplay=!1,n.preload="auto",n.controls=!0,i.src=d,n.appendChild(i),E.appendChild(n)),a("preparing audio tag"),s=document.createElement("audio"),l=document.createElement("source"),D.preloadInlineAudioForIos&&!D.vpaid&&this.activateAudio(),c=t.getContext("2d"),u=Date.now(),h=35,m=!1,f=!1,v=!0,g=.3,y=.3,A=.1,b=!1,k=!1,T=99999999,a("renderVideo callback"),void r(!0)):void r(!1)};var L=function(e){a("saveCSS");var t={},n={position:"",width:"",height:"",top:"",left:"",marginRight:"",transform:"",background:""};for(var i in n)t[i]=e.style[i];return t},F=function(e,t){a("loadCSS");for(var n in t)e.style[n]=t[n]},B=function(e){var i=n.videoWidth/n.videoHeight,o=0,r=0,a=D.sideStream&&D.sideStream.enabled&&D.sideStreamObject&&D.sideStreamObject.isActivated;if(!e&&a){var s,l,d=D.sideStream.width,c=D.sideStream.height,u=0,p=30;D.disableTopBar||(u=24),c-=p+u,d||c||(d=D.width,c=D.mediaHeight),d&&c?(s=d,l=c):(s=d?d:c/i,l=c?c:d/i),o=Math.round(Math.min(l*i,s)),r=Math.round(Math.min(s/i,l))}else o=t.parentElement.parentElement.style.width.replace("px",""),r=t.parentElement.parentElement.style.height.replace("px","");return{width:o,height:r}},$=function(e){var n=B(e).width,i=B(e).height;e?(t.width=n,t.height=i):(t.width=n,t.height=D.mediaHeight)},H=function(){var e=t.height/n.videoHeight*n.videoWidth,i=t.height,o=(t.width-e)/2,r=0;if(e>t.width){var a=t.width/n.videoWidth*n.videoHeight;o=0,r=Math.abs(t.height-a)/2,c.drawImage(n,o,r,t.width,a)}else c.drawImage(n,o,r,e,i)},W=function(e){var t=0;n.currentTime=n.currentTime+e,$(k),t=Math.abs(s.currentTime-n.currentTime),v===!1&&t>=g&&t<=T&&(n.currentTime=s.currentTime+e),H(),V()},z=function(){return window.innerHeight>window.innerWidth},q=function(){this.resumeVideo()},J=function(e){var t=window.innerWidth,n=window.innerHeight,i=D.playerSkin.controlBarHeight,o=t,r=n-i,a=0,s=0;return{width:o,height:r,top:a,left:s}},G=function(){S.style.backgroundColor="black",S.style.width="100%",S.style.height="100%",S.style.position="fixed",S.style.top="0px",S.style.left="0px",S.style.zIndex="999999",S.style.background="rgba(0,0,0,1)",S.style.transition="height 0s ease",j.style.background="rgba(0,0,0,1)",t.style.background="rgba(0,0,0,1)",C.style.background="rgba(0,0,0,1)"},Q=function(){F(S,I),S.style.height=J().height+"px"},X=function(e){A=e.target.videoWidth/e.target.videoHeight},Y=function(){var e=z(),t=J(e),n=t.width,i=t.height,o=t.top,r=t.left;C.style.position="absolute",C.style.width=n,C.style.height=i,C.style.top=o+"px",C.style.left=r+"px",C.style.marginRight="",C.style.transform="",j.style.width=n+"px",j.style.height=i+"px",j.style.marginLeft="",j.style.marginRight=""},K=function(){k=!1,S.ontouchmove=function(){return!0},t.ontouchmove=function(){return!0},j.ontouchmove=function(){return!0},Q(),F(S,I),F(C,P),F(j,x),F(t,_)};this.exitFullscreeenAsCanvas=function(){K(),f===!0&&this.resizeAndRedraw()},this.enterFullscreenAsCanvas=function(){S.ontouchmove=function(){return!1},t.ontouchmove=function(){return!1},j.ontouchmove=function(){return!1},I=L(S),P=L(C),x=L(j),_=L(t),S.style.marginLeft="0px",S.style.marginRight="0px",S.style.marginTop="0px",S.style.marginBottom="0px",k=!0,G(),Y(),f===!0&&this.resizeAndRedraw()},this.resizeAndRedraw=function(){$(k),H()},this.initialPlay=function(e){this.play(e)},this.play=function(t){N||(f=!1,t&&s&&s.play&&s.play(),p=window.requestAnimationFrame(e))},this.resumeVideo=function(){f=!1,s&&s.play&&s.play(),p=window.requestAnimationFrame(e)},this.pauseVideo=function(){f=!0,s.pause(),window.cancelAnimationFrame(p),N=!1},this.activateAudio=function(){r("activateAudio : "+n.src),s.style.display="none",s.autoplay=!1,s.preload="auto",s.controls=!0,l.src=n.src,s.appendChild(l),E.appendChild(s),s.load()},this.hearAudio=function(){return b?(r("resume audio"),v=!1,s.currentTime=n.currentTime,void(f||s.play())):(s.addEventListener("playing",function(){r("first playing audio"),s.currentTime=n.currentTime+g,v=!1,b=!0}),D.preloadInlineAudioForIos===!1&&this.activateAudio(),s.currentTime=n.currentTime,void(f||s.play()))},this.stopAudio=function(){r("pausing audio"),s.pause(),v=!0},this.checkOrientation=function(){M&&!D.disableCollapse.enabled||(k?(Q(),G(),Y(),f===!0&&this.resizeAndRedraw()):($(k),H()))},this.initiate=function(){n.addEventListener("canplaythrough",X.bind(this)),n.addEventListener("webkitendfullscreen",q,!1),n.load(),n.pause()},this.getCanvas=function(){return t},this.destroy=function(){window.cancelAnimationFrame(p),k&&K(),M=!0},this.resizeCanvas=$,this.redrawCanvas=H};e.exports=s},function(e,t,n){var i=n(8),o=n(9),r=function(e){o.debug("iOSInlineVideoPlayer :: EmulateHtml5Video: "+e)},a=function(e){o.verbose("iOSInlineVideoPlayer :: EmulateHtml5Video: "+e)},s=n(32);e.exports=function(e,t){return{handleFullScreen:function(n){t.isFullscreen=!0,r("handleFullScreen");var o=n.contentWindow.document.getElementById("top_chrome");e.dispatchEventToAdunit({name:"fullscreenchange",fullscreenStatus:"enter"}),e.iOSVideoPlayer.enterFullscreenAsCanvas(),e.isFullscreen=!0,o&&(o.style.display="none"),e.options.disableTopBar||(a("Hiding ad text for fullscreen"),e.floatingAdIndicator.style.display="block",e.floatingSkipButton&&(e.readyForSkip?(e.floatingSkipButton.style.display="block",e.floatingAdSkipText.style.display="none"):(e.floatingSkipButton.style.display="none",e.floatingAdSkipText.style.display="block"))),i.makeIframeFlexbileSize(t)},handleNormalScreen:function(n){t.isFullscreen=!1,r("handleNormalScreen");var o=n.contentWindow.document.getElementById("top_chrome");e.dispatchEventToAdunit({name:"fullscreenchange",fullscreenStatus:"exit"}),o&&(o.style.display="block"),e.options.disableTopBar||(a("Showing ad text for fullscreen"),e.floatingAdIndicator.style.display="none",e.floatingSkipButton&&(e.floatingSkipButton.style.display="none",e.floatingAdSkipText.style.display="none")),e.iOSVideoPlayer.exitFullscreeenAsCanvas(),e.isFullscreen=!1;var s=t.options.sideStream&&t.options.sideStream.enabled&&t.options.sideStreamObject&&t.options.sideStreamObject.isActivated;s===!1&&e.refreshVideoLookAndFeel(e.options,t),e.resizeIosCanvas(e.isFullscreen);var l=document.getElementById(t.videoObjectId);l&&"undefined"!=typeof l&&(l.style.width=e.options.width,l.style.height=e.options.height);var d=t.options.sideStream&&t.options.sideStream.enabled,c=t.options.sideStreamObject&&"function"==typeof t.options.sideStreamObject.moveAdUnitBack;d&&c&&t.options.sideStreamObject.moveAdUnitBack(),i.makeIframeFlexbileSize(t)},resizeIosCanvas:function(t){e.iOSVideoPlayer.resizeCanvas(t),e.iOSVideoPlayer.redrawCanvas(t)},cbWhenVideoComplete:function(n,o){if(r("cbWhenVideoComplete"),e.isFullscreen&&(e.fromFullscreen=!0,e.handleNormalScreen(n)),e.options.disableCollapse.enabled===!0&&(t.options.sideStreamObject&&t.options.sideStreamObject.isActivated&&t.options.sideStreamObject.moveAdUnitBack(),t.options.sideStream.wasEnabled=t.options.sideStream.enabled,t.options.sideStream.enabled=!1),e.options.disableCollapse.enabled!==!0||e.options.disableCollapse.replay!==!0&&e.options.endCard.enabled!==!0){if(e.isAlreadyDoneVideoComplete)return;e.isAlreadyDoneVideoComplete=!0,"below"===e.options.controlBarPosition&&(e.videojsPlayer.controlBar.el().style.bottom=s.getBottomMarginForControlbar(e.options,!1)+"em"),a("removing control bar items"),e.videojsPlayer.trigger("concealControls"),a("destroying iOSVideoPlayer"),e.iOSVideoPlayer.destroy(),e.resizeIosCanvas(e.isFullscreen),e.options.disableCollapse.enabled||(window.removeEventListener("orientationchange",e.eventOrientationChange),window.removeEventListener("resize",e.eventSizeChange));var l=function(){if(!e.options.disableCollapse.enabled){var n=t.options.sideStream&&t.options.sideStream.enabled&&t.options.sideStreamObject&&t.options.sideStreamObject.isActivated;n?t.isFullscreen=!1:t.isFullscreen=!0,t.destroyWithoutSkip()}t.isCompleted=!0,e.options.vpaid&&i.fireEvent(o,"ended")};e.dispatchEventToAdunit({name:"video_complete"},l)}else e.options.endCard.enabled&&t.endCard?(e.videojsPlayer.trigger("concealControls"),e.dispatchEventToAdunit({name:"video_complete"}),t.endCard.show()):(e.videojsPlayer.bigPlayButton.addClass("vjs-big-play-button-replay"),t.explicitPause(),e.videojsPlayer.currentTime(0),e.videojsPlayer.bigPlayButton.show(),e.videojsPlayer.player().bigPlayButton.el().style.display="block",e.dispatchEventToAdunit({name:"video_complete"}));t.isEnded=!0}}}},function(e,t,n){var i=n(8),o=n(17),r=n(9),a=function(e){r.log("iOSInlineVideoPlayer: "+e)},s=function(e){r.debug("iOSInlineVideoPlayer :: Events: "+e)},l=function(e){r.error("iOSInlineVideoPlayer :: Events: "+e)},d=n(41),c=n(24),u=24;e.exports=function(e,t,r){return{fnMainProcess:function(p){var h;a("fnMainProcess");var m=p.contentWindow.document.getElementById(e.an_video_ad_player_id);if(t.iframeVideoWrapper=p,e.options.vpaid)try{t.options.showVpaidIcons=!1,o(t)}catch(f){l(f)}else e.options.isWaterfall&&e.options.plugins&&(e.options.plugins=null);e.options.nativeControlsForTouch=!1,e.options.customControlsOnMobile=!1,e.videojsPlayer=e.videojsOrigin(m,e.options,function(){}),n(47)(e,t,r,e.videojsPlayer,p).run(),t.adVideoPlayer=e.videojsPlayer;var v=document.getElementById(e.options.iframeVideoWrapperId).contentWindow.document.getElementById(e.an_video_ad_player_id),g=document.getElementById(e.options.iframeVideoWrapperId).contentWindow.document.getElementById(e.an_video_ad_player_html5_api_id);e.options.enableInlineVideoForIos===!0&&(g.style.width="0.1px",g.style.height="0.1px");var y=document.createElement("div");y.style.position="absolute",y.style.top="0px",y.style.left="0px",e.options.vpaid||(y.className="vjs-tech"),y.style.textAlign="center",v.insertBefore(y,g),e.options.targetElement.addEventListener("IOS_INLINE_RESIZE",function(){e.resizeIosCanvas(!1)}),e.options.targetElement.addEventListener("IOS_INLINE_REFERESH",function(){e.refreshVideoLookAndFeel(e.options,t),e.iOSVideoPlayer.checkOrientation(),e.customFullscreenBtn.style.visibility="hidden"});var A={mediaUrl:e.options.videoUrl,divArea:y,width:e.options.width,height:e.options.height,videoElement:g,cbWhenVideoComplete:function(){e.cbWhenVideoComplete(p,g)},targetElement:e.options.targetElement,iframeVideoWrapper:p,el_wholeArea:v,cbTimeUpdate:function(){e.videojsPlayer.trigger("timeupdate")}},b=e.options.isWaterfall?e.options.waterfallStepId:null;e.iOSVideoPlayer.setPubOptions(e.options),e.iOSVideoPlayer.renderVideo(A,function(n){return n?(e.eventOrientationChange=function(){if((!b||b===e.options.waterfallStepId)&&t.isReadyToExpandForMobile){var n=!(!t.options.sideStreamObject||"function"!=typeof t.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated)&&t.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated();if(n)return;e.refreshVideoLookAndFeel(e.options,t),e.iOSVideoPlayer.checkOrientation()}},e.eventSizeChange=function(){b&&b!==e.options.waterfallStepId||e.isFullscreen&&(t.resizeVideo(-1,e.shouldConsiderHeightOfDevice),e.iOSVideoPlayer.checkOrientation())},window.addEventListener("resize",e.eventSizeChange),window.addEventListener("orientationchange",function(){(t.isCompleted||t.isEnded)&&e.options.disableCollapse.enabled===!1||(clearTimeout(h),h=setTimeout(function(){e.eventOrientationChange()},250))}),g.onseeked=function(){return!1},"auto"===e.options.initialPlayback?e.videojsPlayer.player().loadingSpinner.show():e.videojsPlayer.player().loadingSpinner.hide(),e.videojsPlayer.player().off("seeked"),e.iOSVideoPlayer.initiate(),"click"===e.options.initialPlayback&&g.addEventListener("canplay",function(){e.iOSVideoPlayer.checkOrientation()}),void 0):void s("only works in iOS")}),e.videojsPlayer.controlBar.fullscreenToggle.dispose(),e.options.allowFullscreen===!0&&e.enableFullscreen&&(e.customFullscreenBtn=e.videojsOrigin.createEl("div",{id:"customFullscreenToggle",role:"button",innerHTML:'Fullscreen' +}),e.customFullscreenBtn.style.cssText="text-align:right;float:right;margin-right:0em;font-size:1em;line-height:3em;outline:0;position:relative;padding:0;height:3em",e.customFullscreenBtn.className="vjs-fullscreen-control vjs-control",e.videojsPlayer.controlBar.addChild("button",{el:e.customFullscreenBtn}),e.customFullscreenBtn.addEventListener("touchend",function(t){setTimeout(function(){if(e.isFullscreen){var n=document.getElementById(e.options.iframeVideoWrapperId).contentWindow.document.getElementById(e.an_video_ad_player_html5_api_id),i=n.style.visibility;n.style.visibility="hidden",setTimeout(function(){e.handleNormalScreen(p),n.style.visibility=i},0)}else e.handleFullScreen(p);t.preventDefault()},200)})),e.iOSVideoPlayer.getCanvas().onclick=function(){e.options.learnMore.enabled===!1?(t.options.expandable||t.explicitPause(),t.click()):e.options.learnMore.clickToPause===!0&&(e.isTogglePaused===!1?t.explicitPause():t.explicitPlay())};var k=function(t){t?e.customPlayToggle.innerHTML="":e.customPlayToggle.innerHTML=""},T=function(){e.videojsPlayer.player().bigPlayButton.hide(),e.videojsPlayer.player().loadingSpinner.hide(),e.videojsPlayer.player().addClass("vjs-has-started"),e.videojsPlayer.player().removeClass("vjs-paused"),e.videojsPlayer.player().addClass("vjs-playing");try{k(!1);var n=e.enabledAudio;e.iOSVideoPlayer.initialPlay(n),s("override play method"),e.isDoneiOSInitialPlay?(i.fireEvent(g,"play"),i.fireEvent(g,"playing")):(i.fireEvent(g,"play"),i.fireEvent(g,"playing"),e.isDoneiOSInitialPlay=!0),t.isPlayingVideo=!0,e.isTogglePaused=!1}catch(o){l(o)}},w=function(){if(!e.isTogglePaused&&!t.isCompleted&&!t.isEnded){if(e.options.showBigPlayButton!==!1){var n=t.options.sideStream&&t.options.sideStream.enabled&&t.options.sideStreamObject&&t.options.sideStreamObject.isActivated;n===!0&&t.options.showPlayToggle===!0&&1==t.options.sideStream.dynamicBigPlayButtonOnSideStream||(e.videojsPlayer.bigPlayButton.show(),e.videojsPlayer.player().bigPlayButton.el().style.display="block")}e.iOSVideoPlayer.pauseVideo(),s("override pause method"),k(!0),t.isPlayingVideo=!1,e.isTogglePaused=!0,i.fireEvent(g,"pause")}},E=function(){var t=function(e){e&&0===e.readyState&&e.load()};g.play=function(){t(g),T()},g.pause=function(){w()},e.videojsPlayer.one("vpaid.AdStarted",function(){t(g)}),e.videojsPlayer.one("an.readytogovpaid",function(){e.iOSVideoPlayer.activateAudio(),t(g)})};e.options.vpaid?E():(g.play=T,g.pause=w),e.videojsPlayer.controlBar.el().ontouchend=function(){},e.videojsPlayer.controlBar.playToggle.dispose(),e.customPlayToggle=e.videojsOrigin.createEl("div",{id:"customPlayToggle",role:"button","aria-live":"polite",tabindex:"0",innerHTML:"",width:"5em"}),e.customPlayToggle.style.cssText="float:left;font-family:VideoJS;font-size:1.5em;line-height:2;width:3em;height:100%;text-align:center",e.videojsPlayer.controlBar.addChild("button",{el:e.customPlayToggle}),e.videojsPlayer.controlBar.el().insertBefore(e.customPlayToggle,e.videojsPlayer.controlBar.currentTimeDisplay.el()),e.customPlayToggle.ontouchend=function(n){e.isTogglePaused===!1?t.explicitPause():t.explicitPlay(),n.preventDefault()},e.customPlayToggle.onclick=function(){e.isTogglePaused===!1?t.explicitPause():t.explicitPlay()},e.videojsPlayer.controlBar.muteToggle.el().ontouchend=function(){e.enabledAudio?(e.iOSVideoPlayer.stopAudio(),e.enabledAudio=!1,e.videojsPlayer.controlBar.muteToggle.el_.style.opacity="0.3",t.dispatchEventToAdunit({name:"video_mute"})):(e.iOSVideoPlayer.hearAudio(),e.enabledAudio=!0,e.videojsPlayer.controlBar.muteToggle.el_.style.opacity="1",t.dispatchEventToAdunit({name:"video_unmute"}),e.isTogglePaused===!0&&t.explicitPause())},e.videojsPlayer.controlBar.muteToggle.el().onclick=function(){e.enabledAudio?(e.iOSVideoPlayer.stopAudio(),e.enabledAudio=!1,e.videojsPlayer.controlBar.muteToggle.el_.style.opacity="0.3"):(e.iOSVideoPlayer.hearAudio(),e.enabledAudio=!0,e.videojsPlayer.controlBar.muteToggle.el_.style.opacity="1",e.isTogglePaused===!0&&t.explicitPause())},e.videojsPlayer.one("loadedmetadata",function(n){if(e.options.showPlayToggle===!1&&e.videojsPlayer.controlBar.playToggle.hide(),e.options.showBigPlayButton===!1&&e.videojsPlayer.bigPlayButton.hide(),e.options.showMute===!1?e.videojsPlayer.controlBar.muteToggle.hide():(e.videojsPlayer.controlBar.muteToggle.show(),e.videojsPlayer.controlBar.muteToggle.el_.style.opacity="0.3"),e.options.allowFullscreen===!0&&(e.customFullscreenBtn.style.display="none"),e.options.showMute===!0&&e.videojsPlayer.controlBar.muteToggle.hide(),e.options.targetElement.addEventListener("outstream-impression",function(){e.options.allowFullscreen===!0&&(e.customFullscreenBtn.style.display="block"),e.options.showMute===!0&&e.videojsPlayer.controlBar.muteToggle.show()}),!t.options.vpaid){t.isReadyToExpandForMobile=!0,t.videoObjectId=n.currentTarget.id,s("loadedmetadata"),s("video.js is ready to play"),e.videojsPlayer.tech.removeControlsListeners();var i=n.currentTarget.videoWidth,o=n.currentTarget.videoHeight,r=i/o;i>0?(t.resizeVideo(r,e.shouldConsiderHeightOfDevice),"function"==typeof e.callbackForAdUnit.cbWhenReady&&e.callbackForAdUnit.cbWhenReady(t)):(t.resizeVideo(0,e.shouldConsiderHeightOfDevice),e.callbackForAdUnit.cbWhenReady(t))}}),t.customSkinning.render(e,e.videojsPlayer,p.contentWindow.document,!0);var S=function(){var n=t.options.playerSkin.controlBarHeight,i=e.videojsPlayer,o=new d;o.init(t.options.data.adIcons);var r=o.getIcons();if(r&&(!r||0!==r.length)){var a=t.options.disableTopBar?0:u,s=n;i.controlBar.el_.style.zIndex=10,t.test("adIconOffset",o),i.on("timeupdate",function(){if(!t.options.vpaid||t.options.showVpaidIcons){var e=Math.round(i.player().currentTime()),n=1e3*e,l=Math.round(i.player().duration()),d=1e3*l;r&&r.length>0&&o.renderIcons(function(e){var n={};n.name=e,t.dispatchEventToAdunit(n)},function(e){t.options.expandable||t.explicitPause(),t.click(e,!1)},i.player().el_,a,s,n,d)}})}};r(v,g),S(),e.options.vpaid&&e.videojsPlayer.trigger("an.doneInitialize"),e.options.endCard.enabled&&(t.endCard=new c(e.options.endCard,e.videojsPlayer,t)),e.videojsPlayer.on("concealControls",function(){var t=e.videojsPlayer.player().controlBar;t&&!t.concealed&&(t.currentTimeDisplay&&t.currentTimeDisplay.hide(),t.durationDisplay&&t.durationDisplay.hide(),t.timeDivider&&t.timeDivider.hide(),t.muteToggle&&t.muteToggle.hide(),t.playToggle&&t.playToggle.hide(),t.fullscreenToggle&&t.fullscreenToggle.hide(),t.progressControl&&t.progressControl.hide(),t.volumeControl&&t.volumeControl.hide(),i.isEmptyAndObject(e.customPlayToggle)===!1&&(e.customPlayToggle.style.display="none"),i.isEmptyAndObject(e.customFullscreenBtn)===!1&&(e.customFullscreenBtn.style.display="none"),e.savedBackgroundColorForBottomBar=t.el_.style.backgroundColor,e.savedBackgroundForBottomBar=t.el_.style.background,t.concealed=!0)}),e.videojsPlayer.on("revealControls",function(){var t=e.videojsPlayer.player().controlBar;t&&t.concealed&&("bar"!==e.options.showProgressBar&&e.options.showProgressBar!==!1&&(t.currentTimeDisplay&&t.currentTimeDisplay.show(),t.durationDisplay&&t.durationDisplay.show(),t.timeDivider&&t.timeDivider.show()),t.muteToggle&&e.options.showMute&&t.muteToggle.show(),t.playToggle&&e.options.showPlayToggle&&t.playToggle.show(),t.fullscreenToggle&&e.options.allowFullscreen&&t.fullscreenToggle.show(),e.options.showProgressBar!==!1&&"text"!==e.options.showProgressBar&&t.progressControl&&t.progressControl.show(),i.isEmptyAndObject(e.customPlayToggle)===!1&&(e.customPlayToggle.style.display="block"),i.isEmptyAndObject(e.customFullscreenBtn)===!1&&(e.customFullscreenBtn.style.display="block"),t.el_.style.backgroundColor=e.savedBackgroundColorForBottomBar,t.el_.style.background=e.savedBackgroundForBottomBar,t.concealed=!1)})}}}},function(e,t,n){var i=n(9),o=function(e){i.debug("iOSInlineVideoPlayer :: CustomizeVideoArea: "+e)},r=function(e){i.verbose("Video Player: "+e)},a=n(8),s="General error reported from HTML5 video player (iOS inline)";e.exports=function(e,t,n,i,l){return{run:function(){if(o("run"),e.options.isWaterfall&&e.options.vpaid&&(i.controlBar.hide(),e.options.firstAdAttempted&&i.bigPlayButton.hide()),"boolean"==typeof e.options.customButton.enabled&&e.options.customButton.enabled===!0){var n=e.options.playerSkin.controlBarHeight||30,d=Math.min(50,e.options.customButton.imgWidth),c=Math.min(n,e.options.customButton.imgHeight),u=Math.floor((n-c)/2),p=e.videojsOrigin.createEl("div",{innerHTML:'',role:"button","aria-live":"polite",tabindex:"0"});p.style.cssText="float:right;font-family:VideoJS;font-size:1.5em;line-height:2;width:50px;height:100%;text-align:center",i.controlBar.addChild("button",{el:p}),i.controlBar.el().insertBefore(p,i.controlBar.fullscreenToggle.el())}i.controlBar.progressControl.seekBar.seekHandle.hide(),i.controlBar.progressControl.seekBar.el_.style.pointerEvents="none","boolean"==typeof e.options.showProgressBar?(e.options.showProgressBar===!1&&(r("removing progress bar"),i.controlBar.currentTimeDisplay.hide(),i.controlBar.timeDivider.hide(),i.controlBar.durationDisplay.hide()),i.controlBar.progressControl.seekBar.hide()):"text"===e.options.showProgressBar?(r("removing progress text"),i.controlBar.progressControl.seekBar.hide()):"bar"===e.options.showProgressBar&&(r("removing progress bar"),i.controlBar.currentTimeDisplay.hide(),i.controlBar.timeDivider.hide(),i.controlBar.durationDisplay.hide()),e.options.showVolume===!1&&i.controlBar.volumeControl.dispose();var h=e.videojsOrigin.createEl("div");h.className="vjs-control-bar-divider",h.style.position="absolute",h.style.left="0",h.style.right="0",i.controlBar.addChild("button",{el:h});var m=l.contentWindow.document.getElementById("top_chrome"),f=l.contentWindow.document.createElement("div");f.id="ad_indicator_text";var v=e.options.adText,g=e.options.learnMore.enabled;if(e.options.clickUrls[0]||(g=!1),g&&("top-right"===e.options.skippable.skipLocation?v=e.options.learnMore.text+" "+e.options.learnMore.separator+" "+v:v+=" "+e.options.learnMore.separator+" "+e.options.learnMore.text),f.innerHTML=v,f.className="top-bar-text",f.role="button",f.style["text-align"]="right",f.style["margin-right"]="1em",f.style["margin-left"]="1em",f.style["font-size"]="1em",f.style.right="0px",f.style.left="",f.style["line-height"]="24px",f.style.outline="0",f.style.position="absolute",f.style.padding="0",f.style.height="auto",f.style.width="auto",f.style["max-width"]="35%",f.style["white-space"]="nowrap",f.style.overflow="hidden",f.style["text-overflow"]="ellipsis",e.floatingAdIndicator=e.videojsOrigin.createEl("div",{role:"button",innerHTML:v,className:"top-bar-text"}),e.floatingAdIndicator.style["text-align"]="right",e.floatingAdIndicator.style["margin-right"]="1em",e.floatingAdIndicator.style["margin-left"]="1em",e.floatingAdIndicator.style["font-size"]="1em",e.floatingAdIndicator.style.right="0px",e.floatingAdIndicator.style.left="",e.floatingAdIndicator.style["line-height"]="3em",e.floatingAdIndicator.style.outline="0",e.floatingAdIndicator.style.position="absolute",e.floatingAdIndicator.style.padding="0",e.floatingAdIndicator.style.height="3em",e.floatingAdIndicator.style["max-width"]="35%",e.floatingAdIndicator.style.width="auto",e.floatingAdIndicator.style["text-overflow"]="ellipsis",e.floatingAdIndicator.style["white-space"]="nowrap",e.floatingAdIndicator.style.overflow="hidden",e.floatingAdIndicator.style.display="none",i.addChild("button",{el:e.floatingAdIndicator}),g){var y=function(n){e.iOSVideoPlayer.pauseVideo(),t.click(),n.stopPropagation(),n.preventDefault()};f.addEventListener("click",y),e.floatingAdIndicator.addEventListener("click",y)}var A,b;if(e.options.skippable.enabled===!0){var k=e.options.skippable.videoThreshold,T=e.options.skippable.skipText,w=e.options.skippable.skipButtonText;A=l.contentWindow.document.createElement("div"),A.id="skip_button",A.innerHTML=w,A.className="top-bar-text",A.role="button",A.style.display="none",A.style.cursor="pointer",A.style["font-weight"]="bold",A.style["margin-right"]="1em",A.style["margin-left"]="1em",A.style["font-size"]="1em",A.style.right="",A.style.left="0px",A.style["line-height"]="24px",A.style.outline="0",A.style.position="absolute",A.style.padding="0",A.style.height="5em",A.style.width="auto",A.style["min-width"]="5em",A.style["text-align"]="left",e.floatingSkipButton=e.videojsOrigin.createEl("div",{className:"top-bar-text",role:"button",innerHTML:w}),e.floatingSkipButton.style.display="none",e.floatingSkipButton.style.cursor="pointer",e.floatingSkipButton.style["font-weight"]="bold",e.floatingSkipButton.style["margin-right"]="1em",e.floatingSkipButton.style["margin-left"]="1em",e.floatingSkipButton.style["font-size"]="1em",e.floatingSkipButton.style.right="",e.floatingSkipButton.style.left="0px",e.floatingSkipButton.style["line-height"]="3em",e.floatingSkipButton.style.outline="0",e.floatingSkipButton.style.position="absolute",e.floatingSkipButton.style.padding="0",e.floatingSkipButton.style.height="5em",e.floatingSkipButton.style["min-width"]="5em",e.floatingSkipButton.style.width="auto",e.floatingSkipButton.style.display="none",e.floatingSkipButton.style["text-align"]="left",i.addChild("button",{el:e.floatingSkipButton});var E=function(n){window.removeEventListener("orientationchange",e.eventOrientationChange),window.removeEventListener("resize",e.eventSizeChange),e.iOSVideoPlayer.destroy(),t.pause(),t.isFullscreen=e.isFullscreen,t.forceToSkip=!0,t.destroy(),t.isCompleted=!0,n.stopPropagation(),n.preventDefault()};switch(A.addEventListener("touchend",E),A.addEventListener("click",E),e.floatingSkipButton.addEventListener("touchend",E),e.floatingSkipButton.addEventListener("click",E),b=l.contentWindow.document.createElement("div"),b.id="ad_skip_text",b.innerHTML=w,b.className="top-bar-text",b.role="button",b.style["margin-left"]="1em",b.style["margin-right"]="1em",b.style.right="",b.style.left="0px",b.style["font-size"]="1em",b.style["line-height"]="24px",b.style.outline="0",b.style.position="absolute",b.style["text-align"]="left",b.style.padding="0",b.style.height="3em",b.style.width="auto",b.style["pointer-events"]="none",b.style.display="none",e.floatingAdSkipText=e.videojsOrigin.createEl("div",{role:"button",className:"top-bar-text",innerHTML:""}),e.floatingAdSkipText.style["margin-left"]="1em",e.floatingAdSkipText.style["margin-right"]="1em",e.floatingAdSkipText.style.right="",e.floatingAdSkipText.style.left="0px",e.floatingAdSkipText.style["font-size"]="1em",e.floatingAdSkipText.style["line-height"]="3em",e.floatingAdSkipText.style.outline="0",e.floatingAdSkipText.style.position="absolute",e.floatingAdSkipText.style["text-align"]="left",e.floatingAdSkipText.style.padding="0",e.floatingAdSkipText.style.height="3em",e.floatingAdSkipText.style.width="auto",e.floatingAdSkipText.style["pointer-events"]="none",e.floatingAdSkipText.style.display="none",i.addChild("button",{el:e.floatingAdSkipText}),e.options.skippable.skipLocation){case"top-right":A.style.right="0px",A.style.left="",A.style["text-align"]="right",b.style.right="0px",b.style.left="",e.floatingSkipButton.style.right="0px",e.floatingSkipButton.style.left="",e.floatingSkipButton.style["text-align"]="right",e.floatingAdSkipText.style.right="0px",e.floatingAdSkipText.style.left=""}var S=!1,I=!1,C=!1,P={},j=function(){var n,o=Math.round(i.player().duration()),r=Math.round(i.player().currentTime());n=t.options.skippable.allowOverride?Math.round(e.options.data.skipOffsetMsec/1e3):e.options.skippable.videoOffset;var s=n-r,l=!e.options.skippable.allowOverride||e.options.data.isVastVideoSkippable;l=!(n>o)&&l,t.test("VIDLA163_needToShowSkip",l),k0&&!t.startedReplay&&!t.isEnded?(e.floatingAdSkipText.innerHTML=T.replace("%%TIME%%",s),A.style.display="none",b.innerHTML=T.replace("%%TIME%%",s),b.style.display="block",a.elementsOverlap(b,f)&&(b.style.display="none")):(e.readyForSkip||(t.test("log",r),t.test("VIDLA163_skip",r)),e.readyForSkip=!0,e.isFullscreen&&(e.floatingAdSkipText.style.display="none",e.floatingSkipButton.style.display="block"),b.style.display="none",A.style.display="block"))};i.on("resize",function(){j()}),i.on("timeupdate",function(){var n=t.options.data.vastProgressEvent;if(!e.options.isWaterfall||!e.options.vpaid||e.options.vpaidImpressionFired){var o=Math.round(i.player().currentTime()),r=1e3*o;if(n&&"object"==typeof n){var a=function(){t.test("VIDLA163_Tracking",P)};for(var s in n){var l=n[s];if(l&&l>=0&&r>=l&&Object.keys(P).indexOf(s)===-1){P[s]=l;var d={};d.name=s,d.name&&t.dispatchEventToAdunit(d,a)}}}j()}})}if(e.options.skippable&&e.options.skippable.skipLocation)switch(e.options.skippable.skipLocation){case"top-right":f.style.right="",f.style.left="0px",e.floatingAdIndicator.style.right="",e.floatingAdIndicator.style.left="0px"}!e.options.disableTopBar&&m&&(e.options.skippable.enabled===!0&&(m.appendChild(A),m.appendChild(b)),m.appendChild(f)),i.on("timeupdate",function(){if(!e.options.vpaid){var t=Math.round(i.player().currentTime()),n=i.player().duration(),o=n/4,r=n/4*2,a=n/4*3;!S&&t>=o&&t=r&&t=a&&(e.dispatchEventToAdunit({name:"video-third-quartile"}),C=!0)}});var x=function(){t.isEnded&&e.options.disableCollapse.replay&&(t.replay(),e.options.showBigPlayButton===!1&&i.player().bigPlayButton.hide(),i.player().bigPlayButton.removeClass("vjs-big-play-button-replay")),t.isDoneInitialPlay&&(t.isPlayingVideo=!1),t.explicitPlay()};i.player().bigPlayButton.on("touchend",function(e){x(),e.preventDefault()}),i.player().bigPlayButton.on("click",function(){x()}),i.on("error",function(){t.destroyWithoutSkip(!0,s,null,900)}),i.on("loadstart",function(){e.dispatchEventToAdunit({name:"loadstart"})}),i.on("pause",function(){var e=t.options.sideStream&&t.options.sideStream.enabled&&t.options.sideStreamObject&&t.options.sideStreamObject.isActivated;e===!0&&t.options.showPlayToggle===!0&&1==t.options.sideStream.dynamicBigPlayButtonOnSideStream||t.isFullscreen||(i.player().bigPlayButton.el().style.display="block")})}}}},function(e,t,n){var i=n(9),o=function(e){i.log("Video Player: "+e)},r=function(e){i.debug("Video Player: "+e)},a=n(49);e.exports=function(e,t){return{createIframeAndRequiredObject:function(n){o("createIframeAndRequiredObject");var i=e.options,s=document.createElement("iframe");s.src="about:blank",i.targetElement.appendChild(s),s.style.width=i.width+"px",s.style.height=i.height+"px",s.id=i.iframeVideoWrapperId,s.setAttribute("allowfullscreen","true"),s.setAttribute("webkitallowfullscreen","true"),s.setAttribute("mozallowfullscreen","true");var l="";s.contentWindow.document.open(),s.contentWindow.document.write(l),s.contentWindow.document.close(),"undefined"!=typeof i.enableInlineVideoFullscreenButton&&(e.enableFullscreen=i.enableInlineVideoFullscreenButton);var d=s.contentWindow.document,c=s.contentWindow.window;r("Creating and styling top chrome bar");var u=d.createElement("div");u.id="top_chrome",u.style.height=function(){return i.playerSkin&&"number"==typeof i.playerSkin.dividerHeight?e.topChromeHeight-i.playerSkin.dividerHeight+"px":e.topChromeHeight-1+"px"}(),u.style.width=i.width+"px",u.style.marginRight="auto",u.style.marginLeft="auto",u.className="video-js vjs-default-skin",r("Generating and styling video object");var p=d.createElement("video");if(p.id=e.an_video_ad_player_id,p.className="video-js vjs-default-skin",p.style.marginRight="auto",p.style.marginLeft="auto",u.style["z-index"]=p.style["z-index"]+1,!i.vpaid){r("Generating source object");var h=d.createElement("source");h.type="video/mp4",h.src=i.videoUrl,p.appendChild(h)}if(r("Injecting required elements into iframe"),i.disableTopBar||d.body.appendChild(u),d.body.appendChild(p),c.videojs=e.videojsOrigin,d.body.style.margin="0px",d.body.style.overflow="hidden",i.vpaid){var m=d.createElement("script");m.innerHTML=t.videojs_vpaid,d.head.appendChild(m)}e.options.verifications&&(t.verificationManager=new a(e.options.verifications,{parentDoc:d,videoElement:p,viewableImpression:e.options.viewableImpression,adServingId:e.options.adServingId,player:t}),t.verificationManager.init(),t.verificationManager.start()),n(s)}}}},function(e,t,n){var i=n(12),o=n(14),r="[PlayerManager_Verifications]",a=n(9);e.exports=function(e,t){var n=e,s=t,l=[],d=new o(e,t.player);return{init:function(){a.debug(r,"init verifications");for(var e=0;eu&&l<1&&(c=u,r=c+C-y-A,g=Math.round(u*l))}if(n.setFinalAspectRatio(l),p.height=c,p.mediaHeight=r,i.isMobile()&&p.isWaterfall&&(p.targetElement.style.height=p.height+"px"),"html5"===m(p.requiredPlayer)){var P=window.innerWidth&&document.documentElement.clientWidth?Math.max(window.innerWidth,document.documentElement.clientWidth):window.innerWidth||document.documentElement.clientWidth||document.getElementsByTagName("body")[0].clientWidth,j=window.innerHeight&&document.documentElement.clientHeight?Math.max(window.innerHeight,document.documentElement.clientHeight):window.innerHeight||document.documentElement.clientHeight||document.getElementsByTagName("body")[0].clientHeight;if(f&&"object"==typeof f&&f.style){if(f.style.border="none",f.style.width=P+"px",f.style.height=c+"px",f.style.position="absolute",p.shouldResizeVideoToFillMobileWebview&&r+A+yj){var _=j,V=j-A-y;v.height(V),a("mobile set video.js height to : "+V),p.height=_,a("mobile options.height to : "+_),p.mediaHeight=V,a("mobile options.mediaHeight to : "+V),f.style.height=V+"px",a("mobile set iframeVideoWrapper to : "+V)}else{var D=r;E()||(D+=A),v.height(D),a("desktop set video.js height to : "+D)}n.isEnded&&n.endCard&&n.endCard.onVideoResized(P,r)}else v.width=g+"px",v.height=c+"px",v.style.width=g+"px",v.style.height=c+"px",a("flash width : "+g),a("flash height : "+c);p.targetElement.style.visibility="visible","function"==typeof o&&o()},d=function(e,t,n,o){var r=!1;a("resizeVideo-sidestream");var s,l,d,c,u=e.options,p=e.isIosInlineRequired.bind(e),h=e.decidePlayer.bind(e),m=e.iframeVideoWrapper,f=e.adVideoPlayer,v=t,g=0,y=0,A=!0,b=u.video.width,k=u.video.height,T=function(){return i.isAndroid()||p()||"below"===u.controlBarPosition};if(d=u.aspectRatio||u.playerAspectRatio,a("options.height : "+n),i.isEmpty(d)&&(d=i.isEmpty(n)?"16:9":"none"),a("aspectRatioOption : "+d),l="undefined"==typeof b||"undefined"==typeof k||0===b||0===k?16/9:b/k,u.disableTopBar||(g=24),T()&&(y+=u.playerSkin.controlBarHeight),a("initial VAST width : "+b), +a("initial VAST height : "+k),a("initial topOffset : "+g),a("initial bottomOffset : "+y),a("initial mediaAspectRatio : "+l),A)c=n,v=t,s=n-g-y;else{var w=d.split(":");if(2===w.length)try{l=w[0]/w[1]}catch(E){a(E)}s=Math.round(v/l),c=s+g+y}if(n&&t&&(u.mediaHeight=s),"html5"===h(u.requiredPlayer)){var S=window.innerWidth&&document.documentElement.clientWidth?Math.max(window.innerWidth,document.documentElement.clientWidth):window.innerWidth||document.documentElement.clientWidth||document.getElementsByTagName("body")[0].clientWidth,I=window.innerHeight&&document.documentElement.clientHeight?Math.max(window.innerHeight,document.documentElement.clientHeight):window.innerHeight||document.documentElement.clientHeight||document.getElementsByTagName("body")[0].clientHeight;if(m&&"object"==typeof m&&m.style){if(m.style.border="none",m.style.width=S+"px",m.style.height=c+"px",m.contentWindow){var C=m.contentWindow.document&&m.contentWindow.document.getElementById("top_chrome");C&&(C.style.width=S,C.style.marginLeft="",C.style.marginRight="")}e.adVideoPlayer.el_.style.marginLeft="",e.adVideoPlayer.el_.style.marginRight="",a("final wrapper width for html5 : "+S),a("final wrapper height for html5 : "+c)}if(f.width(S),u.sideStream&&u.sideStream.enabled===!0&&u.emptyDiv?u.targetElement.style.width=S+"px":u.targetElement.style.width="",a("resize video.js width to : "+S),a("shouldConsiderHeightOfDevice : "+r),a("mediaHeight + bottomOffset + topOffset : "+(s+y+g)),a("viewPortHeight : "+I),r&&s+y+g>I){var P=I-g,j=I,x=I-y-g;f.height(P),a("mobile set video.js height to : "+P),a("mobile options.height to : "+j),a("mobile options.mediaHeight to : "+x),e.isEnded&&e.endCard&&e.endCard.onVideoResized(S,x)}else{var _=s;T()||(_+=y),f.height(_),a("desktop set video.js height to : "+_),e.isEnded&&e.endCard&&e.endCard.onVideoResized(S,s)}}else f.width=v+"px",f.height=c+"px",f.style.width=v+"px",f.style.height=c+"px",a("flash width : "+v),a("flash height : "+c);"function"==typeof o&&o()},c=function(e){a("setSizeForInitialRender");var t=e.width;e.autoInitialSize&&(t=e.targetElement.offsetWidth,t<=0&&(t=e.width,s("Width of target element was not set or zero, using tag width for player instead"))),a("setSizeForInitialRender using width: "+t),e.width=t},u=function(e){var t={width:0,height:0};if("flash"===e.decidePlayer(e.options.requiredPlayer))t={width:e.adVideoPlayer.offsetWidth,height:e.adVideoPlayer.offsetHeight};else{var n=document.getElementById(e.options.iframeVideoWrapperId);t={width:n.offsetWidth,height:n.offsetHeight}}return t},p=function(e,t,n){if(a("resizePlayer"),n.overlayPlayer&&n.adVideoPlayer)if("flash"===n.decidePlayer(n.options.requiredPlayer))n.adVideoPlayer.width=e+"px",n.adVideoPlayer.height=t+"px",n.adVideoPlayer.style.width=e+"px",n.adVideoPlayer.style.height=t+"px";else{if(n.resizeVideoWithDimensions(e,t),n.iframeVideoWrapper&&"object"==typeof n.iframeVideoWrapper){n.iframeVideoWrapper.style.border="none",n.iframeVideoWrapper.style.width=e+"px",n.iframeVideoWrapper.style.height=t+"px";var o=n&&n.iframeVideoWrapper&&n.iframeVideoWrapper.contentWindow&&n.iframeVideoWrapper.contentWindow.document&&n.iframeVideoWrapper.contentWindow.document.getElementById("top_chrome");o&&(o.style.width=e+"px",i.isIos()&&(o.style.marginLeft="",o.style.marginRight="")),i.isIos()&&(n.adVideoPlayer.el_.style.marginLeft="",n.adVideoPlayer.el_.style.marginRight="")}n.adVideoPlayer.width(e);var r=0;n.options.disableTopBar||(r=24),(i.isAndroid()||n.isIosInlineRequired()||"below"===n.options.controlBarPosition)&&(r+=n.options.playerSkin.controlBarHeight,n.adVideoPlayer.controlBar&&n.adVideoPlayer.controlBar.progressControl&&(r+=n.adVideoPlayer.controlBar.progressControl.el_.offsetHeight)),n.adVideoPlayer.height(t-r)}};e.exports={resizeVideo:l,setSizeForInitialRender:c,getFinalSize:u,resizePlayer:p,resizeVideoForSideStream:d}},function(e,t){e.exports="/* jshint ignore:start */\n(function(window, document, vjs, undefined) {\n (function e(t, n, r) {\n function s(o, u) {\n if (!n[o]) {\n if (!t[o]) {\n var a = typeof require == \"function\" && require;\n if (!u && a) return a(o, !0);\n if (i) return i(o, !0);\n var f = new Error(\"Cannot find module '\" + o + \"'\");\n throw f.code = \"MODULE_NOT_FOUND\", f }\n var l = n[o] = { exports: {} };\n t[o][0].call(l.exports, function(e) {\n var n = t[o][1][e];\n return s(n ? n : e) }, l, l.exports, e, t, n, r) }\n return n[o].exports }\n var i = typeof require == \"function\" && require;\n for (var o = 0; o < r.length; o++) s(r[o]);\n return s })({\n 1: [function(require, module, exports) {\n 'use strict';\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n\n var _createClass = (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor); } }\n return function(Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor; }; })();\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function'); } }\n\n //simple representation of the API\n\n var IVPAIDAdUnit = (function() {\n function IVPAIDAdUnit() {\n _classCallCheck(this, IVPAIDAdUnit);\n }\n\n _createClass(IVPAIDAdUnit, [{\n key: 'handshakeVersion',\n\n //all methods below\n //are async methods\n value: function handshakeVersion() {\n var playerVPAIDVersion = arguments[0] === undefined ? '2.0' : arguments[0];\n var callback = arguments[1] === undefined ? undefined : arguments[1];\n }\n }, {\n key: 'initAd',\n\n //creativeData is an object to be consistent with VPAIDHTML\n value: function initAd(width, height, viewMode, desiredBitrate) {\n var creativeData = arguments[4] === undefined ? { AdParameters: '' } : arguments[4];\n var environmentVars = arguments[5] === undefined ? { flashVars: '' } : arguments[5];\n var callback = arguments[6] === undefined ? undefined : arguments[6];\n }\n }, {\n key: 'resizeAd',\n value: function resizeAd(width, height, viewMode) {\n var callback = arguments[3] === undefined ? undefined : arguments[3];\n }\n }, {\n key: 'startAd',\n value: function startAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n }\n }, {\n key: 'stopAd',\n value: function stopAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n }\n }, {\n key: 'pauseAd',\n value: function pauseAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n }\n }, {\n key: 'resumeAd',\n value: function resumeAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n }\n }, {\n key: 'expandAd',\n value: function expandAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n }\n }, {\n key: 'collapseAd',\n value: function collapseAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n }\n }, {\n key: 'skipAd',\n value: function skipAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n }\n }, {\n key: 'getAdLinear',\n\n //properties that will be treat as async methods\n value: function getAdLinear(callback) {}\n }, {\n key: 'getAdWidth',\n value: function getAdWidth(callback) {}\n }, {\n key: 'getAdHeight',\n value: function getAdHeight(callback) {}\n }, {\n key: 'getAdExpanded',\n value: function getAdExpanded(callback) {}\n }, {\n key: 'getAdSkippableState',\n value: function getAdSkippableState(callback) {}\n }, {\n key: 'getAdRemainingTime',\n value: function getAdRemainingTime(callback) {}\n }, {\n key: 'getAdDuration',\n value: function getAdDuration(callback) {}\n }, {\n key: 'setAdVolume',\n value: function setAdVolume(soundVolume) {\n var callback = arguments[1] === undefined ? undefined : arguments[1];\n }\n }, {\n key: 'getAdVolume',\n value: function getAdVolume(callback) {}\n }, {\n key: 'getAdCompanions',\n value: function getAdCompanions(callback) {}\n }, {\n key: 'getAdIcons',\n value: function getAdIcons(callback) {}\n }]);\n\n return IVPAIDAdUnit;\n })();\n\n exports.IVPAIDAdUnit = IVPAIDAdUnit;\n\n Object.defineProperty(IVPAIDAdUnit, 'EVENTS', {\n writable: false,\n configurable: false,\n value: ['AdLoaded', 'AdStarted', 'AdStopped', 'AdSkipped', 'AdSkippableStateChange', // VPAID 2.0 new event\n 'AdSizeChange', // VPAID 2.0 new event\n 'AdLinearChange', 'AdDurationChange', // VPAID 2.0 new event\n 'AdExpandedChange', 'AdRemainingTimeChange', // [Deprecated in 2.0] but will be still fired for backwards compatibility\n 'AdVolumeChange', 'AdImpression', 'AdVideoStart', 'AdVideoFirstQuartile', 'AdVideoMidpoint', 'AdVideoThirdQuartile', 'AdVideoComplete', 'AdClickThru', 'AdInteraction', // VPAID 2.0 new event\n 'AdUserAcceptInvitation', 'AdUserMinimize', 'AdUserClose', 'AdPaused', 'AdPlaying', 'AdLog', 'AdError'\n ]\n });\n\n }, {}],\n 2: [function(require, module, exports) {\n 'use strict';\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n\n var _createClass = (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor); } }\n return function(Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor; }; })();\n\n var _get = function get(_x15, _x16, _x17) {\n var _again = true;\n _function: while (_again) {\n var object = _x15,\n property = _x16,\n receiver = _x17;\n desc = parent = getter = undefined;\n _again = false;\n if (object === null) object = Function.prototype;\n var desc = Object.getOwnPropertyDescriptor(object, property);\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n if (parent === null) {\n return undefined; } else { _x15 = parent;\n _x16 = property;\n _x17 = receiver;\n _again = true;\n continue _function; } } else if ('value' in desc) {\n return desc.value; } else {\n var getter = desc.get;\n if (getter === undefined) {\n return undefined; }\n return getter.call(receiver); } } };\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function'); } }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== 'function' && superClass !== null) {\n throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); }\n subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });\n if (superClass) subClass.__proto__ = superClass; }\n\n var IVPAIDAdUnit = require('./IVPAIDAdUnit').IVPAIDAdUnit;\n var ALL_VPAID_METHODS = Object.getOwnPropertyNames(IVPAIDAdUnit.prototype).filter(function(property) {\n return ['constructor'].indexOf(property) === -1;\n });\n\n var VPAIDAdUnit = (function(_IVPAIDAdUnit) {\n function VPAIDAdUnit(flash) {\n _classCallCheck(this, VPAIDAdUnit);\n\n _get(Object.getPrototypeOf(VPAIDAdUnit.prototype), 'constructor', this).call(this);\n this._destroyed = false;\n this._flash = flash;\n }\n\n _inherits(VPAIDAdUnit, _IVPAIDAdUnit);\n\n _createClass(VPAIDAdUnit, [{\n key: '_destroy',\n value: function _destroy() {\n var _this = this;\n\n this._destroyed = true;\n ALL_VPAID_METHODS.forEach(function(methodName) {\n _this._flash.removeCallbackByMethodName(methodName);\n });\n IVPAIDAdUnit.EVENTS.forEach(function(event) {\n _this._flash.offEvent(event);\n });\n\n this._flash = null;\n }\n }, {\n key: 'isDestroyed',\n value: function isDestroyed() {\n return this._destroyed;\n }\n }, {\n key: 'on',\n value: function on(eventName, callback) {\n this._flash.on(eventName, callback);\n }\n }, {\n key: 'off',\n value: function off(eventName, callback) {\n this._flash.off(eventName, callback);\n }\n }, {\n key: 'handshakeVersion',\n\n //VPAID interface\n value: function handshakeVersion() {\n var playerVPAIDVersion = arguments[0] === undefined ? '2.0' : arguments[0];\n var callback = arguments[1] === undefined ? undefined : arguments[1];\n\n this._flash.callFlashMethod('handshakeVersion', [playerVPAIDVersion], callback);\n }\n }, {\n key: 'initAd',\n value: function initAd(width, height, viewMode, desiredBitrate) {\n var creativeData = arguments[4] === undefined ? { AdParameters: '' } : arguments[4];\n var environmentVars = arguments[5] === undefined ? { flashVars: '' } : arguments[5];\n var callback = arguments[6] === undefined ? undefined : arguments[6];\n\n //resize element that has the flash object\n this._flash.setSize(width, height);\n creativeData = creativeData || { AdParameters: '' };\n environmentVars = environmentVars || { flashVars: '' };\n\n this._flash.callFlashMethod('initAd', [this._flash.getWidth(), this._flash.getHeight(), viewMode, desiredBitrate, creativeData.AdParameters || '', environmentVars.flashVars || ''], callback);\n }\n }, {\n key: 'resizeAd',\n value: function resizeAd(width, height, viewMode) {\n var callback = arguments[3] === undefined ? undefined : arguments[3];\n\n //resize element that has the flash object\n this._flash.setSize(width, height);\n\n //resize ad inside the flash\n this._flash.callFlashMethod('resizeAd', [this._flash.getWidth(), this._flash.getHeight(), viewMode], callback);\n }\n }, {\n key: 'startAd',\n value: function startAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n\n this._flash.callFlashMethod('startAd', [], callback);\n }\n }, {\n key: 'stopAd',\n value: function stopAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n\n this._flash.callFlashMethod('stopAd', [], callback);\n }\n }, {\n key: 'pauseAd',\n value: function pauseAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n\n this._flash.callFlashMethod('pauseAd', [], callback);\n }\n }, {\n key: 'resumeAd',\n value: function resumeAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n\n this._flash.callFlashMethod('resumeAd', [], callback);\n }\n }, {\n key: 'expandAd',\n value: function expandAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n\n this._flash.callFlashMethod('expandAd', [], callback);\n }\n }, {\n key: 'collapseAd',\n value: function collapseAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n\n this._flash.callFlashMethod('collapseAd', [], callback);\n }\n }, {\n key: 'skipAd',\n value: function skipAd() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n\n this._flash.callFlashMethod('skipAd', [], callback);\n }\n }, {\n key: 'getAdLinear',\n\n //properties that will be treat as async methods\n value: function getAdLinear(callback) {\n this._flash.callFlashMethod('getAdLinear', [], callback);\n }\n }, {\n key: 'getAdWidth',\n value: function getAdWidth(callback) {\n this._flash.callFlashMethod('getAdWidth', [], callback);\n }\n }, {\n key: 'getAdHeight',\n value: function getAdHeight(callback) {\n this._flash.callFlashMethod('getAdHeight', [], callback);\n }\n }, {\n key: 'getAdExpanded',\n value: function getAdExpanded(callback) {\n this._flash.callFlashMethod('getAdExpanded', [], callback);\n }\n }, {\n key: 'getAdSkippableState',\n value: function getAdSkippableState(callback) {\n this._flash.callFlashMethod('getAdSkippableState', [], callback);\n }\n }, {\n key: 'getAdRemainingTime',\n value: function getAdRemainingTime(callback) {\n this._flash.callFlashMethod('getAdRemainingTime', [], callback);\n }\n }, {\n key: 'getAdDuration',\n value: function getAdDuration(callback) {\n this._flash.callFlashMethod('getAdDuration', [], callback);\n }\n }, {\n key: 'setAdVolume',\n value: function setAdVolume(volume) {\n var callback = arguments[1] === undefined ? undefined : arguments[1];\n\n this._flash.callFlashMethod('setAdVolume', [volume], callback);\n }\n }, {\n key: 'getAdVolume',\n value: function getAdVolume(callback) {\n this._flash.callFlashMethod('getAdVolume', [], callback);\n }\n }, {\n key: 'getAdCompanions',\n value: function getAdCompanions(callback) {\n this._flash.callFlashMethod('getAdCompanions', [], callback);\n }\n }, {\n key: 'getAdIcons',\n value: function getAdIcons(callback) {\n this._flash.callFlashMethod('getAdIcons', [], callback);\n }\n }]);\n\n return VPAIDAdUnit;\n })(IVPAIDAdUnit);\n\n exports.VPAIDAdUnit = VPAIDAdUnit;\n\n }, { \"./IVPAIDAdUnit\": 1 }],\n 3: [function(require, module, exports) {\n 'use strict';\n\n var _createClass = (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor); } }\n return function(Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor; }; })();\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function'); } }\n\n var JSFlashBridge = require('./jsFlashBridge').JSFlashBridge;\n var VPAIDAdUnit = require('./VPAIDAdUnit').VPAIDAdUnit;\n\n var noop = require('./utils').noop;\n var callbackTimeout = require('./utils').callbackTimeout;\n var isPositiveInt = require('./utils').isPositiveInt;\n var createElementWithID = require('./utils').createElementWithID;\n var uniqueVPAID = require('./utils').unique('vpaid');\n\n var ERROR = 'error';\n var FLASH_VERSION = '10.1.0';\n\n var VPAIDFLASHClient = (function() {\n function VPAIDFLASHClient(vpaidParentEl, callback) {\n var swfConfig = arguments[2] === undefined ? { data: 'VPAIDFlash.swf', width: 800, height: 400 } : arguments[2];\n\n var _this = this;\n\n var params = arguments[3] === undefined ? { wmode: 'transparent', salign: 'tl', align: 'left', allowScriptAccess: 'always', scale: 'noScale', allowFullScreen: 'true', quality: 'high' } : arguments[3];\n var vpaidOptions = arguments[4] === undefined ? { debug: false, timeout: 10000 } : arguments[4];\n\n _classCallCheck(this, VPAIDFLASHClient);\n\n if (!VPAIDFLASHClient.hasExternalDependencies()) {\n return onError('no swfobject in global scope. check: https://github.com/swfobject/swfobject or https://code.google.com/p/swfobject/');\n }\n\n this._vpaidParentEl = vpaidParentEl;\n this._flashID = uniqueVPAID();\n this._destroyed = false;\n callback = callback || noop;\n\n swfConfig.width = isPositiveInt(swfConfig.width, 800);\n swfConfig.height = isPositiveInt(swfConfig.height, 400);\n\n createElementWithID(vpaidParentEl, this._flashID);\n\n params.movie = swfConfig.data;\n params.FlashVars = 'flashid=' + this._flashID + '&handler=' + JSFlashBridge.VPAID_FLASH_HANDLER + '&debug=' + vpaidOptions.debug + '&salign=' + params.salign;\n\n if (!VPAIDFLASHClient.isSupported()) {\n return onError('user don\\'t support flash or doesn\\'t have the minimum required version of flash ' + FLASH_VERSION);\n }\n\n this.el = swfobject.createSWF(swfConfig, params, this._flashID);\n\n if (!this.el) {\n return onError('swfobject failed to create object in element');\n }\n\n var handler = callbackTimeout(vpaidOptions.timeout, function(err, data) {\n $loadPendedAdUnit.call(_this);\n callback(err, data);\n }, function() {\n callback('vpaid flash load timeout ' + vpaidOptions.timeout);\n });\n\n this._flash = new JSFlashBridge(this.el, swfConfig.data, this._flashID, swfConfig.width, swfConfig.height, handler);\n\n function onError(error) {\n setTimeout(function() {\n callback(new Error(error));\n }, 0);\n return this;\n }\n }\n\n _createClass(VPAIDFLASHClient, [{\n key: 'destroy',\n value: function destroy() {\n this._destroyAdUnit();\n\n if (this._flash) {\n this._flash.destroy();\n this._flash = null;\n }\n this.el = null;\n this._destroyed = true;\n }\n }, {\n key: 'isDestroyed',\n value: function isDestroyed() {\n return this._destroyed;\n }\n }, {\n key: '_destroyAdUnit',\n value: function _destroyAdUnit() {\n delete this._loadLater;\n\n if (this._adUnitLoad) {\n this._adUnitLoad = null;\n this._flash.removeCallback(this._adUnitLoad);\n }\n\n if (this._adUnit) {\n this._adUnit._destroy();\n this._adUnit = null;\n }\n }\n }, {\n key: 'loadAdUnit',\n value: function loadAdUnit(adURL, callback) {\n var _this2 = this;\n\n $throwIfDestroyed.call(this);\n\n if (this._adUnit) {\n this._destroyAdUnit();\n }\n\n if (this._flash.isReady()) {\n this._adUnitLoad = function(err, message) {\n if (!err) {\n _this2._adUnit = new VPAIDAdUnit(_this2._flash);\n }\n _this2._adUnitLoad = null;\n callback(err, _this2._adUnit);\n };\n\n this._flash.callFlashMethod('loadAdUnit', [adURL], this._adUnitLoad);\n } else {\n this._loadLater = { url: adURL, callback: callback };\n }\n }\n }, {\n key: 'unloadAdUnit',\n value: function unloadAdUnit() {\n var callback = arguments[0] === undefined ? undefined : arguments[0];\n\n $throwIfDestroyed.call(this);\n\n this._destroyAdUnit();\n this._flash.callFlashMethod('unloadAdUnit', [], callback);\n }\n }, {\n key: 'getFlashID',\n value: function getFlashID() {\n $throwIfDestroyed.call(this);\n return this._flash.getFlashID();\n }\n }, {\n key: 'getFlashURL',\n value: function getFlashURL() {\n $throwIfDestroyed.call(this);\n return this._flash.getFlashURL();\n }\n }]);\n\n return VPAIDFLASHClient;\n })();\n\n setStaticProperty('isSupported', function() {\n return VPAIDFLASHClient.hasExternalDependencies() && swfobject.hasFlashPlayerVersion(FLASH_VERSION);\n });\n\n setStaticProperty('hasExternalDependencies', function() {\n return !!window.swfobject;\n });\n\n function $throwIfDestroyed() {\n if (this._destroyed) {\n throw new error('VPAIDFlashToJS is destroyed!');\n }\n }\n\n function $loadPendedAdUnit() {\n if (this._loadLater) {\n this.loadAdUnit(this._loadLater.url, this._loadLater.callback);\n delete this._loadLater;\n }\n }\n\n function setStaticProperty(propertyName, value) {\n Object.defineProperty(VPAIDFLASHClient, propertyName, {\n writable: false,\n configurable: false,\n value: value\n });\n }\n\n window.VPAIDFLASHClient = VPAIDFLASHClient;\n module.exports = VPAIDFLASHClient;\n\n }, { \"./VPAIDAdUnit\": 2, \"./jsFlashBridge\": 4, \"./utils\": 7 }],\n 4: [function(require, module, exports) {\n 'use strict';\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n\n var _createClass = (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor); } }\n return function(Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor; }; })();\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function'); } }\n\n var unique = require('./utils').unique;\n var isPositiveInt = require('./utils').isPositiveInt;\n var stringEndsWith = require('./utils').stringEndsWith;\n var SingleValueRegistry = require('./registry').SingleValueRegistry;\n var MultipleValuesRegistry = require('./registry').MultipleValuesRegistry;\n var registry = require('./jsFlashBridgeRegistry');\n var VPAID_FLASH_HANDLER = 'vpaid_video_flash_handler';\n var ERROR = 'AdError';\n\n var JSFlashBridge = (function() {\n function JSFlashBridge(el, flashURL, flashID, width, height, loadHandShake) {\n _classCallCheck(this, JSFlashBridge);\n\n this._el = el;\n this._flashID = flashID;\n this._flashURL = flashURL;\n this._width = width;\n this._height = height;\n this._handlers = new MultipleValuesRegistry();\n this._callbacks = new SingleValueRegistry();\n this._uniqueMethodIdentifier = unique(this._flashID);\n this._ready = false;\n this._handShakeHandler = loadHandShake;\n\n registry.addInstance(this._flashID, this);\n }\n\n _createClass(JSFlashBridge, [{\n key: 'on',\n value: function on(eventName, callback) {\n this._handlers.add(eventName, callback);\n }\n }, {\n key: 'off',\n value: function off(eventName, callback) {\n return this._handlers.remove(eventName, callback);\n }\n }, {\n key: 'offEvent',\n value: function offEvent(eventName) {\n return this._handlers.removeByKey(eventName);\n }\n }, {\n key: 'offAll',\n value: function offAll() {\n return this._handlers.removeAll();\n }\n }, {\n key: 'callFlashMethod',\n value: function callFlashMethod(methodName) {\n var args = arguments[1] === undefined ? [] : arguments[1];\n var callback = arguments[2] === undefined ? undefined : arguments[2];\n\n var callbackID = '';\n // if no callback, some methods the return is void so they don't need callback\n if (callback) {\n callbackID = this._uniqueMethodIdentifier() + '_' + methodName;\n this._callbacks.add(callbackID, callback);\n }\n\n try {\n //methods are created by ExternalInterface.addCallback in as3 code, if for some reason it failed\n //this code will throw an error\n this._el[methodName]([callbackID].concat(args));\n } catch (e) {\n if (callback) {\n $asyncCallback.call(this, callbackID, e);\n } else {\n\n //if there isn't any callback to return error use error event handler\n this._trigger(ERROR, e);\n }\n }\n }\n }, {\n key: 'removeCallback',\n value: function removeCallback(callback) {\n return this._callbacks.removeByValue(callback);\n }\n }, {\n key: 'removeCallbackByMethodName',\n value: function removeCallbackByMethodName(suffix) {\n var _this = this;\n\n this._callbacks.filterKeys(function(key) {\n return stringEndsWith(key, suffix);\n }).forEach(function(key) {\n _this._callbacks.remove(key);\n });\n }\n }, {\n key: 'removeAllCallbacks',\n value: function removeAllCallbacks() {\n return this._callbacks.removeAll();\n }\n }, {\n key: '_trigger',\n value: function _trigger(eventName, event) {\n var _this2 = this;\n\n this._handlers.get(eventName).forEach(function(callback) {\n //clickThru has to be sync, if not will be block by the popupblocker\n if (eventName === 'AdClickThru') {\n callback(event);\n } else {\n setTimeout(function() {\n if (_this2._handlers.get(eventName).length > 0) {\n callback(event);\n }\n }, 0);\n }\n });\n }\n }, {\n key: '_callCallback',\n value: function _callCallback(methodName, callbackID, err, result) {\n\n var callback = this._callbacks.get(callbackID);\n\n //not all methods callback's are mandatory\n //but if there exist an error, fire the error event\n if (!callback) {\n if (err && callbackID === '') {\n this.trigger(ERROR, err);\n }\n return;\n }\n\n $asyncCallback.call(this, callbackID, err, result);\n }\n }, {\n key: '_handShake',\n value: function _handShake(err, data) {\n this._ready = true;\n if (this._handShakeHandler) {\n this._handShakeHandler(err, data);\n delete this._handShakeHandler;\n }\n }\n }, {\n key: 'getSize',\n\n //methods like properties specific to this implementation of VPAID\n value: function getSize() {\n return { width: this._width, height: this._height };\n }\n }, {\n key: 'setSize',\n value: function setSize(newWidth, newHeight) {\n this._width = isPositiveInt(newWidth, this._width);\n this._height = isPositiveInt(newHeight, this._height);\n this._el.setAttribute('width', this._width);\n this._el.setAttribute('height', this._height);\n }\n }, {\n key: 'getWidth',\n value: function getWidth() {\n return this._width;\n }\n }, {\n key: 'setWidth',\n value: function setWidth(newWidth) {\n this.setSize(newWidth, this._height);\n }\n }, {\n key: 'getHeight',\n value: function getHeight() {\n return this._height;\n }\n }, {\n key: 'setHeight',\n value: function setHeight(newHeight) {\n this.setSize(this._width, newHeight);\n }\n }, {\n key: 'getFlashID',\n value: function getFlashID() {\n return this._flashID;\n }\n }, {\n key: 'getFlashURL',\n value: function getFlashURL() {\n return this._flashURL;\n }\n }, {\n key: 'isReady',\n value: function isReady() {\n return this._ready;\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.offAll();\n this.removeAllCallbacks();\n registry.removeInstanceByID(this._flashID);\n if (this._el.parentElement) {\n this._el.parentElement.removeChild(this._el);\n }\n }\n }]);\n\n return JSFlashBridge;\n })();\n\n exports.JSFlashBridge = JSFlashBridge;\n\n function $asyncCallback(callbackID, err, result) {\n var _this3 = this;\n\n setTimeout(function() {\n var callback = _this3._callbacks.get(callbackID);\n if (callback) {\n _this3._callbacks.remove(callbackID);\n callback(err, result);\n }\n }, 0);\n }\n\n Object.defineProperty(JSFlashBridge, 'VPAID_FLASH_HANDLER', {\n writable: false,\n configurable: false,\n value: VPAID_FLASH_HANDLER\n });\n\n /**\n * External interface handler\n *\n * @param {string} flashID identifier of the flash who call this\n * @param {string} typeID what type of message is, can be 'event' or 'callback'\n * @param {string} typeName if the typeID is a event the typeName will be the eventName, if is a callback the typeID is the methodName that is related this callback\n * @param {string} callbackID only applies when the typeID is 'callback', identifier of the callback to call\n * @param {object} error error object\n * @param {object} data\n */\n window[VPAID_FLASH_HANDLER] = function(flashID, typeID, typeName, callbackID, error, data) {\n var instance = registry.getInstanceByID(flashID);\n if (!instance) return;\n if (typeName === 'handShake') {\n instance._handShake(error, data);\n } else {\n if (typeID !== 'event') {\n instance._callCallback(typeName, callbackID, error, data);\n } else {\n instance._trigger(typeName, data);\n }\n }\n };\n\n }, { \"./jsFlashBridgeRegistry\": 5, \"./registry\": 6, \"./utils\": 7 }],\n 5: [function(require, module, exports) {\n 'use strict';\n\n var SingleValueRegistry = require('./registry').SingleValueRegistry;\n var instances = new SingleValueRegistry();\n\n var JSFlashBridgeRegistry = {};\n Object.defineProperty(JSFlashBridgeRegistry, 'addInstance', {\n writable: false,\n configurable: false,\n value: function value(id, instance) {\n instances.add(id, instance);\n }\n });\n\n Object.defineProperty(JSFlashBridgeRegistry, 'getInstanceByID', {\n writable: false,\n configurable: false,\n value: function value(id) {\n return instances.get(id);\n }\n });\n\n Object.defineProperty(JSFlashBridgeRegistry, 'removeInstanceByID', {\n writable: false,\n configurable: false,\n value: function value(id) {\n return instances.remove(id);\n }\n });\n\n module.exports = JSFlashBridgeRegistry;\n\n }, { \"./registry\": 6 }],\n 6: [function(require, module, exports) {\n 'use strict';\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n\n var _createClass = (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor); } }\n return function(Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor; }; })();\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function'); } }\n\n var MultipleValuesRegistry = (function() {\n function MultipleValuesRegistry() {\n _classCallCheck(this, MultipleValuesRegistry);\n\n this._registries = {};\n }\n\n _createClass(MultipleValuesRegistry, [{\n key: 'add',\n value: function add(id, value) {\n if (!this._registries[id]) {\n this._registries[id] = [];\n }\n if (this._registries[id].indexOf(value) === -1) {\n this._registries[id].push(value);\n }\n }\n }, {\n key: 'get',\n value: function get(id) {\n return this._registries[id] || [];\n }\n }, {\n key: 'filterKeys',\n value: function filterKeys(handler) {\n return Object.keys(this._registries).filter(handler);\n }\n }, {\n key: 'findByValue',\n value: function findByValue(value) {\n var _this = this;\n\n var keys = Object.keys(this._registries).filter(function(key) {\n return _this._registries[key].indexOf(value) !== -1;\n });\n\n return keys;\n }\n }, {\n key: 'remove',\n value: function remove(key, value) {\n if (!this._registries[key]) {\n return;\n }\n\n var index = this._registries[key].indexOf(value);\n\n if (index < 0) {\n return;\n }\n return this._registries[key].splice(index, 1);\n }\n }, {\n key: 'removeByKey',\n value: function removeByKey(id) {\n var old = this._registries[id];\n delete this._registries[id];\n return old;\n }\n }, {\n key: 'removeByValue',\n value: function removeByValue(value) {\n var _this2 = this;\n\n var keys = this.findByValue(value);\n return keys.map(function(key) {\n return _this2.remove(key, value);\n });\n }\n }, {\n key: 'removeAll',\n value: function removeAll() {\n var old = this._registries;\n this._registries = {};\n return old;\n }\n }, {\n key: 'size',\n value: function size() {\n return Object.keys(this._registries).length;\n }\n }]);\n\n return MultipleValuesRegistry;\n })();\n\n exports.MultipleValuesRegistry = MultipleValuesRegistry;\n\n var SingleValueRegistry = (function() {\n function SingleValueRegistry() {\n _classCallCheck(this, SingleValueRegistry);\n\n this._registries = {};\n }\n\n _createClass(SingleValueRegistry, [{\n key: 'add',\n value: function add(id, value) {\n this._registries[id] = value;\n }\n }, {\n key: 'get',\n value: function get(id) {\n return this._registries[id];\n }\n }, {\n key: 'filterKeys',\n value: function filterKeys(handler) {\n return Object.keys(this._registries).filter(handler);\n }\n }, {\n key: 'findByValue',\n value: function findByValue(value) {\n var _this3 = this;\n\n var keys = Object.keys(this._registries).filter(function(key) {\n return _this3._registries[key] === value;\n });\n\n return keys;\n }\n }, {\n key: 'remove',\n value: function remove(id) {\n var old = this._registries[id];\n delete this._registries[id];\n return old;\n }\n }, {\n key: 'removeByValue',\n value: function removeByValue(value) {\n var _this4 = this;\n\n var keys = this.findByValue(value);\n return keys.map(function(key) {\n return _this4.remove(key);\n });\n }\n }, {\n key: 'removeAll',\n value: function removeAll() {\n var old = this._registries;\n this._registries = {};\n return old;\n }\n }, {\n key: 'size',\n value: function size() {\n return Object.keys(this._registries).length;\n }\n }]);\n\n return SingleValueRegistry;\n })();\n\n exports.SingleValueRegistry = SingleValueRegistry;\n\n }, {}],\n 7: [function(require, module, exports) {\n 'use strict';\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n exports.unique = unique;\n exports.noop = noop;\n exports.callbackTimeout = callbackTimeout;\n exports.createElementWithID = createElementWithID;\n exports.isPositiveInt = isPositiveInt;\n exports.stringEndsWith = stringEndsWith;\n\n function unique(prefix) {\n var count = -1;\n return function(f) {\n return prefix + '_' + ++count;\n };\n }\n\n function noop() {}\n\n function callbackTimeout(timer, onSuccess, onTimeout) {\n\n var timeout = setTimeout(function() {\n\n onSuccess = noop;\n onTimeout();\n }, timer);\n\n return function() {\n clearTimeout(timeout);\n onSuccess.apply(this, arguments);\n };\n }\n\n function createElementWithID(parent, id) {\n var nEl = document.createElement('div');\n nEl.id = id;\n parent.innerHTML = '';\n parent.appendChild(nEl);\n return nEl;\n }\n\n function isPositiveInt(newVal, oldVal) {\n return !isNaN(parseFloat(newVal)) && isFinite(newVal) && newVal > 0 ? newVal : oldVal;\n }\n\n var endsWith = (function() {\n if (String.prototype.endsWith) return String.prototype.endsWith;\n return function endsWith(searchString, position) {\n var subjectString = this.toString();\n if (position === undefined || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n };\n })();\n\n function stringEndsWith(string, search) {\n return endsWith.call(string, search);\n }\n\n }, {}]\n }, {}, [3])\n\n\n //# sourceMappingURL=VPAIDFLASHClient.js.map\n ;\n /*jshint unused:false */\n \"use strict\";\n\n var NODE_TYPE_ELEMENT = 1;\n\n function noop() {}\n\n function isNull(o) {\n return o === null;\n }\n\n function isDefined(o) {\n return o !== undefined;\n }\n\n function isUndefined(o) {\n return o === undefined;\n }\n\n function isObject(obj) {\n return typeof obj === 'object';\n }\n\n function isFunction(str) {\n return typeof str === 'function';\n }\n\n function isNumber(num) {\n return typeof num === 'number';\n }\n\n function isWindow(obj) {\n return isObject(obj) && obj.window === obj;\n }\n\n function isArray(array) {\n return Object.prototype.toString.call(array) === '[object Array]';\n }\n\n function isArrayLike(obj) {\n if (obj === null || isWindow(obj) || isFunction(obj) || isUndefined(obj)) {\n return false;\n }\n\n var length = obj.length;\n\n if (obj.nodeType === NODE_TYPE_ELEMENT && length) {\n return true;\n }\n\n return isString(obj) || isArray(obj) || length === 0 ||\n typeof length === 'number' && length > 0 && (length - 1) in obj;\n }\n\n function isString(str) {\n return typeof str === 'string';\n }\n\n function isEmptyString(str) {\n return isString(str) && str.length === 0;\n }\n\n function isNotEmptyString(str) {\n return isString(str) && str.length !== 0;\n }\n\n function arrayLikeObjToArray(args) {\n return Array.prototype.slice.call(args);\n }\n\n function forEach(obj, iterator, context) {\n var key, length;\n if (obj) {\n if (isFunction(obj)) {\n for (key in obj) {\n // Need to check if hasOwnProperty exists,\n // as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function\n if (key !== 'prototype' && key !== 'length' && key !== 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else if (isArray(obj)) {\n var isPrimitive = typeof obj !== 'object';\n for (key = 0, length = obj.length; key < length; key++) {\n if (isPrimitive || key in obj) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else if (obj.forEach && obj.forEach !== forEach) {\n obj.forEach(iterator, context, obj);\n } else {\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n }\n }\n return obj;\n }\n\n var SNAKE_CASE_REGEXP = /[A-Z]/g;\n\n function snake_case(name, separator) {\n separator = separator || '_';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }\n\n function isValidEmail(email) {\n if (!isString(email)) {\n return false;\n }\n var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i;\n return EMAIL_REGEXP.test(email.trim());\n }\n\n function extend(obj) {\n var arg, i, k;\n for (i = 1; i < arguments.length; i++) {\n arg = arguments[i];\n for (k in arg) {\n if (arg.hasOwnProperty(k)) {\n if (isObject(obj[k]) && !isNull(obj[k]) && isObject(arg[k])) {\n obj[k] = extend({}, obj[k], arg[k]);\n } else {\n obj[k] = arg[k];\n }\n }\n }\n }\n return obj;\n }\n\n function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n }\n\n function decapitalize(s) {\n return s.charAt(0).toLowerCase() + s.slice(1);\n }\n\n /**\n * This method works the same way array.prototype.map works but if the transformer returns undefine, then\n * it won't be added to the transformed Array.\n */\n function transformArray(array, transformer) {\n var transformedArray = [];\n\n array.forEach(function(item, index) {\n var transformedItem = transformer(item, index);\n if (isDefined(transformedItem)) {\n transformedArray.push(transformedItem);\n }\n });\n\n return transformedArray;\n }\n\n function toFixedDigits(num, digits) {\n var formattedNum = num + '';\n digits = isNumber(digits) ? digits : 0;\n num = isNumber(num) ? num : parseInt(num, 10);\n if (isNumber(num) && !isNaN(num)) {\n formattedNum = num + '';\n while (formattedNum.length < digits) {\n formattedNum = '0' + formattedNum;\n }\n return formattedNum;\n }\n return NaN + '';\n }\n\n function debounce(callback, wait) {\n var timeoutId;\n\n return function() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(function() {\n callback.apply(this, arguments);\n timeoutId = undefined;\n }, wait);\n };\n }\n\n // a function designed to blow up the stack in a naive way\n // but it is ok for videoJs children components\n function treeSearch(root, getChildren, found) {\n var children = getChildren(root);\n for (var i = 0; i < children.length; i++) {\n if (found(children[i])) {\n return children[i];\n } else {\n var el = treeSearch(children[i], getChildren, found);\n if (el) {\n return el;\n }\n }\n }\n }\n\n function echoFn(val) {\n return function() {\n return val;\n };\n }\n\n //Note: Supported formats come from http://www.w3.org/TR/NOTE-datetime\n // and the iso8601 regex comes from http://www.pelagodesign.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/\n function isISO8601(value) {\n if (isNumber(value)) {\n value = value + ''; //we make sure that we are working with strings\n }\n\n if (!isString(value)) {\n return false;\n }\n\n /*jslint maxlen: 500 */\n var iso8086Regex = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\n return iso8086Regex.test(value.trim());\n }\n\n /**\n * Checks if the Browser is IE9 and below\n * @returns {boolean}\n */\n function isOldIE() {\n var version = getInternetExplorerVersion(navigator);\n if (version === -1) {\n return false;\n }\n\n return version < 10;\n }\n\n /**\n * Returns the version of Internet Explorer or a -1 (indicating the use of another browser).\n * Source: https://msdn.microsoft.com/en-us/library/ms537509(v=vs.85).aspx\n * @returns {number} the version of Internet Explorer or a -1 (indicating the use of another browser).\n */\n function getInternetExplorerVersion(navigator) {\n var rv = -1;\n\n if (navigator.appName == 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent;\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n var res = re.exec(ua);\n if (res !== null) {\n rv = parseFloat(res[1]);\n }\n }\n\n return rv;\n }\n\n /*** Mobile Utility functions ***/\n var _UA = navigator.userAgent;\n\n function isIDevice() {\n return /iP(hone|ad)/.test(_UA);\n }\n\n function isMobile() {\n return /iP(hone|ad|od)|Android|Windows Phone/.test(_UA);\n }\n\n function isIPhone() {\n return /iP(hone|od)/.test(_UA);\n }\n\n function isAndroid() {\n return /Android/.test(_UA);\n }\n\n ;\n (function e(t, n, r) {\n function s(o, u) {\n if (!n[o]) {\n if (!t[o]) {\n var a = typeof require == \"function\" && require;\n if (!u && a) return a(o, !0);\n if (i) return i(o, !0);\n var f = new Error(\"Cannot find module '\" + o + \"'\");\n throw f.code = \"MODULE_NOT_FOUND\", f }\n var l = n[o] = { exports: {} };\n t[o][0].call(l.exports, function(e) {\n var n = t[o][1][e];\n return s(n ? n : e) }, l, l.exports, e, t, n, r) }\n return n[o].exports }\n var i = typeof require == \"function\" && require;\n for (var o = 0; o < r.length; o++) s(r[o]);\n return s })({\n 1: [function(require, module, exports) {\n 'use strict';\n\n var METHODS = [\n 'handshakeVersion',\n 'initAd',\n 'startAd',\n 'stopAd',\n 'skipAd', // VPAID 2.0 new method\n 'resizeAd',\n 'pauseAd',\n 'resumeAd',\n 'expandAd',\n 'collapseAd',\n 'subscribe',\n 'unsubscribe'\n ];\n\n var EVENTS = [\n 'AdLoaded',\n 'AdStarted',\n 'AdStopped',\n 'AdSkipped',\n 'AdSkippableStateChange', // VPAID 2.0 new event\n 'AdSizeChange', // VPAID 2.0 new event\n 'AdLinearChange',\n 'AdDurationChange', // VPAID 2.0 new event\n 'AdExpandedChange',\n 'AdRemainingTimeChange', // [Deprecated in 2.0] but will be still fired for backwards compatibility\n 'AdVolumeChange',\n 'AdImpression',\n 'AdVideoStart',\n 'AdVideoFirstQuartile',\n 'AdVideoMidpoint',\n 'AdVideoThirdQuartile',\n 'AdVideoComplete',\n 'AdClickThru',\n 'AdInteraction', // VPAID 2.0 new event\n 'AdUserAcceptInvitation',\n 'AdUserMinimize',\n 'AdUserClose',\n 'AdPaused',\n 'AdPlaying',\n 'AdLog',\n 'AdError'\n ];\n\n var GETTERS = [\n 'getAdLinear',\n 'getAdWidth', // VPAID 2.0 new getter\n 'getAdHeight', // VPAID 2.0 new getter\n 'getAdExpanded',\n 'getAdSkippableState', // VPAID 2.0 new getter\n 'getAdRemainingTime',\n 'getAdDuration', // VPAID 2.0 new getter\n 'getAdVolume',\n 'getAdCompanions', // VPAID 2.0 new getter\n 'getAdIcons' // VPAID 2.0 new getter\n ];\n\n var SETTERS = [\n 'setAdVolume'\n ];\n\n\n /**\n * This callback is displayed as global member. The callback use nodejs error-first callback style\n * @callback NodeStyleCallback\n * @param {string|null}\n * @param {undefined|object}\n */\n\n\n /**\n * IVPAIDAdUnit\n *\n * @class\n *\n * @param {object} creative\n * @param {HTMLElement} el\n * @param {HTMLVideoElement} video\n */\n function IVPAIDAdUnit(creative, el, video) {}\n\n\n /**\n * handshakeVersion\n *\n * @param {string} VPAIDVersion\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.handshakeVersion = function(VPAIDVersion, callback) {};\n\n /**\n * initAd\n *\n * @param {number} width\n * @param {number} height\n * @param {string} viewMode can be 'normal', 'thumbnail' or 'fullscreen'\n * @param {number} desiredBitrate indicates the desired bitrate in kbps\n * @param {object} [creativeData] used for additional initialization data\n * @param {object} [environmentVars] used for passing implementation-specific of js version\n * @param {NodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.initAd = function(width, height, viewMode, desiredBitrate, creativeData, environmentVars, callback) {};\n\n /**\n * startAd\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.startAd = function(callback) {};\n\n /**\n * stopAd\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.stopAd = function(callback) {};\n\n /**\n * skipAd\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.skipAd = function(callback) {};\n\n /**\n * resizeAd\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.resizeAd = function(width, height, viewMode, callback) {};\n\n /**\n * pauseAd\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.pauseAd = function(callback) {};\n\n /**\n * resumeAd\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.resumeAd = function(callback) {};\n\n /**\n * expandAd\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.expandAd = function(callback) {};\n\n /**\n * collapseAd\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.collapseAd = function(callback) {};\n\n /**\n * subscribe\n *\n * @param {string} event\n * @param {nodeStyleCallback} handler\n * @param {object} context\n */\n IVPAIDAdUnit.prototype.subscribe = function(event, handler, context) {};\n\n /**\n * startAd\n *\n * @param {string} event\n * @param {function} handler\n */\n IVPAIDAdUnit.prototype.unsubscribe = function(event, handler) {};\n\n\n\n /**\n * getAdLinear\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdLinear = function(callback) {};\n\n /**\n * getAdWidth\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdWidth = function(callback) {};\n\n /**\n * getAdHeight\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdHeight = function(callback) {};\n\n /**\n * getAdExpanded\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdExpanded = function(callback) {};\n\n /**\n * getAdSkippableState\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdSkippableState = function(callback) {};\n\n /**\n * getAdRemainingTime\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdRemainingTime = function(callback) {};\n\n /**\n * getAdDuration\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdDuration = function(callback) {};\n\n /**\n * getAdVolume\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdVolume = function(callback) {};\n\n /**\n * getAdCompanions\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdCompanions = function(callback) {};\n\n /**\n * getAdIcons\n *\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.getAdIcons = function(callback) {};\n\n /**\n * setAdVolume\n *\n * @param {number} volume\n * @param {nodeStyleCallback} callback\n */\n IVPAIDAdUnit.prototype.setAdVolume = function(volume, callback) {};\n\n addStaticToInterface(IVPAIDAdUnit, 'METHODS', METHODS);\n addStaticToInterface(IVPAIDAdUnit, 'GETTERS', GETTERS);\n addStaticToInterface(IVPAIDAdUnit, 'SETTERS', SETTERS);\n addStaticToInterface(IVPAIDAdUnit, 'EVENTS', EVENTS);\n\n\n var VPAID1_METHODS = METHODS.filter(function(method) {\n return ['skipAd'].indexOf(method) === -1;\n });\n\n addStaticToInterface(IVPAIDAdUnit, 'checkVPAIDInterface', function checkVPAIDInterface(creative) {\n var result = VPAID1_METHODS.every(function(key) {\n return typeof creative[key] === 'function';\n });\n return result;\n });\n\n module.exports = IVPAIDAdUnit;\n\n function addStaticToInterface(Interface, name, value) {\n Object.defineProperty(Interface, name, {\n writable: false,\n configurable: false,\n value: value\n });\n }\n\n\n }, {}],\n 2: [function(require, module, exports) {\n 'use strict';\n\n var IVPAIDAdUnit = require('./IVPAIDAdUnit');\n var Subscriber = require('./subscriber');\n var checkVPAIDInterface = IVPAIDAdUnit.checkVPAIDInterface;\n var utils = require('./utils');\n var METHODS = IVPAIDAdUnit.METHODS;\n var ERROR = 'AdError';\n var AD_CLICK = 'AdClickThru';\n var FILTERED_EVENTS = IVPAIDAdUnit.EVENTS.filter(function(event) {\n return event != AD_CLICK;\n });\n\n /**\n * This callback is displayed as global member. The callback use nodejs error-first callback style\n * @callback NodeStyleCallback\n * @param {string|null}\n * @param {undefined|object}\n */\n\n\n /**\n * VPAIDAdUnit\n * @class\n *\n * @param VPAIDCreative\n * @param {HTMLElement} [el] this will be used in initAd environmentVars.slot if defined\n * @param {HTMLVideoElement} [video] this will be used in initAd environmentVars.videoSlot if defined\n */\n function VPAIDAdUnit(VPAIDCreative, el, video, iframe) {\n this._isValid = checkVPAIDInterface(VPAIDCreative);\n if (this._isValid) {\n this._creative = VPAIDCreative;\n this._el = el;\n this._videoEl = video;\n this._iframe = iframe;\n this._subscribers = new Subscriber();\n $addEventsSubscribers.call(this);\n }\n }\n\n VPAIDAdUnit.prototype = Object.create(IVPAIDAdUnit.prototype);\n\n /**\n * isValidVPAIDAd will return if the VPAIDCreative passed in constructor is valid or not\n *\n * @return {boolean}\n */\n VPAIDAdUnit.prototype.isValidVPAIDAd = function isValidVPAIDAd() {\n return this._isValid;\n };\n\n IVPAIDAdUnit.METHODS.forEach(function(method) {\n //NOTE: this methods arguments order are implemented differently from the spec\n var ignores = [\n 'subscribe',\n 'unsubscribe',\n 'initAd'\n ];\n\n if (ignores.indexOf(method) !== -1) return;\n\n VPAIDAdUnit.prototype[method] = function() {\n var ariaty = IVPAIDAdUnit.prototype[method].length;\n // TODO avoid leaking arguments\n // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments\n var args = Array.prototype.slice.call(arguments);\n var callback = (ariaty === args.length) ? args.pop() : undefined;\n\n setTimeout(function() {\n var result, error = null;\n try {\n result = this._creative[method].apply(this._creative, args);\n } catch (e) {\n error = e;\n }\n\n callOrTriggerEvent(callback, this._subscribers, error, result);\n }.bind(this), 0);\n };\n });\n\n\n /**\n * initAd concreate implementation\n *\n * @param {number} width\n * @param {number} height\n * @param {string} viewMode can be 'normal', 'thumbnail' or 'fullscreen'\n * @param {number} desiredBitrate indicates the desired bitrate in kbps\n * @param {object} [creativeData] used for additional initialization data\n * @param {object} [environmentVars] used for passing implementation-specific of js version, if el & video was used in constructor slot & videoSlot will be added to the object\n * @param {NodeStyleCallback} callback\n */\n VPAIDAdUnit.prototype.initAd = function initAd(width, height, viewMode, desiredBitrate, creativeData, environmentVars, callback) {\n creativeData = creativeData || {};\n environmentVars = utils.extend({\n slot: this._el,\n videoSlot: this._videoEl\n }, environmentVars || {});\n\n setTimeout(function() {\n var error;\n try {\n this._creative.initAd(width, height, viewMode, desiredBitrate, creativeData, environmentVars);\n } catch (e) {\n error = e;\n }\n\n callOrTriggerEvent(callback, this._subscribers, error);\n }.bind(this), 0);\n };\n\n /**\n * subscribe\n *\n * @param {string} event\n * @param {nodeStyleCallback} handler\n * @param {object} context\n */\n VPAIDAdUnit.prototype.subscribe = function subscribe(event, handler, context) {\n this._subscribers.subscribe(handler, event, context);\n };\n\n\n /**\n * unsubscribe\n *\n * @param {string} event\n * @param {nodeStyleCallback} handler\n */\n VPAIDAdUnit.prototype.unsubscribe = function unsubscribe(event, handler) {\n this._subscribers.unsubscribe(handler, event);\n };\n\n //alias\n VPAIDAdUnit.prototype.on = VPAIDAdUnit.prototype.subscribe;\n VPAIDAdUnit.prototype.off = VPAIDAdUnit.prototype.unsubscribe;\n\n IVPAIDAdUnit.GETTERS.forEach(function(getter) {\n VPAIDAdUnit.prototype[getter] = function(callback) {\n setTimeout(function() {\n\n var result, error = null;\n try {\n result = this._creative[getter]();\n } catch (e) {\n error = e;\n }\n\n callOrTriggerEvent(callback, this._subscribers, error, result);\n }.bind(this), 0);\n };\n });\n\n /**\n * setAdVolume\n *\n * @param volume\n * @param {nodeStyleCallback} callback\n */\n VPAIDAdUnit.prototype.setAdVolume = function setAdVolume(volume, callback) {\n setTimeout(function() {\n\n var self = this;\n var result, error = null;\n try {\n this._creative.setAdVolume(volume);\n } catch (e) {\n error = e;\n }\n // Wait for creative volume to be set\n setTimeout(function() {\n result = self._creative.getAdVolume();\n if (!error) {\n error = utils.validate(result === volume, 'failed to apply volume: ' + volume);\n }\n callOrTriggerEvent(callback, self._subscribers, error, result);\n }, 200)\n }.bind(this), 0);\n };\n\n VPAIDAdUnit.prototype._destroy = function destroy() {\n this.stopAd();\n this._subscribers.unsubscribeAll();\n };\n\n function $addEventsSubscribers() {\n // some ads implement\n // so they only handle one subscriber\n // to handle this we create our one\n FILTERED_EVENTS.forEach(function(event) {\n this._creative.subscribe($trigger.bind(this, event), event);\n }.bind(this));\n\n // map the click event to be an object instead of depending of the order of the arguments\n // and to be consistent with the flash\n this._creative.subscribe($clickThruHook.bind(this), AD_CLICK);\n\n // because we are adding the element inside the iframe\n // the user is not able to click in the video\n if (this._videoEl) {\n var documentElement = this._iframe.contentDocument.documentElement;\n var videoEl = this._videoEl;\n documentElement.addEventListener('click', function(e) {\n if (e.target === documentElement) {\n videoEl.click();\n }\n });\n }\n }\n\n function $clickThruHook(url, id, playerHandles) {\n this._subscribers.triggerSync(AD_CLICK, { url: url, id: id, playerHandles: playerHandles });\n }\n\n function $trigger(event) {\n // TODO avoid leaking arguments\n // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments\n this._subscribers.trigger(event, Array.prototype.slice.call(arguments, 1));\n }\n\n function callOrTriggerEvent(callback, subscribers, error, result) {\n if (callback) {\n callback(error, result);\n } else if (error) {\n subscribers.trigger(ERROR, error);\n }\n }\n\n module.exports = VPAIDAdUnit;\n\n\n }, { \"./IVPAIDAdUnit\": 1, \"./subscriber\": 4, \"./utils\": 5 }],\n 3: [function(require, module, exports) {\n 'use strict';\n\n\n var utils = require('./utils');\n var unique = utils.unique('vpaidIframe');\n var VPAIDAdUnit = require('./VPAIDAdUnit');\n //var defaultTemplate = \"\\n\\n\\n \\n\\n\\n \\n \\n \\n \\n\\n\\n\";\n var defaultTemplate = \"\\n\\n \\n \\n \\n \\n \\n \\n \\n\\n\\n\";\n\n var AD_STOPPED = 'AdStopped';\n\n /**\n * This callback is displayed as global member. The callback use nodejs error-first callback style\n * @callback NodeStyleCallback\n * @param {string|null}\n * @param {undefined|object}\n */\n\n /**\n * VPAIDHTML5Client\n * @class\n *\n * @param {HTMLElement} el that will contain the iframe to load adUnit and a el to add to adUnit slot\n * @param {HTMLVideoElement} video default video element to be used by adUnit\n * @param {object} [templateConfig] template: html template to be used instead of the default, extraOptions: to be used when rendering the template\n * @param {object} [vpaidOptions] timeout: when loading adUnit\n */\n function VPAIDHTML5Client(el, video, templateConfig, vpaidOptions) {\n templateConfig = templateConfig || {};\n\n this._id = unique();\n this._destroyed = false;\n\n this._frameContainer = utils.createElementInEl(el, 'div');\n this._videoEl = video;\n this._vpaidOptions = vpaidOptions || { timeout: 10000 };\n\n this._templateConfig = {\n template: templateConfig.template || defaultTemplate,\n extraOptions: templateConfig.extraOptions || {}\n };\n\n }\n\n /**\n * destroy\n *\n */\n VPAIDHTML5Client.prototype.destroy = function destroy() {\n if (this._destroyed) {\n return;\n }\n this._destroyed = true;\n $unloadPreviousAdUnit.call(this);\n };\n\n /**\n * isDestroyed\n *\n * @return {boolean}\n */\n VPAIDHTML5Client.prototype.isDestroyed = function isDestroyed() {\n return this._destroyed;\n };\n\n /**\n * loadAdUnit\n *\n * @param {string} adURL url of the js of the adUnit\n * @param {nodeStyleCallback} callback\n */\n VPAIDHTML5Client.prototype.loadAdUnit = function loadAdUnit(adURL, callback) {\n $throwIfDestroyed.call(this);\n $unloadPreviousAdUnit.call(this);\n\n var frame = utils.createIframeWithContent(\n this._frameContainer,\n this._templateConfig.template,\n utils.extend({\n iframeURL_JS: adURL,\n iframeID: this.getID()\n }, this._templateConfig.extraOptions)\n );\n this._frame = frame;\n\n this._onLoad = utils.callbackTimeout(\n this._vpaidOptions.timeout,\n onLoad.bind(this),\n onTimeout.bind(this)\n );\n\n // Set up user activity detection Hook for the iframe;\n handleUserActivityIframeEvents(this._frame);\n\n window.addEventListener('message', this._onLoad);\n\n function onLoad(e) {\n\n console.log(\"got postMessage from container\");\n\n //minthe : this should have proper logic for dynamic iframe generates on runtime.\n //don't clear timeout\n //if (e.origin !== window.location.origin) return;\n var result = JSON.parse(e.data);\n\n //don't clear timeout\n if (result.id !== this.getID()) return;\n\n var adUnit, error, createAd;\n if (!this._frame.contentWindow) {\n\n error = 'the iframe is not anymore in the DOM tree';\n\n } else {\n createAd = this._frame.contentWindow.getVPAIDAd;\n error = utils.validate(typeof createAd === 'function', 'the ad didn\\'t return a function to create an ad');\n }\n\n if (!error) {\n var adEl = this._frame.contentWindow.document.querySelector('.ad-element');\n adUnit = new VPAIDAdUnit(createAd(), adEl, this._videoEl, this._frame);\n adUnit.subscribe(AD_STOPPED, $adDestroyed.bind(this));\n error = utils.validate(adUnit.isValidVPAIDAd(), 'the add is not fully complaint with VPAID specification');\n }\n\n this._adUnit = adUnit;\n $destroyLoadListener.call(this);\n callback(error, error ? null : adUnit);\n\n //clear timeout\n return true;\n }\n\n function onTimeout() {\n callback('timeout', null);\n }\n\n // VIDLA 1106 + VIDLA 601:\n // Root cause for video JS not detecting UserActivity.\n // if mousemove and touch events happens inside an iframe,\n // then it is not automatically propogated to the player element.\n // This code is forcing the mouse and touch event up to video js\n // so that useractivity logic works just as for Vast mp4s\n function handleUserActivityIframeEvents(iframe){\n // Save any previous handler\n var existingOnMouseMove = iframe.contentWindow.onmousemove;\n var existingOnMouseOver = iframe.contentWindow.onmouseover;\n\n var existingOnTouchStart = iframe.contentWindow.ontouchstart;\n var existingOnTouchEnd = iframe.contentWindow.ontouchend;\n\n iframe.contentWindow.onmousemove = function(e) {\n if (existingOnMouseMove) existingOnMouseMove(e);\n forwardMouseEvent(e, \"mousemove\");\n };\n\n iframe.contentWindow.onmouseover = function(e) {\n if (existingOnMouseOver) existingOnMouseOver(e);\n forwardMouseEvent(e, \"mouseover\");\n };\n\n function forwardMouseEvent(e, nameOfEvent){\n var evt = document.createEvent(\"MouseEvents\");\n // We'll need this to offset the mouse move appropriately\n var boundingClientRect = iframe.getBoundingClientRect();\n // Initialize the event, copying exiting event values\n // for the most part\n evt.initMouseEvent(\n nameOfEvent,\n true, // bubbles\n false, // not cancelable\n window,\n e.detail,\n e.screenX,\n e.screenY,\n e.clientX + boundingClientRect.left,\n e.clientY + boundingClientRect.top,\n e.ctrlKey,\n e.altKey,\n e.shiftKey,\n e.metaKey,\n e.button,\n null // no related element\n );\n iframe.dispatchEvent(evt);\n };\n\n iframe.contentWindow.ontouchstart = function(e) {\n if (existingOnTouchStart) existingOnTouchStart(e);\n forwardTouch(e);\n };\n\n iframe.contentWindow.ontouchend = function(e) {\n if (existingOnTouchEnd) existingOnTouchEnd(e);\n forwardTouch(e);\n };\n\n function forwardTouch(e){\n var evt = document.createEvent(\"HTMLEvents\");\n evt.initEvent(\n e.type,\n true, // bubbles\n false, // not cancelable\n window);\n iframe.dispatchEvent(evt);\n };\n };\n };\n\n /**\n * unloadAdUnit\n *\n */\n VPAIDHTML5Client.prototype.unloadAdUnit = function unloadAdUnit() {\n $unloadPreviousAdUnit.call(this);\n };\n\n /**\n * getID will return the unique id\n *\n * @return {string}\n */\n VPAIDHTML5Client.prototype.getID = function() {\n return this._id;\n };\n\n\n /**\n * $removeEl\n *\n * @param {string} key\n */\n function $removeEl(key) {\n var el = this[key];\n if (el) {\n el.remove();\n delete this[key];\n }\n }\n\n function $adDestroyed() {\n $removeAdElements.call(this);\n delete this._adUnit;\n }\n\n function $unloadPreviousAdUnit() {\n $removeAdElements.call(this);\n $destroyAdUnit.call(this);\n }\n\n function $removeAdElements() {\n $removeEl.call(this, '_frame');\n $destroyLoadListener.call(this);\n }\n\n /**\n * $destroyLoadListener\n *\n */\n function $destroyLoadListener() {\n if (this._onLoad) {\n window.removeEventListener('message', this._onLoad);\n utils.clearCallbackTimeout(this._onLoad);\n delete this._onLoad;\n }\n }\n\n\n function $destroyAdUnit() {\n if (this._adUnit) {\n this._adUnit.stopAd();\n delete this._adUnit;\n }\n }\n\n /**\n * $throwIfDestroyed\n *\n */\n function $throwIfDestroyed() {\n if (this._destroyed) {\n throw new Error('VPAIDHTML5Client already destroyed!');\n }\n }\n\n module.exports = VPAIDHTML5Client;\n window.VPAIDHTML5Client = VPAIDHTML5Client;\n\n\n }, { \"./VPAIDAdUnit\": 2, \"./utils\": 5 }],\n 4: [function(require, module, exports) {\n 'use strict';\n\n function Subscriber() {\n this._subscribers = {};\n }\n\n Subscriber.prototype.subscribe = function subscribe(handler, eventName, context) {\n this.get(eventName).push({ handler: handler, context: context });\n };\n\n Subscriber.prototype.unsubscribe = function unsubscribe(handler, eventName) {\n this._subscribers[eventName] = this.get(eventName).filter(function(subscriber) {\n return handler === subscriber.handler;\n });\n };\n\n Subscriber.prototype.unsubscribeAll = function unsubscribeAll() {\n this._subscribers = {};\n };\n\n Subscriber.prototype.trigger = function(eventName, data) {\n var that = this;\n that.get(eventName).forEach(function(subscriber) {\n setTimeout(function() {\n if (that.get(eventName)) {\n subscriber.handler.call(subscriber.context, data);\n }\n }, 0);\n });\n };\n\n Subscriber.prototype.triggerSync = function(eventName, data) {\n this.get(eventName).forEach(function(subscriber) {\n subscriber.handler.call(subscriber.context, data);\n });\n };\n\n Subscriber.prototype.get = function get(eventName) {\n if (!this._subscribers[eventName]) {\n this._subscribers[eventName] = [];\n }\n return this._subscribers[eventName];\n };\n\n module.exports = Subscriber;\n\n\n }, {}],\n 5: [function(require, module, exports) {\n 'use strict';\n\n /**\n * noop a empty function\n */\n function noop() {}\n\n /**\n * validate if is not validate will return an Error with the message\n *\n * @param {boolean} isValid\n * @param {string} message\n */\n function validate(isValid, message) {\n return isValid ? null : new Error(message);\n }\n\n var timeouts = {};\n /**\n * clearCallbackTimeout\n *\n * @param {function} func handler to remove\n */\n function clearCallbackTimeout(func) {\n var timeout = timeouts[func];\n if (timeout) {\n clearTimeout(timeout);\n delete timeouts[func];\n }\n }\n\n /**\n * callbackTimeout if the onSuccess is not called and returns true in the timelimit then onTimeout will be called\n *\n * @param {number} timer\n * @param {function} onSuccess\n * @param {function} onTimeout\n */\n function callbackTimeout(timer, onSuccess, onTimeout) {\n var callback, timeout;\n\n timeout = setTimeout(function() {\n onSuccess = noop;\n if (!timeouts[callback]) {\n // Timeout has already been resolved.\n return;\n }\n delete timeout[callback];\n onTimeout();\n }, timer);\n\n callback = function() {\n // TODO avoid leaking arguments\n // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments\n if (onSuccess.apply(this, arguments)) {\n clearCallbackTimeout(callback);\n }\n };\n\n timeouts[callback] = timeout;\n\n return callback;\n }\n\n\n /**\n * createElementInEl\n *\n * @param {HTMLElement} parent\n * @param {string} tagName\n * @param {string} id\n */\n function createElementInEl(parent, tagName, id) {\n var nEl = document.createElement(tagName);\n if (id) nEl.id = id;\n parent.appendChild(nEl);\n return nEl;\n }\n\n /**\n * createIframeWithContent\n *\n * @param {HTMLElement} parent\n * @param {string} template simple template using {{var}}\n * @param {object} data\n */\n function createIframeWithContent(parent, template, data) {\n var iframe = createIframe(parent);\n if (!setIframeContent(iframe, simpleTemplate(template, data))) return;\n return iframe;\n }\n\n /**\n * createIframe\n *\n * @param {HTMLElement} parent\n * @param {string} url\n */\n function createIframe(parent, url) {\n var nEl = document.createElement('iframe');\n nEl.src = url || 'about:blank';\n nEl.width = '100%';\n nEl.height = '100%';\n nEl.style.position = 'absolute';\n nEl.style.left = '0';\n nEl.style.top = '0';\n nEl.style.border = '0';\n parent.innerHTML = '';\n parent.appendChild(nEl);\n return nEl;\n }\n\n /**\n * simpleTemplate\n *\n * @param {string} template\n * @param {object} data\n */\n function simpleTemplate(template, data) {\n Object.keys(data).forEach(function(key) {\n var value = (typeof value === 'object') ? JSON.stringify(data[key]) : data[key];\n template = template.replace(new RegExp('{{' + key + '}}', 'g'), value);\n });\n return template;\n }\n\n /**\n * setIframeContent\n *\n * @param {HTMLIframeElement} iframeEl\n * @param content\n */\n function setIframeContent(iframeEl, content) {\n var iframeDoc = iframeEl.contentWindow && iframeEl.contentWindow.document;\n if (!iframeDoc) return false;\n\n iframeDoc.write(content);\n\n return true;\n }\n\n\n /**\n * extend object with keys from another object\n *\n * @param {object} toExtend\n * @param {object} fromSource\n */\n function extend(toExtend, fromSource) {\n Object.keys(fromSource).forEach(function(key) {\n toExtend[key] = fromSource[key];\n });\n return toExtend;\n }\n\n\n /**\n * unique will create a unique string everytime is called, sequentially and prefixed\n *\n * @param {string} prefix\n */\n function unique(prefix) {\n var count = -1;\n return function() {\n return prefix + '_' + (++count);\n };\n }\n\n module.exports = {\n noop: noop,\n validate: validate,\n clearCallbackTimeout: clearCallbackTimeout,\n callbackTimeout: callbackTimeout,\n createElementInEl: createElementInEl,\n createIframeWithContent: createIframeWithContent,\n createIframe: createIframe,\n simpleTemplate: simpleTemplate,\n setIframeContent: setIframeContent,\n extend: extend,\n unique: unique\n };\n\n\n }, {}]\n }, {}, [3])\n\n\n //# sourceMappingURL=VPAIDHTML5Client.js.map\n ;\n //Small subset of async\n var async = {};\n\n async.setImmediate = function(fn) {\n setTimeout(fn, 0);\n };\n\n async.iterator = function(tasks) {\n var makeCallback = function(index) {\n var fn = function() {\n if (tasks.length) {\n tasks[index].apply(null, arguments);\n }\n return fn.next();\n };\n fn.next = function() {\n return (index < tasks.length - 1) ? makeCallback(index + 1) : null;\n };\n return fn;\n };\n return makeCallback(0);\n };\n\n\n async.waterfall = function(tasks, callback) {\n callback = callback || function() {};\n if (!isArray(tasks)) {\n var err = new Error('First argument to waterfall must be an array of functions');\n return callback(err);\n }\n if (!tasks.length) {\n return callback();\n }\n var wrapIterator = function(iterator) {\n return function(err) {\n if (err) {\n callback.apply(null, arguments);\n callback = function() {};\n } else {\n var args = Array.prototype.slice.call(arguments, 1);\n var next = iterator.next();\n if (next) {\n args.push(wrapIterator(next));\n } else {\n args.push(callback);\n }\n async.setImmediate(function() {\n iterator.apply(null, args);\n });\n }\n };\n };\n wrapIterator(async.iterator(tasks))();\n };\n\n async.when = function(condition, callback) {\n if (!isFunction(callback)) {\n throw new Error(\"async.when error: missing callback argument\");\n }\n\n var isAllowed = isFunction(condition) ? condition : function() {\n return !!condition;\n };\n\n return function() {\n var args = arrayLikeObjToArray(arguments);\n var next = args.pop();\n\n if (isAllowed.apply(null, args)) {\n return callback.apply(this, arguments);\n }\n\n args.unshift(null);\n return next.apply(null, args);\n };\n };\n\n\n\n ;\n \"use strict\";\n\n var dom = {};\n\n dom.isVisible = function isVisible(el) {\n var style = window.getComputedStyle(el);\n return style.visibility !== 'hidden';\n };\n\n dom.isHidden = function isHidden(el) {\n var style = window.getComputedStyle(el);\n return style.display === 'none';\n };\n\n dom.isShown = function isShown(el) {\n return !dom.isHidden(el);\n };\n\n dom.hide = function hide(el) {\n el.__prev_style_display_ = el.style.display;\n el.style.display = 'none';\n };\n\n dom.show = function show(el) {\n if (dom.isHidden(el)) {\n el.style.display = el.__prev_style_display_;\n }\n el.__prev_style_display_ = undefined;\n };\n\n dom.hasClass = function hasClass(el, cssClass) {\n var classes, i, len;\n\n if (isNotEmptyString(cssClass)) {\n if (el.classList) {\n return el.classList.contains(cssClass);\n }\n\n classes = isString(el.getAttribute('class')) ? el.getAttribute('class').split(/\\s+/) : [];\n cssClass = (cssClass || '');\n\n for (i = 0, len = classes.length; i < len; i += 1) {\n if (classes[i] === cssClass) {\n return true;\n }\n }\n }\n return false;\n };\n\n dom.addClass = function(el, cssClass) {\n var classes;\n\n if (isNotEmptyString(cssClass)) {\n if (el.classList) {\n return el.classList.add(cssClass);\n }\n\n classes = isString(el.getAttribute('class')) ? el.getAttribute('class').split(/\\s+/) : [];\n if (isString(cssClass) && isNotEmptyString(cssClass.replace(/\\s+/, ''))) {\n classes.push(cssClass);\n el.setAttribute('class', classes.join(' '));\n }\n }\n };\n\n dom.removeClass = function(el, cssClass) {\n var classes;\n\n if (isNotEmptyString(cssClass)) {\n if (el.classList) {\n return el.classList.remove(cssClass);\n }\n\n classes = isString(el.getAttribute('class')) ? el.getAttribute('class').split(/\\s+/) : [];\n var newClasses = [];\n var i, len;\n if (isString(cssClass) && isNotEmptyString(cssClass.replace(/\\s+/, ''))) {\n\n for (i = 0, len = classes.length; i < len; i += 1) {\n if (cssClass !== classes[i]) {\n newClasses.push(classes[i]);\n }\n }\n el.setAttribute('class', newClasses.join(' '));\n }\n }\n };\n\n dom.addEventListener = function addEventListener(el, type, handler) {\n if (isArray(el)) {\n forEach(el, function(e) {\n dom.addEventListener(e, type, handler);\n });\n return;\n }\n\n if (isArray(type)) {\n forEach(type, function(t) {\n dom.addEventListener(el, t, handler);\n });\n return;\n }\n\n if (el.addEventListener) {\n el.addEventListener(type, handler, false);\n } else if (el.attachEvent) {\n // WARNING!!! this is a very naive implementation !\n // the event object that should be passed to the handler\n // would not be there for IE8\n // we should use \"window.event\" and then \"event.srcElement\"\n // instead of \"event.target\"\n el.attachEvent(\"on\" + type, handler);\n }\n };\n\n dom.removeEventListener = function removeEventListener(el, type, handler) {\n if (isArray(el)) {\n forEach(el, function(e) {\n dom.removeEventListener(e, type, handler);\n });\n return;\n }\n\n if (isArray(type)) {\n forEach(type, function(t) {\n dom.removeEventListener(el, t, handler);\n });\n return;\n }\n\n if (el.removeEventListener) {\n el.removeEventListener(type, handler, false);\n } else if (el.detachEvent) {\n el.detachEvent(\"on\" + type, handler);\n } else {\n el[\"on\" + type] = null;\n }\n };\n\n dom.dispatchEvent = function dispatchEvent(el, event) {\n if (el.dispatchEvent) {\n el.dispatchEvent(event);\n } else {\n el.fireEvent(\"on\" + event.eventType, event);\n }\n };\n\n dom.isDescendant = function isDescendant(parent, child) {\n var node = child.parentNode;\n while (node !== null) {\n if (node === parent) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n };\n\n dom.getTextContent = function getTextContent(el) {\n return el.textContent || el.text;\n };\n\n dom.prependChild = function prependChild(parent, child) {\n if (child.parentNode) {\n child.parentNode.removeChild(child);\n }\n return parent.insertBefore(child, parent.firstChild);\n };\n\n dom.remove = function removeNode(node) {\n if (node && node.parentNode) {\n node.parentNode.removeChild(node);\n }\n };\n\n dom.isDomElement = function isDomElement(o) {\n return o instanceof Element;\n };\n\n dom.click = function(el, handler) {\n dom.addEventListener(el, 'click', handler);\n };\n\n dom.once = function(el, type, handler) {\n function handlerWrap() {\n handler.apply(null, arguments);\n dom.removeEventListener(el, type, handlerWrap);\n }\n\n dom.addEventListener(el, type, handlerWrap);\n };\n\n //Note: there is no getBoundingClientRect on iPad so we need a fallback\n dom.getDimension = function getDimension(element) {\n var rect;\n var parentNode = element.parentNode;\n // VIDLA-910 Always initializing with 1x1 for creative to better deal with falsy cases.\n // some creatives do not like 0x0 initializations specially inside iframe.\n var width = 1;\n var height = 1;\n if (parentNode) {\n width = parentNode.clientWidth ? parentNode.clientWidth : width;\n height = parentNode.clientHeight ? parentNode.clientHeight : height;\n }else {\n width = element.offsetWidth ? element.offsetWidth : width;\n height = element.offsetHeight ? element.offsetHeight : height;\n }\n return {\n width: width,\n height: height\n };\n };\n\n \"use strict\";\n\n var logger = {};\n\n ;\n \"use strict\";\n\n //minthe2 profile\n var profile = {};\n\n profile.timeout = 0;\n profile.initAdTimestamp = 0;\n profile.adLoadedTimestamp = 0;\n\n profile.startAdTimestamp = 0;\n profile.adStartedTimestamp = 0;\n\n profile.adImpressionTimestamp = 0;\n\n profile.getState = function() {\n if (profile.adImpressionTimestamp) {\n return 'adImpression';\n }\n if (profile.startAdTimestamp) {\n return 'startAd';\n }\n if (profile.initAdTimestamp) {\n return 'initAd';\n }\n return 'pluginInit';\n };\n\n profile.getRemainingTime = function(type) {\n var offset = 0;\n var currTime = new Date().getTime();\n switch (type) {\n case 'initAd':\n offset = currTime - profile.initAdTimestamp;\n break;\n case 'AdLoaded':\n offset = profile.getInitTime();\n break;\n case 'startAd':\n offset = profile.getInitTime();\n break;\n case 'AdStarted':\n offset = profile.getInitTime() + profile.getStartTime();\n break;\n case 'AdImpression':\n offset = profile.getTotalTime();\n break;\n default:\n break;\n }\n var remainingTime = profile.timeout - offset;\n return remainingTime;\n };\n\n profile.getInitTime = function() {\n var interval = profile.adLoadedTimestamp - profile.initAdTimestamp;\n return interval;\n };\n\n profile.getStartTime = function() {\n var interval = profile.adStartedTimestamp - profile.startAdTimestamp;\n return interval;\n };\n\n profile.getAdImpressionTime = function() {\n var interval = profile.adImpressionTimestamp - profile.startAdTimestamp;\n return interval;\n };\n\n profile.getTotalTime = function() {\n\n var interval = profile.getInitTime();\n\n if (profile.adStartedTimestamp > profile.adImpressionTimestamp) {\n interval = interval + profile.getStartTime();\n } else {\n interval = interval + profile.getAdImpressionTime();\n }\n\n // if (profile.adImpressionTimestamp) {\n // interval = interval + profile.getAdImpressionTime();\n // }\n return interval;\n };\n\n ;\n \"use strict\";\n\n //minthe2 timer\n var timer = {};\n\n timer.killUnresponsiveCreative = false;\n timer.responseWaitingTime = 1000;\n timer.killTimeout = null;\n timer.adCancelTimeout = 5000;\n timer.adLoadTimeout = null;\n timer.adStartTimeout = null;\n // timer.adImpressionTimeout = null;\n timer.adStartedResponseTime = 0;\n timer.adImpressionResponseTime = 0;\n\n\n timer.startKillTimeout = function(adUnit) {\n if (timer.killUnresponsiveCreative) {\n // if already timeout is set . cleanup\n if (timer.killTimeout) {\n timer.stopKillTimeout();\n }\n timer.killTimeout = setTimeout(function() {\n if (timer.killTimeout) {\n logger.log('killUnresponsiveCreative Timeout reached ');\n adUnit.stopAd();\n }\n }, timer.responseWaitingTime);\n }\n };\n\n timer.stopKillTimeout = function() {\n if (!timer.killTimeout) {\n return;\n }\n timer.clearTimeout(timer.killTimeout);\n timer.killTimeout = null;\n };\n\n timer.handleAdTimeout = function(cb, state) {\n logger.error('VPAID AD TIMED OUT :: AFTER ' + state + ' ,timeout value : ' + timer.adCancelTimeout);\n if (cb) {\n cb(new VASTError('timeout while waiting for the video to start playing', 402));\n }\n };\n\n timer.clearTimeout = function(timeout) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n timer.startInitAdTimeout = function(cb) {\n profile.timeout = timer.adCancelTimeout;\n profile.initAdTimestamp = new Date().getTime();\n timer.adLoadTimeout = setTimeout(function() {\n timer.handleAdTimeout(cb, \"initAd\");\n }, timer.adCancelTimeout);\n };\n\n timer.stopInitAdTimeout = function() {\n profile.adLoadedTimestamp = new Date().getTime();\n timer.adStartedResponseTime = timer.adCancelTimeout - profile.getInitTime();\n timer.clearTimeout(timer.adLoadTimeout);\n\n };\n\n timer.startStartAdTimeout = function(cb) {\n profile.startAdTimestamp = new Date().getTime();\n var timeoutFunction;\n\n timeoutFunction = function() {\n if (profile.adStartedTimestamp > 0) {\n timer.handleAdTimeout(cb, \"AdStarted\");\n } else {\n timer.handleAdTimeout(cb, \"startAd\");\n }\n }\n\n timer.adStartTimeout = setTimeout(timeoutFunction, timer.adStartedResponseTime);\n };\n\n timer.stopStartAdTimeout = function() {\n timer.clearTimeout(timer.adStartTimeout);\n logger.debug(\"stopStartAdTimeout\");\n };\n\n // timer.startAdImpressionTimeout = function(cb) {\n // profile.adImpressionTimestamp = new Date().getTime();\n // timer.adImpressionTimeout = setTimeout(function(){\n // timer.handleAdTimeout(cb,\"AdStarted\");\n // }, timer.adImpressionResponseTime);\n // };\n\n // timer.stopAdImpressionTimeout = function() {\n // profile.adImpressionTimestamp = new Date().getTime();\n // timer.clearTimeout(timer.adImpressionTimeout);\n // };\n\n timer.stopAdTimeouts = function() {\n logger.debug(\"stopAdTimeouts\");\n timer.clearTimeout(timer.adLoadTimeout);\n timer.clearTimeout(timer.adStartTimeout);\n // timer.clearTimeout(timer.adImpressionTimeout);\n };\n\n ;\n \"use strict\";\n\n function HttpRequestError(message) {\n this.message = 'HttpRequest Error: ' + (message || '');\n }\n HttpRequestError.prototype = new Error();\n HttpRequestError.prototype.name = \"HttpRequest Error\";\n\n function HttpRequest(createXhr) {\n if (!isFunction(createXhr)) {\n throw new HttpRequestError('Missing XMLHttpRequest factory method');\n }\n\n this.createXhr = createXhr;\n }\n\n HttpRequest.prototype.run = function(method, url, callback, options) {\n sanityCheck(url, callback, options);\n var timeout, timeoutId;\n var xhr = this.createXhr();\n options = options || {};\n timeout = isNumber(options.timeout) ? options.timeout : 0;\n\n xhr.open(method, urlParts(url).href, true);\n\n if (options.headers) {\n setHeaders(xhr, options.headers);\n }\n\n if (options.withCredentials) {\n xhr.withCredentials = true;\n }\n\n xhr.onload = function() {\n var statusText, response, status;\n\n /**\n * The only way to do a secure request on IE8 and IE9 is with the XDomainRequest object. Unfortunately, microsoft is\n * so nice that decided that the status property and the 'getAllResponseHeaders' method where not needed so we have to\n * fake them. If the request gets done with an XDomainRequest instance, we will assume that there are no headers and\n * the status will always be 200. If you don't like it, DO NOT USE ANCIENT BROWSERS!!!\n *\n * For mor info go to: https://msdn.microsoft.com/en-us/library/cc288060(v=vs.85).aspx\n */\n if (!xhr.getAllResponseHeaders) {\n xhr.getAllResponseHeaders = function() {\n return null;\n };\n }\n\n if (!xhr.status) {\n xhr.status = 200;\n }\n\n if (isDefined(timeoutId)) {\n clearTimeout(timeoutId);\n timeoutId = undefined;\n }\n\n statusText = xhr.statusText || '';\n\n // responseText is the old-school way of retrieving response (supported by IE8 & 9)\n // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)\n response = ('response' in xhr) ? xhr.response : xhr.responseText;\n\n // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)\n status = xhr.status === 1223 ? 204 : xhr.status;\n\n callback(\n status,\n response,\n xhr.getAllResponseHeaders(),\n statusText);\n };\n\n xhr.onerror = requestError;\n xhr.onabort = requestError;\n\n xhr.send();\n\n if (timeout > 0) {\n timeoutId = setTimeout(function() {\n xhr && xhr.abort();\n }, timeout);\n }\n\n function sanityCheck(url, callback, options) {\n if (!isString(url) || isEmptyString(url)) {\n throw new HttpRequestError(\"Invalid url '\" + url + \"'\");\n }\n\n if (!isFunction(callback)) {\n throw new HttpRequestError(\"Invalid handler '\" + callback + \"' for the http request\");\n }\n\n if (isDefined(options) && !isObject(options)) {\n throw new HttpRequestError(\"Invalid options map '\" + options + \"'\");\n }\n }\n\n function setHeaders(xhr, headers) {\n forEach(headers, function(value, key) {\n if (isDefined(value)) {\n xhr.setRequestHeader(key, value);\n }\n });\n }\n\n function requestError() {\n callback(-1, null, null, '');\n }\n };\n\n HttpRequest.prototype.get = function(url, callback, options) {\n this.run('GET', url, processResponse, options);\n\n function processResponse(status, response, headersString, statusText) {\n if (isSuccess(status)) {\n callback(null, response, status, headersString, statusText);\n } else {\n callback(new HttpRequestError(statusText), response, status, headersString, statusText);\n }\n }\n\n function isSuccess(status) {\n return 200 <= status && status < 300;\n }\n };\n\n function createXhr() {\n var xhr = new XMLHttpRequest();\n if (!(\"withCredentials\" in xhr)) {\n // XDomainRequest for IE.\n xhr = new XDomainRequest();\n }\n return xhr;\n }\n\n var http = new HttpRequest(createXhr);\n\n ;\n var playerUtils = {};\n\n /**\n * Returns an object that captures the portions of player state relevant to\n * video playback. The result of this function can be passed to\n * restorePlayerSnapshot with a player to return the player to the state it\n * was in when this function was invoked.\n * @param {object} player The videojs player object\n */\n playerUtils.getPlayerSnapshot = function getPlayerSnapshot(player) {\n var tech = player.el().querySelector('.vjs-tech');\n var snapshot = {\n ended: player.ended(),\n src: player.currentSrc(),\n currentTime: player.currentTime(),\n type: player.currentType(),\n playing: !player.paused(),\n suppressedTracks: getSuppressedTracks(player)\n };\n\n if (tech) {\n snapshot.nativePoster = tech.poster;\n snapshot.style = tech.getAttribute('style');\n }\n\n return snapshot;\n\n /**** Local Functions ****/\n function getSuppressedTracks(player) {\n var tracks = player.remoteTextTracks ? player.remoteTextTracks() : [];\n\n if (tracks && isArray(tracks.tracks_)) {\n tracks = tracks.tracks_;\n }\n\n if (!isArray(tracks)) {\n tracks = [];\n }\n\n var suppressedTracks = [];\n tracks.forEach(function(track) {\n suppressedTracks.push({\n track: track,\n mode: track.mode\n });\n track.mode = 'disabled';\n });\n\n return suppressedTracks;\n }\n };\n\n /**\n * Attempts to modify the specified player so that its state is equivalent to\n * the state of the snapshot.\n * @param {object} snapshot - the player state to apply\n */\n playerUtils.restorePlayerSnapshot = function restorePlayerSnapshot(player, snapshot) {\n var tech = player.el().querySelector('.vjs-tech');\n var attempts = 20; // the number of remaining attempts to restore the snapshot\n\n if (snapshot.nativePoster) {\n tech.poster = snapshot.nativePoster;\n }\n\n if ('style' in snapshot) {\n // overwrite all css style properties to restore state precisely\n tech.setAttribute('style', snapshot.style || '');\n }\n\n if (hasSrcChanged(player, snapshot)) {\n // on ios7, fiddling with textTracks too early will cause safari to crash\n player.one('contentloadedmetadata', restoreTracks);\n\n player.one('canplay', tryToResume);\n ensureCanplayEvtGetsFired();\n\n // if the src changed for ad playback, reset it\n player.src({ src: snapshot.src, type: snapshot.type });\n\n // safari requires a call to `load` to pick up a changed source\n player.load();\n\n } else {\n restoreTracks();\n\n if (snapshot.playing) {\n player.play();\n }\n }\n\n /*** Local Functions ***/\n\n /**\n * Sometimes firefox does not trigger the 'canplay' evt.\n * This code ensure that it always gets triggered triggered.\n */\n function ensureCanplayEvtGetsFired() {\n var timeoutId = setTimeout(function() {\n player.trigger('canplay');\n }, 1000);\n\n player.one('canplay', function() {\n clearTimeout(timeoutId);\n });\n }\n\n /**\n * Determine whether the player needs to be restored to its state\n * before ad playback began. With a custom ad display or burned-in\n * ads, the content player state hasn't been modified and so no\n * restoration is required\n */\n function hasSrcChanged(player, snapshot) {\n if (player.src()) {\n return player.src() !== snapshot.src;\n }\n // the player was configured through source element children\n return player.currentSrc() !== snapshot.src;\n }\n\n function restoreTracks() {\n var suppressedTracks = snapshot.suppressedTracks;\n suppressedTracks.forEach(function(trackSnapshot) {\n trackSnapshot.track.mode = trackSnapshot.mode;\n });\n }\n\n /**\n * Determine if the video element has loaded enough of the snapshot source\n * to be ready to apply the rest of the state\n */\n function tryToResume() {\n if (playerUtils.isReadyToResume(tech)) {\n // if some period of the video is seekable, resume playback\n return resume();\n }\n\n // delay a bit and then check again unless we're out of attempts\n if (attempts--) {\n setTimeout(tryToResume, 50);\n } else {\n (function() {\n try {\n resume();\n } catch (e) {\n videojs.log.warn('Failed to resume the content after an advertisement', e);\n }\n })();\n }\n\n\n /*** Local functions ***/\n function resume() {\n player.currentTime(snapshot.currentTime);\n\n if (snapshot.playing) {\n player.play();\n }\n }\n\n }\n };\n\n playerUtils.isReadyToResume = function(tech) {\n if (tech.readyState > 1) {\n // some browsers and media aren't \"seekable\".\n // readyState greater than 1 allows for seeking without exceptions\n return true;\n }\n\n if (tech.seekable === undefined) {\n // if the tech doesn't expose the seekable time ranges, try to\n // resume playback immediately\n return true;\n }\n\n if (tech.seekable.length > 0) {\n // if some period of the video is seekable, resume playback\n return true;\n }\n\n return false;\n };\n\n /**\n * This function prepares the player to display ads.\n * Adding convenience events like the 'vast.firsPlay' that gets fired when the video is first played\n * and ads the blackPoster to the player to prevent content from being displayed before the preroll ad.\n *\n * @param player\n */\n playerUtils.prepareForAds = function(player, disableMonkeyPatchPlayerApi) {\n\n var blackPoster = player.addChild('blackPoster');\n var _firstPlay = true;\n var volumeSnapshot;\n\n // VID-1955 Causes Interference with Waterfall playback\n // VIDLA-853 Causes Interference with Mobile App playback\n if (!disableMonkeyPatchPlayerApi) {\n monkeyPatchPlayerApi();\n }\n\n player.on('play', tryToTriggerFirstPlay);\n player.on('vast.reset', resetFirstPlay); //Every time we change the sources we reset the first play.\n player.on('vast.firstPlay', restoreContentVolume);\n player.on('error', hideBlackPoster); //If there is an error in the player we remove the blackposter to show the err msg\n player.on('vast.adStart', hideBlackPoster);\n player.on('vast.adsCancel', hideBlackPoster);\n player.on('vast.adError', hideBlackPoster);\n player.on('vast.adStart', addStyles);\n player.on('vast.adEnd', removeStyles);\n player.on('vast.adsCancel', removeStyles);\n\n /*** Local Functions ***/\n\n /**\n What this function does is ugly and horrible and I should think twice before calling myself a good developer. With that said,\n it is the best solution I could find to mute the video until the 'play' event happens (on mobile devices) and the plugin can decide whether\n to play the ad or not.\n\n We also need this monkeypatch to be able to pause and resume an ad using the player's API\n\n If you have a better solution please do tell me.\n */\n function monkeyPatchPlayerApi() {\n\n /**\n * Monkey patch needed to handle firstPlay and resume of playing ad.\n *\n * @param prepareForAds necessary flag to prevent infinite loop when you are restoring a VAST ad.\n * @returns {player}\n */\n var origPlay = player.play;\n player.play = function(callOrigPlay) {\n\n\n\n\n if (isFirstPlay()) {\n firstPlay.call(this);\n } else {\n resume.call(this, callOrigPlay);\n }\n\n return this;\n\n /*** local functions ***/\n function firstPlay() {\n\n\n if (!isIPhone()) {\n volumeSnapshot = saveVolumeSnapshot();\n player.muted(true);\n }\n // Do not call play on the video element instead just trigger startAd and the creative will call play as it is suppose to.\n // VID-2515 Force the enabling of the spinner. As we do not call actual play the wait state to trigger spinner never gets activated until its too late.\n player.addClass('vjs-waiting');\n player.trigger('firstplay');\n player.trigger('play');\n }\n\n function resume(callOrigPlay) {\n if (isAdPlaying() && !callOrigPlay) {\n player.vast.adUnit.resumeAd();\n } else {\n origPlay.apply(this, arguments);\n }\n }\n };\n\n\n /**\n * Needed monkey patch to handle pause of playing ad.\n *\n * @param callOrigPlay necessary flag to prevent infinite loop when you are pausing a VAST ad.\n * @returns {player}\n */\n var origPause = player.pause;\n player.pause = function(callOrigPause) {\n if (isAdPlaying() && !callOrigPause) {\n player.vast.adUnit.pauseAd();\n } else {\n origPause.apply(this, arguments);\n }\n return this;\n };\n\n\n /**\n * Needed monkey patch to handle paused state of the player when ads are playing.\n *\n * @param callOrigPlay necessary flag to prevent infinite loop when you are pausing a VAST ad.\n * @returns {player}\n */\n var origPaused = player.paused;\n player.paused = function(callOrigPaused) {\n if (isAdPlaying() && !callOrigPaused) {\n return player.vast.adUnit.isPaused();\n }\n return origPaused.apply(this, arguments);\n };\n }\n\n function isAdPlaying() {\n return player.vast && player.vast.adUnit;\n }\n\n function tryToTriggerFirstPlay() {\n\n if (isFirstPlay()) {\n _firstPlay = false;\n player.trigger('vast.firstPlay');\n }\n }\n\n function resetFirstPlay() {\n _firstPlay = true;\n blackPoster.show();\n restoreContentVolume();\n }\n\n function isFirstPlay() {\n return _firstPlay;\n }\n\n function saveVolumeSnapshot() {\n return {\n muted: player.muted(),\n volume: player.volume()\n };\n }\n\n function restoreContentVolume() {\n if (volumeSnapshot) {\n player.currentTime(0);\n restoreVolumeSnapshot(volumeSnapshot);\n volumeSnapshot = null;\n }\n }\n\n function restoreVolumeSnapshot(snapshot) {\n if (isObject(snapshot)) {\n player.volume(snapshot.volume);\n player.muted(snapshot.muted);\n }\n }\n\n function hideBlackPoster() {\n if (!dom.hasClass(blackPoster.el(), 'vjs-hidden')) {\n blackPoster.hide();\n }\n }\n\n function addStyles() {\n dom.addClass(player.el(), 'vjs-ad-playing');\n }\n\n function removeStyles() {\n dom.removeClass(player.el(), 'vjs-ad-playing');\n }\n };\n\n /**\n * Remove the poster attribute from the video element tech, if present. When\n * reusing a video element for multiple videos, the poster image will briefly\n * reappear while the new source loads. Removing the attribute ahead of time\n * prevents the poster from showing up between videos.\n * @param {object} player The videojs player object\n */\n playerUtils.removeNativePoster = function(player) {\n var tech = player.el().querySelector('.vjs-tech');\n if (tech) {\n tech.removeAttribute('poster');\n }\n };\n\n /**\n * Helper function to listen to many events until one of them gets fired, then we\n * execute the handler and unsubscribe all the event listeners;\n *\n * @param player specific player from where to listen for the events\n * @param events array of events\n * @param handler function to execute once one of the events fires\n */\n playerUtils.once = function once(player, events, handler) {\n function listener() {\n handler.apply(null, arguments);\n\n events.forEach(function(event) {\n player.off(event, listener);\n });\n }\n\n events.forEach(function(event) {\n player.on(event, listener);\n });\n };\n\n ;\n 'use strict';\n\n /**\n * documentMode is an IE-only property\n * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx\n */\n var msie = document.documentMode;\n\n /**\n *\n * IMPORTANT NOTE: This function comes from angularJs and was originally called urlResolve\n * you can take a look at the original code here https://github.com/angular/angular.js/blob/master/src/ng/urlUtils.js\n *\n * Implementation Notes for non-IE browsers\n * ----------------------------------------\n * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM,\n * results both in the normalizing and parsing of the URL. Normalizing means that a relative\n * URL will be resolved into an absolute URL in the context of the application document.\n * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related\n * properties are all populated to reflect the normalized URL. This approach has wide\n * compatibility - Safari 1+, Mozilla 1+, Opera 7+,e etc. See\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n *\n * Implementation Notes for IE\n * ---------------------------\n * IE >= 8 and <= 10 normalizes the URL when assigned to the anchor node similar to the other\n * browsers. However, the parsed components will not be set if the URL assigned did not specify\n * them. (e.g. if you assign a.href = \"foo\", then a.protocol, a.host, etc. will be empty.) We\n * work around that by performing the parsing in a 2nd step by taking a previously normalized\n * URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the\n * properties such as protocol, hostname, port, etc.\n *\n * IE7 does not normalize the URL when assigned to an anchor node. (Apparently, it does, if one\n * uses the inner HTML approach to assign the URL as part of an HTML snippet -\n * http://stackoverflow.com/a/472729) However, setting img[src] does normalize the URL.\n * Unfortunately, setting img[src] to something like \"javascript:foo\" on IE throws an exception.\n * Since the primary usage for normalizing URLs is to sanitize such URLs, we can't use that\n * method and IE < 8 is unsupported.\n *\n * References:\n * http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n * http://url.spec.whatwg.org/#urlutils\n * https://github.com/angular/angular.js/pull/2902\n * http://james.padolsey.com/javascript/parsing-urls-with-the-dom/\n *\n * @kind function\n * @param {string} url The URL to be parsed.\n * @description Normalizes and parses a URL.\n * @returns {object} Returns the normalized URL as a dictionary.\n *\n * | member name | Description |\n * |---------------|----------------|\n * | href | A normalized version of the provided URL if it was not an absolute URL |\n * | protocol | The protocol including the trailing colon |\n * | host | The host and port (if the port is non-default) of the normalizedUrl |\n * | search | The search params, minus the question mark |\n * | hash | The hash string, minus the hash symbol\n * | hostname | The hostname\n * | port | The port, without \":\"\n * | pathname | The pathname, beginning with \"/\"\n *\n */\n\n var urlParsingNode = document.createElement(\"a\");\n\n function urlParts(url) {\n var href = url;\n\n if (msie) {\n // Normalize before parse. Refer Implementation Notes on why this is\n // done in two steps on IE.\n urlParsingNode.setAttribute(\"href\", href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: isNotEmptyString(urlParsingNode.port) ? urlParsingNode.port : 80,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname : '/' + urlParsingNode.pathname\n };\n }\n\n\n /**\n * This function accepts a query string (search part of a url) and returns a dictionary with\n * the different key value pairs\n * @param {string} qs queryString\n */\n function queryStringToObj(qs, cond) {\n var pairs, qsObj;\n\n cond = isFunction(cond) ? cond : function() {\n return true;\n };\n\n qs = qs.trim().replace(/^\\?/, '');\n pairs = qs.split('&');\n qsObj = {};\n\n forEach(pairs, function(pair) {\n var keyValue, key, value;\n if (pair !== '') {\n keyValue = pair.split('=');\n key = keyValue[0];\n value = keyValue[1];\n if (cond(key, value)) {\n qsObj[key] = value;\n }\n }\n });\n\n return qsObj;\n }\n\n /**\n * This function accepts an object and serializes it into a query string without the leading '?'\n * @param obj\n * @returns {string}\n */\n function objToQueryString(obj) {\n var pairs = [];\n forEach(obj, function(value, key) {\n pairs.push(key + '=' + value);\n });\n return pairs.join('&');\n }\n\n\n ;\n var xml = {};\n\n xml.strToXMLDoc = function strToXMLDoc(stringContainingXMLSource) {\n //IE 8\n if (typeof window.DOMParser === 'undefined') {\n var xmlDocument = new ActiveXObject('Microsoft.XMLDOM');\n xmlDocument.async = false;\n xmlDocument.loadXML(stringContainingXMLSource);\n return xmlDocument;\n }\n\n return parseString(stringContainingXMLSource);\n\n function parseString(stringContainingXMLSource) {\n var parser = new DOMParser();\n var parsedDocument;\n\n //Note: This try catch is to deal with the fact that on IE parser.parseFromString does throw an error but the rest of the browsers don't.\n try {\n parsedDocument = parser.parseFromString(stringContainingXMLSource, \"application/xml\");\n\n if (isParseError(parsedDocument) || isEmptyString(stringContainingXMLSource)) {\n throw new Error();\n }\n } catch (e) {\n throw new Error(\"xml.strToXMLDOC: Error parsing the string: '\" + stringContainingXMLSource + \"'\");\n }\n\n return parsedDocument;\n }\n\n function isParseError(parsedDocument) {\n try { // parser and parsererrorNS could be cached on startup for efficiency\n var parser = new DOMParser(),\n errorneousParse = parser.parseFromString('INVALID', 'text/xml'),\n parsererrorNS = errorneousParse.getElementsByTagName(\"parsererror\")[0].namespaceURI;\n\n if (parsererrorNS === 'http://www.w3.org/1999/xhtml') {\n // In PhantomJS the parseerror element doesn't seem to have a special namespace, so we are just guessing here :(\n return parsedDocument.getElementsByTagName(\"parsererror\").length > 0;\n }\n\n return parsedDocument.getElementsByTagNameNS(parsererrorNS, 'parsererror').length > 0;\n } catch (e) {\n //Note on IE parseString throws an error by itself and it will never reach this code. Because it will have failed before\n }\n }\n };\n\n xml.parseText = function parseText(sValue) {\n if (/^\\s*$/.test(sValue)) {\n return null; }\n if (/^(?:true|false)$/i.test(sValue)) {\n return sValue.toLowerCase() === \"true\"; }\n if (isFinite(sValue)) {\n return parseFloat(sValue); }\n if (isISO8601(sValue)) {\n return new Date(sValue); }\n return sValue.trim();\n };\n\n xml.JXONTree = function JXONTree(oXMLParent) {\n var parseText = xml.parseText;\n\n //The document object is an especial object that it may miss some functions or attrs depending on the browser.\n //To prevent this problem with create the JXONTree using the root childNode which is a fully fleshed node on all supported\n //browsers.\n if (oXMLParent.documentElement) {\n return new xml.JXONTree(oXMLParent.documentElement);\n }\n\n if (oXMLParent.hasChildNodes()) {\n var sCollectedTxt = \"\";\n for (var oNode, sProp, vContent, nItem = 0; nItem < oXMLParent.childNodes.length; nItem++) {\n oNode = oXMLParent.childNodes.item(nItem);\n /*jshint bitwise: false*/\n if ((oNode.nodeType - 1 | 1) === 3) { sCollectedTxt += oNode.nodeType === 3 ? oNode.nodeValue.trim() : oNode.nodeValue; } else if (oNode.nodeType === 1 && !oNode.prefix) {\n sProp = decapitalize(oNode.nodeName);\n vContent = new xml.JXONTree(oNode);\n if (this.hasOwnProperty(sProp)) {\n if (this[sProp].constructor !== Array) { this[sProp] = [this[sProp]]; }\n this[sProp].push(vContent);\n } else { this[sProp] = vContent; }\n }\n }\n if (sCollectedTxt) { this.keyValue = parseText(sCollectedTxt); }\n }\n\n //IE8 Stupid fix\n var hasAttr = typeof oXMLParent.hasAttributes === 'undefined' ? oXMLParent.attributes.length > 0 : oXMLParent.hasAttributes();\n if (hasAttr) {\n var oAttrib;\n for (var nAttrib = 0; nAttrib < oXMLParent.attributes.length; nAttrib++) {\n oAttrib = oXMLParent.attributes.item(nAttrib);\n this[\"@\" + decapitalize(oAttrib.name)] = parseText(oAttrib.value.trim());\n }\n }\n };\n\n xml.JXONTree.prototype.attr = function(attr) {\n return this['@' + decapitalize(attr)];\n };\n\n xml.toJXONTree = function toJXONTree(xmlString) {\n var xmlDoc = xml.strToXMLDoc(xmlString);\n return new xml.JXONTree(xmlDoc);\n };\n\n /**\n * Helper function to extract the keyvalue of a JXONTree obj\n *\n * @param xmlObj {JXONTree}\n * return the key value or undefined;\n */\n xml.keyValue = function getKeyValue(xmlObj) {\n if (xmlObj) {\n return xmlObj.keyValue;\n }\n return undefined;\n };\n\n xml.attr = function getAttrValue(xmlObj, attr) {\n if (xmlObj) {\n return xmlObj['@' + decapitalize(attr)];\n }\n return undefined;\n };\n\n xml.encode = function encodeXML(str) {\n return str.replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n };\n\n xml.decode = function decodeXML(str) {\n return str.replace(/'/g, \"'\")\n .replace(/"/g, '\"')\n .replace(/>/g, '>')\n .replace(/</g, '<')\n .replace(/&/g, '&');\n };;\n\n //minthe : initalize vastClient\n vjs.plugin('vastClient', function VASTPlugin(options) {\n\n var snapshot;\n var player = this;\n var vast = new VASTClient();\n var adsCanceled = false;\n var defaultOpts = {\n // maximum amount of time in ms to wait to receive `adsready` from the ad\n // implementation after play has been requested. Ad implementations are\n // expected to load any dynamic libraries and make any requests to determine\n // ad policies for a video during this time.\n timeout: 500,\n\n //TODO:finish this IOS FIX\n //Whenever you play an add on IOS, the native player kicks in and we loose control of it. On very heavy pages the 'play' event\n // May occur after the video content has already started. This is wrong if you want to play a preroll ad that needs to happen before the user\n // starts watching the content. To prevent this usec\n iosPrerollCancelTimeout: 2000,\n\n // maximun amount of time for the ad to actually start playing. If this timeout gets\n // triggered the ads will be cancelled\n adCancelTimeout: 5000,\n\n // Boolean flag that configures the player to play a new ad before the user sees the video again\n // the current video\n playAdAlways: false,\n\n // Flag to enable or disable the ads by default.\n adsEnabled: true,\n\n // Boolean flag to enable or disable the resize with window.resize or orientationchange\n autoResize: true,\n\n // Path to the VPAID flash ad's loader\n vpaidFlashLoaderPath: '/VPAIDFlash.swf',\n\n //Boolean flag to enable/disable Controls on mouse over/out.\n disableControlsOnMouseover: false,\n\n initialAudio: 'off',\n\n overlayPlayer: false,\n\n mobileSDK: false,\n\n controlBarPosition: \"below\"\n };\n\n var settings = extend({}, defaultOpts, options || {});\n\n if (isUndefined(settings.adTagUrl) && isDefined(settings.url)) {\n settings.adTagUrl = settings.url;\n }\n\n if (isString(settings.adTagUrl)) {\n settings.adTagUrl = echoFn(settings.adTagUrl);\n }\n\n if (isDefined(settings.adTagXML) && !isFunction(settings.adTagXML)) {\n return trackAdError(new VASTError('on VideoJS VAST plugin, the passed adTagXML option does not contain a function'));\n }\n\n if (!isDefined(settings.adTagUrl) && !isFunction(settings.adTagXML)) {\n return trackAdError(new VASTError('on VideoJS VAST plugin, missing adTagUrl on options object'));\n }\n //VIDLA-1491 Disabling for iOS. Few creatives such as Mediamind(Bemruda) and Moat create playback problems\n var disableForOverlay = settings.overlayPlayer && isIDevice();\n var disableMonkeyPatchPlayerApi = disableForOverlay || settings.mobileSDK ;\n playerUtils.prepareForAds(player, disableMonkeyPatchPlayerApi);\n if (settings.playAdAlways) {\n // No matter what happens we play a new ad before the user sees the video again.\n player.on('vast.contentEnd', function() {\n setTimeout(function() {\n player.trigger('vast.reset');\n }, 0);\n });\n }\n\n player.on('vast.firstPlay', tryToPlayPrerollAd);\n\n player.on('vast.reset', function() {\n //If we are reseting the plugin, we don't want to restore the content\n snapshot = null;\n cancelAds();\n });\n\n player.vast = {\n isEnabled: function() {\n return settings.adsEnabled;\n },\n\n enable: function() {\n settings.adsEnabled = true;\n },\n\n disable: function() {\n settings.adsEnabled = false;\n }\n };\n\n if (settings.loggerCallback) {\n logger = settings.loggerCallback;\n } else {\n logger = console;\n }\n if (settings.terminateUnresponsiveVPAIDCreative) {\n timer.killUnresponsiveCreative = true;\n }\n if (settings.adCancelTimeout) {\n timer.adCancelTimeout = settings.adCancelTimeout;\n }\n\n var vastResponse = getAnVastXml();\n var adIntegrator = isVPAID(vastResponse) ? new VPAIDIntegrator(player, settings) : new VASTIntegrator(player);\n\n if (settings.delayExpandUntilVPAIDInit) {\n checkAd(); //minthe : invoke init method of vpaid creative here in order to check valid ad, at the end of this checkAd process it will dispatch custom event which is called \"an.readytogovpaid\"\n }\n\n return player.vast;\n\n\n\n /**** Local functions ****/\n function tryToPlayPrerollAd() {\n //We remove the poster to prevent flickering whenever the content starts playing\n playerUtils.removeNativePoster(player);\n\n playerUtils.once(player, ['vast.adsCancel', 'vast.adEnd'], function() {\n removeAdUnit();\n restoreVideoContent();\n });\n\n async.waterfall([\n checkAdsEnabled,\n preparePlayerForAd,\n playPrerollAd\n ], function(error, response) {\n if (error) {\n trackAdError(error, response);\n } else {\n player.trigger('vast.adEnd');\n }\n });\n\n /*** Local functions ***/\n\n function removeAdUnit() {\n if (player.vast && player.vast.adUnit) {\n player.vast.adUnit = null; //We remove the adUnit\n }\n }\n\n function restoreVideoContent() {\n setupContentEvents();\n if (snapshot) {\n playerUtils.restorePlayerSnapshot(player, snapshot);\n snapshot = null;\n }\n }\n\n function setupContentEvents() {\n playerUtils.once(player, ['playing', 'vast.reset', 'vast.firstPlay'], function(evt) {\n if (evt.type !== 'playing') {\n return;\n }\n\n player.trigger('vast.contentStart');\n\n playerUtils.once(player, ['ended', 'vast.reset', 'vast.firstPlay'], function(evt) {\n if (evt.type === 'ended') {\n player.trigger('vast.contentEnd');\n }\n });\n });\n }\n\n function checkAdsEnabled(next) {\n if (settings.adsEnabled) {\n return next(null);\n }\n next(new VASTError('Ads are not enabled'));\n }\n\n function preparePlayerForAd(next) {\n if (canPlayPrerollAd()) {\n snapshot = playerUtils.getPlayerSnapshot(player);\n addSpinnerIcon();\n next(null);\n } else {\n next(new VASTError('video content has been playing before preroll ad'));\n }\n }\n\n function canPlayPrerollAd() {\n return !isIPhone() || player.currentTime() <= settings.iosPrerollCancelTimeout;\n }\n\n function addSpinnerIcon() {\n dom.addClass(player.el(), 'vjs-vast-ad-loading');\n playerUtils.once(player, ['vast.adStart', 'vast.adsCancel'], removeSpinnerIcon);\n }\n\n function removeSpinnerIcon() {\n //IMPORTANT NOTE: We remove the spinnerIcon asynchronously to give time to the browser to start the video.\n // If we remove it synchronously we see a flash of the content video before the ad starts playing.\n setTimeout(function() {\n dom.removeClass(player.el(), 'vjs-vast-ad-loading');\n }, 100);\n }\n\n }\n\n function cancelAds() {\n player.trigger('vast.adsCancel');\n adsCanceled = true;\n }\n\n function playPrerollAd(callback) {\n async.waterfall([\n //getVastResponse,//minthe : comment out, we're not using mail online's vast parser and loader\n playAd\n ], callback);\n }\n\n function getVastResponse(callback) {\n vast.getVASTResponse(settings.adTagUrl ? settings.adTagUrl() : settings.adTagXML, callback);\n }\n\n function getAnVastXml() { //minthe : override vast response to use jsVpaidUrl coming from videoplayer framework\n var vastResponse = new VASTResponse();\n vastResponse._linearAdded = true;\n vastResponse.ads = [{\n \"id\": 1234567,\n \"inLine\": {\n \"adTitle\": \"\",\n \"adSystem\": \"\",\n \"impressions\": [],\n \"creatives\": [{\n \"sequence\": 1,\n \"linear\": {\n \"duration\": 13000,\n \"mediaFiles\": [{\n \"src\": settings.jsVpaidUrl,\n \"type\": \"application/javascript\",\n \"apiFramework\": \"VPAID\"\n }],\n \"skipoffset\": null,\n }\n }, { \"sequence\": 1 }],\n \"description\": \"Vpaid Linear Video Ad\",\n \"surveys\": []\n }\n }];\n vastResponse.errorURLMacros = [];\n vastResponse.impressions = [];\n vastResponse.customClicks = [];\n vastResponse.mediaFiles = [{\n \"src\": settings.jsVpaidUrl,\n \"type\": \"application/javascript\",\n \"apiFramework\": \"VPAID\"\n }];\n vastResponse.clickThrough = settings.clickUrl;\n vastResponse.adTitle = \"\";\n vastResponse.adParameters = settings.adParameters;\n\n return vastResponse;\n }\n\n function playAd(vastResponse, callback) {\n\n //minthe : override vast response to use jsVpaidUrl coming from videoplayer framework\n vastResponse = getAnVastXml();\n\n //TODO: Find a better way to stop the play. The 'playPrerollWaterfall' ends in an inconsistent situation\n //If the state is not 'preroll?' it means the ads were canceled therefore, we break the waterfall\n if (adsCanceled) {\n return;\n }\n\n var adFinished = false;\n\n //comment out for VID-1359\n //if (isIDevice()) {\n //preventManualProgress();\n //}\n callback = callback || trackAdError;\n player.vast.adUnit = adIntegrator.playAd(vastResponse, callback);\n\n //comment out for VID-1359\n //function preventManualProgress() {\n // //IOS video clock is very unreliable and we need a 3 seconds threshold to ensure that the user forwarded/rewound the ad\n // var PROGRESS_THRESHOLD = 3;\n // var previousTime = 0;\n // var tech = player.el().querySelector('.vjs-tech');\n // var skipad_attempts = 0;\n //\n // player.on('timeupdate', adTimeupdateHandler);\n // playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel', 'vast.adError'], stopPreventManualProgress);\n //\n // /*** Local functions ***/\n // function adTimeupdateHandler() {\n // var currentTime = player.currentTime();\n // var progressDelta = Math.abs(currentTime - previousTime);\n //\n // if (progressDelta > PROGRESS_THRESHOLD) {\n // skipad_attempts += 1;\n // if (skipad_attempts >= 2) {\n // player.pause();\n // }\n // player.currentTime(previousTime);\n // } else {\n // previousTime = currentTime;\n // }\n // }\n //\n // function stopPreventManualProgress() {\n // player.off('timeupdate', adTimeupdateHandler);\n // }\n //}\n }\n\n //minthe : checkAd to check vpaid ad is ready to go\n function checkAd(vastResponse, callback) {\n vastResponse = getAnVastXml();\n callback = callback || trackAdError;\n player.vast.adUnit = adIntegrator.playAd(vastResponse, callback, true);\n }\n\n function trackAdError(error, vastResponse) {\n if (!error) return;\n player.trigger({ type: 'vast.adError', error: error });\n cancelAds();\n if (console && console.log) {\n console.log('AD ERROR:', error.message, error, vastResponse);\n }\n }\n\n function isVPAID(vastResponse) {\n var i, len;\n var mediaFiles = vastResponse.mediaFiles;\n for (i = 0, len = mediaFiles.length; i < len; i++) {\n if (vastUtil.isVPAID(mediaFiles[i])) {\n return true;\n }\n }\n return false;\n }\n });\n\n ;\n vjs.AdsLabel = vjs.Component.extend({\n /** @constructor */\n init: function(player, options) {\n vjs.Component.call(this, player, options);\n\n var that = this;\n\n // We asynchronously reposition the ads label element\n setTimeout(function() {\n var currentTimeComp = player.controlBar && (player.controlBar.getChild(\"timerControls\") || player.controlBar.getChild(\"currentTimeDisplay\"));\n if (currentTimeComp) {\n player.controlBar.el().insertBefore(that.el(), currentTimeComp.el());\n }\n dom.removeClass(that.el(), 'vjs-label-hidden');\n }, 0);\n }\n });\n\n vjs.AdsLabel.prototype.createEl = function() {\n return vjs.Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-ads-label vjs-control vjs-label-hidden',\n innerHTML: 'Advertisement'\n });\n };;\n /**\n * The component that shows a black screen until the ads plugin has decided if it can or it can not play the ad.\n *\n * Note: In case you wonder why instead of this black poster we don't just show the spinner loader.\n * IOS devices do not work well with animations and the browser chrashes from time to time That is why we chose to\n * have a secondary black poster.\n *\n * It also makes it much more easier for the users of the plugin since it does not change the default behaviour of the\n * spinner and the player works the same way with and without the plugin.\n *\n * @param {vjs.Player|Object} player\n * @param {Object=} options\n * @constructor\n */\n vjs.BlackPoster = vjs.Component.extend({\n /** @constructor */\n init: function(player, options) {\n vjs.Component.call(this, player, options);\n\n var posterImg = player.getChild('posterImage');\n\n //We need to do it asynchronously to be sure that the black poster el is on the dom.\n setTimeout(function() {\n if (posterImg) {\n player.el().insertBefore(this.el(), posterImg.el());\n }\n }.bind(this), 0);\n }\n });\n\n /**\n * Create the black poster div element\n * @return {Element}\n */\n vjs.BlackPoster.prototype.createEl = function() {\n return vjs.createEl('div', {\n className: 'vjs-black-poster'\n });\n };;\n\n function VPAIDAdUnitWrapper(vpaidAdUnit, opts) {\n if (!(this instanceof VPAIDAdUnitWrapper)) {\n return new VPAIDAdUnitWrapper(vpaidAdUnit, opts);\n }\n sanityCheck(vpaidAdUnit, opts);\n\n this.options = extend({}, opts);\n\n this._adUnit = vpaidAdUnit;\n this._adLoaded = false;\n this._adStopped = false;\n this._adStarted = false;\n this._adSkipped = false;\n\n /*** Local Functions ***/\n function sanityCheck(adUnit, opts) {\n if (!adUnit || !VPAIDAdUnitWrapper.checkVPAIDInterface(adUnit)) {\n throw new VASTError('on VPAIDAdUnitWrapper, the passed VPAID adUnit does not fully implement the VPAID interface');\n }\n\n if (!isObject(opts)) {\n throw new VASTError(\"on VPAIDAdUnitWrapper, expected options hash but got '\" + opts + \"'\");\n }\n\n if (!(\"adCancelTimeout\" in opts) || !isNumber(opts.adCancelTimeout)) {\n throw new VASTError(\"on VPAIDAdUnitWrapper, expected adCancelTimeout in options\");\n }\n }\n }\n\n VPAIDAdUnitWrapper.checkVPAIDInterface = function checkVPAIDInterface(VPAIDAdUnit) {\n //NOTE: skipAd is not part of the method list because it only appears in VPAID 2.0 and we support VPAID 1.0\n var VPAIDInterfaceMethods = [\n 'handshakeVersion', 'initAd', 'startAd', 'stopAd', 'resizeAd', 'pauseAd', 'expandAd', 'collapseAd'\n ];\n\n for (var i = 0, len = VPAIDInterfaceMethods.length; i < len; i++) {\n if (!VPAIDAdUnit || !isFunction(VPAIDAdUnit[VPAIDInterfaceMethods[i]])) {\n return false;\n }\n }\n\n\n return canSubscribeToEvents(VPAIDAdUnit) && canUnsubscribeFromEvents(VPAIDAdUnit);\n\n /*** Local Functions ***/\n\n function canSubscribeToEvents(adUnit) {\n return isFunction(adUnit.subscribe) || isFunction(adUnit.addEventListener) || isFunction(adUnit.on);\n }\n\n function canUnsubscribeFromEvents(adUnit) {\n return isFunction(adUnit.unsubscribe) || isFunction(adUnit.removeEventListener) || isFunction(adUnit.off);\n\n }\n };\n\n VPAIDAdUnitWrapper.prototype.adUnitAsyncCall = function() {\n var args = arrayLikeObjToArray(arguments);\n var method = args.shift();\n var cb = args.pop();\n var timeoutId;\n\n sanityCheck(method, cb, this._adUnit);\n args.push(wrapCallback());\n\n this._adUnit[method].apply(this._adUnit, args);\n timeoutId = setTimeout(function() {\n timeoutId = null;\n cb(new VASTError(\"on VPAIDAdUnitWrapper, timeout while waiting for a response on call '\" + method + \"'\"));\n cb = noop;\n }, this.options.adCancelTimeout);\n\n /*** Local functions ***/\n function sanityCheck(method, cb, adUnit) {\n if (!isString(method) || !isFunction(adUnit[method])) {\n throw new VASTError(\"on VPAIDAdUnitWrapper.adUnitAsyncCall, invalid method name\");\n }\n\n if (!isFunction(cb)) {\n throw new VASTError(\"on VPAIDAdUnitWrapper.adUnitAsyncCall, missing callback\");\n }\n }\n\n function wrapCallback() {\n return function() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n cb.apply(this, arguments);\n };\n }\n };\n\n VPAIDAdUnitWrapper.prototype.on = function(evtName, handler) {\n var addEventListener = this._adUnit.addEventListener || this._adUnit.subscribe || this._adUnit.on;\n addEventListener.call(this._adUnit, evtName, handler);\n };\n\n VPAIDAdUnitWrapper.prototype.off = function(evtName, handler) {\n var removeEventListener = this._adUnit.removeEventListener || this._adUnit.unsubscribe || this._adUnit.off;\n removeEventListener.call(this._adUnit, evtName, handler);\n };\n\n //minthe : waitForEvent\n VPAIDAdUnitWrapper.prototype.waitForEvent = function(evtName, cb, context) {\n var timeoutId;\n sanityCheck(evtName, cb);\n context = context || null;\n\n this.on(evtName, responseListener);\n\n timeoutId = setTimeout(function() {\n cb(new VASTError(\"on VPAIDAdUnitWrapper.waitForEvent, timeout while waiting for event '\" + evtName + \"'\"));\n timeoutId = null;\n cb = noop;\n }, this.options.adCancelTimeout);\n\n /*** Local functions ***/\n function sanityCheck(evtName, cb) {\n if (!isString(evtName)) {\n throw new VASTError(\"on VPAIDAdUnitWrapper.waitForEvent, missing evt name\");\n }\n\n if (!isFunction(cb)) {\n throw new VASTError(\"on VPAIDAdUnitWrapper.waitForEvent, missing callback\");\n }\n }\n\n function responseListener() {\n var args = arrayLikeObjToArray(arguments);\n if (timeoutId) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n\n args.unshift(null);\n cb.apply(context, args);\n }\n };\n\n // VPAID METHODS\n VPAIDAdUnitWrapper.prototype.handshakeVersion = function(version, cb) {\n this.adUnitAsyncCall('handshakeVersion', version, cb);\n };\n\n /* jshint maxparams:6 */\n VPAIDAdUnitWrapper.prototype.initAd = function(width, height, viewMode, desiredBitrate, adUnitData, environmentVars, cb) {\n //minthe : AdLoaded\n logger.info('Calling VPAID initAd, time remaining =' + profile.getRemainingTime('initAd'));\n this.waitForEvent('AdLoaded', cb);\n\n //minthe VID-1580\n this._adUnit.initAd(width, height, viewMode, desiredBitrate, adUnitData, environmentVars);\n\n };\n\n VPAIDAdUnitWrapper.prototype.resizeAd = function(width, height, viewMode, cb) {\n // NOTE: AdSizeChange event is only supported on VPAID 2.0 so for the moment we are not going to use it\n // and will assume that everything is fine after the async call\n this.adUnitAsyncCall('resizeAd', width, height, viewMode, cb);\n };\n\n VPAIDAdUnitWrapper.prototype.startAd = function(cb) {\n logger.info('Calling VPAID startAd, time remaining =' + profile.getRemainingTime('startAd'));\n this.waitForEvent('AdStarted', cb);\n this._adUnit.startAd();\n };\n\n VPAIDAdUnitWrapper.prototype.stopAd = function(cb) {\n logger.info(' Calling VPAID stopAd');\n this.waitForEvent('AdStopped', cb);\n this._adUnit.stopAd();\n };\n\n VPAIDAdUnitWrapper.prototype.pauseAd = function(cb) {\n if (this._adStopped || !this._adStarted) return;\n logger.log(' Calling VPAID pauseAd');\n this._adUnit.pauseAd();\n timer.startKillTimeout(this._adUnit);\n };\n\n VPAIDAdUnitWrapper.prototype.resumeAd = function(cb) {\n if (this._adStopped || !this._adStarted) return;\n logger.log(' Calling VPAID resumeAd');\n this.waitForEvent('AdPlaying', cb);\n this._adUnit.resumeAd();\n timer.startKillTimeout(this._adUnit);\n };\n\n VPAIDAdUnitWrapper.prototype.expandAd = function(cb) {\n if (this._adStopped) return;\n this.waitForEvent('AdExpandedChange', cb);\n this._adUnit.expandAd();\n };\n\n VPAIDAdUnitWrapper.prototype.collapseAd = function(cb) {\n if (this._adStopped) return;\n this.waitForEvent('AdExpandedChange', cb);\n this._adUnit.collapseAd();\n };\n\n VPAIDAdUnitWrapper.prototype.skipAd = function(cb) {\n var skipAnyway = function() {\n if(!this._adSkipped){\n logger.debug('VPAID Creative has ' + ((this._adStopped) ? 'already stopped' : 'not responded with AdSkipped') + ': Forcing AdSkipped');\n this._adSkipped = true;\n this.player.trigger('vpaid.AdSkipped');\n }\n }\n\n if (this._adStopped) {\n // VIDLA-990 VPAID Ads that have already stopped should be skipped anyway (to support collapsing ad unit when disableCollapse is on)\n skipAnyway.apply(this);\n return;\n }\n logger.log('Calling VPAID skipAd');\n if (cb) {\n this.waitForEvent('AdSkipped', cb);\n }\n this._adUnit.skipAd();\n //VIDLA-442 VPAID Ads that don't respond to skipAd should be skipped anyway\n setTimeout(function() {\n skipAnyway.apply(this);\n }.bind(this), 500);\n };\n\n //VPAID property getters\n [\n 'adLinear',\n 'adWidth',\n 'adHeight',\n 'adExpanded',\n 'adSkippableState',\n 'adRemainingTime',\n 'adDuration',\n 'adVolume',\n 'adCompanions',\n 'adIcons'\n ].forEach(function(property) {\n var getterName = 'get' + capitalize(property);\n\n VPAIDAdUnitWrapper.prototype[getterName] = function(cb) {\n this.adUnitAsyncCall(getterName, cb);\n };\n });\n\n //VPAID property setters\n VPAIDAdUnitWrapper.prototype.setAdVolume = function(volume, cb) {\n if (this._adStopped) return;\n logger.debug('Calling VPAID setAdVolume :: volume :' + volume);\n this.adUnitAsyncCall('setAdVolume', volume, cb);\n };\n\n ;\n\n function VPAIDFlashTech(mediaFile, settings) {\n if (!(this instanceof VPAIDFlashTech)) {\n return new VPAIDFlashTech(mediaFile);\n }\n sanityCheck(mediaFile);\n this.name = 'vpaid-flash';\n this.mediaFile = mediaFile;\n this.containerEl = null;\n this.vpaidFlashClient = null;\n this.settings = settings;\n\n /*** local functions ***/\n function sanityCheck(mediaFile) {\n if (!mediaFile || !isString(mediaFile.src)) {\n throw new VASTError('on VPAIDFlashTech, invalid MediaFile');\n }\n }\n }\n\n VPAIDFlashTech.supports = function(type) {\n return type === 'application/x-shockwave-flash' && VPAIDFLASHClient.isSupported();\n };\n\n VPAIDFlashTech.prototype.loadAdUnit = function loadFlashCreative(containerEl, objectEl, callback) {\n var that = this;\n var flashClientOpts = this.settings && this.settings.vpaidFlashLoaderPath ? { data: this.settings.vpaidFlashLoaderPath } : undefined;\n sanityCheck(containerEl, callback);\n\n this.containerEl = containerEl;\n this.vpaidFlashClient = new VPAIDFLASHClient(containerEl, function(error) {\n if (error) {\n return callback(error);\n }\n\n that.vpaidFlashClient.loadAdUnit(that.mediaFile.src, callback);\n }, flashClientOpts);\n\n /*** Local Functions ***/\n function sanityCheck(container, cb) {\n\n if (!dom.isDomElement(container)) {\n throw new VASTError('on VPAIDFlashTech.loadAdUnit, invalid dom container element');\n }\n\n if (!isFunction(cb)) {\n throw new VASTError('on VPAIDFlashTech.loadAdUnit, missing valid callback');\n }\n }\n };\n\n VPAIDFlashTech.prototype.unloadAdUnit = function() {\n if (this.vpaidFlashClient) {\n try {\n this.vpaidFlashClient.destroy();\n } catch (e) {\n if (console && isFunction(console.log)) {\n console.log('VAST ERROR: trying to unload the VPAID adunit');\n }\n }\n this.vpaidFlashClient = null;\n }\n\n if (this.containerEl) {\n dom.remove(this.containerEl);\n this.containerEl = null;\n }\n };\n\n ;\n\n function VPAIDHTML5Tech(mediaFile) {\n\n if (!(this instanceof VPAIDHTML5Tech)) {\n return new VPAIDHTML5Tech(mediaFile);\n }\n\n sanityCheck(mediaFile);\n\n this.name = 'vpaid-html5';\n this.containerEl = null;\n this.videoEl = null;\n this.vpaidHTMLClient = null;\n\n this.mediaFile = mediaFile;\n\n function sanityCheck(mediaFile) {\n if (!mediaFile || !isString(mediaFile.src)) {\n throw new VASTError(VPAIDHTML5Tech.INVALID_MEDIA_FILE);\n }\n }\n }\n\n VPAIDHTML5Tech.supports = function(type) {\n return !isOldIE() && type === 'application/javascript';\n };\n\n VPAIDHTML5Tech.prototype.loadAdUnit = function loadAdUnit(containerEl, videoEl, callback) {\n sanityCheck(containerEl, videoEl, callback);\n\n this.containerEl = containerEl;\n this.videoEl = videoEl;\n this.vpaidHTMLClient = new VPAIDHTML5Client(containerEl, videoEl, {});\n this.vpaidHTMLClient.loadAdUnit(this.mediaFile.src, callback);\n\n\n\n function sanityCheck(container, video, cb) {\n if (!dom.isDomElement(container)) {\n throw new VASTError(VPAIDHTML5Tech.INVALID_DOM_CONTAINER_EL);\n }\n\n if (!dom.isDomElement(video) || video.tagName.toLowerCase() !== 'video') {\n throw new VASTError(VPAIDHTML5Tech.INVALID_DOM_CONTAINER_EL);\n }\n\n if (!isFunction(cb)) {\n throw new VASTError(VPAIDHTML5Tech.MISSING_CALLBACK);\n }\n }\n };\n\n VPAIDHTML5Tech.prototype.unloadAdUnit = function unloadAdUnit() {\n if (this.vpaidHTMLClient) {\n try {\n this.vpaidHTMLClient.destroy();\n } catch (e) {\n if (console && isFunction(console.log)) {\n console.log('VAST ERROR: trying to unload the VPAID adunit');\n }\n }\n\n this.vpaidHTMLClient = null;\n }\n\n if (this.containerEl) {\n dom.remove(this.containerEl);\n this.containerEl = null;\n }\n };\n\n var PREFIX = 'on VPAIDHTML5Tech';\n VPAIDHTML5Tech.INVALID_MEDIA_FILE = PREFIX + ', invalid MediaFile';\n VPAIDHTML5Tech.INVALID_DOM_CONTAINER_EL = PREFIX + ', invalid container HtmlElement';\n VPAIDHTML5Tech.INVALID_DOM_VIDEO_EL = PREFIX + ', invalid HTMLVideoElement';\n VPAIDHTML5Tech.MISSING_CALLBACK = PREFIX + ', missing valid callback';\n\n\n ;\n\n function VPAIDIntegrator(player, settings) {\n if (!(this instanceof VPAIDIntegrator)) {\n return new VPAIDIntegrator(player);\n }\n\n this.VIEW_MODE = {\n NORMAL: 'normal',\n FULLSCREEN: \"fullscreen\",\n THUMBNAIL: \"thumbnail\"\n };\n this.player = player;\n this.containerEl = createVPAIDContainerEl(player);\n this.options = {\n adCancelTimeout: 5000,\n VPAID_VERSION: '2.0'\n };\n this.settings = settings;\n this.volume = 1;\n this.initVolume = 1;\n if (this.settings.initialAudio === 'off') {\n logger.log(\"Initial audio off\");\n this.initVolume = 0;\n }\n this.initAdUnitCalled = false;\n this.initialisedAdUnit = null;\n this.initAdTimeout = false;\n /*** Local functions ***/\n\n function createVPAIDContainerEl() {\n var containerEl = document.createElement('div');\n dom.addClass(containerEl, 'VPAID-container');\n player.el().insertBefore(containerEl, player.controlBar.el());\n return containerEl;\n\n }\n this.EVENTS = [\n 'AdLoaded', 'AdStarted', 'AdStopped', 'AdSkipped', 'AdSkippableStateChange',\n 'AdSizeChange', 'AdLinearChange', 'AdDurationChange', 'AdExpandedChange',\n 'AdRemainingTimeChange', 'AdVolumeChange', 'AdImpression', 'AdVideoStart',\n 'AdVideoFirstQuartile', 'AdVideoMidpoint', 'AdVideoThirdQuartile',\n 'AdVideoComplete', 'AdClickThru', 'AdInteraction', 'AdUserAcceptInvitation',\n 'AdUserMinimize', 'AdUserClose', 'AdPaused', 'AdPlaying', 'AdLog', 'AdError'\n ];\n }\n\n //List of supported VPAID technologies\n VPAIDIntegrator.techs = [\n VPAIDFlashTech,\n VPAIDHTML5Tech\n ];\n\n //minthe : protoype.playAd\n VPAIDIntegrator.prototype.playAd = function playVPaidAd(vastResponse, callback, isTestPlay) {\n //flag to sperate logic for checking vpaid ad is valid\n isTestPlay = (isTestPlay && isTestPlay !== undefined ? isTestPlay : false);\n\n var that = this;\n var tech;\n var player = this.player;\n\n callback = callback || noop;\n if (!(vastResponse instanceof VASTResponse)) {\n return callback(new VASTError('on VASTIntegrator.playAd, missing required VASTResponse'));\n }\n\n tech = this._findSupportedTech(vastResponse, this.settings);\n dom.addClass(player.el(), 'vjs-vpaid-ad');\n\n player.on('vast.adsCancel', triggerVpaidAdEnd);\n player.one('vpaid.adEnd', function() {\n player.off('vast.adsCancel', triggerVpaidAdEnd);\n removeAdUnit();\n });\n\n if (tech) {\n\n //if it's test-play this routine will invoke initAd and return result to notify the creative is ready to go\n if (isTestPlay) {\n async.waterfall([\n function(next) {\n next(null, tech, vastResponse);\n },\n this._loadAdUnit.bind(this),\n this._initAdUnit.bind(this)\n ], function(error, adUnit, vastResponse) {\n if (error) {\n that._trackError(vastResponse);\n } else {\n player.trigger('an.readytogovpaid');\n }\n callback(error, vastResponse);\n });\n } else {\n var errorCallback = function(error, adUnit, vastResponse) {\n if (error) {\n that._trackError(vastResponse);\n }\n player.trigger('vpaid.adEnd');\n callback(error, vastResponse);\n };\n var taskList = [\n function(next) {\n next(null, that.initialisedAdUnit, vastResponse, true);\n },\n this._playAdUnit.bind(this)\n ];\n if (this.initialisedAdUnit) {\n async.waterfall(taskList, errorCallback);\n } else {\n if (this.initAdUnitCalled) {\n player.one(\"an.readytogovpaid\", function() {\n async.waterfall(taskList, errorCallback);\n });\n } else {\n async.waterfall([\n function(next) {\n next(null, tech, vastResponse);\n },\n this._loadAdUnit.bind(this),\n this._initAdUnit.bind(this),\n this._playAdUnit.bind(this)\n ], errorCallback);\n }\n }\n }\n\n this._adUnit = {\n _paused: true,\n _completed: false,\n type: 'VPAID',\n pauseAd: function() {\n player.trigger('vpaid.pauseAd');\n // VIDLA-1327-1329 Reverting back the pause which caused the regression.\n player.pause(true);\n },\n resumeAd: function() {\n player.trigger('vpaid.resumeAd');\n },\n isPaused: function() {\n return that.player.paused(true);\n },\n getSrc: function() {\n return tech.mediaFile;\n }\n };\n\n return this._adUnit;\n }\n\n callback(new VASTError('on VPAIDIntegrator.playAd, could not find a supported mediaFile'));\n\n return null;\n /*** Local functions ***/\n function triggerVpaidAdEnd() {\n player.trigger('vpaid.adEnd');\n }\n\n function removeAdUnit() {\n if (tech) {\n tech.unloadAdUnit();\n }\n dom.removeClass(player.el(), 'vjs-vpaid-ad');\n }\n };\n\n VPAIDIntegrator.prototype._findSupportedTech = function(vastResponse, settings) {\n if (!(vastResponse instanceof VASTResponse)) {\n return null;\n }\n\n var vpaidMediaFiles = vastResponse.mediaFiles.filter(vastUtil.isVPAID);\n var i, len, mediaFile, VPAIDTech;\n\n for (i = 0, len = vpaidMediaFiles.length; i < len; i += 1) {\n mediaFile = vpaidMediaFiles[i];\n VPAIDTech = findSupportedTech(mediaFile);\n if (VPAIDTech) {\n return new VPAIDTech(mediaFile, settings);\n }\n }\n\n return null;\n\n /*** Local functions ***/\n function findSupportedTech(mediafile) {\n var type = mediafile.type;\n var i, len, VPAIDTech;\n\n for (i = 0, len = VPAIDIntegrator.techs.length; i < len; i += 1) {\n VPAIDTech = VPAIDIntegrator.techs[i];\n if (VPAIDTech.supports(type)) {\n return VPAIDTech;\n }\n }\n return null;\n }\n };\n\n //minthe : loadAdUnit\n VPAIDIntegrator.prototype._loadAdUnit = function(tech, vastResponse, next) {\n if (this.initAdUnitCalled) {\n return;\n }\n var player = this.player;\n var vjsTechEl = player.el().querySelector('.vjs-tech');\n var adCancelTimeout = this.settings.adCancelTimeout || this.options.adCancelTimeout;\n var overlayPlayer = this.settings.overlayPlayer;\n var initialPlayback = this.settings.initialPlayback;\n var controlBarPosition = this.settings.controlBarPosition;\n tech.loadAdUnit(this.containerEl, vjsTechEl, function(error, adUnit) {\n if (error) {\n return next(error, adUnit, vastResponse);\n }\n\n try {\n var WrappedAdUnit = new VPAIDAdUnitWrapper(adUnit, { src: tech.mediaFile.src, adCancelTimeout: adCancelTimeout, overlayPlayer: overlayPlayer, initialPlayback: initialPlayback, controlBarPosition: controlBarPosition });\n WrappedAdUnit.player = player;\n var techClass = 'vjs-' + tech.name + '-ad';\n dom.addClass(player.el(), techClass);\n player.one('vpaid.adEnd', function() {\n dom.removeClass(player.el(), techClass);\n });\n //Entry point for player's skip button which trigger 'skip' event;\n player.on('skip', function() {\n WrappedAdUnit.skipAd();\n });\n next(null, WrappedAdUnit, vastResponse);\n } catch (e) {\n next(e, adUnit, vastResponse);\n }\n });\n };\n\n\n //minthe : _testAdUnit\n VPAIDIntegrator.prototype._initAdUnit = function(adUnit, vastResponse, callback) {\n if (this.initAdUnitCalled) {\n return;\n }\n this.initAdUnitCalled = true;\n async.waterfall([\n function(next) {\n next(null, adUnit, vastResponse);\n },\n this._handshake.bind(this),\n this._setupEvents.bind(this),\n this._initAd.bind(this)\n ], callback);\n };\n\n //minthe : _playAdUnit\n VPAIDIntegrator.prototype._playAdUnit = function(adUnit, vastResponse, callback) {\n async.waterfall([\n function(next) {\n next(null, adUnit, vastResponse);\n },\n this._linkPlayerControls.bind(this),\n this._startAd.bind(this)\n ], callback);\n };\n\n VPAIDIntegrator.prototype._handshake = function handshake(adUnit, vastResponse, next) {\n adUnit.handshakeVersion(this.options.VPAID_VERSION, function(error, version) {\n if (error) {\n return next(error, adUnit, vastResponse);\n }\n\n if (version && isSupportedVersion(version)) {\n return next(null, adUnit, vastResponse);\n }\n\n return next(new VASTError('on VPAIDIntegrator._handshake, unsupported version \"' + version + '\"'), adUnit, vastResponse);\n });\n\n function isSupportedVersion(version) {\n var majorNum = major(version);\n return majorNum >= 1 && majorNum <= 2;\n }\n\n function major(version) {\n var parts = version.split('.');\n return parseInt(parts[0], 10);\n }\n };\n\n //minthe : _initAd\n VPAIDIntegrator.prototype._initAd = function(adUnit, vastResponse, next) {\n var self = this;\n var tech = this.player.el().querySelector('.vjs-tech');\n var dimension = dom.getDimension(tech);\n // Reset the timeout flag\n self.initAdTimeout = false;\n\n timer.startInitAdTimeout(function(error) {\n self.initAdTimeout = true;\n self._reportTimeout(adUnit, error);\n });\n /*\n adUnit.initAd(dimension.width, dimension.height, this.VIEW_MODE.NORMAL, -1, {AdParameters: vastResponse.adParameters || ''}, function (error) {\n self.initialisedAdUnit = adUnit;\n next(error, adUnit, vastResponse);\n });\n */\n\n adUnit.initAd(dimension.width, dimension.height, this.VIEW_MODE.NORMAL, -1, { AdParameters: vastResponse.adParameters || '' }, self.settings.vpaidEnvironmentVars, function(error) {\n self.initialisedAdUnit = adUnit;\n next(error, adUnit, vastResponse);\n });\n };\n\n VPAIDIntegrator.prototype._setupEvents = function(adUnit, vastResponse, next) {\n var adUnitSrc = adUnit.options.src;\n var tracker = new VASTTracker(adUnitSrc, vastResponse);\n var player = this.player;\n var that = this;\n\n function setupEventCallbacks() {\n var cb = that.settings.vpaidEventCallback;\n if (!cb) return;\n that.EVENTS.forEach(function(event) {\n adUnit.on(event, function(data) {\n cb.call(this, event, data);\n });\n });\n };\n\n setupEventCallbacks();\n\n adUnit.on('AdLoaded', function() {\n adUnit._adLoaded = true;\n timer.stopInitAdTimeout();\n logger.info('VPAID event received :: AdLoaded, time = ' + profile.getInitTime() + ', time remaining = ' + profile.getRemainingTime('AdLoaded'));\n });\n\n //minthe2 AdStarted Handler\n //fix for VID-1525\n adUnit.on('AdStarted', function() {\n\n adUnit._adStarted = true;\n profile.adStartedTimestamp = new Date().getTime();\n\n if (that.settings.delayExpandUntilVPAIDImpression) {\n if (profile.adImpressionTimestamp !== 0 && profile.adStartedTimestamp !== 0) {\n timer.stopStartAdTimeout();\n }\n } else {\n timer.stopStartAdTimeout();\n }\n\n // if (profile.adImpressionTimestamp !== 0) {//if AdImpression is deliverd without AdStarted\n // profile.adLoadedTimestamp = profile.adImpressionTimestamp;\n // }\n\n\n if (!adUnit._adLoaded) {\n var remainingTime = profile.timeout - (profile.adStartedTimestamp - profile.initAdTimestamp);\n logger.info('VPAID event received :: AdStarted, time = ' + 0 + ', time remaining = ' + remainingTime + ', Out of order AdStarted');\n } else {\n if (that.settings.delayExpandUntilVPAIDImpression && profile.adImpressionTimestamp === 0) {\n logger.info('VPAID event received :: AdStarted');\n } else {\n logger.info('VPAID event received :: AdStarted, time = ' + profile.getStartTime() + ', total time = ' + profile.getTotalTime() + ', time remaining = ' + profile.getRemainingTime('AdStarted'));\n }\n }\n player.trigger('vpaid.AdStarted');\n tracker.trackCreativeView();\n notifyPlayToPlayer();\n\n\n //activate impression timer if it's not already started\n if (that.settings.delayExpandUntilVPAIDImpression && profile.adImpressionTimestamp === 0) {\n profile.adImpressionTimestamp = new Date().getTime();\n // timer.startAdImpressionTimeout(function (error) {\n // that._reportTimeout(adUnit, error);\n // });\n }\n if (isAndroid()) {\n ChiveFacebookHack();\n }\n });\n\n // For creatives that do not use the video tag provided by the player.\n function handleAdPlayPause() {\n // Ad creatives do not creative their own video tags on devices so no need to handle AdProgess timer\n // TODO : find more reliable way to figure out the video src set.\n if (isIDevice() || isAndroid()) {\n // VIDLA-421 (do not ignore pause/resume event handlers for overlay player)\n if (!adUnit.options.overlayPlayer) {\n return;\n }\n }\n\n // Ad uses video JS Slot\n if (isVideoSlotUsed()) {\n return;\n }\n var creative = adUnit._adUnit ? adUnit._adUnit._creative : null;\n\n if (adUnit.options.overlayPlayer) {\n // since no monkeypatch api is activated.\n player.on('pause', function() {\n if (adUnit._adUnit && creative) {\n that._adUnit.pauseAd();\n }\n });\n player.on('play', function() {\n if (adUnit._adUnit && creative) {\n that._adUnit.resumeAd();\n }\n });\n }\n\n //IE11 has an issue to not listen this pause event - VID-2405, VID-2406\n //video.js has their own event pooling sytem for video element and parent div of video element, the \"pause event\" area is so crowded for now - when vpaid player injects \"pause\" listener to player object on IE11, the video.js doesn't handle as well. looks like incorrect GUID setting problem in order to get events unique\n //for handling this vpaid-creative.pause by \"pause\" signal from video.js we don't have to stick with the crowded \"pause\" signal. we can do samething with differnet signal for this\n // player.on('pause', function(){\n // if(creative){\n // that._adUnit.pauseAd();\n // }\n // });\n player.on('apn-vpaid-pause', function() { //this \"apn-vpaid-pause\" will be dispatch from video.js pause.\n if (creative) {\n // that._adUnit.pauseAd();//no need to dispatch pause again to video.js because video.js already dispatch pause before triggered \"apn-vpaid-pause\". this will also cover a case showing pause button on the UI\n player.trigger('vpaid.pauseAd'); //vpaid video pause\n }\n });\n };\n\n // For creatives that do not use the video tag provided by the player.\n function handleAdProgress() {\n\n // Ad creatives do not creative their own video tags on devices so no need to handle AdProgess timer\n // TODO : find more reliable way to figure out the video src set.\n //if(isIDevice() || isAndroid()){\n if (isIDevice()) { //for VID-2597\n return;\n }\n\n // Ad uses video JS Slot\n if (isVideoSlotUsed()) {\n return;\n }\n\n // Ad is using its own Video slot.\n var creative = adUnit._adUnit._creative;\n var remainingTimeUnknown = false;\n\n function updateProgress() {\n var duration = creative.getAdDuration ? creative.getAdDuration() : 0;\n var remainingTime = creative.getAdRemainingTime ? creative.getAdRemainingTime() : -1;\n remainingTime = isNumber(remainingTime) ? remainingTime : -1;\n remainingTime = (remainingTime > duration) ? duration : remainingTime;//fix VIDLA-429\n var currentTime = duration - remainingTime;\n\n switch (remainingTime) {\n case -2:\n // If time is not currently known\n remainingTimeUnknown = true;\n player.controlBar.currentTimeDisplay.hide();\n player.controlBar.timeDivider.hide();\n player.controlBar.durationDisplay.hide();\n break;\n case -1:\n // If time is not implemeneted\n clearInterval(progressHandler);\n player.controlBar.currentTimeDisplay.hide();\n player.controlBar.timeDivider.hide();\n player.controlBar.durationDisplay.hide();\n break;\n case 0:\n clearInterval(progressHandler);\n break;\n default:\n if (remainingTimeUnknown) {\n remainingTimeUnknown = false;\n player.controlBar.currentTimeDisplay.show();\n player.controlBar.timeDivider.show();\n player.controlBar.durationDisplay.show();\n }\n player.currentTime(currentTime);\n player.controlBar.currentTimeDisplay.updateContent();\n player.duration(duration);\n player.controlBar.durationDisplay.updateContent();\n break;\n }\n }\n var progressHandler = setInterval(updateProgress, 200);\n updateProgress();\n }\n\n adUnit.on('AdSkipped', function() {\n logger.log('VPAID event received :: AdSkipped');\n if(!adUnit._adSkipped) {\n adUnit._adSkipped = true;\n player.trigger('vpaid.AdSkipped');\n tracker.trackSkip();\n }\n });\n\n\n //minthe2 AdImpression Handler\n adUnit.on('AdImpression', function() {\n\n profile.adImpressionTimestamp = new Date().getTime();\n\n\n if (that.settings.delayExpandUntilVPAIDImpression) {\n if (profile.adImpressionTimestamp !== 0 && profile.adStartedTimestamp !== 0) {\n timer.stopStartAdTimeout();\n }\n }\n\n // if (profile.adImpressionTimestamp !== 0) {//if AdImpression is deliverd without AdStarted\n // profile.adLoadedTimestamp = profile.adImpressionTimestamp;\n // }\n // if (profile.adStartedTimestamp === 0) {//if AdImpression is deliverd without AdStarted\n // profile.adStartedTimestamp = profile.adLoadedTimestamp;\n // }\n\n if (that.settings.delayExpandUntilVPAIDImpression && profile.adStartedTimestamp === 0) {\n logger.info('VPAID event received :: AdImpression');\n } else {\n logger.info('VPAID event received :: AdImpression, time = ' + profile.getAdImpressionTime() + ', total time = ' + profile.getTotalTime() + ', time remaining = ' + profile.getRemainingTime('AdImpression'));\n }\n\n\n player.trigger('vpaid.AdImpression');\n tracker.trackImpressions();\n if(adUnit._adUnit && adUnit._adUnit._creative){\n var creative = adUnit._adUnit._creative;\n var creativeIcons = false;\n if(creative.getAdIcons){\n creativeIcons = creative.getAdIcons();\n }\n player.trigger({type: 'vpaid.AdIcons', adIcons: creativeIcons});\n }\n });\n\n adUnit.on('AdVideoStart', function() {\n logger.info('VPAID event received :: AdVideoStart');\n\n // VIDLA-441 This is definitely when the Ad video has started and all the metadata is ready. AdStarted event may be too early\n handleAdPlayPause();\n handleAdProgress();\n\n player.trigger('vpaid.AdVideoStart');\n tracker.trackStart();\n notifyPlayToPlayer();\n if (that.settings.initialAudio === 'off') {\n player.muted(true);\n } else {\n player.muted(false);\n }\n linkVolumeControl();\n\n\n var controlBarPosition = adUnit.options.controlBarPosition ? adUnit.options.controlBarPosition : \"over\";\n if (controlBarPosition === \"over\") {\n var handleUserActive = function() {\n logger.debug(\"caught useractive\");\n resizeAd(player, adUnit, that.VIEW_MODE, true);\n logger.debug(\"did resizeAd\");\n };\n var handleUserInActive = function() {\n logger.debug(\"caught userinactive\");\n if (player.hasClass(\"vjs-paused\") === false || player.paused() === false || that._adUnit._completed === true) {//fix unnecessary resize after pause which can cause bad user experience with transparent controlbar color\n resizeAd(player, adUnit, that.VIEW_MODE, true);\n logger.debug(\"did resizeAd\");\n }\n };\n var handleManualUserActive = function() {\n logger.debug(\"caught handleManualUserActive\");\n setTimeout(function() {\n resizeAd(player, adUnit, that.VIEW_MODE, true, \"useractive\");\n logger.debug(\"did resizeAd\");\n },0);\n };\n var handleManualUserInActive = function(e) {\n logger.debug(\"caught handleManualUserInActive\");\n setTimeout(function() {\n resizeAd(player, adUnit, that.VIEW_MODE, true, \"userinactive\");\n logger.debug(\"did resizeAd\");\n },0);\n };\n\n //handle VPAID resize by useractive event from video.js\n player.on(\"useractive\", handleUserActive);\n\n //handle VPAID resize by userinactive event from video.js\n player.on(\"userinactive\", handleUserInActive);\n\n //handle VPAID resize by useractive event from video.js\n player.on(\"handleManualUserActive\", handleManualUserActive);\n\n //handle VPAID resize by userinactive event from video.js\n player.on(\"handleManualUserInActive\", handleManualUserInActive);\n\n }\n\n //VIDLA-2143\n //to figure out specific creative issue which has 1px of height after AdVideoStart\n //details here: https://stash.corp.appnexus.com/projects/VIDEO/repos/resources_video-ad-video-player-html5-plugin-vpaid/pull-requests/14/overview\n resizeAd(player, adUnit, that.VIEW_MODE, true);\n\n if (isIDevice()) {\n ChiveFacebookHack();\n }\n });\n\n // VID-3052 This is a temporary hack for FB creative autoplay on chive pages. Please see ticket for details.\n function ChiveFacebookHack() {\n var videoSlot = adUnit._adUnit._videoEl;\n if (adUnit.options.overlayPlayer && adUnit.options.initialPlayback === 'auto' && videoSlot.paused) {\n setTimeout(function() {\n // Overlay Chive hack for Facebook Creative\n logger.log('Applying Facebook Chive Hack');\n player.muted(true);\n that._adUnit.resumeAd();\n }, 1000);\n }\n };\n\n adUnit.on('AdPlaying', function() {\n logger.log('VPAID event received :: AdPlaying');\n timer.stopKillTimeout();\n player.trigger('vpaid.AdPlaying');\n tracker.trackResume();\n notifyPlayToPlayer();\n player.trigger(\"handleManualUserInActive\");\n });\n\n adUnit.on('AdPaused', function() {\n logger.log('VPAID event received :: AdPaused');\n timer.stopKillTimeout();\n player.trigger('vpaid.AdPaused');\n tracker.trackPause();\n notifyPauseToPlayer();\n player.trigger(\"handleManualUserActive\");\n });\n\n function notifyPlayToPlayer() {\n if (that._adUnit && that._adUnit.isPaused()) {\n that._adUnit._paused = false;\n }\n player.trigger('play');\n\n }\n\n function notifyPauseToPlayer() {\n if (that._adUnit) {\n that._adUnit._paused = true;\n }\n player.trigger('pause');\n }\n\n adUnit.on('AdVideoFirstQuartile', function() {\n logger.info('VPAID event received :: AdVideoFirstQuartile');\n player.trigger('vpaid.AdVideoFirstQuartile');\n tracker.trackFirstQuartile();\n });\n\n adUnit.on('AdVideoMidpoint', function() {\n logger.info('VPAID event received :: AdVideoMidpoint');\n player.trigger('vpaid.AdVideoMidpoint');\n tracker.trackMidpoint();\n });\n\n adUnit.on('AdVideoThirdQuartile', function() {\n logger.info('VPAID event received :: AdVideoThirdQuartile');\n player.trigger('vpaid.AdVideoThirdQuartile');\n tracker.trackThirdQuartile();\n });\n\n adUnit.on('AdVideoComplete', function() {\n logger.info('VPAID event received :: AdVideoComplete');\n player.trigger('vpaid.AdVideoComplete');\n tracker.trackComplete();\n that._adUnit._completed = true;\n });\n\n adUnit.on('AdClickThru', function(data) {\n player.trigger('vpaid.AdClickThru');\n });\n\n adUnit.on('AdUserAcceptInvitation', function() {\n player.trigger('vpaid.AdUserAcceptInvitation');\n tracker.trackAcceptInvitation();\n tracker.trackAcceptInvitationLinear();\n });\n\n adUnit.on('AdUserClose', function() {\n player.trigger('vpaid.AdUserClose');\n tracker.trackClose();\n tracker.trackCloseLinear();\n });\n\n adUnit.on('AdUserMinimize', function() {\n player.trigger('vpaid.AdUserMinimize');\n tracker.trackCollapse();\n });\n\n adUnit.on('AdError', function(message) {\n timer.stopAdTimeouts();\n logger.error('VPAID event received :: AdError : message : ' + message);\n //player.trigger('vast.adError');//TODO jeff's change for VID-583\n player.trigger('vpaid.AdError');\n //NOTE: we track errors code 901, as noted in VAST 3.0\n tracker.trackErrorWithCode(901);\n });\n\n adUnit.on('AdVolumeChange', function() {\n logger.debug('VPAID event received :: AdVolumeChange');\n player.trigger('vpaid.AdVolumeChange');\n });\n\n adUnit.on('AdStopped', function() {\n logger.info('VPAID event received :: AdStopped');\n adUnit._adStopped = true;\n player.trigger('vpaid.AdStopped');\n });\n\n var updateViewSize = resizeAd.bind(this, player, adUnit, this.VIEW_MODE);\n var autoResize = this.settings.autoResize;\n\n if (autoResize) {\n dom.addEventListener(window, 'resize', updateViewSize);\n dom.addEventListener(window, 'orientationchange', updateViewSize);\n }\n\n player.on('vast.resize', updateViewSize);\n player.on('vpaid.pauseAd', pauseAdUnit);\n player.on('vpaid.resumeAd', resumeAdUnit);\n\n player.one('vpaid.adEnd', function() {\n player.off('vast.resize', updateViewSize);\n player.off('vpaid.pauseAd', pauseAdUnit);\n player.off('vpaid.resumeAd', resumeAdUnit);\n\n if (autoResize) {\n dom.removeEventListener(window, 'resize', updateViewSize);\n dom.removeEventListener(window, 'orientationchange', updateViewSize);\n }\n });\n\n next(null, adUnit, vastResponse);\n\n /*** Local Functions ***/\n function pauseAdUnit() {\n adUnit.pauseAd(noop);\n }\n\n function resumeAdUnit() {\n adUnit.resumeAd(noop);\n }\n\n function isVideoSlotUsed() {\n var videoSlot = adUnit._adUnit._videoEl;\n var creative = adUnit._adUnit._creative;\n var hasSource = videoSlot && videoSlot.src;\n\n if (videoSlot && !hasSource) {\n var sources = videoSlot.getElementsByTagName('source');\n for (var i = 0; i < sources; i++) {\n if (sources[i].src) {\n hasSource = true;\n }\n }\n }\n\n // Ad uses video JS Slot\n if (!creative || !videoSlot || hasSource) {\n return true;\n }\n\n return false;\n }\n\n function linkVolumeControl() {\n // Ad uses video JS slot. Volume be controlled via Player Framework\n if (isVideoSlotUsed()) {\n return;\n }\n // for creatives that create own tag set initial volume appropriately\n adUnit.setAdVolume(that.initVolume, function(error, result) {\n if (error) {\n logger.log('The volume change is not implemented as part of the ad unit');\n } else {\n logger.debug('The volume change is implemented as part of the ad unit');\n }\n });\n // Ad is using its own Video slot. Volume be controlled by setAdVolume\n player.on('volumechange', updateAdUnitVolume);\n\n player.one('vpaid.adEnd', function() {\n player.off('volumechange', updateAdUnitVolume);\n });\n\n /*** local functions ***/\n function updateAdUnitVolume() {\n var vol;\n if (player.muted()) {\n vol = 0;\n } else {\n that.volume = player.volume() ? player.volume() : that.volume;\n vol = that.volume;\n }\n adUnit.setAdVolume(vol, logError);\n }\n }\n };\n\n VPAIDIntegrator.prototype._linkPlayerControls = function(adUnit, vastResponse, next) {\n var that = this;\n linkFullScreenControl(this.player, adUnit, this.VIEW_MODE);\n\n next(null, adUnit, vastResponse);\n\n /*** Local functions ***/\n\n function linkFullScreenControl(player, adUnit, VIEW_MODE) {\n var updateViewSize = resizeAd.bind(this, player, adUnit, VIEW_MODE);\n\n player.on('fullscreenchange', updateViewSize);\n\n player.on('fullscreenchange', function() {\n if (player.paused() || player.hasClass(\"vjs-paused\")) {\n player.trigger(\"handleManualUserActive\");\n }\n });\n\n player.one('vpaid.adEnd', function() {\n player.off('fullscreenchange', updateViewSize);\n });\n }\n };\n\n //minthe : _startAd\n VPAIDIntegrator.prototype._startAd = function(adUnit, vastResponse, next) {\n var self = this;\n var player = this.player;\n\n if (self.initAdTimeout) {\n return;\n }\n // VIDLA-245 IAS hack: If AdStarted is received before calling startAd then do not cap it with a timer.\n if (!adUnit._adStarted) {\n timer.startStartAdTimeout(function(error) {\n self._reportTimeout(adUnit, error);\n });\n } else {\n //Just set the timestamp correctly for VIDLA-245\n profile.startAdTimestamp = new Date().getTime();\n }\n adUnit.startAd(function(error) {\n if (!error) {\n player.trigger('vast.adStart');\n }\n });\n };\n\n\n VPAIDIntegrator.prototype._trackError = function trackError(response) {\n vastUtil.track(response.errorURLMacros, { ERRORCODE: 901 });\n };\n\n VPAIDIntegrator.prototype._reportTimeout = function(adUnit, error) {\n var player = this.player;\n player.trigger({ type: 'vast.adTimeout', error: error });\n try {\n if (adUnit && adUnit._adUnit) {\n logger.log(\"Calling VPAID stopAd on TIMEOUT\");\n adUnit._adUnit.stopAd();\n }\n } catch (e) {\n logger.log('VPAID error in calling stopAd on Timeout');\n }\n };\n\n function resizeAd(player, adUnit, VIEW_MODE, isAdVideoStart, manualUserActive) {\n\n var tech = player.el().querySelector('.vjs-tech');\n var dimension = dom.getDimension(tech);\n var width = dimension.width;\n var height = dimension.height;\n var MODE = player.isFullscreen() ? VIEW_MODE.FULLSCREEN : VIEW_MODE.NORMAL;\n\n var slot = adUnit._adUnit._el;\n var videoSlot = adUnit._adUnit._videoEl;\n var controlBar = player.controlBar;\n var needToUserActive = player.hasClass(\"vjs-controls-enabled\") && player.hasClass(\"vjs-has-started\") && player.hasClass(\"vjs-paused\");\n\n if (needToUserActive || player.userActive() || manualUserActive != undefined) {//if video.js's useractive status is true by mousemove\n\n if (needToUserActive) {\n manualUserActive = \"useractive\";\n }\n\n var controlBarPosition = adUnit.options.controlBarPosition ? adUnit.options.controlBarPosition : \"over\";\n var currentControlBarHeight = (manualUserActive === \"userinactive\") ? 0 : controlBar.height();\n var controlBarHeight = (controlBar && controlBarPosition === \"over\") ? currentControlBarHeight : 0;\n\n if (controlBar && controlBarHeight && player.hasClass(\"vjs-ended\") === false) {\n height = dimension.height - controlBarHeight;\n }\n }\n\n //Resize both slot and video slot (Ads could use either or both)\n if (slot && videoSlot) {\n slot.style.height = height + 'px';\n videoSlot.style.height = height + 'px';\n }\n\n //VIDLA-2143\n //To figure out specific creative issue which has 1px of height after AdVideoStart\n //details here: https://stash.corp.appnexus.com/projects/VIDEO/repos/resources_video-ad-video-player-html5-plugin-vpaid/pull-requests/14/overview\n if (isAdVideoStart && isAdVideoStart === true) {\n adUnit.resizeAd(width + 1, height + 1, MODE, logError);\n adUnit.resizeAd(width, height, MODE, logError);\n } else {\n adUnit.resizeAd(width, height, MODE, logError);\n }\n };\n\n function logError(error) {\n if (error) {\n logger.log('ERROR: ' + error.message);\n }\n };\n\n function Ad(adJTree) {\n if (!(this instanceof Ad)) {\n return new Ad(adJTree);\n }\n\n this.id = adJTree.attr('id');\n this.sequence = adJTree.attr('sequence');\n\n if (adJTree.inLine) {\n this.inLine = new InLine(adJTree.inLine);\n }\n\n if (adJTree.wrapper) {\n this.wrapper = new Wrapper(adJTree.wrapper);\n }\n };\n\n function Creative(creativeJTree) {\n if (!(this instanceof Creative)) {\n return new Creative(creativeJTree);\n }\n\n this.id = creativeJTree.attr('id');\n this.sequence = creativeJTree.attr('sequence');\n this.adId = creativeJTree.attr('adId');\n this.apiFramework = creativeJTree.attr('apiFramework');\n\n if (creativeJTree.linear) {\n this.linear = new Linear(creativeJTree.linear);\n }\n };\n\n function InLine(inlineJTree) {\n if (!(this instanceof InLine)) {\n return new InLine(inlineJTree);\n }\n\n //Required Fields\n this.adTitle = xml.keyValue(inlineJTree.adTitle);\n this.adSystem = xml.keyValue(inlineJTree.adSystem);\n this.impressions = vastUtil.parseImpressions(inlineJTree.impression);\n this.creatives = vastUtil.parseCreatives(inlineJTree.creatives);\n\n //Optional Fields\n this.description = xml.keyValue(inlineJTree.description);\n this.advertiser = xml.keyValue(inlineJTree.advertiser);\n this.surveys = parseSurveys(inlineJTree.survey);\n this.error = xml.keyValue(inlineJTree.error);\n this.pricing = xml.keyValue(inlineJTree.pricing);\n this.extensions = inlineJTree.extensions;\n\n /*** Local Functions ***/\n function parseSurveys(inlineSurveys) {\n if (inlineSurveys) {\n return transformArray(isArray(inlineSurveys) ? inlineSurveys : [inlineSurveys], function(survey) {\n if (isNotEmptyString(survey.keyValue)) {\n return {\n uri: survey.keyValue,\n type: survey.attr('type')\n };\n }\n\n return undefined;\n });\n }\n return [];\n }\n };\n\n function Linear(linearJTree) {\n if (!(this instanceof Linear)) {\n return new Linear(linearJTree);\n }\n\n //Required Elements\n this.duration = vastUtil.parseDuration(xml.keyValue(linearJTree.duration));\n this.mediaFiles = parseMediaFiles(linearJTree.mediaFiles && linearJTree.mediaFiles.mediaFile);\n\n //Optional fields\n this.trackingEvents = parseTrackingEvents(linearJTree.trackingEvents && linearJTree.trackingEvents.tracking, this.duration);\n this.skipoffset = vastUtil.parseOffset(xml.attr(linearJTree, 'skipoffset'), this.duration);\n\n if (linearJTree.videoClicks) {\n this.videoClicks = new VideoClicks(linearJTree.videoClicks);\n }\n\n if (linearJTree.adParameters) {\n this.adParameters = xml.keyValue(linearJTree.adParameters);\n\n if (xml.attr(linearJTree.adParameters, 'xmlEncoded')) {\n this.adParameters = xml.decode(this.adParameters);\n }\n }\n\n /*** Local functions ***/\n function parseTrackingEvents(trackingEvents, duration) {\n var trackings = [];\n if (isDefined(trackingEvents)) {\n trackingEvents = isArray(trackingEvents) ? trackingEvents : [trackingEvents];\n trackingEvents.forEach(function(trackingData) {\n trackings.push(new TrackingEvent(trackingData, duration));\n });\n }\n return trackings;\n }\n\n function parseMediaFiles(mediaFilesJxonTree) {\n var mediaFiles = [];\n if (isDefined(mediaFilesJxonTree)) {\n mediaFilesJxonTree = isArray(mediaFilesJxonTree) ? mediaFilesJxonTree : [mediaFilesJxonTree];\n\n mediaFilesJxonTree.forEach(function(mfData) {\n mediaFiles.push(new MediaFile(mfData));\n });\n }\n return mediaFiles;\n }\n };\n\n function MediaFile(mediaFileJTree) {\n if (!(this instanceof MediaFile)) {\n return new MediaFile(mediaFileJTree);\n }\n\n //Required attributes\n this.src = xml.keyValue(mediaFileJTree);\n this.delivery = mediaFileJTree.attr('delivery');\n this.type = mediaFileJTree.attr('type');\n this.width = mediaFileJTree.attr('width');\n this.height = mediaFileJTree.attr('height');\n\n //Optional attributes\n this.codec = mediaFileJTree.attr('codec');\n this.id = mediaFileJTree.attr('id');\n this.bitrate = mediaFileJTree.attr('bitrate');\n this.minBitrate = mediaFileJTree.attr('minBitrate');\n this.maxBitrate = mediaFileJTree.attr('maxBitrate');\n this.scalable = mediaFileJTree.attr('scalable');\n this.maintainAspectRatio = mediaFileJTree.attr('maintainAspectRatio');\n this.apiFramework = mediaFileJTree.attr('apiFramework');\n };\n\n function TrackingEvent(trackingJTree, duration) {\n if (!(this instanceof TrackingEvent)) {\n return new TrackingEvent(trackingJTree, duration);\n }\n\n this.name = trackingJTree.attr('event');\n this.uri = xml.keyValue(trackingJTree);\n\n if ('progress' === this.name) {\n this.offset = vastUtil.parseOffset(trackingJTree.attr('offset'), duration);\n }\n }\n\n ;\n\n //minthe : VASTClient initialize\n function VASTClient(options) {\n\n if (!(this instanceof VASTClient)) {\n return new VASTClient(options);\n }\n var defaultOptions = {\n WRAPPER_LIMIT: 5\n };\n\n options = options || {};\n this.settings = extend({}, options, defaultOptions);\n this.errorURLMacros = [];\n }\n\n VASTClient.prototype.getVASTResponse = function getVASTResponse(adTagUrl, callback) {\n var that = this;\n\n var error = sanityCheck(adTagUrl, callback);\n if (error) {\n if (isFunction(callback)) {\n return callback(error);\n }\n throw error;\n }\n\n async.waterfall([\n this._getVASTAd.bind(this, adTagUrl),\n buildVASTResponse\n ],\n callback);\n\n /*** Local functions ***/\n function buildVASTResponse(adsChain, cb) {\n try {\n var response = that._buildVASTResponse(adsChain);\n cb(null, response);\n } catch (e) {\n cb(e);\n }\n }\n\n function sanityCheck(adTagUrl, cb) {\n if (!adTagUrl) {\n return new VASTError('on VASTClient.getVASTResponse, missing ad tag URL');\n }\n\n if (!isFunction(cb)) {\n return new VASTError('on VASTClient.getVASTResponse, missing callback function');\n }\n }\n };\n\n VASTClient.prototype._getVASTAd = function(adTagUrl, callback) {\n var that = this;\n\n getAdWaterfall(adTagUrl, function(error, vastTree) {\n var waterfallAds = vastTree && isArray(vastTree.ads) ? vastTree.ads : null;\n if (error) {\n that._trackError(error, waterfallAds);\n return callback(error, waterfallAds);\n }\n\n getAd(waterfallAds.shift(), [], waterfallHandler);\n\n /*** Local functions ***/\n function waterfallHandler(error, adChain) {\n if (error) {\n that._trackError(error, adChain);\n if (waterfallAds.length > 0) {\n getAd(waterfallAds.shift(), [], waterfallHandler);\n } else {\n callback(error, adChain);\n }\n } else {\n callback(null, adChain);\n }\n }\n });\n\n /*** Local functions ***/\n function getAdWaterfall(adTagUrl, callback) {\n var requestVastXML = that._requestVASTXml.bind(that, adTagUrl);\n async.waterfall([\n requestVastXML,\n buildVastWaterfall\n ], callback);\n }\n\n function buildVastWaterfall(xmlStr, callback) {\n var vastTree;\n try {\n vastTree = xml.toJXONTree(xmlStr);\n vastTree.ads = isArray(vastTree.ad) ? vastTree.ad : [vastTree.ad];\n callback(validateVASTTree(vastTree), vastTree);\n } catch (e) {\n callback(new VASTError(\"on VASTClient.getVASTAd.buildVastWaterfall, error parsing xml\", 100), null);\n }\n }\n\n function validateVASTTree(vastTree) {\n var vastVersion = xml.attr(vastTree, 'version');\n\n if (!vastTree.ad) {\n return new VASTError('on VASTClient.getVASTAd.validateVASTTree, no Ad in VAST tree', 303);\n }\n\n if (vastVersion && (vastVersion != 3 && vastVersion != 2)) {\n return new VASTError('on VASTClient.getVASTAd.validateVASTTree, not supported VAST version \"' + vastVersion + '\"', 102);\n }\n\n return null;\n }\n\n function getAd(adTagUrl, adChain, callback) {\n if (adChain.length >= that.WRAPPER_LIMIT) {\n return callback(new VASTError(\"on VASTClient.getVASTAd.getAd, players wrapper limit reached (the limit is \" + that.WRAPPER_LIMIT + \")\", 302), adChain);\n }\n\n async.waterfall([\n function(next) {\n if (isString(adTagUrl)) {\n requestVASTAd(adTagUrl, next);\n } else {\n next(null, adTagUrl);\n }\n },\n buildAd\n ], function(error, ad) {\n if (ad) {\n adChain.push(ad);\n }\n\n if (error) {\n return callback(error, adChain);\n }\n\n if (ad.wrapper) {\n return getAd(ad.wrapper.VASTAdTagURI, adChain, callback);\n }\n\n return callback(null, adChain);\n });\n }\n\n function buildAd(adJxonTree, callback) {\n try {\n var ad = new Ad(adJxonTree);\n callback(validateAd(ad), ad);\n } catch (e) {\n callback(new VASTError('on VASTClient.getVASTAd.buildAd, error parsing xml', 100), null);\n }\n }\n\n function validateAd(ad) {\n var wrapper = ad.wrapper;\n var inLine = ad.inLine;\n var errMsgPrefix = 'on VASTClient.getVASTAd.validateAd, ';\n\n if (inLine && wrapper) {\n return new VASTError(errMsgPrefix + \"InLine and Wrapper both found on the same Ad\", 101);\n }\n\n if (!inLine && !wrapper) {\n return new VASTError(errMsgPrefix + \"nor wrapper nor inline elements found on the Ad\", 101);\n }\n\n if (inLine && inLine.creatives.length === 0) {\n return new VASTError(errMsgPrefix + \"missing creative in InLine element\", 101);\n }\n\n if (wrapper && !wrapper.VASTAdTagURI) {\n return new VASTError(errMsgPrefix + \"missing 'VASTAdTagURI' in wrapper\", 101);\n }\n }\n\n function requestVASTAd(adTagUrl, callback) {\n that._requestVASTXml(adTagUrl, function(error, xmlStr) {\n if (error) {\n return callback(error);\n }\n try {\n var vastTree = xml.toJXONTree(xmlStr);\n callback(validateVASTTree(vastTree), vastTree.ad);\n } catch (e) {\n callback(new VASTError(\"on VASTClient.getVASTAd.requestVASTAd, error parsing xml\", 100));\n }\n });\n }\n };\n\n VASTClient.prototype._requestVASTXml = function requestVASTXml(adTagUrl, callback) {\n try {\n if (isFunction(adTagUrl)) {\n adTagUrl(requestHandler);\n } else {\n http.get(adTagUrl, requestHandler, {\n withCredentials: true\n });\n }\n } catch (e) {\n callback(e);\n }\n\n /*** Local functions ***/\n function requestHandler(error, response, status) {\n if (error) {\n var errMsg = isDefined(status) ?\n \"on VASTClient.requestVastXML, HTTP request error with status '\" + status + \"'\" :\n \"on VASTClient.requestVastXML, Error getting the the VAST XML with he passed adTagXML fn\";\n return callback(new VASTError(errMsg, 301), null);\n }\n\n callback(null, response);\n }\n };\n\n VASTClient.prototype._buildVASTResponse = function buildVASTResponse(adsChain) {\n var response = new VASTResponse();\n addAdsToResponse(response, adsChain);\n validateResponse(response);\n\n return response;\n\n //*** Local function ****\n function addAdsToResponse(response, ads) {\n ads.forEach(function(ad) {\n response.addAd(ad);\n });\n }\n\n function validateResponse(response) {\n var progressEvents = response.trackingEvents.progress;\n\n if (!response.hasLinear()) {\n throw new VASTError(\"on VASTClient._buildVASTResponse, Received an Ad type that is not supported\", 200);\n }\n\n if (response.duration === undefined) {\n throw new VASTError(\"on VASTClient._buildVASTResponse, Missing duration field in VAST response\", 101);\n }\n\n if (progressEvents) {\n progressEvents.forEach(function(progressEvent) {\n if (!isNumber(progressEvent.offset)) {\n throw new VASTError(\"on VASTClient._buildVASTResponse, missing or wrong offset attribute on progress tracking event\", 101);\n }\n });\n }\n }\n };\n\n VASTClient.prototype._trackError = function(error, adChain) {\n if (!isArray(adChain) || adChain.length === 0) { //There is nothing to track\n return;\n }\n\n var errorURLMacros = [];\n adChain.forEach(addErrorUrlMacros);\n vastUtil.track(errorURLMacros, { ERRORCODE: error.code || 900 }); //900 <== Undefined error\n\n /*** Local functions ***/\n function addErrorUrlMacros(ad) {\n if (ad.wrapper && ad.wrapper.error) {\n errorURLMacros.push(ad.wrapper.error);\n }\n\n if (ad.inLine && ad.inLine.error) {\n errorURLMacros.push(ad.inLine.error);\n }\n }\n };\n\n ;\n var VAST = {};\n\n function VASTError(message, code) {\n this.message = 'VAST Error: ' + (message || '');\n if (code) {\n this.code = code;\n }\n }\n\n VASTError.prototype = new Error();\n VASTError.prototype.name = \"VAST Error\";;\n /**\n * Inner helper class that deals with the logic of the individual steps needed to setup an ad in the player.\n *\n * @param player {object} instance of the player that will play the ad. It assumes that the videojs-contrib-ads plugin\n * has been initialized when you use its utility functions.\n *\n * @constructor\n */\n function VASTIntegrator(player) {\n if (!(this instanceof VASTIntegrator)) {\n return new VASTIntegrator(player);\n }\n\n this.player = player;\n }\n\n VASTIntegrator.prototype.playAd = function playAd(vastResponse, callback) {\n var that = this;\n callback = callback || noop;\n\n if (!(vastResponse instanceof VASTResponse)) {\n return callback(new VASTError('On VASTIntegrator, missing required VASTResponse'));\n }\n\n async.waterfall([\n function(next) {\n next(null, vastResponse);\n },\n this._selectAdSource.bind(this),\n this._createVASTTracker.bind(this),\n this._addClickThrough.bind(this),\n this._setupEvents.bind(this),\n this._playSelectedAd.bind(this)\n ], function(error, response) {\n if (error && response) {\n that._trackError(error, response);\n }\n callback(error, response);\n });\n\n this._adUnit = {\n _src: null,\n type: 'VAST',\n pauseAd: function() {\n that.player.pause(true); //video.js player pause\n },\n\n resumeAd: function() {\n that.player.play(true);\n },\n\n isPaused: function() {\n return that.player.paused(true);\n },\n\n getSrc: function() {\n return this._src;\n }\n };\n\n return this._adUnit;\n };\n\n VASTIntegrator.prototype._selectAdSource = function selectAdSource(response, callback) {\n var source;\n\n var playerWidth = dom.getDimension(this.player.el()).width;\n response.mediaFiles.sort(function compareTo(a, b) {\n var deltaA = Math.abs(playerWidth - a.width);\n var deltaB = Math.abs(playerWidth - b.width);\n return deltaA - deltaB;\n });\n\n source = this.player.selectSource(response.mediaFiles).source;\n\n if (source) {\n if (this._adUnit) {\n this._adUnit._src = source;\n }\n return callback(null, source, response);\n }\n\n // code 403 <== Couldn't find MediaFile that is supported by this video player\n callback(new VASTError(\"Could not find Ad mediafile supported by this player\", 403), response);\n };\n\n VASTIntegrator.prototype._createVASTTracker = function createVASTTracker(adMediaFile, response, callback) {\n try {\n callback(null, adMediaFile, new VASTTracker(adMediaFile.src, response), response);\n } catch (e) {\n callback(e, response);\n }\n };\n\n VASTIntegrator.prototype._setupEvents = function setupEvents(adMediaFile, tracker, response, callback) {\n var previouslyMuted;\n var player = this.player;\n player.on('fullscreenchange', trackFullscreenChange);\n player.on('vast.adStart', trackImpressions);\n player.on('pause', trackPause);\n player.on('timeupdate', trackProgress);\n player.on('volumechange', trackVolumeChange);\n\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel'], unbindEvents);\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel', 'vast.adSkip'], function(evt) {\n if (evt.type === 'vast.adEnd') {\n tracker.trackComplete();\n }\n });\n\n return callback(null, adMediaFile, response);\n\n /*** Local Functions ***/\n function unbindEvents() {\n player.off('fullscreenchange', trackFullscreenChange);\n player.off('vast.adStart', trackImpressions);\n player.off('pause', trackPause);\n player.off('timeupdate', trackProgress);\n player.off('volumechange', trackVolumeChange);\n }\n\n function trackFullscreenChange() {\n if (player.isFullscreen()) {\n tracker.trackFullscreen();\n } else {\n tracker.trackExitFullscreen();\n }\n }\n\n function trackPause() {\n //NOTE: whenever a video ends the video Element triggers a 'pause' event before the 'ended' event.\n // We should not track this pause event because it makes the VAST tracking confusing again we use a\n // Threshold of 2 seconds to prevent false positives on IOS.\n if (Math.abs(player.duration() - player.currentTime()) < 2) {\n return;\n }\n\n tracker.trackPause();\n playerUtils.once(player, ['play', 'vast.adEnd', 'vast.adsCancel'], function(evt) {\n if (evt.type === 'play') {\n tracker.trackResume();\n }\n });\n }\n\n function trackProgress() {\n var currentTimeInMs = player.currentTime() * 1000;\n tracker.trackProgress(currentTimeInMs);\n }\n\n function trackImpressions() {\n tracker.trackImpressions();\n tracker.trackCreativeView();\n }\n\n function trackVolumeChange() {\n var muted = player.muted();\n if (muted) {\n tracker.trackMute();\n } else if (previouslyMuted) {\n tracker.trackUnmute();\n }\n previouslyMuted = muted;\n }\n };\n\n VASTIntegrator.prototype._addClickThrough = function addClickThrough(mediaFile, tracker, response, callback) {\n var player = this.player;\n var blocker = createClickThroughBlocker(player, tracker, response);\n var updateBlocker = updateBlockerURL.bind(this, blocker, response, player);\n\n player.el().insertBefore(blocker, player.controlBar.el());\n player.on('timeupdate', updateBlocker);\n playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel'], removeBlocker);\n\n return callback(null, mediaFile, tracker, response);\n\n /*** Local Functions ***/\n\n function createClickThroughBlocker(player, tracker, response) {\n var blocker = window.document.createElement(\"a\");\n var clickThroughMacro = response.clickThrough;\n\n dom.addClass(blocker, 'vast-blocker');\n blocker.href = generateClickThroughURL(clickThroughMacro, player);\n\n if (isString(clickThroughMacro)) {\n blocker.target = \"_blank\";\n }\n\n blocker.onclick = function(e) {\n if (player.paused()) {\n player.play();\n\n //We prevent event propagation to avoid problems with the player's normal pause mechanism\n if (window.Event.prototype.stopPropagation !== undefined) {\n e.stopPropagation();\n }\n return false;\n }\n\n player.pause();\n tracker.trackClick();\n };\n\n return blocker;\n }\n\n function updateBlockerURL(blocker, response, player) {\n blocker.href = generateClickThroughURL(response.clickThrough, player);\n }\n\n function generateClickThroughURL(clickThroughMacro, player) {\n var variables = {\n ASSETURI: mediaFile.src,\n CONTENTPLAYHEAD: vastUtil.formatProgress(player.currentTime() * 1000)\n };\n\n return clickThroughMacro ? vastUtil.parseURLMacro(clickThroughMacro, variables) : '#';\n }\n\n function removeBlocker() {\n player.off('timeupdate', updateBlocker);\n dom.remove(blocker);\n }\n };\n\n VASTIntegrator.prototype._playSelectedAd = function playSelectedAd(source, response, callback) {\n var player = this.player;\n\n player.preload(\"auto\"); //without preload=auto the durationchange event is never fired\n player.src(source);\n\n playerUtils.once(player, ['durationchange', 'error', 'vast.adsCancel'], function(evt) {\n if (evt.type === 'durationchange') {\n playAd();\n } else if (evt.type === 'error') {\n callback(new VASTError(\"on VASTIntegrator, Player is unable to play the Ad\", 400), response);\n }\n //NOTE: If the ads get canceled we do nothing/\n });\n\n /**** local functions ******/\n function playAd() {\n player.play();\n playerUtils.once(player, ['playing', 'vast.adsCancel'], function(evt) {\n if (evt.type === 'vast.adsCancel') {\n return;\n }\n\n player.trigger('vast.adStart');\n\n playerUtils.once(player, ['ended', 'vast.adsCancel', 'vast.adSkip'], function(evt) {\n if (evt.type === 'ended' || evt.type === 'vast.adSkip') {\n callback(null, response);\n }\n //NOTE: if the ads get cancel we do nothing\n });\n });\n }\n };\n\n VASTIntegrator.prototype._trackError = function trackError(error, response) {\n vastUtil.track(response.errorURLMacros, { ERRORCODE: error.code || 900 });\n };\n\n ;\n (function(window) {\n \"use strict\";\n\n\n function VASTResponse() {\n if (!(this instanceof VASTResponse)) {\n return new VASTResponse();\n }\n\n this._linearAdded = false;\n this.ads = [];\n this.errorURLMacros = [];\n this.impressions = [];\n this.clickTrackings = [];\n this.customClicks = [];\n this.trackingEvents = {};\n this.mediaFiles = [];\n this.clickThrough = undefined;\n this.adTitle = '';\n this.duration = undefined;\n this.skipoffset = undefined;\n }\n\n VASTResponse.prototype.addAd = function(ad) {\n var inLine, wrapper;\n\n if (ad instanceof Ad) {\n inLine = ad.inLine;\n wrapper = ad.wrapper;\n\n this.ads.push(ad);\n\n if (inLine) {\n this._addInLine(inLine);\n }\n\n if (wrapper) {\n this._addWrapper(wrapper);\n }\n }\n };\n\n VASTResponse.prototype._addErrorTrackUrl = function(error) {\n var errorURL = error instanceof xml.JXONTree ? xml.keyValue(error) : error;\n if (errorURL) {\n this.errorURLMacros.push(errorURL);\n }\n };\n\n VASTResponse.prototype._addImpressions = function(impressions) {\n isArray(impressions) && appendToArray(this.impressions, impressions);\n };\n\n VASTResponse.prototype._addClickThrough = function(clickThrough) {\n if (isNotEmptyString(clickThrough)) {\n this.clickThrough = clickThrough;\n }\n };\n\n VASTResponse.prototype._addClickTrackings = function(clickTrackings) {\n isArray(clickTrackings) && appendToArray(this.clickTrackings, clickTrackings);\n };\n\n VASTResponse.prototype._addCustomClicks = function(customClicks) {\n isArray(customClicks) && appendToArray(this.customClicks, customClicks);\n };\n\n VASTResponse.prototype._addTrackingEvents = function(trackingEvents) {\n var eventsMap = this.trackingEvents;\n\n if (trackingEvents) {\n trackingEvents = isArray(trackingEvents) ? trackingEvents : [trackingEvents];\n trackingEvents.forEach(function(trackingEvent) {\n if (!eventsMap[trackingEvent.name]) {\n eventsMap[trackingEvent.name] = [];\n }\n eventsMap[trackingEvent.name].push(trackingEvent);\n });\n }\n };\n\n VASTResponse.prototype._addTitle = function(title) {\n if (isNotEmptyString(title)) {\n this.adTitle = title;\n }\n };\n\n VASTResponse.prototype._addDuration = function(duration) {\n if (isNumber(duration)) {\n this.duration = duration;\n }\n };\n\n VASTResponse.prototype._addVideoClicks = function(videoClicks) {\n if (videoClicks instanceof VideoClicks) {\n this._addClickThrough(videoClicks.clickThrough);\n this._addClickTrackings(videoClicks.clickTrackings);\n this._addCustomClicks(videoClicks.customClicks);\n }\n };\n\n VASTResponse.prototype._addMediaFiles = function(mediaFiles) {\n isArray(mediaFiles) && appendToArray(this.mediaFiles, mediaFiles);\n };\n\n VASTResponse.prototype._addSkipoffset = function(offset) {\n if (offset) {\n this.skipoffset = offset;\n }\n };\n\n VASTResponse.prototype._addAdParameters = function(adParameters) {\n if (adParameters) {\n this.adParameters = adParameters;\n }\n };\n\n VASTResponse.prototype._addLinear = function(linear) {\n if (linear instanceof Linear) {\n this._addDuration(linear.duration);\n this._addTrackingEvents(linear.trackingEvents);\n this._addVideoClicks(linear.videoClicks);\n this._addMediaFiles(linear.mediaFiles);\n this._addSkipoffset(linear.skipoffset);\n this._addAdParameters(linear.adParameters);\n this._linearAdded = true;\n }\n };\n\n VASTResponse.prototype._addInLine = function(inLine) {\n var that = this;\n\n if (inLine instanceof InLine) {\n this._addTitle(inLine.adTitle);\n this._addErrorTrackUrl(inLine.error);\n this._addImpressions(inLine.impressions);\n\n inLine.creatives.forEach(function(creative) {\n if (creative.linear) {\n that._addLinear(creative.linear);\n }\n });\n }\n };\n\n VASTResponse.prototype._addWrapper = function(wrapper) {\n var that = this;\n\n if (wrapper instanceof Wrapper) {\n this._addErrorTrackUrl(wrapper.error);\n this._addImpressions(wrapper.impressions);\n\n wrapper.creatives.forEach(function(creative) {\n var linear = creative.linear;\n if (linear) {\n that._addVideoClicks(linear.videoClicks);\n that.clickThrough = undefined; //We ensure that no clickThrough has been added\n that._addTrackingEvents(linear.trackingEvents);\n }\n });\n }\n };\n\n VASTResponse.prototype.hasLinear = function() {\n return this._linearAdded;\n };\n\n function appendToArray(array, items) {\n items.forEach(function(item) {\n array.push(item);\n });\n }\n\n window.VASTResponse = VASTResponse;\n })(window);\n\n ;\n\n function VASTTracker(assetURI, vastResponse) {\n if (!(this instanceof VASTTracker)) {\n return new VASTTracker(assetURI, vastResponse);\n }\n\n sanityCheck(assetURI, vastResponse);\n this.response = vastResponse;\n this.assetURI = assetURI;\n this.progress = 0;\n this.quartiles = {\n firstQuartile: { tracked: false, time: Math.round(25 * vastResponse.duration) / 100 },\n midpoint: { tracked: false, time: Math.round(50 * vastResponse.duration) / 100 },\n thirdQuartile: { tracked: false, time: Math.round(75 * vastResponse.duration) / 100 }\n };\n\n /*** Local Functions ***/\n function sanityCheck(assetURI, vastResponse) {\n if (!isString(assetURI) || isEmptyString(assetURI)) {\n throw new VASTError('on VASTTracker constructor, missing required the URI of the ad asset being played');\n }\n\n if (!(vastResponse instanceof VASTResponse)) {\n throw new VASTError('on VASTTracker constructor, missing required VAST response');\n }\n }\n }\n\n VASTTracker.prototype.trackURLs = function trackURLs(urls, variables) {\n if (isArray(urls) && urls.length > 0) {\n variables = extend({\n ASSETURI: this.assetURI,\n CONTENTPLAYHEAD: vastUtil.formatProgress(this.progress)\n }, variables || {});\n\n vastUtil.track(urls, variables);\n }\n };\n\n VASTTracker.prototype.trackEvent = function trackEvent(eventName, trackOnce) {\n this.trackURLs(getEventUris(this.response.trackingEvents[eventName]));\n if (trackOnce) {\n this.response.trackingEvents[eventName] = undefined;\n }\n\n /*** Local function ***/\n function getEventUris(trackingEvents) {\n var uris;\n\n if (trackingEvents) {\n uris = [];\n trackingEvents.forEach(function(event) {\n uris.push(event.uri);\n });\n }\n return uris;\n }\n };\n\n VASTTracker.prototype.trackProgress = function trackProgress(newProgressInMs) {\n var events = [];\n var ONCE = true;\n var ALWAYS = false;\n var trackingEvents = this.response.trackingEvents;\n\n if (isNumber(newProgressInMs)) {\n addTrackEvent('start', ONCE, newProgressInMs > 0);\n addTrackEvent('rewind', ALWAYS, hasRewound(this.progress, newProgressInMs));\n addQuartileEvents.call(this, newProgressInMs);\n trackProgressEvents.call(this, newProgressInMs);\n trackEvents.call(this);\n this.progress = newProgressInMs;\n }\n\n /*** Local function ***/\n function hasRewound(currentProgress, newProgress) {\n var REWIND_THRESHOLD = 3000; //IOS video clock is very unreliable and we need a 3 seconds threshold to ensure that there was a rewind an that it was on purpose.\n return currentProgress > newProgressInMs && Math.abs(newProgress - currentProgress) > REWIND_THRESHOLD;\n }\n\n function addTrackEvent(eventName, trackOnce, canBeAdded) {\n if (trackingEvents[eventName] && canBeAdded) {\n events.push({\n name: eventName,\n trackOnce: !!trackOnce\n });\n }\n }\n\n function addQuartileEvents(progress) {\n var quartiles = this.quartiles;\n var firstQuartile = this.quartiles.firstQuartile;\n var midpoint = this.quartiles.midpoint;\n var thirdQuartile = this.quartiles.thirdQuartile;\n\n if (!firstQuartile.tracked) {\n trackQuartile('firstQuartile', progress);\n } else if (!midpoint.tracked) {\n trackQuartile('midpoint', progress);\n } else {\n trackQuartile('thirdQuartile', progress);\n }\n\n /*** Local function ***/\n function trackQuartile(quartileName, progress) {\n var quartile = quartiles[quartileName];\n if (canBeTracked(quartile, progress)) {\n quartile.tracked = true;\n addTrackEvent(quartileName, ONCE, true);\n }\n }\n }\n\n function canBeTracked(quartile, progress) {\n var quartileTime = quartile.time;\n //We only fire the quartile event if the progress is bigger than the quartile time by 5 seconds at most.\n return progress >= quartileTime && progress <= (quartileTime + 5000);\n }\n\n function trackProgressEvents(progress) {\n if (!isArray(trackingEvents.progress)) {\n return; //Nothing to track\n }\n\n var pendingProgressEvts = [];\n var that = this;\n\n trackingEvents.progress.forEach(function(evt) {\n if (evt.offset <= progress) {\n that.trackURLs([evt.uri]);\n } else {\n pendingProgressEvts.push(evt);\n }\n });\n trackingEvents.progress = pendingProgressEvts;\n }\n\n function trackEvents() {\n events.forEach(function(event) {\n this.trackEvent(event.name, event.trackOnce);\n }, this);\n }\n };\n\n [\n 'rewind',\n 'fullscreen',\n 'exitFullscreen',\n 'pause',\n 'resume',\n 'mute',\n 'unmute',\n 'acceptInvitation',\n 'acceptInvitationLinear',\n 'collapse',\n 'expand'\n ].forEach(function(eventName) {\n VASTTracker.prototype['track' + capitalize(eventName)] = function() {\n this.trackEvent(eventName);\n };\n });\n\n [\n 'start',\n 'skip',\n 'close',\n 'closeLinear'\n ].forEach(function(eventName) {\n VASTTracker.prototype['track' + capitalize(eventName)] = function() {\n this.trackEvent(eventName, true);\n };\n });\n\n [\n 'firstQuartile',\n 'midpoint',\n 'thirdQuartile'\n ].forEach(function(quartile) {\n VASTTracker.prototype['track' + capitalize(quartile)] = function() {\n this.quartiles[quartile].tracked = true;\n this.trackEvent(quartile, true);\n };\n });\n\n VASTTracker.prototype.trackComplete = function() {\n if (this.quartiles.thirdQuartile.tracked) {\n this.trackEvent('complete', true);\n }\n };\n\n VASTTracker.prototype.trackErrorWithCode = function trackErrorWithCode(errorcode) {\n if (isNumber(errorcode)) {\n this.trackURLs(this.response.errorURLMacros, { ERRORCODE: errorcode });\n }\n };\n\n VASTTracker.prototype.trackImpressions = function trackImpressions() {\n this.trackURLs(this.response.impressions);\n };\n\n VASTTracker.prototype.trackCreativeView = function trackCreativeView() {\n this.trackEvent('creativeView');\n };\n\n VASTTracker.prototype.trackClick = function trackClick() {\n this.trackURLs(this.response.clickTrackings);\n };\n\n ;\n\n function VideoClicks(videoClickJTree) {\n if (!(this instanceof VideoClicks)) {\n return new VideoClicks(videoClickJTree);\n }\n\n this.clickThrough = xml.keyValue(videoClickJTree.clickThrough);\n this.clickTrackings = parseClickTrackings(videoClickJTree.clickTracking);\n this.customClicks = parseClickTrackings(videoClickJTree.customClick);\n\n /*** Local functions ***/\n function parseClickTrackings(trackingData) {\n var clickTrackings = [];\n if (trackingData) {\n trackingData = isArray(trackingData) ? trackingData : [trackingData];\n trackingData.forEach(function(clickTrackingData) {\n clickTrackings.push(xml.keyValue(clickTrackingData));\n });\n }\n return clickTrackings;\n }\n };\n\n function Wrapper(wrapperJTree) {\n if (!(this instanceof Wrapper)) {\n return new Wrapper(wrapperJTree);\n }\n\n //Required elements\n this.adSystem = xml.keyValue(wrapperJTree.adSystem);\n this.impressions = vastUtil.parseImpressions(wrapperJTree.impression);\n this.VASTAdTagURI = xml.keyValue(wrapperJTree.vASTAdTagURI);\n\n //Optional elements\n this.creatives = vastUtil.parseCreatives(wrapperJTree.creatives);\n this.error = xml.keyValue(wrapperJTree.error);\n this.extensions = wrapperJTree.extensions;\n\n //Optional attrs\n this.followAdditionalWrappers = isDefined(xml.attr(wrapperJTree, 'followAdditionalWrappers')) ? xml.attr(wrapperJTree, 'followAdditionalWrappers') : true;\n this.allowMultipleAds = xml.attr(wrapperJTree, 'allowMultipleAds');\n this.fallbackOnNoAd = xml.attr(wrapperJTree, 'fallbackOnNoAd');\n }\n\n\n ;\n \"use strict\";\n\n var vastUtil = {\n\n track: function track(URLMacros, variables) {\n var sources = vastUtil.parseURLMacros(URLMacros, variables);\n var trackImgs = [];\n sources.forEach(function(src) {\n var img = new Image();\n img.src = src;\n trackImgs.push(img);\n });\n return trackImgs;\n },\n\n parseURLMacros: function parseMacros(URLMacros, variables) {\n var parsedURLs = [];\n\n variables = variables || {};\n\n if (!(variables[\"CACHEBUSTING\"])) {\n variables[\"CACHEBUSTING\"] = Math.round(Math.random() * 1.0e+10);\n }\n\n URLMacros.forEach(function(URLMacro) {\n parsedURLs.push(vastUtil._parseURLMacro(URLMacro, variables));\n });\n\n return parsedURLs;\n },\n\n parseURLMacro: function parseMacro(URLMacro, variables) {\n variables = variables || {};\n\n if (!(variables[\"CACHEBUSTING\"])) {\n variables[\"CACHEBUSTING\"] = Math.round(Math.random() * 1.0e+10);\n }\n\n return vastUtil._parseURLMacro(URLMacro, variables);\n },\n\n _parseURLMacro: function parseMacro(URLMacro, variables) {\n variables = variables || {};\n\n forEach(variables, function(value, key) {\n URLMacro = URLMacro.replace(new RegExp(\"\\\\[\" + key + \"\\\\\\]\", 'gm'), value);\n });\n\n return URLMacro;\n },\n\n parseDuration: function parseDuration(durationStr) {\n var durationRegex = /(\\d\\d):(\\d\\d):(\\d\\d)(\\.(\\d\\d\\d))?/;\n var match, durationInMs;\n\n if (isString(durationStr)) {\n match = durationStr.match(durationRegex);\n if (match) {\n durationInMs = parseHoursToMs(match[1]) + parseMinToMs(match[2]) + parseSecToMs(match[3]) + parseInt(match[5] || 0);\n }\n }\n\n return isNaN(durationInMs) ? null : durationInMs;\n\n /*** local functions ***/\n function parseHoursToMs(hourStr) {\n return parseInt(hourStr, 10) * 60 * 60 * 1000;\n }\n\n function parseMinToMs(minStr) {\n return parseInt(minStr, 10) * 60 * 1000;\n }\n\n function parseSecToMs(secStr) {\n return parseInt(secStr, 10) * 1000;\n }\n },\n\n parseImpressions: function parseImpressions(impressions) {\n if (impressions) {\n impressions = isArray(impressions) ? impressions : [impressions];\n return transformArray(impressions, function(impression) {\n if (isNotEmptyString(impression.keyValue)) {\n return impression.keyValue;\n }\n return undefined;\n });\n }\n return [];\n },\n\n parseCreatives: function parseCreatives(creativesJTree) {\n var creatives = [];\n var creativesData;\n if (isDefined(creativesJTree) && isDefined(creativesJTree.creative)) {\n creativesData = isArray(creativesJTree.creative) ? creativesJTree.creative : [creativesJTree.creative];\n creativesData.forEach(function(creative) {\n creatives.push(new Creative(creative));\n });\n }\n return creatives;\n },\n\n //We assume that the progress is going to arrive in milliseconds\n formatProgress: function formatProgress(progress) {\n var hours, minutes, seconds, milliseconds;\n hours = progress / (60 * 60 * 1000);\n hours = Math.floor(hours);\n minutes = (progress / (60 * 1000)) % 60;\n minutes = Math.floor(minutes);\n seconds = (progress / 1000) % 60;\n seconds = Math.floor(seconds);\n milliseconds = progress % 1000;\n return toFixedDigits(hours, 2) + ':' + toFixedDigits(minutes, 2) + ':' + toFixedDigits(seconds, 2) + '.' + toFixedDigits(milliseconds, 3);\n },\n\n parseOffset: function parseOffset(offset, duration) {\n if (isPercentage(offset)) {\n return calculatePercentage(offset, duration);\n }\n return vastUtil.parseDuration(offset);\n\n /*** Local function ***/\n function isPercentage(offset) {\n var percentageRegex = /^\\d+(\\.\\d+)?%$/g;\n return percentageRegex.test(offset);\n }\n\n function calculatePercentage(percentStr, duration) {\n if (duration) {\n return calcPercent(duration, parseFloat(percentStr.replace('%', '')));\n }\n return null;\n }\n\n function calcPercent(quantity, percent) {\n return quantity * percent / 100;\n }\n },\n\n isVPAID: function isVPAIDMediaFile(mediaFile) {\n return !!mediaFile && mediaFile.apiFramework === 'VPAID';\n }\n };\n})(window, document, videojs);\n//# sourceMappingURL=videojs-vast-vpaid.js.map\n\n/* jshint ignore:end */\n"; +},function(e,t){var n=function(e,t){function n(e){return"object"==typeof e}function i(e){return null===e}function o(e){var t,r,a;for(r=1;r=0&&(r.disableCollapseForDelay=r.disableCollapse),r.disableCollapse=!1),r.enableExplicitPause=!0,r};e.exports=n},function(e,t,n){var i=n(56),o="[PlayerManager_ANVideoViewabilityTracker]",r=n(9),a=function(e){r.verbose(o,e)},s=function(e){r.info(o,e)},l=function(){var e,t,n=null,o={video_start:"start",expand:"expand",collapse:"collapse",video_unmute:"sound_on",video_mute:"sound_off",video_pause:"pause",video_resume:"resume","ad-click":"click",video_skip:"stop",video_complete:"stop",fullscreen:"fullscreen",exitFullscreen:"exitFullscreen"},r={video_start:!1,video_skip:!1,video_complete:!1},l=function(e){return e&&e.viewability&&e.viewability.config},d=function(e){return e.targetElement},c=function(e,t,n){return{duration:e,w:t,h:n}},u=function(e){if(e)return e.playerContextId},p=function(n,i){if(e&&i){var o=/notifyEvent.*\[(.[^\]]+)\]/.exec(i);o=Array.isArray(o)&&o.length>1?o[1]:null,o&&e("VIEW",o,t,i)}n&&"debug"===n?a(i):s(i)};this.init=function(o,r,h,m,f){s("initialize with duration: "+r+", width: "+h+", height: "+m+", event: "+f),o&&(e=o.cbNotification,t=o.ASTadId);try{n=new i(l(o),d(o),c(r,h,m),u(o),p),this.isReady=!0}catch(v){a("error on viewability library: "),a(v)}},this.invokeEvent=function(e){if(e&&o[e])try{if(r.hasOwnProperty(e)){if(r[e])return void s("supressing fireOnceEvents event as it is already fired once by viewability library: "+o[e]);r[e]=!0}s("event invoked by viewability library: "+o[e]),n.notifyEvent(o[e])}catch(t){a("error on viewability library: "),a(t)}},this.isReady=!1};e.exports=l},function(e,t){var n={DEBUG:"debug",INFO:"info",ERROR:"error"},i={NO_VIEWABILITY_DATA:100,MISSING_MANDATORY_PARAMETER_JS:101,FAILED_TO_LOAD_VIEWABILITY_JS:102,INITIALIZATION_FAILED:103,MISSING_MANDATORY_PARAMETER_CB:104,MISSING_MANDATORY_PARAMETER_RDCB:105,MISSING_MANDATORY_PARAMETER_VC:106},o=function(e,t,o,r,a,s){"use strict";if(this.contextKey=r,a&&(this.loggerCallback=a),s&&(this.errorCallback=s),this.adUID="WR_"+(new Date).getTime()+Math.round(1e3*Math.random()),this.viewabilityMeasurementActive=!0,this.viewabilityData=this.decodePayload(e),!this.viewabilityData)return void(this.viewabilityMeasurementActive=!1);if(this.contextKey&&""!==this.contextKey&&(this.log(n.INFO,"contextKey is set in this app, checking contextKey in viewability config"),!this.viewabilityData.hasOwnProperty("contextKey")||this.viewabilityData.contextKey.indexOf(this.contextKey)===-1))return this.log(n.INFO,"contextKey doesn't match, disabling viewability measurement"),void(this.viewabilityMeasurementActive=!1);var l="";try{"object"==typeof t?(this.videoNodeDocument=t.ownerDocument,this.videoNodeWindow=this.videoNodeDocument.defaultView||this.videoNodeDocument.videoNodeWindow,""===t.id&&(t.id="an_video_"+this.adUID),l=t.id):(l=t,this.videoNodeDocument=document,this.videoNodeWindow=window)}catch(d){this.videoNodeDocument=document,this.videoNodeWindow=window}this.videoInfo=this.decodeVideoInfos(o),this.log(n.INFO,"ANVideoViewabilityTracker start with parameters \nDomID:\t\t["+l+"]\nadUID:\t\t["+this.adUID+"]\nDuration:\t["+this.videoInfo.duration+"]\nPayload:\t"+e+"\n\nDimension:\t("+this.videoInfo.w+","+this.videoInfo.h+")\nPosition:\t("+this.videoInfo.x+","+this.videoInfo.y+")");try{if("undefined"==typeof this.videoNodeWindow.anxVVAPICache){this.videoNodeWindow.anxVVAPICache={events:Array(),init:Array()};var c=this.videoNodeDocument.createElement("script");c.type="text/javascript",c.async=!0,c.src=this.viewabilityData.vjs,c.readyState&&(c.onreadystatechange=function(){"loaded"!=c.readyState&&"complete"!=c.readyState||(c.onreadystatechange=null)}),c.onerror=function(e){this.log(n.DEBUG,"script load onerror",e),this.error(i.FAILED_TO_LOAD_VIEWABILITY_JS,"ANVideoViewabilityTracker failed to load viewability script ("+c.src+")."),this.viewabilityMeasurementActive=!1}.bind(this);var u=this.videoNodeDocument.getElementsByTagName("head")[0];u.appendChild(c)}}catch(d){this.error(i.INITIALIZATION_FAILED,{message:"ANVideoViewabilityTracker initialization failed",exception:d})}if(this.extractVersionModule(this.viewabilityData),"undefined"==typeof this.videoNodeWindow.anxVVAPI){var p={a:this.adUID,params:this.viewabilityData.viewParams,id:l,v:this.VIEWABILITY_MODULE_VERSION,dur:this.videoInfo.duration,w:this.videoInfo.w,h:this.videoInfo.h,x:this.videoInfo.x,y:this.videoInfo.y};this.videoNodeWindow.anxVVAPICache.init.push(p)}else this.videoNodeWindow.anxVVAPI.initializeFromParams(this.viewabilityData.viewParams,l,this.adUID,this.VIEWABILITY_MODULE_VERSION,this.videoInfo.duration,this.videoInfo.w,this.videoInfo.h,this.videoInfo.x,this.videoInfo.y)};o.prototype={VIEWABILITY_MODULE_VERSION:1,loggerCallback:null,errorCallback:null,log:function(e,t){"use strict";if(this.loggerCallback)try{this.loggerCallback(e,t)}catch(n){console.trace(n)}},error:function(e,t){"use strict";if(this.errorCallback)try{this.errorCallback(e,t)}catch(i){console.trace(i)}else this.log(n.ERROR,"ERR-"+e+": "+t)},lastKnownVolume:-1,parseUrl:function(e){"use strict";var t={http:"",params:""};try{if(e&&"string"==typeof e){var i=e.split(/:/);if(2===i.length&&(e=i[1],t.http=i[0]),i=e.split(/\?/),2===i.length?t.params=i[1]:(""===t.http||"//"!==e.substr(0,2))&&e.indexOf("=")>-1&&(t.params=i[0]),""!==t.params){i=t.params.split(/&/),t.params={};for(var o in i){var r=i[o].split(/=/);if(2===r.length)t.params[r[0]]=decodeURIComponent(r[1]);else if(r.length>2){for(var a="",s=1;s0)&&(t.duration=e.duration),("number"==typeof e.w||e.w>0)&&(t.w=e.w),("number"==typeof e.h||e.h>0)&&(t.h=e.h),("number"==typeof e.x||e.x>0)&&(t.x=e.x),("number"==typeof e.y||e.y>0)&&(t.y=e.y),t},extractVersionModule:function(e){"use strict";if(e){var t=/.+\/(\d+)\/trk\.js/,n=t.exec(e.viewJS);n&&n[1]&&(this.VIEWABILITY_MODULE_VERSION=n[1])}},notifyEvent:function(e){"use strict";if(!this.viewabilityMeasurementActive)return void this.log(n.INFO,"notifyEvent cancelled because viewability is not active");switch(this.log(n.INFO,"notifyEvent: ["+e+"]"),"an_outstream"==this.contextKey&&"sound_off"==e&&(e="sound_on"),e){case"fullscreen":e="expand";break;case"exitFullscreen":e="collapse";break;case"expand":case"collapse":return}var t=(new Date).getTime();try{if("undefined"==typeof this.videoNodeWindow.anxVVAPI){var i={a:this.adUID,c:e,d:t};this.videoNodeWindow.anxVVAPICache.events.push(i)}else this.videoNodeWindow.anxVVAPI.notifyEvent(this.adUID,e)}catch(o){this.log(n.DEBUG,{message:"notifyEvent failed",exception:o})}},onVolumeChange:function(e){"use strict";return this.viewabilityMeasurementActive?void("number"==typeof e&&(e>1&&(e=1),e<0&&(e=0),e!==this.lastKnownVolume&&(e>0?this.notifyEvent("sound_on"):this.notifyEvent("sound_off"),this.lastKnownVolume=e))):void this.log(n.INFO,"onVolumeChange cancelled because viewability is not active")}},e.exports=o,e.exports.LOG_LEVEL=n,e.exports.ERROR_CODE=i},function(e,t,n){var i,o=n(9),r="https:"===document.location.protocol?"https:":"http:",a="apn_mobile_video_placements",s="iframeVideoWrapper",l=r+"//acdn.adnxs.com/video/static/res/b2.mp4",d=5e3,c="[AutoplayHandler]",u=function(e){o.verbose(c,e)},p=function(e){o.error(c,e)},h=function(e){o.warn(c,e)},m=function(e){o.info(c,e)},f=!1,v=r+"//acdn.adnxs.com/video/static/res/av2.mp4",g={},y={stopMediaWithSound:1,neverAutoplay:2,allowAutoplay:3},A=n(18)(),b=function(){var e="safari";try{var t=navigator.platform,n=navigator.userAgent,i=navigator.appVersion;if(/CriOS/.test(n)&&(e="chrome"),/iP(hone|od|ad)/.test(t)){var o=i.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(o[1],10),parseInt(o[2],10),parseInt(o[3]||0,10),e]}return[0,0,0,e]}catch(r){return p(r),[0,0,0,e]}},k=function(){return/iphone/i.test(navigator.userAgent.toLowerCase())||/ipad/i.test(navigator.userAgent.toLowerCase())},T=function(){var e=-1;if(k())try{var t=navigator.userAgent.match(/CriOS\/([0-9]+)\./);t&&Array.isArray(t)&&t.length>1&&(e=parseInt(t[1]))}catch(n){u(n)}return e},w=function(){var e=b();if(e&&Array.isArray(e)&&e.length>=4){var t=e[0],n=e[3];return"chrome"===n&&10===t&&53===T()}},E=function(e,t,n,i){var o=e.length,r=0,s=function(e){r===o&&"function"==typeof n&&(f=!0,h("set hasDoneFakingAutoStartForAndroid = true by "+e),n())},d=function(e,t,n){f||(h("successfully performed autoplay trick by "+t),n[a]=e,r++,s(t))},c=function(e,t,n){h("removing failed iframe #"+(t+1)+" by "+n),document.getElementById(i).removeChild(e)},p=function(e,t,n){try{var i=e.contentWindow;if(!i[a]){var o,p;o=i.document.createElement("video"),i.document.body.appendChild(o),o.src=l,o.muted=!0,p=o.play(),o.pause(),void 0!==p&&p.then(function(){u("video promise done successfully by "+n),r++,s("promise done")})["catch"](function(a){var s={code:a.code,name:a.name,message:a.message};0===s.code?(h("playback failed : "+s.code+","+s.name+","+s.message+" by "+n),c(e,t,n)):(h("waterfall steps #"+(Number(r)+1)+" by "+n+" : autoplay trick's possible due to video promise be caught with "+a.name),d(o,n,i))})}}catch(m){u(m)}};e.forEach(function(e,n){p(e,n,t)})},S=function(){var e=navigator.appVersion.indexOf("Mobile"),t=navigator.appVersion.indexOf("Android");return e>-1||t>-1},I=function(){return/android/i.test(navigator.userAgent.toLowerCase())},C=function(){var e=-1;if(I())try{var t=navigator.userAgent.match(/Chrome\/([0-9]+)\./);t&&Array.isArray(t)&&t.length>1&&(e=parseInt(t[1]))}catch(n){u(n)}return e},P=function(e,t,n,i){if(I()===!1)return!1;var o=e&&"auto"===e,r=t&&"on"===t;return C()>=53?!(!r||!o||n)||!(!o||!i||n):C()<=52?!(!o||n):void 0},j=function(e){m("Start to detect Android Data Saver option in this device");var t,n=window.document.createElement("video"),i=function(e){try{e&&document.body.removeChild(e)}catch(t){u(t)}};try{n.src=l,n.muted=!0,document.body.appendChild(n),t=n.play(),void 0!==t&&t.then(function(){m("Android Data Saver option isn't detected in this device"),i(n),e(!1)})["catch"](function(){m("Android Data Saver option is detected in this device, so auto-play will be initiated by user's activity like touch"),i(n),e(!0)})}catch(o){u(o),m("failed to detect Android Data Saver option in this device, so auto-play will be initiated by user's activity like touch"),i(n),e(!0)}},x=function(e){var t;try{t=b()[0]>=8&&e===!0}catch(n){p(n)}return t},_=function(e,t,n,i,o){if(!f){u("create iframes for Android autoplay by "+e);var r=1;r=n&&n!==-1?n+1:i,u("total "+r+" iframes will be made by waterfall structure with "+e+" event");for(var a=[],l=0;l=1&&"general"!==e?E(a,e,t,o):"function"==typeof t&&t()}},V=function(e){try{var t=e.targetElementId,n=e.windowForPublisher,i=e.callbackAdUnitEntryPoint,o=e.callbackPatchForIOSChrome,r=e.waterfallSteps,a=e.maxWaterfallIframes,s=e.initialPlayback,l=e.initialAudio,d=e.automatedTestingOnlyAndroidSkipTouchStart,c=e.androidDSOverride,p=function(e){var o=e;if(c===!1&&e&&C()<=55&&"on"===l&&"auto"===s)return void i(!1,!0);if(c===!1&&(e=!1),C()<56&&P(s,l,d,e)){var u=function(e){_(e,function(){i(!1,!1)},r,a,t)};n.addEventListener("touchstart",function(){u("touchstart")},{passive:!0}),n.addEventListener("touchend",function(){setTimeout(function(){u("touchend")},1)},{passive:!0})}else{var p,h;C()>=56?(p="on"===l&&"auto"===s&&o===!1,h="auto"===s&&o===!0):h="auto"===s&&o===!0,_("general",function(){i(p,h)},r,a,t)}};S()?I()?(u("intialize for Android"),j(p)):(u("intialize for iOS and etc"),i(!1),w()&&o&&"function"==typeof o&&n.addEventListener("touchstart",o)):(u("initialize for general html5 browsers"),i(!1))}catch(h){u(h),e.callbackAdUnitEntryPoint&&"function"==typeof e.callbackAdUnitEntryPoint&&e.callbackAdUnitEntryPoint(!1)}},D=function(e,t,n,o){var r,a=A.browser.name.toLowerCase(),s=!(!A.os||"Android"!==A.os.name||!parseInt||"function"!=typeof parseInt||5!==parseInt(A.os.version));if(u("hasMaxLimitOnVideo: "+s),k())return g[o]=!0,void t(n);if("firefox"===a)i=document.createElement("video"),i.style.width="1px",i.style.height="1px",i.src=e,i.id=o,i.setAttribute("playsinline",""),document.body.appendChild(i);else{var l=document.createElement("iframe");l.style.display="none",l.id="iframe_"+o,document.body.appendChild(l),s?i||(i=document.createElement("video")):i=document.createElement("video"),i.style.width="1px",i.style.height="1px",i.src=e,i.id=o,i.setAttribute("playsinline",""),l.contentWindow.document.body.appendChild(i)}i.muted=n,n===!1&&i.volume&&(i.volume=.001),r=i.play(),void 0!==r?r.then(function(){g[o]=!0,u("video promise succeeded: "+o+", muted="+n),t(!0)})["catch"](function(e){var i={code:e.code,name:e.name,message:e.message};u("video promise failed: "+o+", muted="+n+","+i.code+","+i.name+","+i.message),g[o]=!0,t(!1)}):(g[o]=!0,t(!0))},M=function(e,t){var n,i;"undefined"==typeof t&&(t=!1),n="videoPlacementTest_"+(new Date).getTime()+Math.floor(1e4*Math.random()),i="videoPlacementTest_"+(new Date).getTime()+Math.floor(1e4*Math.random()),g={},g[n]=!1,g[i]=!1,t?D(v,function(t){t===!0?(u("decided to allowAutoplay"),e(y.allowAutoplay)):D(v,function(t){t===!0?(u("decided to stopMediaWithSound"),e(y.stopMediaWithSound)):(u("decided to neverAutoplay"),e(y.neverAutoplay))},!0,i)},!1,n):D(v,function(t){t===!0?(u("decided to stopMediaWithSound"),e(y.stopMediaWithSound)):(u("decided to neverAutoplay"),e(y.neverAutoplay))},!0,i);var o=function(){document.removeEventListener("onFocus",o),setTimeout(function(){var o=document,r=document.getElementById("iframe_"+n);r&&(o=r.contentWindow.document);var a=o.getElementById(n),s=o.getElementById(i);a&&a.parentNode&&(a.parentNode.removeChild(a),u("remove test video placement :"+n)),s&&s.parentNode&&(s.parentNode.removeChild(s),u("remove test video placement for sound on case :"+i)),t?g[n]===!1&&g[i]===!1&&(u("timeout video test"),u("decided to neverAutoplay"),e(y.neverAutoplay)):g[i]===!1&&(u("timeout video test"),u("decided to neverAutoplay"),e(y.neverAutoplay))},d)};document.hasFocus()?o():document.addEventListener("onFocus",o)};e.exports={APN_MOBILE_VIDEO_PLACEMENT_ID:a,APN_MOBILE_IFRAME_NAME:s,initialize:V,iOSversion:b,isIOS:k,isIosInlineRequired:x,isRequiredFakeAndroidAutoStart:P,isMobile:S,testDataSaverForAndroid:j,getAutoplayPolicy:M,videoPolicy:y}},function(e,t,n){var i=n(59),o=n(26),r=n(66),a=n(25),s=n(28),l=n(29),d=15e3,c="https://rb.adnxs.com/pack?log=log_rb_video_waterfall_events&format=json",u=function(e){s.debug(e,"AdHandler")},p=1,h=2,m=3,f=4,v=5,g=6,y=7,A=8,b=9,k=10,T=11,w={STEP_START:0,STEP_END:1,STEP_NOT_ATTEMPTED:2,DISABLED:3},E={AD_DELIVERED:0,AD_ERROR:1,WATERFALL_TIMEOUT:2,MAX_WATERFALL_STEPS_REACHED:3,PREVIOUS_AD_DELIVERED:4,NON_WATERFALL_TIMEOUT:5,PUBLISHER_DISABLED:11,INCOMPATIBILITY_DISABLED:12};e.exports=function(e,t,n){t._vastObjArr&&Array.isArray(t._vastObjArr)||(t._vastObjArr=[]);var s,S,I,C,P,j=900,x=1,_=!1,V=3e3,D="2.0",M=(new Date).getTime()+Math.floor(1e4*Math.random()),N=!1,O=!1,R=t.waterfallTimeout,U=!1,L=0,F=0,B=0,$=t.waterfallSteps,H=t.disableCollapse&&void 0!==t.disableCollapse.replay,W="",z=!1,q=!1;H&&(P=t.disableCollapse.replay);var J=function(e){n.cbWhenWaterfall&&n.cbWhenWaterfall(e)},G=n.cbWhenVideoComplete,Q=n.cbWhenAudio,X=n.cbWhenQuartile,Y=n.cbWhenClickOpenUrl,K=n.cbWhenDestroy,Z=n.cbWhenImpression,ee=n.cbCoreVideoEvent,te={loaded:"loaded","creative-view":"creativeView","video-start":"start","video-mid":"midpoint","video-first-quartile":"firstQuartile","video-third-quartile":"thirdQuartile","video-complete":"complete","audio-mute":"mute","audio-unmute":"unmute","video-pause":"pause",rewind:"rewind","video-resume":"resume","video-fullscreen":"fullscreen","ad-expand":"expand","ad-collapse":"collapse","video-stopped":"close","video-exit-fullscreen":"exitFullscreen","video-skip":"skip","ad-progress":"progress",acceptInvitation:"acceptInvitation",acceptInvitationLinear:"acceptInvitationLinear",closeLinear:"closeLinear",impression:"impression",error:"error","video-failed":"error","ad-click":"ClickTracking","volume-change":"volumeChange"},ne=!1,ie=[],oe=[],re=null,ae=null,se=!!(t&&t.viewability&&t.viewability.config),le=function(){var e=/iphone/i.test(navigator.userAgent.toLowerCase());return e},de=function(){var e=le()||/ipad/i.test(navigator.userAgent.toLowerCase());return e},ce=function(e){q=!0;var n=t._vastObjArr.slice(0);if(s&&n.push(s),n.length)for(var i=0;i0)for(i=0;i0)for(i=0;irequesting - dispatch : "+e.name);var i=e.name,o={video_start:"video-start",video_impression:"impression",video_mute:"audio-mute",video_click:"video-click",video_complete:"video-complete",video_fullscreen:"video-fullscreen",quartile_event:"quartile-event",video_pause:"video-pause",video_unmute:"audio-unmute",video_failed:"video-failed",video_time:"video-time",video_resume:"video-resume",video_stopped:"video-stopped","video-first-quartile":"video-first-quartile","video-mid":"video-mid","video-third-quartile":"video-third-quartile",fullscreenchange:"video-fullscreen",video_click_open_url:"video-click-open-url",video_skip:"video-skip"},s=o[i],l=!1;if(ne&&ie.indexOf(s)!==-1&&(l=!0),"quartile-event"===s)switch(e.quartile){case 1:s="video-first-quartile";break;case 2:s="video-mid";break;case 3:s="video-third-quartile"}if("video-fullscreen"===s&&"3.0"===D)switch(e.fullscreenStatus){case"enter":s="video-fullscreen";break;case"exit":s="video-exit-fullscreen";break;default:s="video-fullscreen"}void 0===s&&(s=i),e.player&&r.setPlayer(e.player),e&&e.name&&"ad-click"===e.name&&!e.trackClick||(n||(l?oe.push(s):r.requestTracking(s,M)),t.hasOwnProperty("cbNotification")&&("AdUnit"===e.eventType?t.cbNotification(e.eventType,s,t.targetId,e.obj):he(s,e.obj)),t.cbApnVastPlayer&&t.cbApnVastPlayer(s),"canplay"===s&&e.companionAds&&(ae.companionAds=a.parse(e.companionAds)),"impression"===s&&(N=!0,Z&&"function"==typeof Z&&Z(),O?(I&&clearTimeout(I),pe(!1,!0),r.requestTracking("notifyurl",M)):t.overlayPlayer&&r.requestTracking("notifyurl",M),ae.hasOwnProperty("companionAds")&&ae.companionAds.companions.length>0&&t.hasOwnProperty("companionContainers")&&(re=a.renderCompanions(ae.companionAds,t,me))),"video-first-quartile"!==s&&"video-mid"!==s&&"video-third-quartile"!==s||X&&"function"==typeof X&&X(s),"video-complete"===s&&G&&"function"==typeof G&&G(s),"audio-mute"!==s&&"audio-unmute"!==s||Q&&"function"==typeof Q&&Q(s),"video-click-open-url"===s&&Y(e))},ve=function(e,t){if(ne=e)ie=t;else{for(var n=0;n0)for(var i=0;i0&&n.push("IconViewTracking_"+o.program),o&&o.IconClickTracking&&o.IconClickTracking.length>0&&n.push("IconClickTracking_"+o.program)}r.init(n,M),r.addTrackingEvents(e.trackingUrls,M);var a,s,l=e.clickTrackingUrls;for(a=0;a0)for(var h=0;h0)for(var f=0;f0)for(var g=0;g=0&&(s[l]=null);t.data.vastProgressEvent=s,a.maintainAspectRatio&&void 0!==a.maintainAspectRatio?(t.video.maintainAspectRatio=a.maintainAspectRatio,t.maintainAspectRatio=a.maintainAspectRatio):(t.video.maintainAspectRatio=!0,t.maintainAspectRatio=!0),a.scalable&&void 0!==a.scalable?(t.video.scalable=a.scalable,t.canScale=a.scalable):(t.video.scalable=!0,t.canScale=!0),t.video.apiFramework=a.apiFramework,t.video.type=a.type,t.requiredPlayer=a.requiredPlayer,t.videoUrl=a.url,t.clickUrls=i.clickUrls,t.adParameters=i.adParameters,t.extensions=i.extensions,t.data.vastDurationMsec=i.durationMsecs,t.endCard&&t.endCard.showCompanion&&i.companionAds&&(t.endCard.companionAds=i.companionAds.companions,t.endCard.companionCallback=me),t.video.apiFramework&&t.video.apiFramework.toLowerCase().indexOf("vpaid")>=0?t.vpaid=!0:t.vpaid=!1,H&&(t.disableCollapse.replay=!t.vpaid&&P),t.targetElement=e,n.cbForHandlingDispatchedEvent=fe,n.cbDelayEventsTracking=ve;var d=n.cbWhenReady;return n.cbWhenReady=function(e){e.setVastAttribute(),e.test("VIDLA163",e.options.data),fe({name:"loaded",player:e}),d(e)},n.cbRenderVideo(n,t,ye),_=!0,void(ae=i)}return _=!0,void n.cbWhenDestroy({type:1,code:a.errorCode,message:"Unable to select rendition"})}catch(c){u(c),r="Exception error: "+c}_=!0,n.cbWhenDestroy({type:0,code:0,message:r})},be=function(e){_=!1,e&&Ae(e)},ke=function(){var e=null;return s&&(e=s,s=null),e},Te=function(e){var n=null;return L0&&p.expires