react-native-theoplayer 1.6.1 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/android/build.gradle +76 -33
- package/android/local/com/theoplayer/theoplayer-sdk-android/ads-wrapper/4.3.0/ads-wrapper-4.3.0.aar +0 -0
- package/android/local/com/theoplayer/theoplayer-sdk-android/ads-wrapper/4.3.0/ads-wrapper-4.3.0.pom +9 -0
- package/android/local/com/theoplayer/theoplayer-sdk-android/ads-wrapper/maven-metadata-local.xml +13 -0
- package/android/src/main/java/com/theoplayer/PlayerConfigHelper.java +40 -0
- package/android/src/main/java/com/theoplayer/ReactTHEOplayerPackage.java +8 -3
- package/android/src/main/java/com/theoplayer/ReactTHEOplayerView.java +131 -28
- package/android/src/main/java/com/theoplayer/ReactTHEOplayerViewManager.java +14 -1
- package/android/src/main/java/com/theoplayer/SourceHelper.java +137 -86
- package/android/src/main/java/com/theoplayer/VideoEventEmitter.java +44 -12
- package/android/src/main/java/com/theoplayer/abr/ABRConfigurationAdapter.kt +72 -0
- package/android/src/main/java/com/theoplayer/ads/AdEventAdapter.java +92 -0
- package/android/src/main/java/com/theoplayer/ads/AdInfo.java +168 -0
- package/android/src/main/java/com/theoplayer/ads/AdsModule.java +152 -0
- package/android/src/main/java/com/theoplayer/drm/ContentProtectionAdapter.kt +143 -0
- package/android/src/main/java/com/theoplayer/drm/ContentProtectionModule.kt +273 -0
- package/android/src/main/java/com/theoplayer/drm/KeySystemAdapter.kt +22 -0
- package/android/src/main/java/com/theoplayer/drm/ProxyContentProtectionIntegration.kt +33 -0
- package/android/src/main/java/com/theoplayer/drm/ProxyContentProtectionIntegrationFactory.kt +19 -0
- package/android/src/main/java/com/theoplayer/drm/RequestMethodAdapter.kt +28 -0
- package/android/src/main/java/com/theoplayer/track/QualityListAdapter.java +54 -0
- package/android/src/main/java/com/theoplayer/track/QualityListFilter.java +40 -0
- package/android/src/main/java/com/theoplayer/track/TrackListInfo.java +10 -2
- package/android/src/main/java/com/theoplayer/util/TypeUtils.kt +17 -0
- package/android/src/main/java/com/theoplayer/util/ViewResolver.java +42 -0
- package/ios/THEOplayerRCTAdAggregator.swift +158 -0
- package/ios/THEOplayerRCTAdsAPI.swift +296 -0
- package/ios/THEOplayerRCTBridge.m +65 -0
- package/ios/THEOplayerRCTContentProtectionAPI.swift +359 -0
- package/ios/THEOplayerRCTContentProtectionAggregator.swift +119 -0
- package/ios/THEOplayerRCTDebug.swift +11 -5
- package/ios/THEOplayerRCTMetadataAggregator.swift +1 -1
- package/ios/THEOplayerRCTNetworkUtils.swift +54 -0
- package/ios/THEOplayerRCTProxyContentProtectionIntegration.swift +155 -0
- package/ios/THEOplayerRCTProxyContentProtectionIntegrationFactory.swift +32 -0
- package/ios/THEOplayerRCTSourceDescriptionBuilder.swift +223 -30
- package/ios/THEOplayerRCTTypeUtils.swift +18 -0
- package/ios/THEOplayerRCTView.swift +109 -49
- package/ios/THEOplayerRCTViewAdEventHandler.swift +238 -0
- package/ios/{THEOplayerRCTViewEventHandler.swift → THEOplayerRCTViewMainEventHandler.swift} +7 -119
- package/ios/THEOplayerRCTViewTextTrackEventHandler.swift +134 -0
- package/ios/Theoplayer-Bridging-Header.h +3 -1
- package/ios/custom/Frameworks/ios/put_custom_ios_xcframework_here.txt +2 -0
- package/ios/custom/react-native-theoplayer_custom_ios.podspec +36 -0
- package/ios/custom/theofeatures.sh +14 -0
- package/lib/commonjs/api/THEOplayerView.js.map +1 -1
- package/lib/commonjs/api/abr/ABRConfiguration.js +2 -0
- package/lib/commonjs/api/abr/ABRConfiguration.js.map +1 -0
- package/lib/commonjs/api/abr/barrel.js +19 -0
- package/lib/commonjs/api/abr/barrel.js.map +1 -0
- package/lib/commonjs/api/ads/Ad.js +6 -0
- package/lib/commonjs/api/ads/Ad.js.map +1 -0
- package/lib/commonjs/api/ads/AdBreak.js +6 -0
- package/lib/commonjs/api/ads/AdBreak.js.map +1 -0
- package/lib/commonjs/api/ads/AdsAPI.js +6 -0
- package/lib/commonjs/api/ads/AdsAPI.js.map +1 -0
- package/lib/commonjs/api/ads/AdsConfiguration.js +6 -0
- package/lib/commonjs/api/ads/AdsConfiguration.js.map +1 -0
- package/lib/commonjs/api/ads/CompanionAd.js +2 -0
- package/lib/commonjs/api/ads/CompanionAd.js.map +1 -0
- package/lib/commonjs/api/ads/GoogleDai.js +2 -0
- package/lib/commonjs/api/ads/GoogleDai.js.map +1 -0
- package/lib/commonjs/api/ads/GoogleImaAd.js +6 -0
- package/lib/commonjs/api/ads/GoogleImaAd.js.map +1 -0
- package/lib/commonjs/api/ads/GoogleImaConfiguration.js +2 -0
- package/lib/commonjs/api/ads/GoogleImaConfiguration.js.map +1 -0
- package/lib/commonjs/api/ads/barrel.js +110 -0
- package/lib/commonjs/api/ads/barrel.js.map +1 -0
- package/lib/commonjs/api/barrel.js +58 -6
- package/lib/commonjs/api/barrel.js.map +1 -1
- package/lib/commonjs/api/config/PlayerConfiguration.js +4 -0
- package/lib/commonjs/api/config/PlayerConfiguration.js.map +1 -1
- package/lib/commonjs/api/drm/ContentProtectionAPI.js +6 -0
- package/lib/commonjs/api/drm/ContentProtectionAPI.js.map +1 -0
- package/lib/commonjs/api/drm/ContentProtectionIntegration.js +6 -0
- package/lib/commonjs/api/drm/ContentProtectionIntegration.js.map +1 -0
- package/lib/commonjs/api/drm/ContentProtectionIntegrationFactory.js +6 -0
- package/lib/commonjs/api/drm/ContentProtectionIntegrationFactory.js.map +1 -0
- package/lib/commonjs/api/drm/ContentProtectionRequest.js +2 -0
- package/lib/commonjs/api/drm/ContentProtectionRequest.js.map +1 -0
- package/lib/commonjs/api/drm/ContentProtectionResponse.js +6 -0
- package/lib/commonjs/api/drm/ContentProtectionResponse.js.map +1 -0
- package/lib/commonjs/api/drm/barrel.js +71 -0
- package/lib/commonjs/api/drm/barrel.js.map +1 -0
- package/lib/commonjs/api/event/AdEvent.js +89 -0
- package/lib/commonjs/api/event/AdEvent.js.map +1 -0
- package/lib/commonjs/api/event/barrel.js +13 -0
- package/lib/commonjs/api/event/barrel.js.map +1 -1
- package/lib/commonjs/api/source/SourceDescription.js.map +1 -1
- package/lib/commonjs/api/source/ads/FreeWheelAdDescription.js +6 -0
- package/lib/commonjs/api/source/ads/FreeWheelAdDescription.js.map +1 -0
- package/lib/commonjs/api/source/ads/IMAAdDescription.js +6 -0
- package/lib/commonjs/api/source/ads/IMAAdDescription.js.map +1 -0
- package/lib/commonjs/api/source/ads/SpotXAdDescription.js +6 -0
- package/lib/commonjs/api/source/ads/SpotXAdDescription.js.map +1 -0
- package/lib/commonjs/api/source/ads/THEOplayerAdDescription.js +6 -0
- package/lib/commonjs/api/source/ads/THEOplayerAdDescription.js.map +1 -0
- package/lib/commonjs/api/source/ads/barrel.js +84 -0
- package/lib/commonjs/api/source/ads/barrel.js.map +1 -0
- package/lib/commonjs/api/source/ads/ssai/GoogleDAIConfiguration.js +6 -0
- package/lib/commonjs/api/source/ads/ssai/GoogleDAIConfiguration.js.map +1 -0
- package/lib/commonjs/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.js +6 -0
- package/lib/commonjs/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.js.map +1 -0
- package/lib/commonjs/api/source/ads/ssai/ServerSideAdInsertionConfiguration.js +6 -0
- package/lib/commonjs/api/source/ads/ssai/ServerSideAdInsertionConfiguration.js.map +1 -0
- package/lib/commonjs/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.js +6 -0
- package/lib/commonjs/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.js.map +1 -0
- package/lib/commonjs/api/source/ads/ssai/barrel.js +58 -0
- package/lib/commonjs/api/source/ads/ssai/barrel.js.map +1 -0
- package/lib/commonjs/api/source/barrel.js +16 -3
- package/lib/commonjs/api/source/barrel.js.map +1 -1
- package/lib/commonjs/api/source/drm/DRMConfiguration.js.map +1 -1
- package/lib/commonjs/api/track/MediaTrack.js +29 -0
- package/lib/commonjs/api/track/MediaTrack.js.map +1 -1
- package/lib/commonjs/api/utils/TypeUtils.js +62 -0
- package/lib/commonjs/api/utils/TypeUtils.js.map +1 -0
- package/lib/commonjs/api/utils/barrel.js +19 -0
- package/lib/commonjs/api/utils/barrel.js.map +1 -0
- package/lib/commonjs/index.js +10 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internal/THEOplayerView.js +42 -3
- package/lib/commonjs/internal/THEOplayerView.js.map +1 -1
- package/lib/commonjs/internal/THEOplayerView.web.js +41 -2
- package/lib/commonjs/internal/THEOplayerView.web.js.map +1 -1
- package/lib/commonjs/internal/ads/THEOplayerNativeAdsAPI.js +54 -0
- package/lib/commonjs/internal/ads/THEOplayerNativeAdsAPI.js.map +1 -0
- package/lib/commonjs/internal/ads/THEOplayerNativeGoogleDAI.js +34 -0
- package/lib/commonjs/internal/ads/THEOplayerNativeGoogleDAI.js.map +1 -0
- package/lib/commonjs/internal/ads/THEOplayerWebAdsAPI.js +78 -0
- package/lib/commonjs/internal/ads/THEOplayerWebAdsAPI.js.map +1 -0
- package/lib/commonjs/internal/ads/THEOplayerWebGoogleDAI.js +32 -0
- package/lib/commonjs/internal/ads/THEOplayerWebGoogleDAI.js.map +1 -0
- package/lib/commonjs/internal/drm/ContentProtectionRegistry.js +214 -0
- package/lib/commonjs/internal/drm/ContentProtectionRegistry.js.map +1 -0
- package/lib/commonjs/internal/drm/ContentProtectionRegistry.web.js +20 -0
- package/lib/commonjs/internal/drm/ContentProtectionRegistry.web.js.map +1 -0
- package/lib/commonjs/internal/drm/NativeCertificateRequest.js +41 -0
- package/lib/commonjs/internal/drm/NativeCertificateRequest.js.map +1 -0
- package/lib/commonjs/internal/drm/NativeCertificateResponse.js +41 -0
- package/lib/commonjs/internal/drm/NativeCertificateResponse.js.map +1 -0
- package/lib/commonjs/internal/drm/NativeContentProtectionEvent.js +2 -0
- package/lib/commonjs/internal/drm/NativeContentProtectionEvent.js.map +1 -0
- package/lib/commonjs/internal/drm/NativeLicenseRequest.js +44 -0
- package/lib/commonjs/internal/drm/NativeLicenseRequest.js.map +1 -0
- package/lib/commonjs/internal/drm/NativeLicenseResponse.js +41 -0
- package/lib/commonjs/internal/drm/NativeLicenseResponse.js.map +1 -0
- package/lib/commonjs/internal/utils/TypeUtils.js +41 -0
- package/lib/commonjs/internal/utils/TypeUtils.js.map +1 -0
- package/lib/commonjs/internal/web/TrackUtils.js +19 -0
- package/lib/commonjs/internal/web/TrackUtils.js.map +1 -1
- package/lib/module/api/THEOplayerView.js.map +1 -1
- package/lib/module/api/abr/ABRConfiguration.js +2 -0
- package/lib/module/api/abr/ABRConfiguration.js.map +1 -0
- package/lib/module/api/abr/barrel.js +2 -0
- package/lib/module/api/abr/barrel.js.map +1 -0
- package/lib/module/api/ads/Ad.js +2 -0
- package/lib/module/api/ads/Ad.js.map +1 -0
- package/lib/module/api/ads/AdBreak.js +2 -0
- package/lib/module/api/ads/AdBreak.js.map +1 -0
- package/lib/module/api/ads/AdsAPI.js +2 -0
- package/lib/module/api/ads/AdsAPI.js.map +1 -0
- package/lib/module/api/ads/AdsConfiguration.js +2 -0
- package/lib/module/api/ads/AdsConfiguration.js.map +1 -0
- package/lib/module/api/ads/CompanionAd.js +2 -0
- package/lib/module/api/ads/CompanionAd.js.map +1 -0
- package/lib/module/api/ads/GoogleDai.js +2 -0
- package/lib/module/api/ads/GoogleDai.js.map +1 -0
- package/lib/module/api/ads/GoogleImaAd.js +2 -0
- package/lib/module/api/ads/GoogleImaAd.js.map +1 -0
- package/lib/module/api/ads/GoogleImaConfiguration.js +2 -0
- package/lib/module/api/ads/GoogleImaConfiguration.js.map +1 -0
- package/lib/module/api/ads/barrel.js +9 -0
- package/lib/module/api/ads/barrel.js.map +1 -0
- package/lib/module/api/barrel.js +5 -1
- package/lib/module/api/barrel.js.map +1 -1
- package/lib/module/api/config/PlayerConfiguration.js +1 -1
- package/lib/module/api/config/PlayerConfiguration.js.map +1 -1
- package/lib/module/api/drm/ContentProtectionAPI.js +2 -0
- package/lib/module/api/drm/ContentProtectionAPI.js.map +1 -0
- package/lib/module/api/drm/ContentProtectionIntegration.js +2 -0
- package/lib/module/api/drm/ContentProtectionIntegration.js.map +1 -0
- package/lib/module/api/drm/ContentProtectionIntegrationFactory.js +2 -0
- package/lib/module/api/drm/ContentProtectionIntegrationFactory.js.map +1 -0
- package/lib/module/api/drm/ContentProtectionRequest.js +2 -0
- package/lib/module/api/drm/ContentProtectionRequest.js.map +1 -0
- package/lib/module/api/drm/ContentProtectionResponse.js +2 -0
- package/lib/module/api/drm/ContentProtectionResponse.js.map +1 -0
- package/lib/module/api/drm/barrel.js +6 -0
- package/lib/module/api/drm/barrel.js.map +1 -0
- package/lib/module/api/event/AdEvent.js +82 -0
- package/lib/module/api/event/AdEvent.js.map +1 -0
- package/lib/module/api/event/barrel.js +1 -0
- package/lib/module/api/event/barrel.js.map +1 -1
- package/lib/module/api/source/SourceDescription.js.map +1 -1
- package/lib/module/api/source/ads/FreeWheelAdDescription.js +2 -0
- package/lib/module/api/source/ads/FreeWheelAdDescription.js.map +1 -0
- package/lib/module/api/source/ads/IMAAdDescription.js +2 -0
- package/lib/module/api/source/ads/IMAAdDescription.js.map +1 -0
- package/lib/module/api/source/ads/SpotXAdDescription.js +2 -0
- package/lib/module/api/source/ads/SpotXAdDescription.js.map +1 -0
- package/lib/module/api/source/ads/THEOplayerAdDescription.js +2 -0
- package/lib/module/api/source/ads/THEOplayerAdDescription.js.map +1 -0
- package/lib/module/api/source/ads/barrel.js +7 -0
- package/lib/module/api/source/ads/barrel.js.map +1 -0
- package/lib/module/api/source/ads/ssai/GoogleDAIConfiguration.js +2 -0
- package/lib/module/api/source/ads/ssai/GoogleDAIConfiguration.js.map +1 -0
- package/lib/module/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.js +2 -0
- package/lib/module/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.js.map +1 -0
- package/lib/module/api/source/ads/ssai/ServerSideAdInsertionConfiguration.js +2 -0
- package/lib/module/api/source/ads/ssai/ServerSideAdInsertionConfiguration.js.map +1 -0
- package/lib/module/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.js +2 -0
- package/lib/module/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.js.map +1 -0
- package/lib/module/api/source/ads/ssai/barrel.js +5 -0
- package/lib/module/api/source/ads/ssai/barrel.js.map +1 -0
- package/lib/module/api/source/barrel.js +1 -0
- package/lib/module/api/source/barrel.js.map +1 -1
- package/lib/module/api/source/drm/DRMConfiguration.js.map +1 -1
- package/lib/module/api/track/MediaTrack.js +23 -1
- package/lib/module/api/track/MediaTrack.js.map +1 -1
- package/lib/module/api/utils/TypeUtils.js +36 -0
- package/lib/module/api/utils/TypeUtils.js.map +1 -0
- package/lib/module/api/utils/barrel.js +2 -0
- package/lib/module/api/utils/barrel.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/THEOplayerView.js +40 -3
- package/lib/module/internal/THEOplayerView.js.map +1 -1
- package/lib/module/internal/THEOplayerView.web.js +42 -4
- package/lib/module/internal/THEOplayerView.web.js.map +1 -1
- package/lib/module/internal/ads/THEOplayerNativeAdsAPI.js +43 -0
- package/lib/module/internal/ads/THEOplayerNativeAdsAPI.js.map +1 -0
- package/lib/module/internal/ads/THEOplayerNativeGoogleDAI.js +24 -0
- package/lib/module/internal/ads/THEOplayerNativeGoogleDAI.js.map +1 -0
- package/lib/module/internal/ads/THEOplayerWebAdsAPI.js +68 -0
- package/lib/module/internal/ads/THEOplayerWebAdsAPI.js.map +1 -0
- package/lib/module/internal/ads/THEOplayerWebGoogleDAI.js +23 -0
- package/lib/module/internal/ads/THEOplayerWebGoogleDAI.js.map +1 -0
- package/lib/module/internal/drm/ContentProtectionRegistry.js +188 -0
- package/lib/module/internal/drm/ContentProtectionRegistry.js.map +1 -0
- package/lib/module/internal/drm/ContentProtectionRegistry.web.js +9 -0
- package/lib/module/internal/drm/ContentProtectionRegistry.web.js.map +1 -0
- package/lib/module/internal/drm/NativeCertificateRequest.js +31 -0
- package/lib/module/internal/drm/NativeCertificateRequest.js.map +1 -0
- package/lib/module/internal/drm/NativeCertificateResponse.js +30 -0
- package/lib/module/internal/drm/NativeCertificateResponse.js.map +1 -0
- package/lib/module/internal/drm/NativeContentProtectionEvent.js +2 -0
- package/lib/module/internal/drm/NativeContentProtectionEvent.js.map +1 -0
- package/lib/module/internal/drm/NativeLicenseRequest.js +34 -0
- package/lib/module/internal/drm/NativeLicenseRequest.js.map +1 -0
- package/lib/module/internal/drm/NativeLicenseResponse.js +30 -0
- package/lib/module/internal/drm/NativeLicenseResponse.js.map +1 -0
- package/lib/module/internal/utils/TypeUtils.js +24 -0
- package/lib/module/internal/utils/TypeUtils.js.map +1 -0
- package/lib/module/internal/web/TrackUtils.js +15 -0
- package/lib/module/internal/web/TrackUtils.js.map +1 -1
- package/lib/typescript/lib/commonjs/api/abr/ABRConfiguration.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/abr/barrel.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/ads/Ad.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/ads/AdBreak.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/ads/AdsAPI.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/ads/AdsConfiguration.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/ads/CompanionAd.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/ads/GoogleDai.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/ads/GoogleImaAd.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/ads/GoogleImaConfiguration.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/ads/barrel.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/config/PlayerConfiguration.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/drm/ContentProtectionAPI.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/drm/ContentProtectionIntegration.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/drm/ContentProtectionIntegrationFactory.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/drm/ContentProtectionRequest.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/drm/ContentProtectionResponse.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/drm/barrel.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/event/AdEvent.d.ts +2 -0
- package/lib/typescript/lib/commonjs/api/source/ads/FreeWheelAdDescription.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/source/ads/IMAAdDescription.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/source/ads/SpotXAdDescription.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/source/ads/THEOplayerAdDescription.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/source/ads/barrel.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/source/ads/ssai/GoogleDAIConfiguration.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/source/ads/ssai/ServerSideAdInsertionConfiguration.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/source/ads/ssai/barrel.d.ts +1 -0
- package/lib/typescript/lib/commonjs/api/track/MediaTrack.d.ts +8 -0
- package/lib/typescript/lib/commonjs/api/utils/TypeUtils.d.ts +13 -0
- package/lib/typescript/lib/commonjs/api/utils/barrel.d.ts +1 -0
- package/lib/typescript/lib/commonjs/index.d.ts +2 -0
- package/lib/typescript/lib/commonjs/internal/THEOplayerView.d.ts +5 -0
- package/lib/typescript/lib/commonjs/internal/THEOplayerView.web.d.ts +4 -0
- package/lib/typescript/lib/commonjs/internal/ads/THEOplayerNativeAdsAPI.d.ts +14 -0
- package/lib/typescript/lib/commonjs/internal/ads/THEOplayerNativeGoogleDAI.d.ts +9 -0
- package/lib/typescript/lib/commonjs/internal/ads/THEOplayerWebAdsAPI.d.ts +14 -0
- package/lib/typescript/lib/commonjs/internal/ads/THEOplayerWebGoogleDAI.d.ts +9 -0
- package/lib/typescript/lib/commonjs/internal/drm/ContentProtectionRegistry.d.ts +14 -0
- package/lib/typescript/lib/commonjs/internal/drm/ContentProtectionRegistry.web.d.ts +5 -0
- package/lib/typescript/lib/commonjs/internal/drm/NativeCertificateRequest.d.ts +18 -0
- package/lib/typescript/lib/commonjs/internal/drm/NativeCertificateResponse.d.ts +21 -0
- package/lib/typescript/lib/commonjs/internal/drm/NativeContentProtectionEvent.d.ts +0 -0
- package/lib/typescript/lib/commonjs/internal/drm/NativeLicenseRequest.d.ts +20 -0
- package/lib/typescript/lib/commonjs/internal/drm/NativeLicenseResponse.d.ts +22 -0
- package/lib/typescript/lib/commonjs/internal/utils/TypeUtils.d.ts +6 -0
- package/lib/typescript/lib/commonjs/internal/web/TrackUtils.d.ts +2 -0
- package/lib/typescript/lib/module/api/abr/ABRConfiguration.d.ts +0 -0
- package/lib/typescript/lib/module/api/abr/barrel.d.ts +1 -0
- package/lib/typescript/lib/module/api/ads/Ad.d.ts +1 -0
- package/lib/typescript/lib/module/api/ads/AdBreak.d.ts +1 -0
- package/lib/typescript/lib/module/api/ads/AdsAPI.d.ts +1 -0
- package/lib/typescript/lib/module/api/ads/AdsConfiguration.d.ts +1 -0
- package/lib/typescript/lib/module/api/ads/CompanionAd.d.ts +0 -0
- package/lib/typescript/lib/module/api/ads/GoogleDai.d.ts +0 -0
- package/lib/typescript/lib/module/api/ads/GoogleImaAd.d.ts +1 -0
- package/lib/typescript/lib/module/api/ads/GoogleImaConfiguration.d.ts +0 -0
- package/lib/typescript/lib/module/api/ads/barrel.d.ts +5 -0
- package/lib/typescript/lib/module/api/barrel.d.ts +5 -1
- package/lib/typescript/lib/module/api/config/PlayerConfiguration.d.ts +1 -0
- package/lib/typescript/lib/module/api/config/barrel.d.ts +1 -1
- package/lib/typescript/lib/module/api/drm/ContentProtectionAPI.d.ts +1 -0
- package/lib/typescript/lib/module/api/drm/ContentProtectionIntegration.d.ts +1 -0
- package/lib/typescript/lib/module/api/drm/ContentProtectionIntegrationFactory.d.ts +1 -0
- package/lib/typescript/lib/module/api/drm/ContentProtectionRequest.d.ts +0 -0
- package/lib/typescript/lib/module/api/drm/ContentProtectionResponse.d.ts +1 -0
- package/lib/typescript/lib/module/api/drm/barrel.d.ts +4 -0
- package/lib/typescript/lib/module/api/event/AdEvent.d.ts +1 -0
- package/lib/typescript/lib/module/api/event/barrel.d.ts +1 -0
- package/lib/typescript/lib/module/api/source/ads/FreeWheelAdDescription.d.ts +1 -0
- package/lib/typescript/lib/module/api/source/ads/IMAAdDescription.d.ts +1 -0
- package/lib/typescript/lib/module/api/source/ads/SpotXAdDescription.d.ts +1 -0
- package/lib/typescript/lib/module/api/source/ads/THEOplayerAdDescription.d.ts +1 -0
- package/lib/typescript/lib/module/api/source/ads/barrel.d.ts +5 -0
- package/lib/typescript/lib/module/api/source/ads/ssai/GoogleDAIConfiguration.d.ts +1 -0
- package/lib/typescript/lib/module/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.d.ts +1 -0
- package/lib/typescript/lib/module/api/source/ads/ssai/ServerSideAdInsertionConfiguration.d.ts +1 -0
- package/lib/typescript/lib/module/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.d.ts +1 -0
- package/lib/typescript/lib/module/api/source/ads/ssai/barrel.d.ts +4 -0
- package/lib/typescript/lib/module/api/source/barrel.d.ts +1 -0
- package/lib/typescript/lib/module/api/track/MediaTrack.d.ts +8 -1
- package/lib/typescript/lib/module/api/utils/TypeUtils.d.ts +12 -0
- package/lib/typescript/lib/module/api/utils/barrel.d.ts +1 -0
- package/lib/typescript/lib/module/index.d.ts +1 -0
- package/lib/typescript/lib/module/internal/THEOplayerView.d.ts +8 -0
- package/lib/typescript/lib/module/internal/THEOplayerView.web.d.ts +4 -0
- package/lib/typescript/lib/module/internal/ads/THEOplayerNativeAdsAPI.d.ts +13 -0
- package/lib/typescript/lib/module/internal/ads/THEOplayerNativeGoogleDAI.d.ts +8 -0
- package/lib/typescript/lib/module/internal/ads/THEOplayerWebAdsAPI.d.ts +13 -0
- package/lib/typescript/lib/module/internal/ads/THEOplayerWebGoogleDAI.d.ts +8 -0
- package/lib/typescript/lib/module/internal/drm/ContentProtectionRegistry.d.ts +13 -0
- package/lib/typescript/lib/module/internal/drm/ContentProtectionRegistry.web.d.ts +4 -0
- package/lib/typescript/lib/module/internal/drm/NativeCertificateRequest.d.ts +17 -0
- package/lib/typescript/lib/module/internal/drm/NativeCertificateResponse.d.ts +20 -0
- package/lib/typescript/lib/module/internal/drm/NativeContentProtectionEvent.d.ts +0 -0
- package/lib/typescript/lib/module/internal/drm/NativeLicenseRequest.d.ts +19 -0
- package/lib/typescript/lib/module/internal/drm/NativeLicenseResponse.d.ts +21 -0
- package/lib/typescript/lib/module/internal/utils/TypeUtils.d.ts +5 -0
- package/lib/typescript/lib/module/internal/web/TrackUtils.d.ts +2 -0
- package/lib/typescript/src/api/THEOplayerView.d.ts +25 -4
- package/lib/typescript/src/api/abr/ABRConfiguration.d.ts +95 -0
- package/lib/typescript/src/api/abr/barrel.d.ts +1 -0
- package/lib/typescript/src/api/ads/Ad.d.ts +238 -0
- package/lib/typescript/src/api/ads/AdBreak.d.ts +39 -0
- package/lib/typescript/src/api/ads/AdsAPI.d.ts +46 -0
- package/lib/typescript/src/api/ads/AdsConfiguration.d.ts +69 -0
- package/lib/typescript/src/api/ads/CompanionAd.d.ts +59 -0
- package/lib/typescript/src/api/ads/GoogleDai.d.ts +29 -0
- package/lib/typescript/src/api/ads/GoogleImaAd.d.ts +78 -0
- package/lib/typescript/src/api/ads/GoogleImaConfiguration.d.ts +13 -0
- package/lib/typescript/src/api/ads/barrel.d.ts +8 -0
- package/lib/typescript/src/api/barrel.d.ts +5 -1
- package/lib/typescript/src/api/config/PlayerConfiguration.d.ts +5 -0
- package/lib/typescript/src/api/drm/ContentProtectionAPI.d.ts +5 -0
- package/lib/typescript/src/api/drm/ContentProtectionIntegration.d.ts +86 -0
- package/lib/typescript/src/api/drm/ContentProtectionIntegrationFactory.d.ts +15 -0
- package/lib/typescript/src/api/drm/ContentProtectionRequest.d.ts +56 -0
- package/lib/typescript/src/api/drm/ContentProtectionResponse.d.ts +56 -0
- package/lib/typescript/src/api/drm/barrel.d.ts +5 -0
- package/lib/typescript/src/api/event/AdEvent.d.ts +13 -0
- package/lib/typescript/src/api/event/barrel.d.ts +1 -0
- package/lib/typescript/src/api/source/SourceDescription.d.ts +8 -0
- package/lib/typescript/src/api/source/ads/FreeWheelAdDescription.d.ts +85 -0
- package/lib/typescript/src/api/source/ads/IMAAdDescription.d.ts +25 -0
- package/lib/typescript/src/api/source/ads/SpotXAdDescription.d.ts +115 -0
- package/lib/typescript/src/api/source/ads/THEOplayerAdDescription.d.ts +32 -0
- package/lib/typescript/src/api/source/ads/barrel.d.ts +6 -0
- package/lib/typescript/src/api/source/ads/ssai/GoogleDAIConfiguration.d.ts +130 -0
- package/lib/typescript/src/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.d.ts +27 -0
- package/lib/typescript/src/api/source/ads/ssai/ServerSideAdInsertionConfiguration.d.ts +26 -0
- package/lib/typescript/src/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.d.ts +46 -0
- package/lib/typescript/src/api/source/ads/ssai/barrel.d.ts +4 -0
- package/lib/typescript/src/api/source/barrel.d.ts +1 -0
- package/lib/typescript/src/api/source/drm/DRMConfiguration.d.ts +0 -30
- package/lib/typescript/src/api/track/MediaTrack.d.ts +5 -2
- package/lib/typescript/src/api/utils/TypeUtils.d.ts +20 -0
- package/lib/typescript/src/api/utils/barrel.d.ts +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/internal/THEOplayerView.d.ts +10 -4
- package/lib/typescript/src/internal/THEOplayerView.web.d.ts +7 -2
- package/lib/typescript/src/internal/ads/THEOplayerNativeAdsAPI.d.ts +17 -0
- package/lib/typescript/src/internal/ads/THEOplayerNativeGoogleDAI.d.ts +10 -0
- package/lib/typescript/src/internal/ads/THEOplayerWebAdsAPI.d.ts +15 -0
- package/lib/typescript/src/internal/ads/THEOplayerWebGoogleDAI.d.ts +10 -0
- package/lib/typescript/src/internal/drm/ContentProtectionRegistry.d.ts +19 -0
- package/lib/typescript/src/internal/drm/ContentProtectionRegistry.web.d.ts +5 -0
- package/lib/typescript/src/internal/drm/NativeCertificateRequest.d.ts +13 -0
- package/lib/typescript/src/internal/drm/NativeCertificateResponse.d.ts +18 -0
- package/lib/typescript/src/internal/drm/NativeContentProtectionEvent.d.ts +5 -0
- package/lib/typescript/src/internal/drm/NativeLicenseRequest.d.ts +14 -0
- package/lib/typescript/src/internal/drm/NativeLicenseResponse.d.ts +18 -0
- package/lib/typescript/src/internal/utils/TypeUtils.d.ts +5 -0
- package/lib/typescript/src/internal/web/TrackUtils.d.ts +3 -1
- package/package.json +4 -3
- package/src/api/THEOplayerView.ts +29 -4
- package/src/api/abr/ABRConfiguration.ts +103 -0
- package/src/api/abr/barrel.ts +1 -0
- package/src/api/ads/Ad.ts +267 -0
- package/src/api/ads/AdBreak.ts +44 -0
- package/src/api/ads/AdsAPI.ts +53 -0
- package/src/api/ads/AdsConfiguration.ts +76 -0
- package/src/api/ads/CompanionAd.ts +65 -0
- package/src/api/ads/GoogleDai.ts +32 -0
- package/src/api/ads/GoogleImaAd.ts +86 -0
- package/src/api/ads/GoogleImaConfiguration.ts +13 -0
- package/src/api/ads/barrel.ts +8 -0
- package/src/api/barrel.ts +5 -1
- package/src/api/config/PlayerConfiguration.ts +7 -0
- package/src/api/drm/ContentProtectionAPI.ts +6 -0
- package/src/api/drm/ContentProtectionIntegration.ts +93 -0
- package/src/api/drm/ContentProtectionIntegrationFactory.ts +16 -0
- package/src/api/drm/ContentProtectionRequest.ts +60 -0
- package/src/api/drm/ContentProtectionResponse.ts +62 -0
- package/src/api/drm/barrel.ts +5 -0
- package/src/api/event/AdEvent.ts +117 -0
- package/src/api/event/barrel.ts +1 -0
- package/src/api/source/SourceDescription.ts +9 -0
- package/src/api/source/ads/FreeWheelAdDescription.ts +97 -0
- package/src/api/source/ads/IMAAdDescription.ts +26 -0
- package/src/api/source/ads/SpotXAdDescription.ts +126 -0
- package/src/api/source/ads/THEOplayerAdDescription.ts +34 -0
- package/src/api/source/ads/barrel.ts +6 -0
- package/src/api/source/ads/ssai/GoogleDAIConfiguration.ts +145 -0
- package/src/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.ts +30 -0
- package/src/api/source/ads/ssai/ServerSideAdInsertionConfiguration.ts +28 -0
- package/src/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.ts +51 -0
- package/src/api/source/ads/ssai/barrel.ts +4 -0
- package/src/api/source/barrel.ts +1 -0
- package/src/api/source/drm/DRMConfiguration.ts +0 -35
- package/src/api/track/MediaTrack.ts +22 -2
- package/src/api/utils/TypeUtils.ts +39 -0
- package/src/api/utils/barrel.ts +1 -0
- package/src/index.tsx +1 -0
- package/src/internal/THEOplayerView.tsx +49 -8
- package/src/internal/THEOplayerView.web.tsx +37 -7
- package/src/internal/ads/THEOplayerNativeAdsAPI.ts +44 -0
- package/src/internal/ads/THEOplayerNativeGoogleDAI.ts +23 -0
- package/src/internal/ads/THEOplayerWebAdsAPI.ts +51 -0
- package/src/internal/ads/THEOplayerWebGoogleDAI.ts +22 -0
- package/src/internal/drm/ContentProtectionRegistry.ts +173 -0
- package/src/internal/drm/ContentProtectionRegistry.web.ts +10 -0
- package/src/internal/drm/NativeCertificateRequest.ts +41 -0
- package/src/internal/drm/NativeCertificateResponse.ts +45 -0
- package/src/internal/drm/NativeContentProtectionEvent.ts +5 -0
- package/src/internal/drm/NativeLicenseRequest.ts +39 -0
- package/src/internal/drm/NativeLicenseResponse.ts +45 -0
- package/src/internal/utils/TypeUtils.ts +39 -0
- package/src/internal/web/TrackUtils.ts +22 -1
|
@@ -7,13 +7,18 @@ import THEOplayerSDK
|
|
|
7
7
|
class THEOplayerRCTView: UIView {
|
|
8
8
|
// MARK: Members
|
|
9
9
|
private var player: THEOplayer?
|
|
10
|
-
private var
|
|
10
|
+
private var mainEventHandler: THEOplayerRCTViewMainEventHandler
|
|
11
|
+
private var textTrackEventHandler: THEOplayerRCTViewTextTrackEventHandler
|
|
12
|
+
private var adEventHandler: THEOplayerRCTViewAdEventHandler
|
|
11
13
|
|
|
12
14
|
// MARK: Bridged props
|
|
13
15
|
private var src: SourceDescription?
|
|
14
16
|
private var license: String?
|
|
15
17
|
private var licenseUrl: String?
|
|
16
18
|
private var chromeless: Bool = true
|
|
19
|
+
private var adSUIEnabled: Bool = true
|
|
20
|
+
private var adPreloadType: THEOplayerSDK.AdPreloadType = THEOplayerSDK.AdPreloadType.MIDROLL_AND_POSTROLL
|
|
21
|
+
private var googleImaUsesNativeIma: Bool = true
|
|
17
22
|
private var config: THEOplayerConfiguration?
|
|
18
23
|
private var paused: Bool = false
|
|
19
24
|
private var muted: Bool = true
|
|
@@ -26,19 +31,30 @@ class THEOplayerRCTView: UIView {
|
|
|
26
31
|
|
|
27
32
|
// MARK: - Initialisation / view setup
|
|
28
33
|
init() {
|
|
29
|
-
// create
|
|
30
|
-
self.
|
|
34
|
+
// create event handlers to maintain event props
|
|
35
|
+
self.mainEventHandler = THEOplayerRCTViewMainEventHandler()
|
|
36
|
+
self.textTrackEventHandler = THEOplayerRCTViewTextTrackEventHandler()
|
|
37
|
+
self.adEventHandler = THEOplayerRCTViewAdEventHandler()
|
|
31
38
|
|
|
32
39
|
super.init(frame: .zero)
|
|
33
40
|
}
|
|
34
41
|
|
|
35
42
|
func destroy() {
|
|
36
|
-
self.
|
|
43
|
+
self.mainEventHandler.destroy()
|
|
44
|
+
self.textTrackEventHandler.destroy()
|
|
45
|
+
self.adEventHandler.destroy()
|
|
37
46
|
self.player?.destroy()
|
|
38
47
|
self.player = nil
|
|
39
48
|
if DEBUG_THEOPLAYER_INTERACTION { print("[NATIVE] THEOplayer instance destroyed.") }
|
|
40
49
|
}
|
|
41
50
|
|
|
51
|
+
func ads() -> Ads? {
|
|
52
|
+
guard let player = self.player else {
|
|
53
|
+
return nil
|
|
54
|
+
}
|
|
55
|
+
return player.ads
|
|
56
|
+
}
|
|
57
|
+
|
|
42
58
|
required init?(coder aDecoder: NSCoder) {
|
|
43
59
|
fatalError("[NATIVE] init(coder:) has not been implemented")
|
|
44
60
|
}
|
|
@@ -79,32 +95,56 @@ class THEOplayerRCTView: UIView {
|
|
|
79
95
|
return
|
|
80
96
|
}
|
|
81
97
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
98
|
+
// reset player for new source
|
|
99
|
+
if self.player != nil {
|
|
100
|
+
self.player?.destroy()
|
|
101
|
+
self.player = nil
|
|
102
|
+
}
|
|
103
|
+
DispatchQueue.main.async {
|
|
104
|
+
self.initPlayer()
|
|
105
|
+
if let player = self.player {
|
|
106
|
+
// couple player instance to event handlers
|
|
107
|
+
self.mainEventHandler.setPlayer(player)
|
|
108
|
+
self.textTrackEventHandler.setPlayer(player)
|
|
109
|
+
self.adEventHandler.setPlayer(player)
|
|
110
|
+
// couple player instance to view
|
|
111
|
+
player.addAsSubview(of: self)
|
|
112
|
+
}
|
|
113
|
+
self.syncAllPlayerProps()
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
private func initPlayer() {
|
|
118
|
+
if DEBUG_THEOPLAYER_INTERACTION { print("[NATIVE] 'lazy' init THEOplayer instance") }
|
|
86
119
|
#if os(tvOS)
|
|
87
|
-
|
|
120
|
+
self.player = THEOplayer(configuration: THEOplayerConfiguration(chromeless: self.chromeless,
|
|
121
|
+
license: self.license,
|
|
122
|
+
licenseUrl: self.licenseUrl,
|
|
123
|
+
pip: nil))
|
|
88
124
|
#else
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
125
|
+
let stylePath = Bundle.main.path(forResource:"style", ofType: "css")
|
|
126
|
+
let cssPaths = stylePath != nil ? [stylePath!] : []
|
|
127
|
+
self.player = THEOplayer(configuration: THEOplayerConfiguration(chromeless: self.chromeless,
|
|
128
|
+
cssPaths: cssPaths,
|
|
129
|
+
pip: nil,
|
|
130
|
+
ads: self.initAdsConfiguration(),
|
|
131
|
+
license: self.license,
|
|
132
|
+
licenseUrl: self.licenseUrl))
|
|
92
133
|
#endif
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
private func initAdsConfiguration() -> AdsConfiguration? {
|
|
137
|
+
#if ADS && (GOOGLE_IMA || GOOGLE_DAI)
|
|
138
|
+
let googleIMAConfiguration = GoogleIMAConfiguration()
|
|
139
|
+
googleIMAConfiguration.useNativeIma = self.googleImaUsesNativeIma
|
|
140
|
+
googleIMAConfiguration.disableUI = !self.adSUIEnabled
|
|
141
|
+
return AdsConfiguration(showCountdown: self.adSUIEnabled,
|
|
142
|
+
preload: self.adPreloadType,
|
|
143
|
+
googleImaConfiguration: googleIMAConfiguration)
|
|
144
|
+
#else
|
|
145
|
+
return nil
|
|
146
|
+
#endif
|
|
147
|
+
|
|
108
148
|
}
|
|
109
149
|
|
|
110
150
|
private func syncPlayerSrc() {
|
|
@@ -121,6 +161,15 @@ class THEOplayerRCTView: UIView {
|
|
|
121
161
|
self.license = configDict["license"] as? String
|
|
122
162
|
self.licenseUrl = configDict["licenseUrl"] as? String
|
|
123
163
|
self.chromeless = configDict["chromeless"] as? Bool ?? true
|
|
164
|
+
if let adsConfig = configDict["ads"] as? NSDictionary {
|
|
165
|
+
self.adSUIEnabled = adsConfig["uiEnabled"] as? Bool ?? true
|
|
166
|
+
if let adPreloadType = adsConfig["preload"] as? String {
|
|
167
|
+
self.adPreloadType = adPreloadType == "none" ? THEOplayerSDK.AdPreloadType.NONE : THEOplayerSDK.AdPreloadType.MIDROLL_AND_POSTROLL
|
|
168
|
+
}
|
|
169
|
+
if let googleImaConfiguration = adsConfig["googleImaConfiguration"] as? NSDictionary {
|
|
170
|
+
self.googleImaUsesNativeIma = googleImaConfiguration["useNativeIma"] as? Bool ?? true
|
|
171
|
+
}
|
|
172
|
+
}
|
|
124
173
|
if DEBUG_PROP_UPDATES { print("[NATIVE] config prop updated.") }
|
|
125
174
|
}
|
|
126
175
|
|
|
@@ -296,130 +345,141 @@ class THEOplayerRCTView: UIView {
|
|
|
296
345
|
}
|
|
297
346
|
}
|
|
298
347
|
|
|
299
|
-
// MARK: - Listener based event bridging
|
|
348
|
+
// MARK: - Listener based MAIN event bridging
|
|
349
|
+
|
|
300
350
|
@objc(setOnNativePlay:)
|
|
301
351
|
func setOnNativePlay(nativePlay: @escaping RCTDirectEventBlock) {
|
|
302
|
-
self.
|
|
352
|
+
self.mainEventHandler.onNativePlay = nativePlay
|
|
303
353
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativePlay prop set.") }
|
|
304
354
|
}
|
|
305
355
|
|
|
306
356
|
@objc(setOnNativePause:)
|
|
307
357
|
func setOnNativePause(nativePause: @escaping RCTDirectEventBlock) {
|
|
308
|
-
self.
|
|
358
|
+
self.mainEventHandler.onNativePause = nativePause
|
|
309
359
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativePause prop set.") }
|
|
310
360
|
}
|
|
311
361
|
|
|
312
362
|
@objc(setOnNativeSourceChange:)
|
|
313
363
|
func setOnNativeSourceChange(nativeSourceChange: @escaping RCTDirectEventBlock) {
|
|
314
|
-
self.
|
|
364
|
+
self.mainEventHandler.onNativeSourceChange = nativeSourceChange
|
|
315
365
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeSourceChange prop set.") }
|
|
316
366
|
}
|
|
317
367
|
|
|
318
368
|
@objc(setOnNativeLoadStart:)
|
|
319
369
|
func setOnNativeLoadStart(nativeLoadStart: @escaping RCTDirectEventBlock) {
|
|
320
|
-
self.
|
|
370
|
+
self.mainEventHandler.onNativeLoadStart = nativeLoadStart
|
|
321
371
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeLoadStart prop set.") }
|
|
322
372
|
}
|
|
323
373
|
|
|
324
374
|
@objc(setOnNativeReadyStateChange:)
|
|
325
375
|
func setOnNativeReadyStateChange(nativeReadyStateChange: @escaping RCTDirectEventBlock) {
|
|
326
|
-
self.
|
|
376
|
+
self.mainEventHandler.onNativeReadyStateChange = nativeReadyStateChange
|
|
327
377
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeReadyStateChange prop set.") }
|
|
328
378
|
}
|
|
329
379
|
|
|
330
380
|
@objc(setOnNativeDurationChange:)
|
|
331
381
|
func setOnNativeDurationChange(nativeDurationChange: @escaping RCTDirectEventBlock) {
|
|
332
|
-
self.
|
|
382
|
+
self.mainEventHandler.onNativeDurationChange = nativeDurationChange
|
|
333
383
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeDurationChange prop set.") }
|
|
334
384
|
}
|
|
335
385
|
|
|
336
386
|
@objc(setOnNativeProgress:)
|
|
337
387
|
func setOnNativeProgress(nativeProgress: @escaping RCTBubblingEventBlock) {
|
|
338
|
-
self.
|
|
388
|
+
self.mainEventHandler.onNativeProgress = nativeProgress
|
|
339
389
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeProgress prop set.") }
|
|
340
390
|
}
|
|
341
391
|
|
|
342
392
|
@objc(setOnNativeTimeUpdate:)
|
|
343
393
|
func setOnNativeTimeUpdate(nativeTimeUpdate: @escaping RCTBubblingEventBlock) {
|
|
344
|
-
self.
|
|
394
|
+
self.mainEventHandler.onNativeTimeUpdate = nativeTimeUpdate
|
|
345
395
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeTimeUpdate prop set.") }
|
|
346
396
|
}
|
|
347
397
|
|
|
348
398
|
@objc(setOnNativePlaying:)
|
|
349
399
|
func setOnNativePlaying(nativePlaying: @escaping RCTDirectEventBlock) {
|
|
350
|
-
self.
|
|
400
|
+
self.mainEventHandler.onNativePlaying = nativePlaying
|
|
351
401
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativePlaying prop set.") }
|
|
352
402
|
}
|
|
353
403
|
|
|
354
404
|
@objc(setOnNativeSeeking:)
|
|
355
405
|
func setOnNativeSeeking(nativeSeeking: @escaping RCTDirectEventBlock) {
|
|
356
|
-
self.
|
|
406
|
+
self.mainEventHandler.onNativeSeeking = nativeSeeking
|
|
357
407
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeSeeking prop set.") }
|
|
358
408
|
}
|
|
359
409
|
|
|
360
410
|
@objc(setOnNativeSeeked:)
|
|
361
411
|
func setOnNativeSeeked(nativeSeeked: @escaping RCTDirectEventBlock) {
|
|
362
|
-
self.
|
|
412
|
+
self.mainEventHandler.onNativeSeeked = nativeSeeked
|
|
363
413
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeSeeked prop set.") }
|
|
364
414
|
}
|
|
365
415
|
|
|
366
416
|
@objc(setOnNativeEnded:)
|
|
367
417
|
func setOnNativeEnded(nativeEnded: @escaping RCTDirectEventBlock) {
|
|
368
|
-
self.
|
|
418
|
+
self.mainEventHandler.onNativeEnded = nativeEnded
|
|
369
419
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeEnded prop set.") }
|
|
370
420
|
}
|
|
371
421
|
|
|
372
422
|
@objc(setOnNativeError:)
|
|
373
423
|
func setOnNativeError(nativeError: @escaping RCTDirectEventBlock) {
|
|
374
|
-
self.
|
|
424
|
+
self.mainEventHandler.onNativeError = nativeError
|
|
375
425
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeError prop set.") }
|
|
376
426
|
}
|
|
377
427
|
|
|
378
428
|
@objc(setOnNativeLoadedData:)
|
|
379
429
|
func setOnNativeLoadedData(nativeLoadedData: @escaping RCTDirectEventBlock) {
|
|
380
|
-
self.
|
|
430
|
+
self.mainEventHandler.onNativeLoadedData = nativeLoadedData
|
|
381
431
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeLoadedData prop set.") }
|
|
382
432
|
}
|
|
383
433
|
|
|
384
434
|
@objc(setOnNativeLoadedMetadata:)
|
|
385
435
|
func setOnNativeLoadedMetadata(nativeLoadedMetadata: @escaping RCTDirectEventBlock) {
|
|
386
|
-
self.
|
|
436
|
+
self.mainEventHandler.onNativeLoadedMetadata = nativeLoadedMetadata
|
|
387
437
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeLoadedMetadata prop set.") }
|
|
388
438
|
}
|
|
389
439
|
|
|
390
440
|
@objc(setOnNativeFullscreenPlayerWillPresent:)
|
|
391
441
|
func setOnNativeFullscreenPlayerWillPresent(nativeFullscreenPlayerWillPresent: @escaping RCTDirectEventBlock) {
|
|
392
|
-
self.
|
|
442
|
+
self.mainEventHandler.onNativeFullscreenPlayerWillPresent = nativeFullscreenPlayerWillPresent
|
|
393
443
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeFullscreenPlayerWillPresent prop set.") }
|
|
394
444
|
}
|
|
395
445
|
|
|
396
446
|
@objc(setOnNativeFullscreenPlayerDidPresent:)
|
|
397
447
|
func setOnNativeFullscreenPlayerDidPresent(nativeFullscreenPlayerDidPresent: @escaping RCTDirectEventBlock) {
|
|
398
|
-
self.
|
|
448
|
+
self.mainEventHandler.onNativeFullscreenPlayerDidPresent = nativeFullscreenPlayerDidPresent
|
|
399
449
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeFullscreenPlayerDidPresent prop set.") }
|
|
400
450
|
}
|
|
401
451
|
|
|
402
452
|
@objc(setOnNativeFullscreenPlayerWillDismiss:)
|
|
403
453
|
func setOnNativeFullscreenPlayerWillDismiss(nativeFullscreenPlayerWillDismiss: @escaping RCTDirectEventBlock) {
|
|
404
|
-
self.
|
|
454
|
+
self.mainEventHandler.onNativeFullscreenPlayerWillDismiss = nativeFullscreenPlayerWillDismiss
|
|
405
455
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeFullscreenPlayerWillDismiss prop set.") }
|
|
406
456
|
}
|
|
407
457
|
|
|
408
458
|
@objc(setOnNativeFullscreenPlayerDidDismiss:)
|
|
409
459
|
func setOnNativeFullscreenPlayerDidDismiss(nativeFullscreenPlayerDidDismiss: @escaping RCTDirectEventBlock) {
|
|
410
|
-
self.
|
|
460
|
+
self.mainEventHandler.onNativeFullscreenPlayerDidDismiss = nativeFullscreenPlayerDidDismiss
|
|
411
461
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeFullscreenPlayerDidDismiss prop set.") }
|
|
412
462
|
}
|
|
413
463
|
|
|
464
|
+
// MARK: - Listener based TEXTTRACK event bridging
|
|
465
|
+
|
|
414
466
|
@objc(setOnNativeTextTrackListEvent:)
|
|
415
467
|
func setOnNativeTextTrackListEvent(nativeTextTrackListEvent: @escaping RCTDirectEventBlock) {
|
|
416
|
-
self.
|
|
468
|
+
self.textTrackEventHandler.onNativeTextTrackListEvent = nativeTextTrackListEvent
|
|
417
469
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeTextTrackListEvent prop set.") }
|
|
418
470
|
}
|
|
419
471
|
|
|
420
472
|
@objc(setOnNativeTextTrackEvent:)
|
|
421
473
|
func setOnNativeTextTrackEvent(nativeTextTrackEvent: @escaping RCTDirectEventBlock) {
|
|
422
|
-
self.
|
|
474
|
+
self.textTrackEventHandler.onNativeTextTrackEvent = nativeTextTrackEvent
|
|
423
475
|
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeTextTrackEvent prop set.") }
|
|
424
476
|
}
|
|
477
|
+
|
|
478
|
+
// MARK: - Listener based AD event bridging
|
|
479
|
+
|
|
480
|
+
@objc(setOnNativeAdEvent:)
|
|
481
|
+
func setOnNativeAdEvent(nativeAdEvent: @escaping RCTDirectEventBlock) {
|
|
482
|
+
self.adEventHandler.onNativeAdEvent = nativeAdEvent
|
|
483
|
+
if DEBUG_PROP_UPDATES { print("[NATIVE] nativeAdEvent prop set.") }
|
|
484
|
+
}
|
|
425
485
|
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
// THEOplayerRCTViewAdEventHandler.swift
|
|
2
|
+
|
|
3
|
+
import Foundation
|
|
4
|
+
import THEOplayerSDK
|
|
5
|
+
|
|
6
|
+
let AD_EVENT_PROP_TYPE: String = "type"
|
|
7
|
+
let AD_EVENT_PROP_AD: String = "ad"
|
|
8
|
+
|
|
9
|
+
let EVENT_TYPE_AD_BEGIN: String = "adbegin"
|
|
10
|
+
let EVENT_TYPE_AD_END: String = "adend"
|
|
11
|
+
let EVENT_TYPE_ADBREAK_BEGIN: String = "adbreakbegin"
|
|
12
|
+
let EVENT_TYPE_ADBREAK_END: String = "adbreakend"
|
|
13
|
+
let EVENT_TYPE_AD_ERROR: String = "aderror"
|
|
14
|
+
let EVENT_TYPE_AD_FIRST_QUARTILE: String = "adfirstquartile"
|
|
15
|
+
let EVENT_TYPE_AD_THIRD_QUARTILE: String = "adthirdquartile"
|
|
16
|
+
let EVENT_TYPE_AD_MIDPOINT: String = "admidpoint"
|
|
17
|
+
let EVENT_TYPE_AD_LOADED: String = "adloaded"
|
|
18
|
+
|
|
19
|
+
class THEOplayerRCTViewAdEventHandler {
|
|
20
|
+
// MARK: Members
|
|
21
|
+
private weak var player: THEOplayer?
|
|
22
|
+
|
|
23
|
+
// MARK: Events
|
|
24
|
+
var onNativeAdEvent: RCTDirectEventBlock?
|
|
25
|
+
|
|
26
|
+
// MARK: Ad Listeners
|
|
27
|
+
private var adBeginListener: EventListener?
|
|
28
|
+
private var adEndListener: EventListener?
|
|
29
|
+
private var adBreakBeginListener: EventListener?
|
|
30
|
+
private var adBreakEndListener: EventListener?
|
|
31
|
+
private var adErrorListener: EventListener?
|
|
32
|
+
private var adFirstQuartileListener: EventListener?
|
|
33
|
+
private var adMidpointListener: EventListener?
|
|
34
|
+
private var adThirdQuartileListener: EventListener?
|
|
35
|
+
private var adLoadedListener: EventListener?
|
|
36
|
+
|
|
37
|
+
// MARK: - destruction
|
|
38
|
+
func destroy() {
|
|
39
|
+
// dettach listeners
|
|
40
|
+
#if ADS && (GOOGLE_IMA || GOOLGE_DAI)
|
|
41
|
+
self.dettachListeners()
|
|
42
|
+
#endif
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// MARK: - player setup / breakdown
|
|
46
|
+
func setPlayer(_ player: THEOplayer) {
|
|
47
|
+
self.player = player;
|
|
48
|
+
|
|
49
|
+
// attach listeners
|
|
50
|
+
#if ADS && (GOOGLE_IMA || GOOLGE_DAI)
|
|
51
|
+
self.attachListeners()
|
|
52
|
+
#endif
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// MARK: - attach/dettach Listeners
|
|
56
|
+
private func attachListeners() {
|
|
57
|
+
guard let player = self.player else {
|
|
58
|
+
return
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// AD_BEGIN
|
|
62
|
+
self.adBeginListener = player.ads.addEventListener(type: AdsEventTypes.AD_BEGIN) { [weak self] event in
|
|
63
|
+
if DEBUG_THEOPLAYER_EVENTS { print("[NATIVE] Received AD_BEGIN event from THEOplayer Ads") }
|
|
64
|
+
if let forwardedAdEvent = self?.onNativeAdEvent,
|
|
65
|
+
let ad = event.ad {
|
|
66
|
+
forwardedAdEvent([
|
|
67
|
+
AD_EVENT_PROP_TYPE: EVENT_TYPE_AD_BEGIN,
|
|
68
|
+
AD_EVENT_PROP_AD: THEOplayerRCTAdAggregator.aggregateAd(ad: ad)
|
|
69
|
+
])
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if DEBUG_EVENTHANDLER { print("[NATIVE] AdBegin listener attached to THEOplayer.ads") }
|
|
73
|
+
|
|
74
|
+
// AD_END
|
|
75
|
+
self.adEndListener = player.ads.addEventListener(type: AdsEventTypes.AD_END) { [weak self] event in
|
|
76
|
+
if DEBUG_THEOPLAYER_EVENTS { print("[NATIVE] Received AD_END event from THEOplayer Ads") }
|
|
77
|
+
if let forwardedAdEvent = self?.onNativeAdEvent,
|
|
78
|
+
let ad = event.ad {
|
|
79
|
+
forwardedAdEvent([
|
|
80
|
+
AD_EVENT_PROP_TYPE: EVENT_TYPE_AD_END,
|
|
81
|
+
AD_EVENT_PROP_AD: THEOplayerRCTAdAggregator.aggregateAd(ad: ad)
|
|
82
|
+
])
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if DEBUG_EVENTHANDLER { print("[NATIVE] AdEnd listener attached to THEOplayer.ads") }
|
|
86
|
+
|
|
87
|
+
// AD_BREAK_BEGIN
|
|
88
|
+
self.adBreakBeginListener = player.ads.addEventListener(type: AdsEventTypes.AD_BREAK_BEGIN) { [weak self] event in
|
|
89
|
+
if DEBUG_THEOPLAYER_EVENTS { print("[NATIVE] Received AD_BREAK_BEGIN event from THEOplayer Ads") }
|
|
90
|
+
if let forwardedAdEvent = self?.onNativeAdEvent,
|
|
91
|
+
let adBreak = event.ad {
|
|
92
|
+
forwardedAdEvent([
|
|
93
|
+
AD_EVENT_PROP_TYPE: EVENT_TYPE_ADBREAK_BEGIN,
|
|
94
|
+
AD_EVENT_PROP_AD: THEOplayerRCTAdAggregator.aggregateAdBreak(adBreak: adBreak)
|
|
95
|
+
])
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if DEBUG_EVENTHANDLER { print("[NATIVE] AdBreakBegin listener attached to THEOplayer.ads") }
|
|
99
|
+
|
|
100
|
+
// AD_BREAK_END
|
|
101
|
+
self.adBreakEndListener = player.ads.addEventListener(type: AdsEventTypes.AD_BREAK_END) { [weak self] event in
|
|
102
|
+
if DEBUG_THEOPLAYER_EVENTS { print("[NATIVE] Received AD_BREAK_END event from THEOplayer Ads") }
|
|
103
|
+
if let forwardedAdEvent = self?.onNativeAdEvent,
|
|
104
|
+
let adBreak = event.ad {
|
|
105
|
+
forwardedAdEvent([
|
|
106
|
+
AD_EVENT_PROP_TYPE: EVENT_TYPE_ADBREAK_END,
|
|
107
|
+
AD_EVENT_PROP_AD: THEOplayerRCTAdAggregator.aggregateAdBreak(adBreak: adBreak)
|
|
108
|
+
])
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if DEBUG_EVENTHANDLER { print("[NATIVE] AdBreakEnd listener attached to THEOplayer.ads") }
|
|
112
|
+
|
|
113
|
+
// AD_ERROR
|
|
114
|
+
self.adErrorListener = player.ads.addEventListener(type: AdsEventTypes.AD_ERROR) { [weak self] event in
|
|
115
|
+
if DEBUG_THEOPLAYER_EVENTS { print("[NATIVE] Received AD_ERROR event from THEOplayer Ads") }
|
|
116
|
+
if let forwardedAdEvent = self?.onNativeAdEvent,
|
|
117
|
+
let ad = event.ad {
|
|
118
|
+
forwardedAdEvent([
|
|
119
|
+
AD_EVENT_PROP_TYPE: EVENT_TYPE_AD_ERROR,
|
|
120
|
+
AD_EVENT_PROP_AD: THEOplayerRCTAdAggregator.aggregateAd(ad: ad)
|
|
121
|
+
])
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if DEBUG_EVENTHANDLER { print("[NATIVE] AdError listener attached to THEOplayer.ads") }
|
|
125
|
+
|
|
126
|
+
// AD_FIRST_QUARTILE
|
|
127
|
+
self.adFirstQuartileListener = player.ads.addEventListener(type: AdsEventTypes.AD_FIRST_QUARTILE) { [weak self] event in
|
|
128
|
+
if DEBUG_THEOPLAYER_EVENTS { print("[NATIVE] Received AD_FIRST_QUARTILE event from THEOplayer Ads") }
|
|
129
|
+
if let forwardedAdEvent = self?.onNativeAdEvent,
|
|
130
|
+
let ad = event.ad {
|
|
131
|
+
forwardedAdEvent([
|
|
132
|
+
AD_EVENT_PROP_TYPE: EVENT_TYPE_AD_FIRST_QUARTILE,
|
|
133
|
+
AD_EVENT_PROP_AD: THEOplayerRCTAdAggregator.aggregateAd(ad: ad)
|
|
134
|
+
])
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if DEBUG_EVENTHANDLER { print("[NATIVE] AdFirstQuartile listener attached to THEOplayer.ads") }
|
|
138
|
+
|
|
139
|
+
// AD_MIDPOINT
|
|
140
|
+
self.adMidpointListener = player.ads.addEventListener(type: AdsEventTypes.AD_MIDPOINT) { [weak self] event in
|
|
141
|
+
if DEBUG_THEOPLAYER_EVENTS { print("[NATIVE] Received AD_MIDPOINT event from THEOplayer Ads") }
|
|
142
|
+
if let forwardedAdEvent = self?.onNativeAdEvent,
|
|
143
|
+
let ad = event.ad {
|
|
144
|
+
forwardedAdEvent([
|
|
145
|
+
AD_EVENT_PROP_TYPE: EVENT_TYPE_AD_MIDPOINT,
|
|
146
|
+
AD_EVENT_PROP_AD: THEOplayerRCTAdAggregator.aggregateAd(ad: ad)
|
|
147
|
+
])
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if DEBUG_EVENTHANDLER { print("[NATIVE] AdMidpoint listener attached to THEOplayer.ads") }
|
|
151
|
+
|
|
152
|
+
// AD_THIRD_QUARTILE
|
|
153
|
+
self.adThirdQuartileListener = player.ads.addEventListener(type: AdsEventTypes.AD_THIRD_QUARTILE) { [weak self] event in
|
|
154
|
+
if DEBUG_THEOPLAYER_EVENTS { print("[NATIVE] Received AD_THIRD_QUARTILE event from THEOplayer Ads") }
|
|
155
|
+
if let forwardedAdEvent = self?.onNativeAdEvent,
|
|
156
|
+
let ad = event.ad {
|
|
157
|
+
forwardedAdEvent([
|
|
158
|
+
AD_EVENT_PROP_TYPE: EVENT_TYPE_AD_THIRD_QUARTILE,
|
|
159
|
+
AD_EVENT_PROP_AD: THEOplayerRCTAdAggregator.aggregateAd(ad: ad)
|
|
160
|
+
])
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if DEBUG_EVENTHANDLER { print("[NATIVE] AdThirdQuartile listener attached to THEOplayer.ads") }
|
|
164
|
+
|
|
165
|
+
// AD_LOADED
|
|
166
|
+
self.adLoadedListener = player.ads.addEventListener(type: AdsEventTypes.AD_LOADED) { [weak self] event in
|
|
167
|
+
if DEBUG_THEOPLAYER_EVENTS { print("[NATIVE] Received AD_LOADED event from THEOplayer Ads") }
|
|
168
|
+
if let forwardedAdEvent = self?.onNativeAdEvent,
|
|
169
|
+
let ad = event.ad {
|
|
170
|
+
forwardedAdEvent([
|
|
171
|
+
AD_EVENT_PROP_TYPE: EVENT_TYPE_AD_LOADED,
|
|
172
|
+
AD_EVENT_PROP_AD: THEOplayerRCTAdAggregator.aggregateAd(ad: ad)
|
|
173
|
+
])
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if DEBUG_EVENTHANDLER { print("[NATIVE] AdThirdQuartile listener attached to THEOplayer.ads") }
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
private func dettachListeners() {
|
|
180
|
+
guard let player = self.player else {
|
|
181
|
+
return
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// AD_BEGIN
|
|
185
|
+
if let adBeginListener = self.adBeginListener {
|
|
186
|
+
player.ads.removeEventListener(type: AdsEventTypes.AD_BEGIN, listener: adBeginListener)
|
|
187
|
+
if DEBUG_EVENTHANDLER { print("[NATIVE] AdBegin listener dettached from THEOplayer.ads") }
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// AD_END
|
|
191
|
+
if let adEndListener = self.adEndListener {
|
|
192
|
+
player.ads.removeEventListener(type: AdsEventTypes.AD_END, listener: adEndListener)
|
|
193
|
+
if DEBUG_EVENTHANDLER { print("[NATIVE] AdEnd listener dettached from THEOplayer.ads") }
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// AD_BREAK_BEGIN
|
|
197
|
+
if let adBreakBeginListener = self.adBreakBeginListener {
|
|
198
|
+
player.ads.removeEventListener(type: AdsEventTypes.AD_BREAK_BEGIN, listener: adBreakBeginListener)
|
|
199
|
+
if DEBUG_EVENTHANDLER { print("[NATIVE] AdBreakBegin listener dettached from THEOplayer.ads") }
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// AD_BREAK_END
|
|
203
|
+
if let adBreakEndListener = self.adBreakEndListener {
|
|
204
|
+
player.ads.removeEventListener(type: AdsEventTypes.AD_BREAK_END, listener: adBreakEndListener)
|
|
205
|
+
if DEBUG_EVENTHANDLER { print("[NATIVE] AdBreakEnd listener dettached from THEOplayer.ads") }
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// AD_ERROR
|
|
209
|
+
if let adErrorListener = self.adErrorListener {
|
|
210
|
+
player.ads.removeEventListener(type: AdsEventTypes.AD_ERROR, listener: adErrorListener)
|
|
211
|
+
if DEBUG_EVENTHANDLER { print("[NATIVE] AdError listener dettached from THEOplayer.ads") }
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// AD_FIRST_QUARTILE
|
|
215
|
+
if let adFirstQuartileListener = self.adFirstQuartileListener {
|
|
216
|
+
player.ads.removeEventListener(type: AdsEventTypes.AD_FIRST_QUARTILE, listener: adFirstQuartileListener)
|
|
217
|
+
if DEBUG_EVENTHANDLER { print("[NATIVE] adFirstQuartileListener listener dettached from THEOplayer.ads") }
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// AD_MIDPOINT
|
|
221
|
+
if let adMidpointListener = self.adMidpointListener {
|
|
222
|
+
player.ads.removeEventListener(type: AdsEventTypes.AD_MIDPOINT, listener: adMidpointListener)
|
|
223
|
+
if DEBUG_EVENTHANDLER { print("[NATIVE] adMidpointListener listener dettached from THEOplayer.ads") }
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// AD_THIRD_QUARTILE
|
|
227
|
+
if let adThirdQuartileListener = self.adThirdQuartileListener {
|
|
228
|
+
player.ads.removeEventListener(type: AdsEventTypes.AD_THIRD_QUARTILE, listener: adThirdQuartileListener)
|
|
229
|
+
if DEBUG_EVENTHANDLER { print("[NATIVE] adThirdQuartileListener listener dettached from THEOplayer.ads") }
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// AD_LOADED
|
|
233
|
+
if let adLoadedListener = self.adLoadedListener {
|
|
234
|
+
player.ads.removeEventListener(type: AdsEventTypes.AD_LOADED, listener: adLoadedListener)
|
|
235
|
+
if DEBUG_EVENTHANDLER { print("[NATIVE] adLoadedListener listener dettached from THEOplayer.ads") }
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|