react-native-theoplayer 1.8.2 → 2.0.0
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/CHANGELOG.md +248 -0
- package/README.md +7 -2
- package/android/build.gradle +46 -24
- package/android/local/com/theoplayer/android-connector/mediasession/4.11.0-local/mediasession-4.11.0-local.aar +0 -0
- package/android/local/com/theoplayer/android-connector/mediasession/4.11.0-local/mediasession-4.11.0-local.pom +15 -0
- package/android/local/com/theoplayer/android-connector/mediasession/maven-metadata-local.xml +13 -0
- package/android/local/com/theoplayer/theoplayer-sdk-android/ads-wrapper/4.8.0/ads-wrapper-4.8.0.aar +0 -0
- package/android/local/com/theoplayer/theoplayer-sdk-android/ads-wrapper/4.8.0/ads-wrapper-4.8.0.pom +9 -0
- package/android/local/com/theoplayer/theoplayer-sdk-android/ads-wrapper/maven-metadata-local.xml +4 -4
- package/android/src/main/AndroidManifest.xml +46 -1
- package/android/src/main/java/com/theoplayer/PlayerConfigAdapter.kt +3 -1
- package/android/src/main/java/com/theoplayer/PlayerEventEmitter.kt +223 -181
- package/android/src/main/java/com/theoplayer/ReactTHEOplayerContext.kt +301 -0
- package/android/src/main/java/com/theoplayer/ReactTHEOplayerPackage.kt +2 -0
- package/android/src/main/java/com/theoplayer/ReactTHEOplayerView.kt +77 -381
- package/android/src/main/java/com/theoplayer/ReactTHEOplayerViewManager.kt +5 -78
- package/android/src/main/java/com/theoplayer/ads/AdsModule.kt +4 -4
- package/android/src/main/java/com/theoplayer/audio/AudioBecomingNoisyManager.kt +32 -0
- package/android/src/main/java/com/theoplayer/audio/BackgroundAudioConfig.kt +17 -0
- package/android/src/main/java/com/theoplayer/audio/BackgroundAudioConfigAdapter.kt +19 -0
- package/android/src/main/java/com/theoplayer/audio/MediaNotificationBuilder.kt +194 -0
- package/android/src/main/java/com/theoplayer/audio/MediaPlaybackService.kt +278 -0
- package/android/src/main/java/com/theoplayer/cast/CastModule.kt +11 -6
- package/android/src/main/java/com/theoplayer/drm/ContentProtectionModule.kt +8 -2
- package/android/src/main/java/com/theoplayer/player/PlayerModule.kt +178 -0
- package/android/src/main/java/com/theoplayer/presentation/PipConfig.kt +10 -0
- package/android/src/main/java/com/theoplayer/presentation/PipConfigAdapter.kt +14 -0
- package/android/src/main/java/com/theoplayer/presentation/PresentationManager.kt +249 -0
- package/android/src/main/java/com/theoplayer/presentation/PresentationModeChangeContext.kt +17 -0
- package/android/src/main/java/com/theoplayer/source/SourceAdapter.kt +6 -2
- package/android/src/main/java/com/theoplayer/track/QualityListAdapter.kt +8 -0
- package/android/src/main/java/com/theoplayer/track/TextTrackCueEventType.kt +3 -1
- package/android/src/main/java/com/theoplayer/track/TrackListAdapter.kt +22 -49
- package/android/src/main/java/com/theoplayer/util/PayloadBuilder.kt +242 -0
- package/android/src/main/java/com/theoplayer/util/ViewResolver.kt +3 -4
- package/android/src/main/res/drawable/ic_close.xml +13 -0
- package/android/src/main/res/drawable/ic_notification_small.xml +9 -0
- package/android/src/main/res/drawable/ic_pause.xml +13 -0
- package/android/src/main/res/drawable/ic_play.xml +13 -0
- package/android/src/main/res/values/colors.xml +4 -0
- package/android/src/main/res/values/strings.xml +9 -0
- package/ios/THEOplayerRCTBridge.m +60 -12
- package/ios/THEOplayerRCTDebug.swift +13 -1
- package/ios/THEOplayerRCTMainEventHandler.swift +101 -49
- package/ios/THEOplayerRCTPlayerAPI.swift +240 -0
- package/ios/THEOplayerRCTPresentationModeContext.swift +29 -0
- package/ios/THEOplayerRCTTextTrackEventHandler.swift +39 -3
- package/ios/THEOplayerRCTTrackEventTypes.swift +2 -0
- package/ios/THEOplayerRCTTrackMetadataAggregator.swift +9 -6
- package/ios/THEOplayerRCTTypeUtils.swift +42 -0
- package/ios/THEOplayerRCTView.swift +130 -288
- package/ios/THEOplayerRCTViewManager.swift +1 -1
- package/ios/ads/THEOplayerRCTAdAggregator.swift +1 -1
- package/ios/ads/THEOplayerRCTAdsAPI.swift +4 -2
- package/ios/ads/THEOplayerRCTAdsEventHandler.swift +2 -2
- package/ios/ads/THEOplayerRCTSourceDescriptionBuilder+Ads.swift +2 -2
- package/ios/ads/THEOplayerRCTView+Ads.swift +14 -1
- package/ios/ads/THEOplayerRCTView+AdsConfig.swift +8 -7
- package/ios/backgroundAudio/THEOplayerRCTNowPlayingManager.swift +254 -0
- package/ios/backgroundAudio/THEOplayerRCTRemoteCommandsManager.swift +238 -0
- package/ios/backgroundAudio/THEOplayerRCTView+BackgroundAudioConfig.swift +33 -0
- package/ios/casting/THEOplayerRCTCastAPI+Chromecast.swift +1 -1
- package/ios/casting/THEOplayerRCTCastEventHandler.swift +2 -2
- package/ios/casting/THEOplayerRCTView+Casting.swift +15 -0
- package/ios/contentprotection/THEOplayerRCTProxyContentProtectionIntegration.swift +66 -46
- package/ios/pip/THEOplayerRCTPipControlsManager.swift +145 -0
- package/ios/pip/THEOplayerRCTView+PipConfig.swift +56 -0
- package/ios/theofeatures.sh +16 -0
- package/lib/commonjs/api/THEOplayerView.js.map +1 -1
- package/lib/commonjs/api/abr/barrel.js +0 -2
- package/lib/commonjs/api/abr/barrel.js.map +1 -1
- package/lib/commonjs/api/ads/barrel.js +0 -16
- package/lib/commonjs/api/ads/barrel.js.map +1 -1
- package/lib/commonjs/api/backgroundAudio/BackgroundAudioConfiguration.js +2 -0
- package/lib/commonjs/api/backgroundAudio/BackgroundAudioConfiguration.js.map +1 -0
- package/lib/commonjs/api/backgroundAudio/barrel.js +17 -0
- package/lib/commonjs/api/backgroundAudio/barrel.js.map +1 -0
- package/lib/commonjs/api/barrel.js +52 -32
- package/lib/commonjs/api/barrel.js.map +1 -1
- package/lib/commonjs/api/cast/Airplay.js.map +1 -1
- package/lib/commonjs/api/cast/CastAPI.js.map +1 -1
- package/lib/commonjs/api/cast/CastState.js +22 -0
- package/lib/commonjs/api/cast/CastState.js.map +1 -1
- package/lib/commonjs/api/cast/Chromecast.js.map +1 -1
- package/lib/commonjs/api/cast/barrel.js +0 -10
- package/lib/commonjs/api/cast/barrel.js.map +1 -1
- package/lib/commonjs/api/config/PlayerConfiguration.js.map +1 -1
- package/lib/commonjs/api/config/barrel.js +0 -2
- package/lib/commonjs/api/config/barrel.js.map +1 -1
- package/lib/commonjs/api/drm/barrel.js +0 -10
- package/lib/commonjs/api/drm/barrel.js.map +1 -1
- package/lib/commonjs/api/error/barrel.js +0 -4
- package/lib/commonjs/api/error/barrel.js.map +1 -1
- package/lib/commonjs/api/event/AdEvent.js +24 -83
- package/lib/commonjs/api/event/AdEvent.js.map +1 -1
- package/lib/commonjs/api/event/CastEvent.js +8 -15
- package/lib/commonjs/api/event/CastEvent.js.map +1 -1
- package/lib/commonjs/api/event/Event.js +2 -0
- package/lib/commonjs/api/event/Event.js.map +1 -0
- package/lib/commonjs/api/event/EventDispatcher.js +6 -0
- package/lib/commonjs/api/event/EventDispatcher.js.map +1 -0
- package/lib/commonjs/api/event/EventListener.js +6 -0
- package/lib/commonjs/api/event/EventListener.js.map +1 -0
- package/lib/commonjs/api/event/PlayerEvent.js +7 -0
- package/lib/commonjs/api/event/PlayerEvent.js.map +1 -1
- package/lib/commonjs/api/event/TrackEvent.js +10 -15
- package/lib/commonjs/api/event/TrackEvent.js.map +1 -1
- package/lib/commonjs/api/event/barrel.js +11 -8
- package/lib/commonjs/api/event/barrel.js.map +1 -1
- package/lib/commonjs/api/media/MediaControlConfiguration.js +2 -0
- package/lib/commonjs/api/media/MediaControlConfiguration.js.map +1 -0
- package/lib/commonjs/api/media/barrel.js +17 -0
- package/lib/commonjs/api/media/barrel.js.map +1 -0
- package/lib/commonjs/api/pip/PiPConfiguration.js +2 -0
- package/lib/commonjs/api/pip/PiPConfiguration.js.map +1 -0
- package/lib/commonjs/api/pip/barrel.js +17 -0
- package/lib/commonjs/api/pip/barrel.js.map +1 -0
- package/lib/commonjs/api/player/PlayerEventMap.js +43 -0
- package/lib/commonjs/api/player/PlayerEventMap.js.map +1 -0
- package/lib/commonjs/api/player/THEOplayer.js +6 -0
- package/lib/commonjs/api/player/THEOplayer.js.map +1 -0
- package/lib/commonjs/api/player/barrel.js +28 -0
- package/lib/commonjs/api/player/barrel.js.map +1 -0
- package/lib/commonjs/api/presentation/PresentationMode.js +22 -0
- package/lib/commonjs/api/presentation/PresentationMode.js.map +1 -0
- package/lib/commonjs/api/presentation/barrel.js +17 -0
- package/lib/commonjs/api/presentation/barrel.js.map +1 -0
- package/lib/commonjs/api/source/ads/Ads.js +46 -0
- package/lib/commonjs/api/source/ads/Ads.js.map +1 -1
- package/lib/commonjs/api/source/ads/FreeWheelAdDescription.js.map +1 -1
- package/lib/commonjs/api/source/ads/IMAAdDescription.js.map +1 -1
- package/lib/commonjs/api/source/ads/barrel.js +0 -12
- package/lib/commonjs/api/source/ads/barrel.js.map +1 -1
- package/lib/commonjs/api/source/ads/ssai/barrel.js +0 -8
- package/lib/commonjs/api/source/ads/ssai/barrel.js.map +1 -1
- package/lib/commonjs/api/source/barrel.js +0 -12
- package/lib/commonjs/api/source/barrel.js.map +1 -1
- package/lib/commonjs/api/source/dash/barrel.js +0 -2
- package/lib/commonjs/api/source/dash/barrel.js.map +1 -1
- package/lib/commonjs/api/source/drm/barrel.js +0 -2
- package/lib/commonjs/api/source/drm/barrel.js.map +1 -1
- package/lib/commonjs/api/source/hls/barrel.js +0 -2
- package/lib/commonjs/api/source/hls/barrel.js.map +1 -1
- package/lib/commonjs/api/source/metadata/barrel.js +0 -2
- package/lib/commonjs/api/source/metadata/barrel.js.map +1 -1
- package/lib/commonjs/api/timeranges/barrel.js +0 -2
- package/lib/commonjs/api/timeranges/barrel.js.map +1 -1
- package/lib/commonjs/api/track/MediaTrack.js +1 -4
- package/lib/commonjs/api/track/MediaTrack.js.map +1 -1
- package/lib/commonjs/api/track/TextTrack.js +29 -24
- package/lib/commonjs/api/track/TextTrack.js.map +1 -1
- package/lib/commonjs/api/track/TextTrackStyle.js +2 -0
- package/lib/commonjs/api/track/TextTrackStyle.js.map +1 -0
- package/lib/commonjs/api/track/Track.js +25 -0
- package/lib/commonjs/api/track/Track.js.map +1 -1
- package/lib/commonjs/api/track/barrel.js +11 -10
- package/lib/commonjs/api/track/barrel.js.map +1 -1
- package/lib/commonjs/api/utils/TypeUtils.js +6 -14
- package/lib/commonjs/api/utils/TypeUtils.js.map +1 -1
- package/lib/commonjs/api/utils/barrel.js +0 -2
- package/lib/commonjs/api/utils/barrel.js.map +1 -1
- package/lib/commonjs/index.js +12 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internal/THEOplayerView.js +103 -235
- package/lib/commonjs/internal/THEOplayerView.js.map +1 -1
- package/lib/commonjs/internal/THEOplayerView.style.js +0 -3
- package/lib/commonjs/internal/THEOplayerView.style.js.map +1 -1
- package/lib/commonjs/internal/THEOplayerView.web.js +69 -589
- package/lib/commonjs/internal/THEOplayerView.web.js.map +1 -1
- package/lib/commonjs/internal/adapter/NativePlayerState.js +6 -0
- package/lib/commonjs/internal/adapter/NativePlayerState.js.map +1 -0
- package/lib/commonjs/internal/adapter/THEOplayerAdapter.js +392 -0
- package/lib/commonjs/internal/adapter/THEOplayerAdapter.js.map +1 -0
- package/lib/commonjs/internal/adapter/THEOplayerWebAdapter.js +233 -0
- package/lib/commonjs/internal/adapter/THEOplayerWebAdapter.js.map +1 -0
- package/lib/commonjs/internal/adapter/WebEventForwarder.js +280 -0
- package/lib/commonjs/internal/adapter/WebEventForwarder.js.map +1 -0
- package/lib/commonjs/internal/adapter/abr/AbrAdapter.js +40 -0
- package/lib/commonjs/internal/adapter/abr/AbrAdapter.js.map +1 -0
- package/lib/commonjs/internal/adapter/ads/THEOplayerNativeAdsAdapter.js +41 -0
- package/lib/commonjs/internal/adapter/ads/THEOplayerNativeAdsAdapter.js.map +1 -0
- package/lib/commonjs/internal/adapter/ads/THEOplayerNativeGoogleDAI.js +26 -0
- package/lib/commonjs/internal/adapter/ads/THEOplayerNativeGoogleDAI.js.map +1 -0
- package/lib/commonjs/internal/adapter/ads/THEOplayerWebAdsAdapter.js +58 -0
- package/lib/commonjs/internal/adapter/ads/THEOplayerWebAdsAdapter.js.map +1 -0
- package/lib/commonjs/internal/adapter/ads/THEOplayerWebGoogleDAI.js +25 -0
- package/lib/commonjs/internal/adapter/ads/THEOplayerWebGoogleDAI.js.map +1 -0
- package/lib/commonjs/internal/adapter/cast/THEOplayerNativeAirplay.js +47 -0
- package/lib/commonjs/internal/adapter/cast/THEOplayerNativeAirplay.js.map +1 -0
- package/lib/commonjs/internal/adapter/cast/THEOplayerNativeCastAdapter.js +46 -0
- package/lib/commonjs/internal/adapter/cast/THEOplayerNativeCastAdapter.js.map +1 -0
- package/lib/commonjs/internal/adapter/cast/THEOplayerNativeChromecast.js +55 -0
- package/lib/commonjs/internal/adapter/cast/THEOplayerNativeChromecast.js.map +1 -0
- package/lib/commonjs/internal/adapter/cast/THEOplayerWebCastAdapter.js +29 -0
- package/lib/commonjs/internal/adapter/cast/THEOplayerWebCastAdapter.js.map +1 -0
- package/lib/commonjs/internal/adapter/event/BaseEvent.js +15 -0
- package/lib/commonjs/internal/adapter/event/BaseEvent.js.map +1 -0
- package/lib/commonjs/internal/adapter/event/DefaultEventDispatcher.js +42 -0
- package/lib/commonjs/internal/adapter/event/DefaultEventDispatcher.js.map +1 -0
- package/lib/commonjs/internal/adapter/event/PlayerEvents.js +166 -0
- package/lib/commonjs/internal/adapter/event/PlayerEvents.js.map +1 -0
- package/lib/commonjs/internal/adapter/event/native/NativeAdEvent.js +6 -0
- package/lib/commonjs/internal/adapter/event/native/NativeAdEvent.js.map +1 -0
- package/lib/commonjs/internal/adapter/event/native/NativeCastEvent.js +6 -0
- package/lib/commonjs/internal/adapter/event/native/NativeCastEvent.js.map +1 -0
- package/lib/commonjs/internal/adapter/event/native/NativePlayerEvent.js +6 -0
- package/lib/commonjs/internal/adapter/event/native/NativePlayerEvent.js.map +1 -0
- package/lib/commonjs/internal/adapter/event/native/NativeTrackEvent.js +74 -0
- package/lib/commonjs/internal/adapter/event/native/NativeTrackEvent.js.map +1 -0
- package/lib/commonjs/internal/adapter/track/TextTrackStyleAdapter.js +51 -0
- package/lib/commonjs/internal/adapter/track/TextTrackStyleAdapter.js.map +1 -0
- package/lib/commonjs/internal/adapter/web/TrackUtils.js +87 -0
- package/lib/commonjs/internal/adapter/web/TrackUtils.js.map +1 -0
- package/lib/commonjs/internal/adapter/web/WebMediaSession.js +188 -0
- package/lib/commonjs/internal/adapter/web/WebMediaSession.js.map +1 -0
- package/lib/commonjs/internal/adapter/web/WebPresentationModeManager.js +101 -0
- package/lib/commonjs/internal/adapter/web/WebPresentationModeManager.js.map +1 -0
- package/lib/commonjs/internal/drm/ContentProtectionRegistry.js +13 -50
- package/lib/commonjs/internal/drm/ContentProtectionRegistry.js.map +1 -1
- package/lib/commonjs/internal/drm/ContentProtectionRegistry.web.js +0 -4
- package/lib/commonjs/internal/drm/ContentProtectionRegistry.web.js.map +1 -1
- package/lib/commonjs/internal/drm/NativeCertificateRequest.js +0 -3
- package/lib/commonjs/internal/drm/NativeCertificateRequest.js.map +1 -1
- package/lib/commonjs/internal/drm/NativeCertificateResponse.js +0 -4
- package/lib/commonjs/internal/drm/NativeCertificateResponse.js.map +1 -1
- package/lib/commonjs/internal/drm/NativeLicenseRequest.js +0 -3
- package/lib/commonjs/internal/drm/NativeLicenseRequest.js.map +1 -1
- package/lib/commonjs/internal/drm/NativeLicenseResponse.js +0 -4
- package/lib/commonjs/internal/drm/NativeLicenseResponse.js.map +1 -1
- package/lib/commonjs/internal/utils/TypeUtils.js +2 -8
- package/lib/commonjs/internal/utils/TypeUtils.js.map +1 -1
- package/lib/commonjs/internal/utils/arrayUtil.js +19 -0
- package/lib/commonjs/internal/utils/arrayUtil.js.map +1 -0
- package/lib/commonjs/ui/THEOplayerDefaultUi.js +82 -0
- package/lib/commonjs/ui/THEOplayerDefaultUi.js.map +1 -0
- package/lib/commonjs/ui/THEOplayerTheme.js +48 -0
- package/lib/commonjs/ui/THEOplayerTheme.js.map +1 -0
- package/lib/commonjs/ui/barrel.js +39 -0
- package/lib/commonjs/ui/barrel.js.map +1 -0
- package/lib/commonjs/ui/components/activityindicator/CenteredDelayedActivityIndicator.js +99 -0
- package/lib/commonjs/ui/components/activityindicator/CenteredDelayedActivityIndicator.js.map +1 -0
- package/lib/commonjs/ui/components/activityindicator/DelayedActivityIndicator.js +35 -0
- package/lib/commonjs/ui/components/activityindicator/DelayedActivityIndicator.js.map +1 -0
- package/lib/commonjs/ui/components/activityindicator/barrel.js +28 -0
- package/lib/commonjs/ui/components/activityindicator/barrel.js.map +1 -0
- package/lib/commonjs/ui/components/barrel.js +105 -0
- package/lib/commonjs/ui/components/barrel.js.map +1 -0
- package/lib/commonjs/ui/components/button/AirplayButton.js +81 -0
- package/lib/commonjs/ui/components/button/AirplayButton.js.map +1 -0
- package/lib/commonjs/ui/components/button/ChromecastButton.js +66 -0
- package/lib/commonjs/ui/components/button/ChromecastButton.js.map +1 -0
- package/lib/commonjs/ui/components/button/ChromecastButton.web.js +82 -0
- package/lib/commonjs/ui/components/button/ChromecastButton.web.js.map +1 -0
- package/lib/commonjs/ui/components/button/FullscreenButton.js +72 -0
- package/lib/commonjs/ui/components/button/FullscreenButton.js.map +1 -0
- package/lib/commonjs/ui/components/button/MuteButton.js +66 -0
- package/lib/commonjs/ui/components/button/MuteButton.js.map +1 -0
- package/lib/commonjs/ui/components/button/PipButton.js +72 -0
- package/lib/commonjs/ui/components/button/PipButton.js.map +1 -0
- package/lib/commonjs/ui/components/button/PlayButton.js +113 -0
- package/lib/commonjs/ui/components/button/PlayButton.js.map +1 -0
- package/lib/commonjs/ui/components/button/SkipButton.js +122 -0
- package/lib/commonjs/ui/components/button/SkipButton.js.map +1 -0
- package/lib/commonjs/ui/components/button/actionbutton/ActionButton.js +82 -0
- package/lib/commonjs/ui/components/button/actionbutton/ActionButton.js.map +1 -0
- package/lib/commonjs/ui/components/button/barrel.js +105 -0
- package/lib/commonjs/ui/components/button/barrel.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/AirplaySvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/AirplaySvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/ArrowForwardSvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/ArrowForwardSvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/BackSvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/BackSvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/BackwardSvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/BackwardSvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/ChromecastSvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/ChromecastSvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/ErrorSvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/ErrorSvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/ForwardSvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/ForwardSvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/FullscreenEnterSvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/FullscreenEnterSvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/FullscreenExitSvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/FullscreenExitSvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/LanguageSvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/LanguageSvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/ListSvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/ListSvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/PauseSvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/PauseSvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/PipEnterSvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/PipEnterSvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/PipExitSvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/PipExitSvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/PlaySvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/PlaySvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/ReplaySvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/ReplaySvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/SettingsSvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/SettingsSvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/SvgUtils.js +13 -0
- package/lib/commonjs/ui/components/button/svg/SvgUtils.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/VolumeOffSvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/VolumeOffSvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/VolumeUpSvg.js +22 -0
- package/lib/commonjs/ui/components/button/svg/VolumeUpSvg.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/barrel.js +226 -0
- package/lib/commonjs/ui/components/button/svg/barrel.js.map +1 -0
- package/lib/commonjs/ui/components/button/svg/res/AirPlayButton.html +6 -0
- package/lib/commonjs/ui/components/button/svg/res/Airplay.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/ChromecastButton.html +25 -0
- package/lib/commonjs/ui/components/button/svg/res/arrow_forward.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/back.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/backward.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/chromecast-48px.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/close.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/error.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/forward.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/fullscreen-enter.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/fullscreen-exit.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/language.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/list.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/live.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/pause.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/pip_enter.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/pip_exit.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/play.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/replay.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/settings.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/skip-next.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/volume-high.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/volume-low.svg +1 -0
- package/lib/commonjs/ui/components/button/svg/res/volume-off.svg +1 -0
- package/lib/commonjs/ui/components/controlbar/ControlBar.js +61 -0
- package/lib/commonjs/ui/components/controlbar/ControlBar.js.map +1 -0
- package/lib/commonjs/ui/components/controlbar/Spacer.js +21 -0
- package/lib/commonjs/ui/components/controlbar/Spacer.js.map +1 -0
- package/lib/commonjs/ui/components/controlbar/barrel.js +28 -0
- package/lib/commonjs/ui/components/controlbar/barrel.js.map +1 -0
- package/lib/commonjs/ui/components/menu/LanguageMenuButton.js +175 -0
- package/lib/commonjs/ui/components/menu/LanguageMenuButton.js.map +1 -0
- package/lib/commonjs/ui/components/menu/PlaybackRateSubMenu.js +91 -0
- package/lib/commonjs/ui/components/menu/PlaybackRateSubMenu.js.map +1 -0
- package/lib/commonjs/ui/components/menu/QualitySubMenu.js +145 -0
- package/lib/commonjs/ui/components/menu/QualitySubMenu.js.map +1 -0
- package/lib/commonjs/ui/components/menu/SettingsMenuButton.js +36 -0
- package/lib/commonjs/ui/components/menu/SettingsMenuButton.js.map +1 -0
- package/lib/commonjs/ui/components/menu/barrel.js +61 -0
- package/lib/commonjs/ui/components/menu/barrel.js.map +1 -0
- package/lib/commonjs/ui/components/menu/common/MenuButton.js +34 -0
- package/lib/commonjs/ui/components/menu/common/MenuButton.js.map +1 -0
- package/lib/commonjs/ui/components/menu/common/MenuRadioButton.js +47 -0
- package/lib/commonjs/ui/components/menu/common/MenuRadioButton.js.map +1 -0
- package/lib/commonjs/ui/components/menu/common/MenuTitle.js +38 -0
- package/lib/commonjs/ui/components/menu/common/MenuTitle.js.map +1 -0
- package/lib/commonjs/ui/components/menu/common/MenuView.js +75 -0
- package/lib/commonjs/ui/components/menu/common/MenuView.js.map +1 -0
- package/lib/commonjs/ui/components/menu/common/ScrollableMenu.js +45 -0
- package/lib/commonjs/ui/components/menu/common/ScrollableMenu.js.map +1 -0
- package/lib/commonjs/ui/components/menu/common/SubMenuWithButton.js +65 -0
- package/lib/commonjs/ui/components/menu/common/SubMenuWithButton.js.map +1 -0
- package/lib/commonjs/ui/components/menu/common/barrel.js +72 -0
- package/lib/commonjs/ui/components/menu/common/barrel.js.map +1 -0
- package/lib/commonjs/ui/components/message/CastMessage.js +79 -0
- package/lib/commonjs/ui/components/message/CastMessage.js.map +1 -0
- package/lib/commonjs/ui/components/message/ErrorDisplay.js +53 -0
- package/lib/commonjs/ui/components/message/ErrorDisplay.js.map +1 -0
- package/lib/commonjs/ui/components/message/barrel.js +28 -0
- package/lib/commonjs/ui/components/message/barrel.js.map +1 -0
- package/lib/commonjs/ui/components/seekbar/SeekBar.js +194 -0
- package/lib/commonjs/ui/components/seekbar/SeekBar.js.map +1 -0
- package/lib/commonjs/ui/components/seekbar/barrel.js +28 -0
- package/lib/commonjs/ui/components/seekbar/barrel.js.map +1 -0
- package/lib/commonjs/ui/components/seekbar/thumbnail/SingleThumbnailView.js +45 -0
- package/lib/commonjs/ui/components/seekbar/thumbnail/SingleThumbnailView.js.map +1 -0
- package/lib/commonjs/ui/components/seekbar/thumbnail/Thumbnail.js +18 -0
- package/lib/commonjs/ui/components/seekbar/thumbnail/Thumbnail.js.map +1 -0
- package/lib/commonjs/ui/components/seekbar/thumbnail/ThumbnailView.js +256 -0
- package/lib/commonjs/ui/components/seekbar/thumbnail/ThumbnailView.js.map +1 -0
- package/lib/commonjs/ui/components/seekbar/thumbnail/Urlpolyfill.js +17 -0
- package/lib/commonjs/ui/components/seekbar/thumbnail/Urlpolyfill.js.map +1 -0
- package/lib/commonjs/ui/components/seekbar/thumbnail/Urlpolyfill.web.js +17 -0
- package/lib/commonjs/ui/components/seekbar/thumbnail/Urlpolyfill.web.js.map +1 -0
- package/lib/commonjs/ui/components/seekbar/thumbnail/barrel.js +28 -0
- package/lib/commonjs/ui/components/seekbar/thumbnail/barrel.js.map +1 -0
- package/lib/commonjs/ui/components/timelabel/StaticTimeLabel.js +55 -0
- package/lib/commonjs/ui/components/timelabel/StaticTimeLabel.js.map +1 -0
- package/lib/commonjs/ui/components/timelabel/TimeLabel.js +88 -0
- package/lib/commonjs/ui/components/timelabel/TimeLabel.js.map +1 -0
- package/lib/commonjs/ui/components/timelabel/barrel.js +28 -0
- package/lib/commonjs/ui/components/timelabel/barrel.js.map +1 -0
- package/lib/commonjs/ui/components/uicontroller/UiContainer.js +350 -0
- package/lib/commonjs/ui/components/uicontroller/UiContainer.js.map +1 -0
- package/lib/commonjs/ui/components/uicontroller/UiControls.js +6 -0
- package/lib/commonjs/ui/components/uicontroller/UiControls.js.map +1 -0
- package/lib/commonjs/ui/components/uicontroller/barrel.js +28 -0
- package/lib/commonjs/ui/components/uicontroller/barrel.js.map +1 -0
- package/lib/commonjs/ui/components/util/PlayerContext.js +19 -0
- package/lib/commonjs/ui/components/util/PlayerContext.js.map +1 -0
- package/lib/commonjs/ui/components/util/TrackUtils.js +69 -0
- package/lib/commonjs/ui/components/util/TrackUtils.js.map +1 -0
- package/lib/commonjs/ui/components/util/barrel.js +17 -0
- package/lib/commonjs/ui/components/util/barrel.js.map +1 -0
- package/lib/commonjs/ui/utils/ArrayUtils.js +19 -0
- package/lib/commonjs/ui/utils/ArrayUtils.js.map +1 -0
- package/lib/commonjs/ui/utils/language/Language.js +38 -0
- package/lib/commonjs/ui/utils/language/Language.js.map +1 -0
- package/lib/commonjs/ui/utils/language/languages.json +1658 -0
- package/lib/commonjs/web/platform/BrowserDetection.js +34 -0
- package/lib/commonjs/web/platform/BrowserDetection.js.map +1 -0
- package/lib/commonjs/web/platform/browser.d.js +2 -0
- package/lib/commonjs/web/platform/browser.d.js.map +1 -0
- package/lib/module/api/THEOplayerView.js.map +1 -1
- package/lib/module/api/abr/barrel.js.map +1 -1
- package/lib/module/api/ads/barrel.js.map +1 -1
- package/lib/module/api/backgroundAudio/BackgroundAudioConfiguration.js +2 -0
- package/lib/module/api/backgroundAudio/BackgroundAudioConfiguration.js.map +1 -0
- package/lib/module/api/backgroundAudio/barrel.js +2 -0
- package/lib/module/api/backgroundAudio/barrel.js.map +1 -0
- package/lib/module/api/barrel.js +4 -0
- package/lib/module/api/barrel.js.map +1 -1
- package/lib/module/api/cast/Airplay.js.map +1 -1
- package/lib/module/api/cast/CastAPI.js.map +1 -1
- package/lib/module/api/cast/CastState.js +16 -1
- package/lib/module/api/cast/CastState.js.map +1 -1
- package/lib/module/api/cast/Chromecast.js.map +1 -1
- package/lib/module/api/cast/barrel.js.map +1 -1
- package/lib/module/api/config/PlayerConfiguration.js.map +1 -1
- package/lib/module/api/config/barrel.js.map +1 -1
- package/lib/module/api/drm/barrel.js.map +1 -1
- package/lib/module/api/error/barrel.js.map +1 -1
- package/lib/module/api/event/AdEvent.js +22 -81
- package/lib/module/api/event/AdEvent.js.map +1 -1
- package/lib/module/api/event/CastEvent.js +6 -13
- package/lib/module/api/event/CastEvent.js.map +1 -1
- package/lib/module/api/event/Event.js +2 -0
- package/lib/module/api/event/Event.js.map +1 -0
- package/lib/module/api/event/EventDispatcher.js +2 -0
- package/lib/module/api/event/EventDispatcher.js.map +1 -0
- package/lib/module/api/event/EventListener.js +2 -0
- package/lib/module/api/event/EventListener.js.map +1 -0
- package/lib/module/api/event/PlayerEvent.js +5 -1
- package/lib/module/api/event/PlayerEvent.js.map +1 -1
- package/lib/module/api/event/TrackEvent.js +10 -15
- package/lib/module/api/event/TrackEvent.js.map +1 -1
- package/lib/module/api/event/barrel.js +1 -0
- package/lib/module/api/event/barrel.js.map +1 -1
- package/lib/module/api/media/MediaControlConfiguration.js +2 -0
- package/lib/module/api/media/MediaControlConfiguration.js.map +1 -0
- package/lib/module/api/media/barrel.js +2 -0
- package/lib/module/api/media/barrel.js.map +1 -0
- package/lib/module/api/pip/PiPConfiguration.js +2 -0
- package/lib/module/api/pip/PiPConfiguration.js.map +1 -0
- package/lib/module/api/pip/barrel.js +2 -0
- package/lib/module/api/pip/barrel.js.map +1 -0
- package/lib/module/api/player/PlayerEventMap.js +37 -0
- package/lib/module/api/player/PlayerEventMap.js.map +1 -0
- package/lib/module/api/player/THEOplayer.js +2 -0
- package/lib/module/api/player/THEOplayer.js.map +1 -0
- package/lib/module/api/player/barrel.js +3 -0
- package/lib/module/api/player/barrel.js.map +1 -0
- package/lib/module/api/presentation/PresentationMode.js +16 -0
- package/lib/module/api/presentation/PresentationMode.js.map +1 -0
- package/lib/module/api/presentation/barrel.js +2 -0
- package/lib/module/api/presentation/barrel.js.map +1 -0
- package/lib/module/api/source/ads/Ads.js +42 -0
- package/lib/module/api/source/ads/Ads.js.map +1 -1
- package/lib/module/api/source/ads/FreeWheelAdDescription.js.map +1 -1
- package/lib/module/api/source/ads/IMAAdDescription.js.map +1 -1
- package/lib/module/api/source/ads/barrel.js.map +1 -1
- package/lib/module/api/source/ads/ssai/barrel.js.map +1 -1
- package/lib/module/api/source/barrel.js.map +1 -1
- package/lib/module/api/source/dash/barrel.js.map +1 -1
- package/lib/module/api/source/drm/barrel.js.map +1 -1
- package/lib/module/api/source/hls/barrel.js.map +1 -1
- package/lib/module/api/source/metadata/barrel.js.map +1 -1
- package/lib/module/api/timeranges/barrel.js.map +1 -1
- package/lib/module/api/track/MediaTrack.js +1 -1
- package/lib/module/api/track/MediaTrack.js.map +1 -1
- package/lib/module/api/track/TextTrack.js +25 -11
- package/lib/module/api/track/TextTrack.js.map +1 -1
- package/lib/module/api/track/TextTrackStyle.js +2 -0
- package/lib/module/api/track/TextTrackStyle.js.map +1 -0
- package/lib/module/api/track/Track.js +17 -0
- package/lib/module/api/track/Track.js.map +1 -1
- package/lib/module/api/track/barrel.js +1 -0
- package/lib/module/api/track/barrel.js.map +1 -1
- package/lib/module/api/utils/TypeUtils.js +8 -4
- package/lib/module/api/utils/TypeUtils.js.map +1 -1
- package/lib/module/api/utils/barrel.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/THEOplayerView.js +104 -224
- package/lib/module/internal/THEOplayerView.js.map +1 -1
- package/lib/module/internal/THEOplayerView.style.js.map +1 -1
- package/lib/module/internal/THEOplayerView.web.js +69 -578
- package/lib/module/internal/THEOplayerView.web.js.map +1 -1
- package/lib/module/internal/adapter/NativePlayerState.js +2 -0
- package/lib/module/internal/adapter/NativePlayerState.js.map +1 -0
- package/lib/module/internal/adapter/THEOplayerAdapter.js +385 -0
- package/lib/module/internal/adapter/THEOplayerAdapter.js.map +1 -0
- package/lib/module/internal/adapter/THEOplayerWebAdapter.js +226 -0
- package/lib/module/internal/adapter/THEOplayerWebAdapter.js.map +1 -0
- package/lib/module/internal/adapter/WebEventForwarder.js +273 -0
- package/lib/module/internal/adapter/WebEventForwarder.js.map +1 -0
- package/lib/module/internal/adapter/abr/AbrAdapter.js +33 -0
- package/lib/module/internal/adapter/abr/AbrAdapter.js.map +1 -0
- package/lib/module/internal/adapter/ads/THEOplayerNativeAdsAdapter.js +34 -0
- package/lib/module/internal/adapter/ads/THEOplayerNativeAdsAdapter.js.map +1 -0
- package/lib/module/internal/adapter/ads/THEOplayerNativeGoogleDAI.js +19 -0
- package/lib/module/internal/adapter/ads/THEOplayerNativeGoogleDAI.js.map +1 -0
- package/lib/module/internal/adapter/ads/THEOplayerWebAdsAdapter.js +51 -0
- package/lib/module/internal/adapter/ads/THEOplayerWebAdsAdapter.js.map +1 -0
- package/lib/module/internal/adapter/ads/THEOplayerWebGoogleDAI.js +18 -0
- package/lib/module/internal/adapter/ads/THEOplayerWebGoogleDAI.js.map +1 -0
- package/lib/module/internal/adapter/cast/THEOplayerNativeAirplay.js +40 -0
- package/lib/module/internal/adapter/cast/THEOplayerNativeAirplay.js.map +1 -0
- package/lib/module/internal/adapter/cast/THEOplayerNativeCastAdapter.js +39 -0
- package/lib/module/internal/adapter/cast/THEOplayerNativeCastAdapter.js.map +1 -0
- package/lib/module/internal/adapter/cast/THEOplayerNativeChromecast.js +48 -0
- package/lib/module/internal/adapter/cast/THEOplayerNativeChromecast.js.map +1 -0
- package/lib/module/internal/adapter/cast/THEOplayerWebCastAdapter.js +22 -0
- package/lib/module/internal/adapter/cast/THEOplayerWebCastAdapter.js.map +1 -0
- package/lib/module/internal/adapter/event/BaseEvent.js +8 -0
- package/lib/module/internal/adapter/event/BaseEvent.js.map +1 -0
- package/lib/module/internal/adapter/event/DefaultEventDispatcher.js +35 -0
- package/lib/module/internal/adapter/event/DefaultEventDispatcher.js.map +1 -0
- package/lib/module/internal/adapter/event/PlayerEvents.js +142 -0
- package/lib/module/internal/adapter/event/PlayerEvents.js.map +1 -0
- package/lib/module/internal/adapter/event/native/NativeAdEvent.js +2 -0
- package/lib/module/internal/adapter/event/native/NativeAdEvent.js.map +1 -0
- package/lib/module/internal/adapter/event/native/NativeCastEvent.js +2 -0
- package/lib/module/internal/adapter/event/native/NativeCastEvent.js.map +1 -0
- package/lib/module/internal/adapter/event/native/NativePlayerEvent.js +2 -0
- package/lib/module/internal/adapter/event/native/NativePlayerEvent.js.map +1 -0
- package/lib/module/internal/adapter/event/native/NativeTrackEvent.js +60 -0
- package/lib/module/internal/adapter/event/native/NativeTrackEvent.js.map +1 -0
- package/lib/module/internal/adapter/track/TextTrackStyleAdapter.js +44 -0
- package/lib/module/internal/adapter/track/TextTrackStyleAdapter.js.map +1 -0
- package/lib/module/internal/adapter/web/TrackUtils.js +75 -0
- package/lib/module/internal/adapter/web/TrackUtils.js.map +1 -0
- package/lib/module/internal/adapter/web/WebMediaSession.js +182 -0
- package/lib/module/internal/adapter/web/WebMediaSession.js.map +1 -0
- package/lib/module/internal/adapter/web/WebPresentationModeManager.js +94 -0
- package/lib/module/internal/adapter/web/WebPresentationModeManager.js.map +1 -0
- package/lib/module/internal/drm/ContentProtectionRegistry.js +13 -32
- package/lib/module/internal/drm/ContentProtectionRegistry.js.map +1 -1
- package/lib/module/internal/drm/ContentProtectionRegistry.web.js +0 -1
- package/lib/module/internal/drm/ContentProtectionRegistry.web.js.map +1 -1
- package/lib/module/internal/drm/NativeCertificateRequest.js.map +1 -1
- package/lib/module/internal/drm/NativeCertificateResponse.js.map +1 -1
- package/lib/module/internal/drm/NativeLicenseRequest.js.map +1 -1
- package/lib/module/internal/drm/NativeLicenseResponse.js.map +1 -1
- package/lib/module/internal/utils/TypeUtils.js +2 -3
- package/lib/module/internal/utils/TypeUtils.js.map +1 -1
- package/lib/module/internal/utils/arrayUtil.js +12 -0
- package/lib/module/internal/utils/arrayUtil.js.map +1 -0
- package/lib/module/ui/THEOplayerDefaultUi.js +74 -0
- package/lib/module/ui/THEOplayerDefaultUi.js.map +1 -0
- package/lib/module/ui/THEOplayerTheme.js +41 -0
- package/lib/module/ui/THEOplayerTheme.js.map +1 -0
- package/lib/module/ui/barrel.js +4 -0
- package/lib/module/ui/barrel.js.map +1 -0
- package/lib/module/ui/components/activityindicator/CenteredDelayedActivityIndicator.js +90 -0
- package/lib/module/ui/components/activityindicator/CenteredDelayedActivityIndicator.js.map +1 -0
- package/lib/module/ui/components/activityindicator/DelayedActivityIndicator.js +26 -0
- package/lib/module/ui/components/activityindicator/DelayedActivityIndicator.js.map +1 -0
- package/lib/module/ui/components/activityindicator/barrel.js +3 -0
- package/lib/module/ui/components/activityindicator/barrel.js.map +1 -0
- package/lib/module/ui/components/barrel.js +10 -0
- package/lib/module/ui/components/barrel.js.map +1 -0
- package/lib/module/ui/components/button/AirplayButton.js +72 -0
- package/lib/module/ui/components/button/AirplayButton.js.map +1 -0
- package/lib/module/ui/components/button/ChromecastButton.js +56 -0
- package/lib/module/ui/components/button/ChromecastButton.js.map +1 -0
- package/lib/module/ui/components/button/ChromecastButton.web.js +72 -0
- package/lib/module/ui/components/button/ChromecastButton.web.js.map +1 -0
- package/lib/module/ui/components/button/FullscreenButton.js +63 -0
- package/lib/module/ui/components/button/FullscreenButton.js.map +1 -0
- package/lib/module/ui/components/button/MuteButton.js +57 -0
- package/lib/module/ui/components/button/MuteButton.js.map +1 -0
- package/lib/module/ui/components/button/PipButton.js +63 -0
- package/lib/module/ui/components/button/PipButton.js.map +1 -0
- package/lib/module/ui/components/button/PlayButton.js +104 -0
- package/lib/module/ui/components/button/PlayButton.js.map +1 -0
- package/lib/module/ui/components/button/SkipButton.js +113 -0
- package/lib/module/ui/components/button/SkipButton.js.map +1 -0
- package/lib/module/ui/components/button/actionbutton/ActionButton.js +72 -0
- package/lib/module/ui/components/button/actionbutton/ActionButton.js.map +1 -0
- package/lib/module/ui/components/button/barrel.js +10 -0
- package/lib/module/ui/components/button/barrel.js.map +1 -0
- package/lib/module/ui/components/button/svg/AirplaySvg.js +12 -0
- package/lib/module/ui/components/button/svg/AirplaySvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/ArrowForwardSvg.js +12 -0
- package/lib/module/ui/components/button/svg/ArrowForwardSvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/BackSvg.js +12 -0
- package/lib/module/ui/components/button/svg/BackSvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/BackwardSvg.js +12 -0
- package/lib/module/ui/components/button/svg/BackwardSvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/ChromecastSvg.js +12 -0
- package/lib/module/ui/components/button/svg/ChromecastSvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/ErrorSvg.js +12 -0
- package/lib/module/ui/components/button/svg/ErrorSvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/ForwardSvg.js +12 -0
- package/lib/module/ui/components/button/svg/ForwardSvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/FullscreenEnterSvg.js +12 -0
- package/lib/module/ui/components/button/svg/FullscreenEnterSvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/FullscreenExitSvg.js +12 -0
- package/lib/module/ui/components/button/svg/FullscreenExitSvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/LanguageSvg.js +12 -0
- package/lib/module/ui/components/button/svg/LanguageSvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/ListSvg.js +12 -0
- package/lib/module/ui/components/button/svg/ListSvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/PauseSvg.js +12 -0
- package/lib/module/ui/components/button/svg/PauseSvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/PipEnterSvg.js +12 -0
- package/lib/module/ui/components/button/svg/PipEnterSvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/PipExitSvg.js +12 -0
- package/lib/module/ui/components/button/svg/PipExitSvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/PlaySvg.js +12 -0
- package/lib/module/ui/components/button/svg/PlaySvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/ReplaySvg.js +12 -0
- package/lib/module/ui/components/button/svg/ReplaySvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/SettingsSvg.js +12 -0
- package/lib/module/ui/components/button/svg/SettingsSvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/SvgUtils.js +5 -0
- package/lib/module/ui/components/button/svg/SvgUtils.js.map +1 -0
- package/lib/module/ui/components/button/svg/VolumeOffSvg.js +12 -0
- package/lib/module/ui/components/button/svg/VolumeOffSvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/VolumeUpSvg.js +12 -0
- package/lib/module/ui/components/button/svg/VolumeUpSvg.js.map +1 -0
- package/lib/module/ui/components/button/svg/barrel.js +21 -0
- package/lib/module/ui/components/button/svg/barrel.js.map +1 -0
- package/lib/module/ui/components/button/svg/res/AirPlayButton.html +6 -0
- package/lib/module/ui/components/button/svg/res/Airplay.svg +1 -0
- package/lib/module/ui/components/button/svg/res/ChromecastButton.html +25 -0
- package/lib/module/ui/components/button/svg/res/arrow_forward.svg +1 -0
- package/lib/module/ui/components/button/svg/res/back.svg +1 -0
- package/lib/module/ui/components/button/svg/res/backward.svg +1 -0
- package/lib/module/ui/components/button/svg/res/chromecast-48px.svg +1 -0
- package/lib/module/ui/components/button/svg/res/close.svg +1 -0
- package/lib/module/ui/components/button/svg/res/error.svg +1 -0
- package/lib/module/ui/components/button/svg/res/forward.svg +1 -0
- package/lib/module/ui/components/button/svg/res/fullscreen-enter.svg +1 -0
- package/lib/module/ui/components/button/svg/res/fullscreen-exit.svg +1 -0
- package/lib/module/ui/components/button/svg/res/language.svg +1 -0
- package/lib/module/ui/components/button/svg/res/list.svg +1 -0
- package/lib/module/ui/components/button/svg/res/live.svg +1 -0
- package/lib/module/ui/components/button/svg/res/pause.svg +1 -0
- package/lib/module/ui/components/button/svg/res/pip_enter.svg +1 -0
- package/lib/module/ui/components/button/svg/res/pip_exit.svg +1 -0
- package/lib/module/ui/components/button/svg/res/play.svg +1 -0
- package/lib/module/ui/components/button/svg/res/replay.svg +1 -0
- package/lib/module/ui/components/button/svg/res/settings.svg +1 -0
- package/lib/module/ui/components/button/svg/res/skip-next.svg +1 -0
- package/lib/module/ui/components/button/svg/res/volume-high.svg +1 -0
- package/lib/module/ui/components/button/svg/res/volume-low.svg +1 -0
- package/lib/module/ui/components/button/svg/res/volume-off.svg +1 -0
- package/lib/module/ui/components/controlbar/ControlBar.js +52 -0
- package/lib/module/ui/components/controlbar/ControlBar.js.map +1 -0
- package/lib/module/ui/components/controlbar/Spacer.js +14 -0
- package/lib/module/ui/components/controlbar/Spacer.js.map +1 -0
- package/lib/module/ui/components/controlbar/barrel.js +3 -0
- package/lib/module/ui/components/controlbar/barrel.js.map +1 -0
- package/lib/module/ui/components/menu/LanguageMenuButton.js +165 -0
- package/lib/module/ui/components/menu/LanguageMenuButton.js.map +1 -0
- package/lib/module/ui/components/menu/PlaybackRateSubMenu.js +80 -0
- package/lib/module/ui/components/menu/PlaybackRateSubMenu.js.map +1 -0
- package/lib/module/ui/components/menu/QualitySubMenu.js +135 -0
- package/lib/module/ui/components/menu/QualitySubMenu.js.map +1 -0
- package/lib/module/ui/components/menu/SettingsMenuButton.js +28 -0
- package/lib/module/ui/components/menu/SettingsMenuButton.js.map +1 -0
- package/lib/module/ui/components/menu/barrel.js +6 -0
- package/lib/module/ui/components/menu/barrel.js.map +1 -0
- package/lib/module/ui/components/menu/common/MenuButton.js +26 -0
- package/lib/module/ui/components/menu/common/MenuButton.js.map +1 -0
- package/lib/module/ui/components/menu/common/MenuRadioButton.js +38 -0
- package/lib/module/ui/components/menu/common/MenuRadioButton.js.map +1 -0
- package/lib/module/ui/components/menu/common/MenuTitle.js +29 -0
- package/lib/module/ui/components/menu/common/MenuTitle.js.map +1 -0
- package/lib/module/ui/components/menu/common/MenuView.js +65 -0
- package/lib/module/ui/components/menu/common/MenuView.js.map +1 -0
- package/lib/module/ui/components/menu/common/ScrollableMenu.js +36 -0
- package/lib/module/ui/components/menu/common/ScrollableMenu.js.map +1 -0
- package/lib/module/ui/components/menu/common/SubMenuWithButton.js +56 -0
- package/lib/module/ui/components/menu/common/SubMenuWithButton.js.map +1 -0
- package/lib/module/ui/components/menu/common/barrel.js +7 -0
- package/lib/module/ui/components/menu/common/barrel.js.map +1 -0
- package/lib/module/ui/components/message/CastMessage.js +70 -0
- package/lib/module/ui/components/message/CastMessage.js.map +1 -0
- package/lib/module/ui/components/message/ErrorDisplay.js +46 -0
- package/lib/module/ui/components/message/ErrorDisplay.js.map +1 -0
- package/lib/module/ui/components/message/barrel.js +3 -0
- package/lib/module/ui/components/message/barrel.js.map +1 -0
- package/lib/module/ui/components/seekbar/SeekBar.js +184 -0
- package/lib/module/ui/components/seekbar/SeekBar.js.map +1 -0
- package/lib/module/ui/components/seekbar/barrel.js +3 -0
- package/lib/module/ui/components/seekbar/barrel.js.map +1 -0
- package/lib/module/ui/components/seekbar/thumbnail/SingleThumbnailView.js +37 -0
- package/lib/module/ui/components/seekbar/thumbnail/SingleThumbnailView.js.map +1 -0
- package/lib/module/ui/components/seekbar/thumbnail/Thumbnail.js +11 -0
- package/lib/module/ui/components/seekbar/thumbnail/Thumbnail.js.map +1 -0
- package/lib/module/ui/components/seekbar/thumbnail/ThumbnailView.js +246 -0
- package/lib/module/ui/components/seekbar/thumbnail/ThumbnailView.js.map +1 -0
- package/lib/module/ui/components/seekbar/thumbnail/Urlpolyfill.js +2 -0
- package/lib/module/ui/components/seekbar/thumbnail/Urlpolyfill.js.map +1 -0
- package/lib/module/ui/components/seekbar/thumbnail/Urlpolyfill.web.js +3 -0
- package/lib/module/ui/components/seekbar/thumbnail/Urlpolyfill.web.js.map +1 -0
- package/lib/module/ui/components/seekbar/thumbnail/barrel.js +3 -0
- package/lib/module/ui/components/seekbar/thumbnail/barrel.js.map +1 -0
- package/lib/module/ui/components/timelabel/StaticTimeLabel.js +48 -0
- package/lib/module/ui/components/timelabel/StaticTimeLabel.js.map +1 -0
- package/lib/module/ui/components/timelabel/TimeLabel.js +78 -0
- package/lib/module/ui/components/timelabel/TimeLabel.js.map +1 -0
- package/lib/module/ui/components/timelabel/barrel.js +3 -0
- package/lib/module/ui/components/timelabel/barrel.js.map +1 -0
- package/lib/module/ui/components/uicontroller/UiContainer.js +336 -0
- package/lib/module/ui/components/uicontroller/UiContainer.js.map +1 -0
- package/lib/module/ui/components/uicontroller/UiControls.js +2 -0
- package/lib/module/ui/components/uicontroller/UiControls.js.map +1 -0
- package/lib/module/ui/components/uicontroller/barrel.js +3 -0
- package/lib/module/ui/components/uicontroller/barrel.js.map +1 -0
- package/lib/module/ui/components/util/PlayerContext.js +11 -0
- package/lib/module/ui/components/util/PlayerContext.js.map +1 -0
- package/lib/module/ui/components/util/TrackUtils.js +60 -0
- package/lib/module/ui/components/util/TrackUtils.js.map +1 -0
- package/lib/module/ui/components/util/barrel.js +2 -0
- package/lib/module/ui/components/util/barrel.js.map +1 -0
- package/lib/module/ui/utils/ArrayUtils.js +12 -0
- package/lib/module/ui/utils/ArrayUtils.js.map +1 -0
- package/lib/module/ui/utils/language/Language.js +27 -0
- package/lib/module/ui/utils/language/Language.js.map +1 -0
- package/lib/module/ui/utils/language/languages.json +1658 -0
- package/lib/module/web/platform/BrowserDetection.js +27 -0
- package/lib/module/web/platform/BrowserDetection.js.map +1 -0
- package/lib/module/web/platform/browser.d.js +2 -0
- package/lib/module/web/platform/browser.d.js.map +1 -0
- package/lib/typescript/api/THEOplayerView.d.ts +21 -0
- package/lib/typescript/api/backgroundAudio/BackgroundAudioConfiguration.d.ts +22 -0
- package/lib/typescript/api/backgroundAudio/barrel.d.ts +1 -0
- package/lib/typescript/api/barrel.d.ts +16 -0
- package/lib/typescript/api/cast/Airplay.d.ts +27 -0
- package/lib/typescript/api/cast/CastAPI.d.ts +25 -0
- package/lib/typescript/api/cast/CastState.d.ts +15 -0
- package/lib/typescript/api/cast/Chromecast.d.ts +39 -0
- package/lib/typescript/api/config/PlayerConfiguration.d.ts +58 -0
- package/lib/typescript/api/event/AdEvent.d.ts +90 -0
- package/lib/typescript/api/event/CastEvent.d.ts +29 -0
- package/lib/typescript/api/event/Event.d.ts +15 -0
- package/lib/typescript/api/event/EventDispatcher.d.ts +44 -0
- package/lib/typescript/api/event/EventListener.d.ts +7 -0
- package/lib/typescript/api/event/PlayerEvent.d.ts +107 -0
- package/lib/typescript/api/event/TrackEvent.d.ts +92 -0
- package/lib/typescript/api/event/barrel.d.ts +5 -0
- package/lib/typescript/api/media/MediaControlConfiguration.d.ts +26 -0
- package/lib/typescript/api/media/barrel.d.ts +1 -0
- package/lib/typescript/api/pip/PiPConfiguration.d.ts +13 -0
- package/lib/typescript/api/pip/barrel.d.ts +1 -0
- package/lib/typescript/api/player/PlayerEventMap.d.ts +158 -0
- package/lib/typescript/api/player/THEOplayer.d.ts +154 -0
- package/lib/typescript/api/player/barrel.d.ts +2 -0
- package/lib/typescript/api/presentation/PresentationMode.d.ts +13 -0
- package/lib/typescript/api/presentation/barrel.d.ts +1 -0
- package/lib/typescript/api/source/ads/Ads.d.ts +99 -0
- package/lib/typescript/api/source/ads/FreeWheelAdDescription.d.ts +85 -0
- package/lib/typescript/api/source/ads/IMAAdDescription.d.ts +25 -0
- package/lib/typescript/api/track/MediaTrack.d.ts +50 -0
- package/lib/typescript/api/track/TextTrack.d.ts +100 -0
- package/lib/typescript/api/track/TextTrackStyle.d.ts +71 -0
- package/lib/typescript/api/track/Track.d.ts +46 -0
- package/lib/typescript/api/track/barrel.d.ts +6 -0
- package/lib/typescript/index.d.ts +4 -0
- package/lib/typescript/internal/THEOplayerView.d.ts +44 -0
- package/lib/typescript/internal/THEOplayerView.web.d.ts +3 -0
- package/lib/typescript/internal/adapter/NativePlayerState.d.ts +27 -0
- package/lib/typescript/internal/adapter/THEOplayerAdapter.d.ts +73 -0
- package/lib/typescript/internal/adapter/THEOplayerWebAdapter.d.ts +70 -0
- package/lib/typescript/internal/adapter/WebEventForwarder.d.ts +52 -0
- package/lib/typescript/internal/adapter/abr/AbrAdapter.d.ts +12 -0
- package/lib/typescript/internal/adapter/ads/THEOplayerNativeAdsAdapter.d.ts +13 -0
- package/lib/typescript/internal/adapter/ads/THEOplayerNativeGoogleDAI.d.ts +9 -0
- package/lib/typescript/internal/adapter/ads/THEOplayerWebAdsAdapter.d.ts +14 -0
- package/lib/typescript/internal/adapter/cast/THEOplayerNativeAirplay.d.ts +15 -0
- package/lib/typescript/internal/adapter/cast/THEOplayerNativeCastAdapter.d.ts +14 -0
- package/lib/typescript/internal/adapter/cast/THEOplayerNativeChromecast.d.ts +18 -0
- package/lib/typescript/internal/adapter/cast/THEOplayerWebCastAdapter.d.ts +9 -0
- package/lib/typescript/internal/adapter/event/BaseEvent.d.ts +6 -0
- package/lib/typescript/internal/adapter/event/DefaultEventDispatcher.d.ts +9 -0
- package/lib/typescript/internal/adapter/event/PlayerEvents.d.ts +99 -0
- package/lib/typescript/internal/adapter/event/native/NativeAdEvent.d.ts +11 -0
- package/lib/typescript/internal/adapter/event/native/NativeCastEvent.d.ts +15 -0
- package/lib/typescript/internal/adapter/event/native/NativePlayerEvent.d.ts +93 -0
- package/lib/typescript/internal/adapter/event/native/NativeTrackEvent.d.ts +102 -0
- package/lib/typescript/internal/adapter/track/TextTrackStyleAdapter.d.ts +17 -0
- package/lib/typescript/internal/adapter/web/TrackUtils.d.ts +9 -0
- package/lib/typescript/internal/adapter/web/WebMediaSession.d.ts +33 -0
- package/lib/typescript/internal/adapter/web/WebPresentationModeManager.d.ts +15 -0
- package/lib/typescript/internal/utils/arrayUtil.d.ts +2 -0
- package/lib/typescript/ui/THEOplayerDefaultUi.d.ts +35 -0
- package/lib/typescript/ui/THEOplayerTheme.d.ts +84 -0
- package/lib/typescript/ui/barrel.d.ts +3 -0
- package/lib/typescript/ui/components/activityindicator/CenteredDelayedActivityIndicator.d.ts +25 -0
- package/lib/typescript/ui/components/activityindicator/DelayedActivityIndicator.d.ts +9 -0
- package/lib/typescript/ui/components/activityindicator/barrel.d.ts +2 -0
- package/lib/typescript/ui/components/barrel.d.ts +9 -0
- package/lib/typescript/ui/components/button/AirplayButton.d.ts +18 -0
- package/lib/typescript/ui/components/button/ChromecastButton.d.ts +19 -0
- package/lib/typescript/ui/components/button/ChromecastButton.web.d.ts +19 -0
- package/lib/typescript/ui/components/button/FullscreenButton.d.ts +17 -0
- package/lib/typescript/ui/components/button/MuteButton.d.ts +16 -0
- package/lib/typescript/ui/components/button/PipButton.d.ts +17 -0
- package/lib/typescript/ui/components/button/PlayButton.d.ts +28 -0
- package/lib/typescript/ui/components/button/SkipButton.d.ts +33 -0
- package/lib/typescript/ui/components/button/actionbutton/ActionButton.d.ts +41 -0
- package/lib/typescript/ui/components/button/barrel.d.ts +9 -0
- package/lib/typescript/ui/components/button/svg/AirplaySvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/ArrowForwardSvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/BackSvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/BackwardSvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/ChromecastSvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/ErrorSvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/ForwardSvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/FullscreenEnterSvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/FullscreenExitSvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/LanguageSvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/ListSvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/PauseSvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/PipEnterSvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/PipExitSvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/PlaySvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/ReplaySvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/SettingsSvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/SvgUtils.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/VolumeOffSvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/VolumeUpSvg.d.ts +3 -0
- package/lib/typescript/ui/components/button/svg/barrel.d.ts +20 -0
- package/lib/typescript/ui/components/controlbar/ControlBar.d.ts +39 -0
- package/lib/typescript/ui/components/controlbar/Spacer.d.ts +5 -0
- package/lib/typescript/ui/components/controlbar/barrel.d.ts +2 -0
- package/lib/typescript/ui/components/menu/LanguageMenuButton.d.ts +40 -0
- package/lib/typescript/ui/components/menu/PlaybackRateSubMenu.d.ts +36 -0
- package/lib/typescript/ui/components/menu/QualitySubMenu.d.ts +29 -0
- package/lib/typescript/ui/components/menu/SettingsMenuButton.d.ts +12 -0
- package/lib/typescript/ui/components/menu/barrel.d.ts +5 -0
- package/lib/typescript/ui/components/menu/common/MenuButton.d.ts +25 -0
- package/lib/typescript/ui/components/menu/common/MenuRadioButton.d.ts +33 -0
- package/lib/typescript/ui/components/menu/common/MenuTitle.d.ts +20 -0
- package/lib/typescript/ui/components/menu/common/MenuView.d.ts +21 -0
- package/lib/typescript/ui/components/menu/common/ScrollableMenu.d.ts +23 -0
- package/lib/typescript/ui/components/menu/common/SubMenuWithButton.d.ts +29 -0
- package/lib/typescript/ui/components/menu/common/barrel.d.ts +6 -0
- package/lib/typescript/ui/components/message/CastMessage.d.ts +16 -0
- package/lib/typescript/ui/components/message/ErrorDisplay.d.ts +12 -0
- package/lib/typescript/ui/components/message/barrel.d.ts +2 -0
- package/lib/typescript/ui/components/seekbar/SeekBar.d.ts +41 -0
- package/lib/typescript/ui/components/seekbar/barrel.d.ts +2 -0
- package/lib/typescript/ui/components/seekbar/thumbnail/SingleThumbnailView.d.ts +8 -0
- package/lib/typescript/ui/components/seekbar/thumbnail/Thumbnail.d.ts +56 -0
- package/lib/typescript/ui/components/seekbar/thumbnail/ThumbnailView.d.ts +60 -0
- package/lib/typescript/ui/components/seekbar/thumbnail/Urlpolyfill.d.ts +1 -0
- package/lib/typescript/ui/components/seekbar/thumbnail/Urlpolyfill.web.d.ts +1 -0
- package/lib/typescript/ui/components/seekbar/thumbnail/barrel.d.ts +2 -0
- package/lib/typescript/ui/components/timelabel/StaticTimeLabel.d.ts +24 -0
- package/lib/typescript/ui/components/timelabel/TimeLabel.d.ts +32 -0
- package/lib/typescript/ui/components/timelabel/barrel.d.ts +2 -0
- package/lib/typescript/ui/components/uicontroller/UiContainer.d.ts +115 -0
- package/lib/typescript/ui/components/uicontroller/UiControls.d.ts +14 -0
- package/lib/typescript/ui/components/uicontroller/barrel.d.ts +2 -0
- package/lib/typescript/ui/components/util/PlayerContext.d.ts +22 -0
- package/lib/typescript/ui/components/util/TrackUtils.d.ts +10 -0
- package/lib/typescript/ui/components/util/barrel.d.ts +1 -0
- package/lib/typescript/ui/utils/ArrayUtils.d.ts +2 -0
- package/lib/typescript/ui/utils/language/Language.d.ts +19 -0
- package/lib/typescript/web/platform/BrowserDetection.d.ts +23 -0
- package/package.json +15 -9
- package/react-native-theoplayer.json +8 -0
- package/react-native-theoplayer.podspec +32 -6
- package/src/api/THEOplayerView.ts +5 -248
- package/src/api/backgroundAudio/BackgroundAudioConfiguration.ts +23 -0
- package/src/api/backgroundAudio/barrel.ts +1 -0
- package/src/api/barrel.ts +4 -0
- package/src/api/cast/Airplay.ts +3 -3
- package/src/api/cast/CastAPI.ts +3 -4
- package/src/api/cast/CastState.ts +6 -1
- package/src/api/cast/Chromecast.ts +3 -3
- package/src/api/config/PlayerConfiguration.ts +38 -0
- package/src/api/event/AdEvent.ts +25 -31
- package/src/api/event/CastEvent.ts +14 -20
- package/src/api/event/Event.ts +16 -0
- package/src/api/event/EventDispatcher.ts +48 -0
- package/src/api/event/EventListener.ts +8 -0
- package/src/api/event/PlayerEvent.ts +69 -8
- package/src/api/event/TrackEvent.ts +28 -29
- package/src/api/event/barrel.ts +1 -0
- package/src/api/media/MediaControlConfiguration.ts +26 -0
- package/src/api/media/barrel.ts +1 -0
- package/src/api/pip/PiPConfiguration.ts +13 -0
- package/src/api/pip/barrel.ts +1 -0
- package/src/api/player/PlayerEventMap.ts +198 -0
- package/src/api/player/THEOplayer.ts +185 -0
- package/src/api/player/barrel.ts +2 -0
- package/src/api/presentation/PresentationMode.ts +14 -0
- package/src/api/presentation/barrel.ts +1 -0
- package/src/api/source/ads/Ads.ts +6 -1
- package/src/api/source/ads/FreeWheelAdDescription.ts +2 -2
- package/src/api/source/ads/IMAAdDescription.ts +2 -2
- package/src/api/track/MediaTrack.ts +2 -11
- package/src/api/track/TextTrack.ts +20 -15
- package/src/api/track/TextTrackStyle.ts +77 -0
- package/src/api/track/Track.ts +12 -0
- package/src/api/track/barrel.ts +1 -0
- package/src/index.tsx +1 -0
- package/src/internal/THEOplayerView.tsx +209 -236
- package/src/internal/THEOplayerView.web.tsx +82 -494
- package/src/internal/adapter/NativePlayerState.ts +28 -0
- package/src/internal/adapter/THEOplayerAdapter.ts +456 -0
- package/src/internal/adapter/THEOplayerWebAdapter.ts +275 -0
- package/src/internal/adapter/WebEventForwarder.ts +399 -0
- package/src/internal/adapter/abr/AbrAdapter.ts +37 -0
- package/src/internal/adapter/ads/THEOplayerNativeAdsAdapter.ts +39 -0
- package/src/internal/adapter/ads/THEOplayerNativeGoogleDAI.ts +22 -0
- package/src/internal/adapter/ads/THEOplayerWebAdsAdapter.ts +51 -0
- package/src/internal/adapter/cast/THEOplayerNativeAirplay.ts +47 -0
- package/src/internal/adapter/cast/THEOplayerNativeCastAdapter.ts +39 -0
- package/src/internal/adapter/cast/THEOplayerNativeChromecast.ts +57 -0
- package/src/internal/adapter/cast/THEOplayerWebCastAdapter.ts +22 -0
- package/src/internal/adapter/event/BaseEvent.ts +5 -0
- package/src/internal/adapter/event/DefaultEventDispatcher.ts +35 -0
- package/src/internal/adapter/event/PlayerEvents.ts +174 -0
- package/src/internal/adapter/event/native/NativeAdEvent.ts +13 -0
- package/src/internal/adapter/event/native/NativeCastEvent.ts +22 -0
- package/src/internal/adapter/event/native/NativePlayerEvent.ts +111 -0
- package/src/internal/adapter/event/native/NativeTrackEvent.ts +159 -0
- package/src/internal/adapter/track/TextTrackStyleAdapter.ts +55 -0
- package/src/internal/adapter/web/TrackUtils.ts +73 -0
- package/src/internal/adapter/web/WebMediaSession.ts +193 -0
- package/src/internal/adapter/web/WebPresentationModeManager.ts +96 -0
- package/src/internal/utils/arrayUtil.ts +12 -0
- package/src/ui/THEOplayerDefaultUi.tsx +108 -0
- package/src/ui/THEOplayerTheme.ts +112 -0
- package/src/ui/barrel.ts +3 -0
- package/src/ui/components/activityindicator/CenteredDelayedActivityIndicator.tsx +96 -0
- package/src/ui/components/activityindicator/DelayedActivityIndicator.tsx +32 -0
- package/src/ui/components/activityindicator/barrel.ts +2 -0
- package/src/ui/components/barrel.ts +9 -0
- package/src/ui/components/button/AirplayButton.tsx +64 -0
- package/src/ui/components/button/ChromecastButton.tsx +60 -0
- package/src/ui/components/button/ChromecastButton.web.tsx +66 -0
- package/src/ui/components/button/FullscreenButton.tsx +60 -0
- package/src/ui/components/button/MuteButton.tsx +52 -0
- package/src/ui/components/button/PipButton.tsx +61 -0
- package/src/ui/components/button/PlayButton.tsx +107 -0
- package/src/ui/components/button/SkipButton.tsx +112 -0
- package/src/ui/components/button/actionbutton/ActionButton.tsx +105 -0
- package/src/ui/components/button/barrel.ts +9 -0
- package/src/ui/components/button/svg/AirplaySvg.tsx +18 -0
- package/src/ui/components/button/svg/ArrowForwardSvg.tsx +18 -0
- package/src/ui/components/button/svg/BackSvg.tsx +18 -0
- package/src/ui/components/button/svg/BackwardSvg.tsx +18 -0
- package/src/ui/components/button/svg/ChromecastSvg.tsx +18 -0
- package/src/ui/components/button/svg/ErrorSvg.tsx +18 -0
- package/src/ui/components/button/svg/ForwardSvg.tsx +18 -0
- package/src/ui/components/button/svg/FullscreenEnterSvg.tsx +18 -0
- package/src/ui/components/button/svg/FullscreenExitSvg.tsx +18 -0
- package/src/ui/components/button/svg/LanguageSvg.tsx +18 -0
- package/src/ui/components/button/svg/ListSvg.tsx +18 -0
- package/src/ui/components/button/svg/PauseSvg.tsx +18 -0
- package/src/ui/components/button/svg/PipEnterSvg.tsx +18 -0
- package/src/ui/components/button/svg/PipExitSvg.tsx +18 -0
- package/src/ui/components/button/svg/PlaySvg.tsx +18 -0
- package/src/ui/components/button/svg/ReplaySvg.tsx +18 -0
- package/src/ui/components/button/svg/SettingsSvg.tsx +18 -0
- package/src/ui/components/button/svg/SvgUtils.ts +4 -0
- package/src/ui/components/button/svg/VolumeOffSvg.tsx +18 -0
- package/src/ui/components/button/svg/VolumeUpSvg.tsx +18 -0
- package/src/ui/components/button/svg/barrel.ts +20 -0
- package/src/ui/components/button/svg/res/AirPlayButton.html +6 -0
- package/src/ui/components/button/svg/res/Airplay.svg +1 -0
- package/src/ui/components/button/svg/res/ChromecastButton.html +25 -0
- package/src/ui/components/button/svg/res/arrow_forward.svg +1 -0
- package/src/ui/components/button/svg/res/back.svg +1 -0
- package/src/ui/components/button/svg/res/backward.svg +1 -0
- package/src/ui/components/button/svg/res/chromecast-48px.svg +1 -0
- package/src/ui/components/button/svg/res/close.svg +1 -0
- package/src/ui/components/button/svg/res/error.svg +1 -0
- package/src/ui/components/button/svg/res/forward.svg +1 -0
- package/src/ui/components/button/svg/res/fullscreen-enter.svg +1 -0
- package/src/ui/components/button/svg/res/fullscreen-exit.svg +1 -0
- package/src/ui/components/button/svg/res/language.svg +1 -0
- package/src/ui/components/button/svg/res/list.svg +1 -0
- package/src/ui/components/button/svg/res/live.svg +1 -0
- package/src/ui/components/button/svg/res/pause.svg +1 -0
- package/src/ui/components/button/svg/res/pip_enter.svg +1 -0
- package/src/ui/components/button/svg/res/pip_exit.svg +1 -0
- package/src/ui/components/button/svg/res/play.svg +1 -0
- package/src/ui/components/button/svg/res/replay.svg +1 -0
- package/src/ui/components/button/svg/res/settings.svg +1 -0
- package/src/ui/components/button/svg/res/skip-next.svg +1 -0
- package/src/ui/components/button/svg/res/volume-high.svg +1 -0
- package/src/ui/components/button/svg/res/volume-low.svg +1 -0
- package/src/ui/components/button/svg/res/volume-off.svg +1 -0
- package/src/ui/components/controlbar/ControlBar.tsx +69 -0
- package/src/ui/components/controlbar/Spacer.tsx +9 -0
- package/src/ui/components/controlbar/barrel.ts +2 -0
- package/src/ui/components/menu/LanguageMenuButton.tsx +192 -0
- package/src/ui/components/menu/PlaybackRateSubMenu.tsx +93 -0
- package/src/ui/components/menu/QualitySubMenu.tsx +148 -0
- package/src/ui/components/menu/SettingsMenuButton.tsx +25 -0
- package/src/ui/components/menu/barrel.ts +5 -0
- package/src/ui/components/menu/common/MenuButton.tsx +49 -0
- package/src/ui/components/menu/common/MenuRadioButton.tsx +65 -0
- package/src/ui/components/menu/common/MenuTitle.tsx +37 -0
- package/src/ui/components/menu/common/MenuView.tsx +62 -0
- package/src/ui/components/menu/common/ScrollableMenu.tsx +43 -0
- package/src/ui/components/menu/common/SubMenuWithButton.tsx +58 -0
- package/src/ui/components/menu/common/barrel.ts +6 -0
- package/src/ui/components/message/CastMessage.tsx +74 -0
- package/src/ui/components/message/ErrorDisplay.tsx +43 -0
- package/src/ui/components/message/barrel.ts +2 -0
- package/src/ui/components/seekbar/SeekBar.tsx +178 -0
- package/src/ui/components/seekbar/barrel.ts +2 -0
- package/src/ui/components/seekbar/thumbnail/SingleThumbnailView.tsx +38 -0
- package/src/ui/components/seekbar/thumbnail/Thumbnail.ts +72 -0
- package/src/ui/components/seekbar/thumbnail/ThumbnailView.tsx +266 -0
- package/src/ui/components/seekbar/thumbnail/Urlpolyfill.ts +1 -0
- package/src/ui/components/seekbar/thumbnail/Urlpolyfill.web.ts +2 -0
- package/src/ui/components/seekbar/thumbnail/barrel.ts +2 -0
- package/src/ui/components/timelabel/StaticTimeLabel.tsx +63 -0
- package/src/ui/components/timelabel/TimeLabel.tsx +79 -0
- package/src/ui/components/timelabel/barrel.ts +2 -0
- package/src/ui/components/uicontroller/UiContainer.tsx +355 -0
- package/src/ui/components/uicontroller/UiControls.ts +31 -0
- package/src/ui/components/uicontroller/barrel.ts +2 -0
- package/src/ui/components/util/PlayerContext.ts +29 -0
- package/src/ui/components/util/TrackUtils.ts +62 -0
- package/src/ui/components/util/barrel.ts +1 -0
- package/src/ui/utils/ArrayUtils.ts +12 -0
- package/src/ui/utils/language/Language.ts +38 -0
- package/src/ui/utils/language/languages.json +1658 -0
- package/src/web/platform/BrowserDetection.ts +38 -0
- package/src/web/platform/browser.d.ts +43 -0
- 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 +0 -9
- package/ios/custom/Frameworks/ios/put_custom_ios_xcframework_here.txt +0 -2
- package/ios/custom/Frameworks/tvos/put_custom_tvos_xcframework_here.txt +0 -2
- package/ios/custom/react-native-theoplayer_custom.podspec +0 -46
- package/ios/custom/theofeatures.sh +0 -14
- package/lib/commonjs/internal/ads/THEOplayerNativeAdsAPI.js +0 -54
- package/lib/commonjs/internal/ads/THEOplayerNativeAdsAPI.js.map +0 -1
- package/lib/commonjs/internal/ads/THEOplayerNativeGoogleDAI.js +0 -34
- package/lib/commonjs/internal/ads/THEOplayerNativeGoogleDAI.js.map +0 -1
- package/lib/commonjs/internal/ads/THEOplayerWebAdsAPI.js +0 -78
- package/lib/commonjs/internal/ads/THEOplayerWebAdsAPI.js.map +0 -1
- package/lib/commonjs/internal/ads/THEOplayerWebGoogleDAI.js +0 -32
- package/lib/commonjs/internal/ads/THEOplayerWebGoogleDAI.js.map +0 -1
- package/lib/commonjs/internal/cast/THEOplayerNativeAirplay.js +0 -34
- package/lib/commonjs/internal/cast/THEOplayerNativeAirplay.js.map +0 -1
- package/lib/commonjs/internal/cast/THEOplayerNativeCastApi.js +0 -46
- package/lib/commonjs/internal/cast/THEOplayerNativeCastApi.js.map +0 -1
- package/lib/commonjs/internal/cast/THEOplayerNativeChromecast.js +0 -42
- package/lib/commonjs/internal/cast/THEOplayerNativeChromecast.js.map +0 -1
- package/lib/commonjs/internal/cast/THEOplayerWebCastApi.js +0 -31
- package/lib/commonjs/internal/cast/THEOplayerWebCastApi.js.map +0 -1
- package/lib/commonjs/internal/web/TrackUtils.js +0 -87
- package/lib/commonjs/internal/web/TrackUtils.js.map +0 -1
- package/lib/commonjs/internal/web/stub/CastButtonStub.js +0 -16
- package/lib/commonjs/internal/web/stub/CastButtonStub.js.map +0 -1
- package/lib/module/internal/ads/THEOplayerNativeAdsAPI.js +0 -43
- package/lib/module/internal/ads/THEOplayerNativeAdsAPI.js.map +0 -1
- package/lib/module/internal/ads/THEOplayerNativeGoogleDAI.js +0 -24
- package/lib/module/internal/ads/THEOplayerNativeGoogleDAI.js.map +0 -1
- package/lib/module/internal/ads/THEOplayerWebAdsAPI.js +0 -68
- package/lib/module/internal/ads/THEOplayerWebAdsAPI.js.map +0 -1
- package/lib/module/internal/ads/THEOplayerWebGoogleDAI.js +0 -23
- package/lib/module/internal/ads/THEOplayerWebGoogleDAI.js.map +0 -1
- package/lib/module/internal/cast/THEOplayerNativeAirplay.js +0 -24
- package/lib/module/internal/cast/THEOplayerNativeAirplay.js.map +0 -1
- package/lib/module/internal/cast/THEOplayerNativeCastApi.js +0 -34
- package/lib/module/internal/cast/THEOplayerNativeCastApi.js.map +0 -1
- package/lib/module/internal/cast/THEOplayerNativeChromecast.js +0 -32
- package/lib/module/internal/cast/THEOplayerNativeChromecast.js.map +0 -1
- package/lib/module/internal/cast/THEOplayerWebCastApi.js +0 -22
- package/lib/module/internal/cast/THEOplayerWebCastApi.js.map +0 -1
- package/lib/module/internal/web/TrackUtils.js +0 -72
- package/lib/module/internal/web/TrackUtils.js.map +0 -1
- package/lib/module/internal/web/stub/CastButtonStub.js +0 -6
- package/lib/module/internal/web/stub/CastButtonStub.js.map +0 -1
- package/lib/typescript/babel.config.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/THEOplayerView.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/abr/ABRConfiguration.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/abr/barrel.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/ads/Ad.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/ads/AdBreak.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/ads/AdsAPI.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/ads/AdsConfiguration.d.ts +0 -1
- 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 +0 -1
- package/lib/typescript/lib/commonjs/api/ads/GoogleImaConfiguration.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/ads/barrel.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/barrel.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/cast/Airplay.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/cast/CastAPI.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/cast/CastConfiguration.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/cast/CastState.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/cast/Chromecast.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/cast/barrel.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/config/PlayerConfiguration.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/config/barrel.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/drm/ContentProtectionAPI.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/drm/ContentProtectionIntegration.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/drm/ContentProtectionIntegrationFactory.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/drm/ContentProtectionRequest.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/drm/ContentProtectionResponse.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/drm/barrel.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/error/ChromecastError.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/error/PlayerError.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/error/barrel.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/event/AdEvent.d.ts +0 -2
- package/lib/typescript/lib/commonjs/api/event/CastEvent.d.ts +0 -2
- package/lib/typescript/lib/commonjs/api/event/PlayerEvent.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/event/TrackEvent.d.ts +0 -9
- package/lib/typescript/lib/commonjs/api/event/barrel.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/source/SourceDescription.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/source/ads/Ads.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/source/ads/FreeWheelAdDescription.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/source/ads/IMAAdDescription.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/source/ads/SpotXAdDescription.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/source/ads/THEOplayerAdDescription.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/source/ads/barrel.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/source/ads/ssai/GoogleDAIConfiguration.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/source/ads/ssai/ServerSideAdInsertionConfiguration.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/source/ads/ssai/barrel.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/source/barrel.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/source/dash/DashPlaybackConfiguration.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/source/dash/barrel.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/source/drm/DRMConfiguration.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/source/drm/barrel.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/source/hls/HlsPlaybackConfiguration.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/source/hls/barrel.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/source/metadata/MetadataDescription.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/source/metadata/barrel.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/timeranges/TimeRange.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/timeranges/barrel.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/track/MediaTrack.d.ts +0 -9
- package/lib/typescript/lib/commonjs/api/track/Quality.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/track/TextTrack.d.ts +0 -21
- package/lib/typescript/lib/commonjs/api/track/TextTrackCue.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/track/Track.d.ts +0 -0
- package/lib/typescript/lib/commonjs/api/track/barrel.d.ts +0 -1
- package/lib/typescript/lib/commonjs/api/utils/TypeUtils.d.ts +0 -13
- package/lib/typescript/lib/commonjs/api/utils/barrel.d.ts +0 -1
- package/lib/typescript/lib/commonjs/index.d.ts +0 -5
- package/lib/typescript/lib/commonjs/internal/THEOplayerView.d.ts +0 -24
- package/lib/typescript/lib/commonjs/internal/THEOplayerView.style.d.ts +0 -12
- package/lib/typescript/lib/commonjs/internal/THEOplayerView.web.d.ts +0 -24
- package/lib/typescript/lib/commonjs/internal/ads/THEOplayerNativeAdsAPI.d.ts +0 -14
- package/lib/typescript/lib/commonjs/internal/ads/THEOplayerNativeGoogleDAI.d.ts +0 -9
- package/lib/typescript/lib/commonjs/internal/ads/THEOplayerWebAdsAPI.d.ts +0 -14
- package/lib/typescript/lib/commonjs/internal/ads/THEOplayerWebGoogleDAI.d.ts +0 -9
- package/lib/typescript/lib/commonjs/internal/cast/THEOplayerNativeAirplay.d.ts +0 -9
- package/lib/typescript/lib/commonjs/internal/cast/THEOplayerNativeCastApi.d.ts +0 -12
- package/lib/typescript/lib/commonjs/internal/cast/THEOplayerNativeChromecast.d.ts +0 -11
- package/lib/typescript/lib/commonjs/internal/cast/THEOplayerWebCastApi.d.ts +0 -8
- package/lib/typescript/lib/commonjs/internal/drm/ContentProtectionRegistry.d.ts +0 -14
- package/lib/typescript/lib/commonjs/internal/drm/ContentProtectionRegistry.web.d.ts +0 -5
- package/lib/typescript/lib/commonjs/internal/drm/NativeCertificateRequest.d.ts +0 -18
- package/lib/typescript/lib/commonjs/internal/drm/NativeCertificateResponse.d.ts +0 -21
- package/lib/typescript/lib/commonjs/internal/drm/NativeContentProtectionEvent.d.ts +0 -0
- package/lib/typescript/lib/commonjs/internal/drm/NativeLicenseRequest.d.ts +0 -20
- package/lib/typescript/lib/commonjs/internal/drm/NativeLicenseResponse.d.ts +0 -22
- package/lib/typescript/lib/commonjs/internal/utils/TypeUtils.d.ts +0 -6
- package/lib/typescript/lib/commonjs/internal/web/TrackUtils.d.ts +0 -32
- package/lib/typescript/lib/commonjs/internal/web/stub/CastButtonStub.d.ts +0 -2
- package/lib/typescript/lib/module/api/THEOplayerView.d.ts +0 -1
- package/lib/typescript/lib/module/api/abr/ABRConfiguration.d.ts +0 -0
- package/lib/typescript/lib/module/api/abr/barrel.d.ts +0 -1
- package/lib/typescript/lib/module/api/ads/Ad.d.ts +0 -1
- package/lib/typescript/lib/module/api/ads/AdBreak.d.ts +0 -1
- package/lib/typescript/lib/module/api/ads/AdsAPI.d.ts +0 -1
- package/lib/typescript/lib/module/api/ads/AdsConfiguration.d.ts +0 -1
- 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 +0 -1
- package/lib/typescript/lib/module/api/ads/GoogleImaConfiguration.d.ts +0 -0
- package/lib/typescript/lib/module/api/ads/barrel.d.ts +0 -5
- package/lib/typescript/lib/module/api/barrel.d.ts +0 -12
- package/lib/typescript/lib/module/api/cast/Airplay.d.ts +0 -1
- package/lib/typescript/lib/module/api/cast/CastAPI.d.ts +0 -1
- package/lib/typescript/lib/module/api/cast/CastConfiguration.d.ts +0 -0
- package/lib/typescript/lib/module/api/cast/CastState.d.ts +0 -0
- package/lib/typescript/lib/module/api/cast/Chromecast.d.ts +0 -1
- package/lib/typescript/lib/module/api/cast/barrel.d.ts +0 -3
- package/lib/typescript/lib/module/api/config/PlayerConfiguration.d.ts +0 -1
- package/lib/typescript/lib/module/api/config/barrel.d.ts +0 -1
- package/lib/typescript/lib/module/api/drm/ContentProtectionAPI.d.ts +0 -1
- package/lib/typescript/lib/module/api/drm/ContentProtectionIntegration.d.ts +0 -1
- package/lib/typescript/lib/module/api/drm/ContentProtectionIntegrationFactory.d.ts +0 -1
- package/lib/typescript/lib/module/api/drm/ContentProtectionRequest.d.ts +0 -0
- package/lib/typescript/lib/module/api/drm/ContentProtectionResponse.d.ts +0 -1
- package/lib/typescript/lib/module/api/drm/barrel.d.ts +0 -4
- package/lib/typescript/lib/module/api/error/ChromecastError.d.ts +0 -0
- package/lib/typescript/lib/module/api/error/PlayerError.d.ts +0 -0
- package/lib/typescript/lib/module/api/error/barrel.d.ts +0 -1
- package/lib/typescript/lib/module/api/event/AdEvent.d.ts +0 -1
- package/lib/typescript/lib/module/api/event/CastEvent.d.ts +0 -1
- package/lib/typescript/lib/module/api/event/PlayerEvent.d.ts +0 -1
- package/lib/typescript/lib/module/api/event/TrackEvent.d.ts +0 -4
- package/lib/typescript/lib/module/api/event/barrel.d.ts +0 -4
- package/lib/typescript/lib/module/api/source/SourceDescription.d.ts +0 -1
- package/lib/typescript/lib/module/api/source/ads/Ads.d.ts +0 -0
- package/lib/typescript/lib/module/api/source/ads/FreeWheelAdDescription.d.ts +0 -1
- package/lib/typescript/lib/module/api/source/ads/IMAAdDescription.d.ts +0 -1
- package/lib/typescript/lib/module/api/source/ads/SpotXAdDescription.d.ts +0 -1
- package/lib/typescript/lib/module/api/source/ads/THEOplayerAdDescription.d.ts +0 -1
- package/lib/typescript/lib/module/api/source/ads/barrel.d.ts +0 -5
- package/lib/typescript/lib/module/api/source/ads/ssai/GoogleDAIConfiguration.d.ts +0 -1
- package/lib/typescript/lib/module/api/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.d.ts +0 -1
- package/lib/typescript/lib/module/api/source/ads/ssai/ServerSideAdInsertionConfiguration.d.ts +0 -1
- package/lib/typescript/lib/module/api/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.d.ts +0 -1
- package/lib/typescript/lib/module/api/source/ads/ssai/barrel.d.ts +0 -4
- package/lib/typescript/lib/module/api/source/barrel.d.ts +0 -6
- package/lib/typescript/lib/module/api/source/dash/DashPlaybackConfiguration.d.ts +0 -0
- package/lib/typescript/lib/module/api/source/dash/barrel.d.ts +0 -1
- package/lib/typescript/lib/module/api/source/drm/DRMConfiguration.d.ts +0 -0
- package/lib/typescript/lib/module/api/source/drm/barrel.d.ts +0 -1
- package/lib/typescript/lib/module/api/source/hls/HlsPlaybackConfiguration.d.ts +0 -0
- package/lib/typescript/lib/module/api/source/hls/barrel.d.ts +0 -1
- package/lib/typescript/lib/module/api/source/metadata/MetadataDescription.d.ts +0 -0
- package/lib/typescript/lib/module/api/source/metadata/barrel.d.ts +0 -1
- package/lib/typescript/lib/module/api/timeranges/TimeRange.d.ts +0 -0
- package/lib/typescript/lib/module/api/timeranges/barrel.d.ts +0 -1
- package/lib/typescript/lib/module/api/track/MediaTrack.d.ts +0 -8
- package/lib/typescript/lib/module/api/track/Quality.d.ts +0 -0
- package/lib/typescript/lib/module/api/track/TextTrack.d.ts +0 -20
- package/lib/typescript/lib/module/api/track/TextTrackCue.d.ts +0 -0
- package/lib/typescript/lib/module/api/track/Track.d.ts +0 -0
- package/lib/typescript/lib/module/api/track/barrel.d.ts +0 -2
- package/lib/typescript/lib/module/api/utils/TypeUtils.d.ts +0 -12
- package/lib/typescript/lib/module/api/utils/barrel.d.ts +0 -1
- package/lib/typescript/lib/module/index.d.ts +0 -3
- package/lib/typescript/lib/module/internal/THEOplayerView.d.ts +0 -25
- package/lib/typescript/lib/module/internal/THEOplayerView.style.d.ts +0 -11
- package/lib/typescript/lib/module/internal/THEOplayerView.web.d.ts +0 -24
- package/lib/typescript/lib/module/internal/ads/THEOplayerNativeAdsAPI.d.ts +0 -13
- package/lib/typescript/lib/module/internal/ads/THEOplayerNativeGoogleDAI.d.ts +0 -8
- package/lib/typescript/lib/module/internal/ads/THEOplayerWebAdsAPI.d.ts +0 -13
- package/lib/typescript/lib/module/internal/ads/THEOplayerWebGoogleDAI.d.ts +0 -8
- package/lib/typescript/lib/module/internal/cast/THEOplayerNativeAirplay.d.ts +0 -8
- package/lib/typescript/lib/module/internal/cast/THEOplayerNativeCastApi.d.ts +0 -11
- package/lib/typescript/lib/module/internal/cast/THEOplayerNativeChromecast.d.ts +0 -10
- package/lib/typescript/lib/module/internal/cast/THEOplayerWebCastApi.d.ts +0 -7
- package/lib/typescript/lib/module/internal/drm/ContentProtectionRegistry.d.ts +0 -13
- package/lib/typescript/lib/module/internal/drm/ContentProtectionRegistry.web.d.ts +0 -4
- package/lib/typescript/lib/module/internal/drm/NativeCertificateRequest.d.ts +0 -17
- package/lib/typescript/lib/module/internal/drm/NativeCertificateResponse.d.ts +0 -20
- package/lib/typescript/lib/module/internal/drm/NativeContentProtectionEvent.d.ts +0 -0
- package/lib/typescript/lib/module/internal/drm/NativeLicenseRequest.d.ts +0 -19
- package/lib/typescript/lib/module/internal/drm/NativeLicenseResponse.d.ts +0 -21
- package/lib/typescript/lib/module/internal/utils/TypeUtils.d.ts +0 -5
- package/lib/typescript/lib/module/internal/web/TrackUtils.d.ts +0 -31
- package/lib/typescript/lib/module/internal/web/stub/CastButtonStub.d.ts +0 -2
- package/lib/typescript/src/api/THEOplayerView.d.ts +0 -217
- package/lib/typescript/src/api/barrel.d.ts +0 -12
- package/lib/typescript/src/api/cast/Airplay.d.ts +0 -27
- package/lib/typescript/src/api/cast/CastAPI.d.ts +0 -25
- package/lib/typescript/src/api/cast/CastState.d.ts +0 -10
- package/lib/typescript/src/api/cast/Chromecast.d.ts +0 -39
- package/lib/typescript/src/api/config/PlayerConfiguration.d.ts +0 -24
- package/lib/typescript/src/api/event/AdEvent.d.ts +0 -13
- package/lib/typescript/src/api/event/CastEvent.d.ts +0 -21
- package/lib/typescript/src/api/event/PlayerEvent.d.ts +0 -56
- package/lib/typescript/src/api/event/TrackEvent.d.ts +0 -92
- package/lib/typescript/src/api/event/barrel.d.ts +0 -4
- package/lib/typescript/src/api/source/ads/Ads.d.ts +0 -94
- package/lib/typescript/src/api/source/ads/FreeWheelAdDescription.d.ts +0 -85
- package/lib/typescript/src/api/source/ads/IMAAdDescription.d.ts +0 -25
- package/lib/typescript/src/api/track/MediaTrack.d.ts +0 -58
- package/lib/typescript/src/api/track/TextTrack.d.ts +0 -86
- package/lib/typescript/src/api/track/Track.d.ts +0 -43
- package/lib/typescript/src/api/track/barrel.d.ts +0 -5
- package/lib/typescript/src/index.d.ts +0 -3
- package/lib/typescript/src/internal/THEOplayerView.d.ts +0 -87
- package/lib/typescript/src/internal/THEOplayerView.web.d.ts +0 -32
- package/lib/typescript/src/internal/ads/THEOplayerNativeAdsAPI.d.ts +0 -17
- package/lib/typescript/src/internal/ads/THEOplayerNativeGoogleDAI.d.ts +0 -10
- package/lib/typescript/src/internal/ads/THEOplayerWebAdsAPI.d.ts +0 -15
- package/lib/typescript/src/internal/cast/THEOplayerNativeAirplay.d.ts +0 -9
- package/lib/typescript/src/internal/cast/THEOplayerNativeCastApi.d.ts +0 -10
- package/lib/typescript/src/internal/cast/THEOplayerNativeChromecast.d.ts +0 -11
- package/lib/typescript/src/internal/cast/THEOplayerWebCastApi.d.ts +0 -9
- package/lib/typescript/src/internal/web/TrackUtils.d.ts +0 -7
- package/lib/typescript/src/internal/web/stub/CastButtonStub.d.ts +0 -3
- package/src/internal/ads/THEOplayerNativeAdsAPI.ts +0 -44
- package/src/internal/ads/THEOplayerNativeGoogleDAI.ts +0 -23
- package/src/internal/ads/THEOplayerWebAdsAPI.ts +0 -51
- package/src/internal/cast/THEOplayerNativeAirplay.ts +0 -22
- package/src/internal/cast/THEOplayerNativeCastApi.ts +0 -28
- package/src/internal/cast/THEOplayerNativeChromecast.ts +0 -30
- package/src/internal/cast/THEOplayerWebCastApi.ts +0 -21
- package/src/internal/web/TrackUtils.ts +0 -65
- package/src/internal/web/stub/CastButtonStub.tsx +0 -7
- /package/lib/typescript/{src/__tests__ → __tests__}/index.test.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/abr/ABRConfiguration.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/abr/barrel.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/ads/Ad.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/ads/AdBreak.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/ads/AdsAPI.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/ads/AdsConfiguration.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/ads/CompanionAd.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/ads/GoogleDai.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/ads/GoogleImaAd.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/ads/GoogleImaConfiguration.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/ads/barrel.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/cast/CastConfiguration.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/cast/barrel.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/config/barrel.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/drm/ContentProtectionAPI.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/drm/ContentProtectionIntegration.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/drm/ContentProtectionIntegrationFactory.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/drm/ContentProtectionRequest.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/drm/ContentProtectionResponse.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/drm/barrel.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/error/ChromecastError.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/error/PlayerError.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/error/barrel.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/source/SourceDescription.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/source/ads/SpotXAdDescription.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/source/ads/THEOplayerAdDescription.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/source/ads/barrel.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/source/ads/ssai/GoogleDAIConfiguration.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/source/ads/ssai/ImagineServerSideAdInsertionConfiguration.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/source/ads/ssai/ServerSideAdInsertionConfiguration.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/source/ads/ssai/YospaceServerSideAdInsertionConfiguration.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/source/ads/ssai/barrel.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/source/barrel.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/source/dash/DashPlaybackConfiguration.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/source/dash/barrel.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/source/drm/DRMConfiguration.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/source/drm/barrel.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/source/hls/HlsPlaybackConfiguration.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/source/hls/barrel.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/source/metadata/MetadataDescription.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/source/metadata/barrel.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/timeranges/TimeRange.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/timeranges/barrel.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/track/Quality.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/track/TextTrackCue.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/utils/TypeUtils.d.ts +0 -0
- /package/lib/typescript/{src/api → api}/utils/barrel.d.ts +0 -0
- /package/lib/typescript/{src/internal → internal}/THEOplayerView.style.d.ts +0 -0
- /package/lib/typescript/{src/internal → internal/adapter}/ads/THEOplayerWebGoogleDAI.d.ts +0 -0
- /package/lib/typescript/{src/internal → internal}/drm/ContentProtectionRegistry.d.ts +0 -0
- /package/lib/typescript/{src/internal → internal}/drm/ContentProtectionRegistry.web.d.ts +0 -0
- /package/lib/typescript/{src/internal → internal}/drm/NativeCertificateRequest.d.ts +0 -0
- /package/lib/typescript/{src/internal → internal}/drm/NativeCertificateResponse.d.ts +0 -0
- /package/lib/typescript/{src/internal → internal}/drm/NativeContentProtectionEvent.d.ts +0 -0
- /package/lib/typescript/{src/internal → internal}/drm/NativeLicenseRequest.d.ts +0 -0
- /package/lib/typescript/{src/internal → internal}/drm/NativeLicenseResponse.d.ts +0 -0
- /package/lib/typescript/{src/internal → internal}/utils/TypeUtils.d.ts +0 -0
- /package/src/internal/{ads → adapter/ads}/THEOplayerWebGoogleDAI.ts +0 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultWebMediaSessionConfig = exports.WebMediaSession = void 0;
|
|
7
|
+
var _reactNativeTheoplayer = require("react-native-theoplayer");
|
|
8
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
+
const defaultWebMediaSessionConfig = {
|
|
12
|
+
skipTime: 15
|
|
13
|
+
};
|
|
14
|
+
exports.defaultWebMediaSessionConfig = defaultWebMediaSessionConfig;
|
|
15
|
+
const NoOp = () => {};
|
|
16
|
+
|
|
17
|
+
// This prevents unnecessary errors when Media Session API is not available.
|
|
18
|
+
const mediaSession = function () {
|
|
19
|
+
var _navigator$mediaSessi, _navigator$mediaSessi2;
|
|
20
|
+
const mediaSession = navigator.mediaSession || {};
|
|
21
|
+
mediaSession.setActionHandler = ((_navigator$mediaSessi = navigator.mediaSession) === null || _navigator$mediaSessi === void 0 ? void 0 : _navigator$mediaSessi.setActionHandler) || function () {};
|
|
22
|
+
mediaSession.setPositionState = ((_navigator$mediaSessi2 = navigator.mediaSession) === null || _navigator$mediaSessi2 === void 0 ? void 0 : _navigator$mediaSessi2.setPositionState) || function () {};
|
|
23
|
+
window.MediaMetadata = window.MediaMetadata || function () {};
|
|
24
|
+
return mediaSession;
|
|
25
|
+
}();
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The MediaSession interface of the Media Session API allows a web page to provide custom behaviors for standard media playback interactions, and
|
|
29
|
+
* to report metadata that can be sent by the user agent to the device or operating system for presentation in standardized user interface elements.
|
|
30
|
+
*
|
|
31
|
+
* @link https://w3c.github.io/mediasession
|
|
32
|
+
*/
|
|
33
|
+
class WebMediaSession {
|
|
34
|
+
constructor(adapter, player) {
|
|
35
|
+
var _this$_player$ads, _this$_player$ads2;
|
|
36
|
+
let config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultWebMediaSessionConfig;
|
|
37
|
+
_defineProperty(this, "_config", void 0);
|
|
38
|
+
_defineProperty(this, "_player", void 0);
|
|
39
|
+
_defineProperty(this, "_webAdapter", void 0);
|
|
40
|
+
_defineProperty(this, "onSourceChange", () => {
|
|
41
|
+
this.updateMetadata();
|
|
42
|
+
this.updatePositionState();
|
|
43
|
+
this.updateActionHandlers();
|
|
44
|
+
});
|
|
45
|
+
_defineProperty(this, "onLoadedMetadata", () => {
|
|
46
|
+
this.updateActionHandlers();
|
|
47
|
+
});
|
|
48
|
+
_defineProperty(this, "onDurationChange", () => {
|
|
49
|
+
this.updateActionHandlers();
|
|
50
|
+
});
|
|
51
|
+
_defineProperty(this, "updateMetadata", () => {
|
|
52
|
+
const source = this._player.source;
|
|
53
|
+
const metadata = source === null || source === void 0 ? void 0 : source.metadata;
|
|
54
|
+
const artwork = [source === null || source === void 0 ? void 0 : source.poster, metadata === null || metadata === void 0 ? void 0 : metadata.displayIconUri, ...(metadata !== null && metadata !== void 0 && metadata.images ? metadata === null || metadata === void 0 ? void 0 : metadata.images : [])].filter(image => image !== undefined).map(image => {
|
|
55
|
+
if (typeof image === 'string') {
|
|
56
|
+
return {
|
|
57
|
+
src: image
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return image;
|
|
61
|
+
});
|
|
62
|
+
mediaSession.metadata = new MediaMetadata({
|
|
63
|
+
title: metadata === null || metadata === void 0 ? void 0 : metadata.title,
|
|
64
|
+
artist: (metadata === null || metadata === void 0 ? void 0 : metadata.artist) || (metadata === null || metadata === void 0 ? void 0 : metadata.subtitle),
|
|
65
|
+
album: metadata === null || metadata === void 0 ? void 0 : metadata.album,
|
|
66
|
+
artwork
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
_defineProperty(this, "updatePositionState", () => {
|
|
70
|
+
const {
|
|
71
|
+
duration,
|
|
72
|
+
playbackRate,
|
|
73
|
+
currentTime
|
|
74
|
+
} = this._player;
|
|
75
|
+
const isLive = !isFinite(duration);
|
|
76
|
+
if (!isLive) {
|
|
77
|
+
mediaSession.setPositionState({
|
|
78
|
+
// The duration is used to specify the duration in seconds.
|
|
79
|
+
// It should always be positive and positive infinity can be used to indicate media without a defined end such as live playback.
|
|
80
|
+
// NOTE: passing Infinite causes an exception to be thrown.
|
|
81
|
+
duration: isNaN(duration) || duration < 0 ? 0 : duration,
|
|
82
|
+
// The playbackRate is used to specify the playback rate.
|
|
83
|
+
// It can be positive to represent forward playback or negative to represent backwards playback. It should not be zero.
|
|
84
|
+
playbackRate,
|
|
85
|
+
// The position is used to specify the last reported playback position in seconds. It should always be positive.
|
|
86
|
+
position: currentTime
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
_defineProperty(this, "onAdbreakBegin", () => {
|
|
91
|
+
this.updateActionHandlers();
|
|
92
|
+
});
|
|
93
|
+
_defineProperty(this, "onAdbreakEnd", () => {
|
|
94
|
+
this.updateActionHandlers();
|
|
95
|
+
});
|
|
96
|
+
this._player = player;
|
|
97
|
+
this._webAdapter = adapter;
|
|
98
|
+
this._config = config;
|
|
99
|
+
this._player.addEventListener('sourcechange', this.onSourceChange);
|
|
100
|
+
this._player.addEventListener('loadedmetadata', this.onLoadedMetadata);
|
|
101
|
+
this._player.addEventListener('durationchange', this.onDurationChange);
|
|
102
|
+
(_this$_player$ads = this._player.ads) === null || _this$_player$ads === void 0 ? void 0 : _this$_player$ads.addEventListener('adbreakbegin', this.onAdbreakBegin);
|
|
103
|
+
(_this$_player$ads2 = this._player.ads) === null || _this$_player$ads2 === void 0 ? void 0 : _this$_player$ads2.addEventListener('adbreakend', this.onAdbreakEnd);
|
|
104
|
+
this.updateActionHandlers();
|
|
105
|
+
}
|
|
106
|
+
updateActionHandlers() {
|
|
107
|
+
if (this.isTrickplayEnabled()) {
|
|
108
|
+
mediaSession.setActionHandler('seekbackward', event => {
|
|
109
|
+
const skipTime = event.seekOffset || this._config.skipTime;
|
|
110
|
+
this._player.currentTime = Math.max(this._player.currentTime - skipTime, 0);
|
|
111
|
+
});
|
|
112
|
+
mediaSession.setActionHandler('seekforward', event => {
|
|
113
|
+
const skipTime = event.seekOffset || this._config.skipTime;
|
|
114
|
+
this._player.currentTime = Math.min(this._player.currentTime + skipTime, this._player.duration);
|
|
115
|
+
});
|
|
116
|
+
} else {
|
|
117
|
+
mediaSession.setActionHandler('seekbackward', NoOp);
|
|
118
|
+
mediaSession.setActionHandler('seekforward', NoOp);
|
|
119
|
+
}
|
|
120
|
+
if (this.isPlayPauseEnabled()) {
|
|
121
|
+
mediaSession.setActionHandler('play', () => {
|
|
122
|
+
var _this$_player;
|
|
123
|
+
(_this$_player = this._player) === null || _this$_player === void 0 ? void 0 : _this$_player.play();
|
|
124
|
+
});
|
|
125
|
+
mediaSession === null || mediaSession === void 0 ? void 0 : mediaSession.setActionHandler('pause', () => {
|
|
126
|
+
var _this$_player2;
|
|
127
|
+
(_this$_player2 = this._player) === null || _this$_player2 === void 0 ? void 0 : _this$_player2.pause();
|
|
128
|
+
});
|
|
129
|
+
} else {
|
|
130
|
+
mediaSession.setActionHandler('play', NoOp);
|
|
131
|
+
mediaSession.setActionHandler('pause', NoOp);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
destroy() {
|
|
135
|
+
var _this$_player$ads3, _this$_player$ads4;
|
|
136
|
+
this._player.removeEventListener('sourcechange', this.onSourceChange);
|
|
137
|
+
this._player.removeEventListener('loadedmetadata', this.onLoadedMetadata);
|
|
138
|
+
this._player.removeEventListener('durationchange', this.onDurationChange);
|
|
139
|
+
(_this$_player$ads3 = this._player.ads) === null || _this$_player$ads3 === void 0 ? void 0 : _this$_player$ads3.removeEventListener('adbreakbegin', this.onAdbreakBegin);
|
|
140
|
+
(_this$_player$ads4 = this._player.ads) === null || _this$_player$ads4 === void 0 ? void 0 : _this$_player$ads4.removeEventListener('adbreakend', this.onAdbreakEnd);
|
|
141
|
+
mediaSession.setActionHandler('play', NoOp);
|
|
142
|
+
mediaSession.setActionHandler('pause', NoOp);
|
|
143
|
+
mediaSession.setActionHandler('seekbackward', NoOp);
|
|
144
|
+
mediaSession.setActionHandler('seekforward', NoOp);
|
|
145
|
+
}
|
|
146
|
+
isLive() {
|
|
147
|
+
return !isFinite(this._player.duration);
|
|
148
|
+
}
|
|
149
|
+
isAd() {
|
|
150
|
+
var _this$_player$ads5;
|
|
151
|
+
return ((_this$_player$ads5 = this._player.ads) === null || _this$_player$ads5 === void 0 ? void 0 : _this$_player$ads5.playing) == true;
|
|
152
|
+
}
|
|
153
|
+
isInBackground() {
|
|
154
|
+
return document.visibilityState !== 'visible';
|
|
155
|
+
}
|
|
156
|
+
isTrickplayEnabled() {
|
|
157
|
+
// By default, no trickplay for live
|
|
158
|
+
if (this.isLive()) {
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// In PiP mode, disable trick-play for ads.
|
|
163
|
+
if (this._webAdapter.presentationMode === _reactNativeTheoplayer.PresentationMode.pip) {
|
|
164
|
+
return !this.isAd();
|
|
165
|
+
}
|
|
166
|
+
// During background playback
|
|
167
|
+
if (this.isInBackground()) {
|
|
168
|
+
// Disable trick-play for ads.
|
|
169
|
+
return !(this.isAd() || this.isLive());
|
|
170
|
+
}
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
isPlayPauseEnabled() {
|
|
174
|
+
// In PiP mode
|
|
175
|
+
if (this._webAdapter.presentationMode === _reactNativeTheoplayer.PresentationMode.pip) {
|
|
176
|
+
// Disable play/pause for ads
|
|
177
|
+
return !this.isAd();
|
|
178
|
+
}
|
|
179
|
+
// During background playback
|
|
180
|
+
if (this.isInBackground()) {
|
|
181
|
+
// Disable play/pause for ads & live content.
|
|
182
|
+
return !(this.isAd() || this.isLive());
|
|
183
|
+
}
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
exports.WebMediaSession = WebMediaSession;
|
|
188
|
+
//# sourceMappingURL=WebMediaSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativeTheoplayer","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","defaultWebMediaSessionConfig","skipTime","exports","NoOp","mediaSession","_navigator$mediaSessi","_navigator$mediaSessi2","navigator","setActionHandler","setPositionState","window","MediaMetadata","WebMediaSession","constructor","adapter","player","_this$_player$ads","_this$_player$ads2","config","arguments","length","updateMetadata","updatePositionState","updateActionHandlers","source","_player","metadata","artwork","poster","displayIconUri","images","filter","image","map","src","title","artist","subtitle","album","duration","playbackRate","currentTime","isLive","isFinite","isNaN","position","_webAdapter","_config","addEventListener","onSourceChange","onLoadedMetadata","onDurationChange","ads","onAdbreakBegin","onAdbreakEnd","isTrickplayEnabled","event","seekOffset","Math","max","min","isPlayPauseEnabled","_this$_player","play","_this$_player2","pause","destroy","_this$_player$ads3","_this$_player$ads4","removeEventListener","isAd","_this$_player$ads5","playing","isInBackground","document","visibilityState","presentationMode","PresentationMode","pip"],"sources":["WebMediaSession.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\nimport type { ChromelessPlayer } from 'theoplayer';\nimport type { THEOplayerWebAdapter } from '../THEOplayerWebAdapter';\nimport { PresentationMode } from 'react-native-theoplayer';\n\ninterface WebMediaSessionConfig {\n skipTime: number;\n}\n\nexport const defaultWebMediaSessionConfig: WebMediaSessionConfig = {\n skipTime: 15,\n};\n\nconst NoOp = () => {};\n\n// This prevents unnecessary errors when Media Session API is not available.\nconst mediaSession = (function () {\n const mediaSession = navigator.mediaSession || {};\n mediaSession.setActionHandler = navigator.mediaSession?.setActionHandler || function () {};\n mediaSession.setPositionState = navigator.mediaSession?.setPositionState || function () {};\n window.MediaMetadata = window.MediaMetadata || function () {};\n return mediaSession;\n})();\n\n/**\n * The MediaSession interface of the Media Session API allows a web page to provide custom behaviors for standard media playback interactions, and\n * to report metadata that can be sent by the user agent to the device or operating system for presentation in standardized user interface elements.\n *\n * @link https://w3c.github.io/mediasession\n */\nexport class WebMediaSession {\n private readonly _config: WebMediaSessionConfig;\n private readonly _player: ChromelessPlayer;\n private readonly _webAdapter: THEOplayerWebAdapter;\n\n constructor(adapter: THEOplayerWebAdapter, player: ChromelessPlayer, config: WebMediaSessionConfig = defaultWebMediaSessionConfig) {\n this._player = player;\n this._webAdapter = adapter;\n this._config = config;\n\n this._player.addEventListener('sourcechange', this.onSourceChange);\n this._player.addEventListener('loadedmetadata', this.onLoadedMetadata);\n this._player.addEventListener('durationchange', this.onDurationChange);\n this._player.ads?.addEventListener('adbreakbegin', this.onAdbreakBegin);\n this._player.ads?.addEventListener('adbreakend', this.onAdbreakEnd);\n this.updateActionHandlers();\n }\n\n updateActionHandlers() {\n if (this.isTrickplayEnabled()) {\n mediaSession.setActionHandler('seekbackward', (event) => {\n const skipTime = event.seekOffset || this._config.skipTime;\n this._player.currentTime = Math.max(this._player.currentTime - skipTime, 0);\n });\n mediaSession.setActionHandler('seekforward', (event) => {\n const skipTime = event.seekOffset || this._config.skipTime;\n this._player.currentTime = Math.min(this._player.currentTime + skipTime, this._player.duration);\n });\n } else {\n mediaSession.setActionHandler('seekbackward', NoOp);\n mediaSession.setActionHandler('seekforward', NoOp);\n }\n\n if (this.isPlayPauseEnabled()) {\n mediaSession.setActionHandler('play', () => {\n this._player?.play();\n });\n mediaSession?.setActionHandler('pause', () => {\n this._player?.pause();\n });\n } else {\n mediaSession.setActionHandler('play', NoOp);\n mediaSession.setActionHandler('pause', NoOp);\n }\n }\n\n destroy() {\n this._player.removeEventListener('sourcechange', this.onSourceChange);\n this._player.removeEventListener('loadedmetadata', this.onLoadedMetadata);\n this._player.removeEventListener('durationchange', this.onDurationChange);\n this._player.ads?.removeEventListener('adbreakbegin', this.onAdbreakBegin);\n this._player.ads?.removeEventListener('adbreakend', this.onAdbreakEnd);\n mediaSession.setActionHandler('play', NoOp);\n mediaSession.setActionHandler('pause', NoOp);\n mediaSession.setActionHandler('seekbackward', NoOp);\n mediaSession.setActionHandler('seekforward', NoOp);\n }\n\n private onSourceChange = () => {\n this.updateMetadata();\n this.updatePositionState();\n this.updateActionHandlers();\n };\n\n private onLoadedMetadata = () => {\n this.updateActionHandlers();\n };\n\n private onDurationChange = () => {\n this.updateActionHandlers();\n };\n\n private updateMetadata = () => {\n const source = this._player.source;\n const metadata = source?.metadata;\n const artwork = [source?.poster, metadata?.displayIconUri, ...(metadata?.images ? metadata?.images : [])]\n .filter((image) => image !== undefined)\n .map((image) => {\n if (typeof image === 'string') {\n return { src: image };\n }\n return image;\n });\n mediaSession.metadata = new MediaMetadata({\n title: metadata?.title,\n artist: metadata?.artist || metadata?.subtitle,\n album: metadata?.album,\n artwork,\n });\n };\n\n private updatePositionState = () => {\n const { duration, playbackRate, currentTime } = this._player;\n const isLive = !isFinite(duration);\n if (!isLive) {\n mediaSession.setPositionState({\n // The duration is used to specify the duration in seconds.\n // It should always be positive and positive infinity can be used to indicate media without a defined end such as live playback.\n // NOTE: passing Infinite causes an exception to be thrown.\n duration: isNaN(duration) || duration < 0 ? 0 : duration,\n\n // The playbackRate is used to specify the playback rate.\n // It can be positive to represent forward playback or negative to represent backwards playback. It should not be zero.\n playbackRate,\n\n // The position is used to specify the last reported playback position in seconds. It should always be positive.\n position: currentTime,\n });\n }\n };\n\n private onAdbreakBegin = () => {\n this.updateActionHandlers();\n };\n\n private onAdbreakEnd = () => {\n this.updateActionHandlers();\n };\n\n private isLive(): boolean {\n return !isFinite(this._player.duration);\n }\n\n private isAd(): boolean {\n return this._player.ads?.playing == true;\n }\n\n private isInBackground(): boolean {\n return document.visibilityState !== 'visible';\n }\n\n private isTrickplayEnabled(): boolean {\n // By default, no trickplay for live\n if (this.isLive()) {\n return false;\n }\n\n // In PiP mode, disable trick-play for ads.\n if (this._webAdapter.presentationMode === PresentationMode.pip) {\n return !this.isAd();\n }\n // During background playback\n if (this.isInBackground()) {\n // Disable trick-play for ads.\n return !(this.isAd() || this.isLive());\n }\n return true;\n }\n\n private isPlayPauseEnabled(): boolean {\n // In PiP mode\n if (this._webAdapter.presentationMode === PresentationMode.pip) {\n // Disable play/pause for ads\n return !this.isAd();\n }\n // During background playback\n if (this.isInBackground()) {\n // Disable play/pause for ads & live content.\n return !(this.isAd() || this.isLive());\n }\n return true;\n }\n}\n"],"mappings":";;;;;;AAGA,IAAAA,sBAAA,GAAAC,OAAA;AAA2D,SAAAC,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QA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xC;IACA,OAAO,IAAI;EACb;AACF;AAACxC,OAAA,CAAAU,eAAA,GAAAA,eAAA"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.WebPresentationModeManager = void 0;
|
|
7
|
+
var _reactNativeTheoplayer = require("react-native-theoplayer");
|
|
8
|
+
var _PlayerEvents = require("../event/PlayerEvents");
|
|
9
|
+
var _BrowserDetection = require("../../../web/platform/BrowserDetection");
|
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
12
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
|
+
class WebPresentationModeManager {
|
|
14
|
+
constructor(player, eventForwarder) {
|
|
15
|
+
_defineProperty(this, "_player", void 0);
|
|
16
|
+
_defineProperty(this, "_presentationMode", _reactNativeTheoplayer.PresentationMode.inline);
|
|
17
|
+
_defineProperty(this, "_element", undefined);
|
|
18
|
+
_defineProperty(this, "_eventForwarder", void 0);
|
|
19
|
+
this._player = player;
|
|
20
|
+
this._eventForwarder = eventForwarder;
|
|
21
|
+
}
|
|
22
|
+
get presentationMode() {
|
|
23
|
+
return this._presentationMode;
|
|
24
|
+
}
|
|
25
|
+
set presentationMode(presentationMode) {
|
|
26
|
+
if (presentationMode === this._presentationMode) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
this.prepareForPresentationModeChanges();
|
|
30
|
+
|
|
31
|
+
// on iOS Safari requestFullscreen isn't supported (https://caniuse.com/?search=requestFullscreen), where we need to use webkit methods on the video element
|
|
32
|
+
if ( /*browserDetection.IS_IOS_ && */_BrowserDetection.browserDetection.IS_SAFARI_) {
|
|
33
|
+
if (presentationMode === _reactNativeTheoplayer.PresentationMode.fullscreen) {
|
|
34
|
+
var _this$_element, _this$_element$webkit;
|
|
35
|
+
(_this$_element = this._element) === null || _this$_element === void 0 ? void 0 : (_this$_element$webkit = _this$_element.webkitEnterFullscreen) === null || _this$_element$webkit === void 0 ? void 0 : _this$_element$webkit.call(_this$_element);
|
|
36
|
+
} else if (presentationMode === _reactNativeTheoplayer.PresentationMode.pip) {
|
|
37
|
+
var _this$_element2, _this$_element2$webki;
|
|
38
|
+
(_this$_element2 = this._element) === null || _this$_element2 === void 0 ? void 0 : (_this$_element2$webki = _this$_element2.webkitSetPresentationMode) === null || _this$_element2$webki === void 0 ? void 0 : _this$_element2$webki.call(_this$_element2, _reactNativeTheoplayer.PresentationMode.pip);
|
|
39
|
+
} else {
|
|
40
|
+
var _this$_element3, _this$_element3$webki;
|
|
41
|
+
(_this$_element3 = this._element) === null || _this$_element3 === void 0 ? void 0 : (_this$_element3$webki = _this$_element3.webkitSetPresentationMode) === null || _this$_element3$webki === void 0 ? void 0 : _this$_element3$webki.call(_this$_element3, _reactNativeTheoplayer.PresentationMode.inline);
|
|
42
|
+
}
|
|
43
|
+
} else {
|
|
44
|
+
// other web-platformsyarn
|
|
45
|
+
|
|
46
|
+
if (presentationMode === _reactNativeTheoplayer.PresentationMode.fullscreen) {
|
|
47
|
+
const appElement = document.getElementById('app');
|
|
48
|
+
void (appElement === null || appElement === void 0 ? void 0 : appElement.requestFullscreen());
|
|
49
|
+
} else if (presentationMode === _reactNativeTheoplayer.PresentationMode.pip) {
|
|
50
|
+
var _this$_element4, _this$_element4$reque;
|
|
51
|
+
void ((_this$_element4 = this._element) === null || _this$_element4 === void 0 ? void 0 : (_this$_element4$reque = _this$_element4.requestPictureInPicture) === null || _this$_element4$reque === void 0 ? void 0 : _this$_element4$reque.call(_this$_element4));
|
|
52
|
+
} else {
|
|
53
|
+
if (this._presentationMode === _reactNativeTheoplayer.PresentationMode.fullscreen) {
|
|
54
|
+
void document.exitFullscreen();
|
|
55
|
+
}
|
|
56
|
+
if (this._presentationMode === _reactNativeTheoplayer.PresentationMode.pip) {
|
|
57
|
+
void document.exitPictureInPicture();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
prepareForPresentationModeChanges() {
|
|
63
|
+
const elements = this._player.element.children;
|
|
64
|
+
for (const element of Array.from(elements)) {
|
|
65
|
+
if (element.tagName === 'VIDEO' && element.attributes.getNamedItem('src') !== null) {
|
|
66
|
+
this._element = element;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// listen for pip updates on element
|
|
70
|
+
if (this._element != null) {
|
|
71
|
+
this._element.onenterpictureinpicture = () => {
|
|
72
|
+
this.updatePresentationMode();
|
|
73
|
+
};
|
|
74
|
+
this._element.onleavepictureinpicture = () => {
|
|
75
|
+
this.updatePresentationMode();
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
// listen for fullscreen updates on document
|
|
79
|
+
document.onfullscreenchange = () => {
|
|
80
|
+
this.updatePresentationMode();
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
updatePresentationMode() {
|
|
84
|
+
// detect new presentation mode
|
|
85
|
+
let newPresentationMode = _reactNativeTheoplayer.PresentationMode.inline;
|
|
86
|
+
if (document.fullscreenElement !== null) {
|
|
87
|
+
newPresentationMode = _reactNativeTheoplayer.PresentationMode.fullscreen;
|
|
88
|
+
} else if (document.pictureInPictureElement !== null) {
|
|
89
|
+
newPresentationMode = _reactNativeTheoplayer.PresentationMode.pip;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// when changed, notify by dispatching presentationModeChange event
|
|
93
|
+
const previousPresentationMode = this._presentationMode;
|
|
94
|
+
if (newPresentationMode !== previousPresentationMode) {
|
|
95
|
+
this._presentationMode = newPresentationMode;
|
|
96
|
+
this._eventForwarder.dispatchEvent(new _PlayerEvents.DefaultPresentationModeChangeEvent(this._presentationMode, previousPresentationMode));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.WebPresentationModeManager = WebPresentationModeManager;
|
|
101
|
+
//# sourceMappingURL=WebPresentationModeManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativeTheoplayer","require","_PlayerEvents","_BrowserDetection","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","WebPresentationModeManager","constructor","player","eventForwarder","PresentationMode","inline","_player","_eventForwarder","presentationMode","_presentationMode","prepareForPresentationModeChanges","browserDetection","IS_SAFARI_","fullscreen","_this$_element","_this$_element$webkit","_element","webkitEnterFullscreen","pip","_this$_element2","_this$_element2$webki","webkitSetPresentationMode","_this$_element3","_this$_element3$webki","appElement","document","getElementById","requestFullscreen","_this$_element4","_this$_element4$reque","requestPictureInPicture","exitFullscreen","exitPictureInPicture","elements","element","children","Array","from","tagName","attributes","getNamedItem","onenterpictureinpicture","updatePresentationMode","onleavepictureinpicture","onfullscreenchange","newPresentationMode","fullscreenElement","pictureInPictureElement","previousPresentationMode","dispatchEvent","DefaultPresentationModeChangeEvent","exports"],"sources":["WebPresentationModeManager.ts"],"sourcesContent":["import type { PlayerEventMap } from 'react-native-theoplayer';\nimport { PresentationMode } from 'react-native-theoplayer';\nimport type * as THEOplayerWeb from 'theoplayer';\nimport { DefaultPresentationModeChangeEvent } from '../event/PlayerEvents';\nimport { browserDetection } from '../../../web/platform/BrowserDetection';\nimport type { DefaultEventDispatcher } from '../event/DefaultEventDispatcher';\n\nexport class WebPresentationModeManager {\n private readonly _player: THEOplayerWeb.ChromelessPlayer;\n private _presentationMode: PresentationMode = PresentationMode.inline;\n private _element: HTMLVideoElement | undefined = undefined;\n private _eventForwarder: DefaultEventDispatcher<PlayerEventMap>;\n\n constructor(player: THEOplayerWeb.ChromelessPlayer, eventForwarder: DefaultEventDispatcher<PlayerEventMap>) {\n this._player = player;\n this._eventForwarder = eventForwarder;\n }\n\n get presentationMode(): PresentationMode {\n return this._presentationMode;\n }\n\n set presentationMode(presentationMode: PresentationMode) {\n if (presentationMode === this._presentationMode) {\n return;\n }\n\n this.prepareForPresentationModeChanges();\n\n // on iOS Safari requestFullscreen isn't supported (https://caniuse.com/?search=requestFullscreen), where we need to use webkit methods on the video element\n if (/*browserDetection.IS_IOS_ && */ browserDetection.IS_SAFARI_) {\n if (presentationMode === PresentationMode.fullscreen) {\n this._element?.webkitEnterFullscreen?.();\n } else if (presentationMode === PresentationMode.pip) {\n this._element?.webkitSetPresentationMode?.(PresentationMode.pip);\n } else {\n this._element?.webkitSetPresentationMode?.(PresentationMode.inline);\n }\n } else {\n // other web-platformsyarn\n\n if (presentationMode === PresentationMode.fullscreen) {\n const appElement = document.getElementById('app');\n void appElement?.requestFullscreen();\n } else if (presentationMode === PresentationMode.pip) {\n void this._element?.requestPictureInPicture?.();\n } else {\n if (this._presentationMode === PresentationMode.fullscreen) {\n void document.exitFullscreen();\n }\n if (this._presentationMode === PresentationMode.pip) {\n void document.exitPictureInPicture();\n }\n }\n }\n }\n\n private prepareForPresentationModeChanges() {\n const elements = this._player.element.children;\n for (const element of Array.from(elements)) {\n if (element.tagName === 'VIDEO' && element.attributes.getNamedItem('src') !== null) {\n this._element = element as HTMLVideoElement;\n }\n }\n // listen for pip updates on element\n if (this._element != null) {\n this._element.onenterpictureinpicture = () => {\n this.updatePresentationMode();\n };\n this._element.onleavepictureinpicture = () => {\n this.updatePresentationMode();\n };\n }\n // listen for fullscreen updates on document\n document.onfullscreenchange = () => {\n this.updatePresentationMode();\n };\n }\n\n private updatePresentationMode() {\n // detect new presentation mode\n let newPresentationMode: PresentationMode = PresentationMode.inline;\n if (document.fullscreenElement !== null) {\n newPresentationMode = PresentationMode.fullscreen;\n } else if (document.pictureInPictureElement !== null) {\n newPresentationMode = PresentationMode.pip;\n }\n\n // when changed, notify by dispatching presentationModeChange event\n const previousPresentationMode = this._presentationMode;\n if (newPresentationMode !== previousPresentationMode) {\n this._presentationMode = newPresentationMode;\n this._eventForwarder.dispatchEvent(new DefaultPresentationModeChangeEvent(this._presentationMode, previousPresentationMode));\n }\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,sBAAA,GAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AAA0E,SAAAG,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,MAAA,EAAAT,KAAA;AAGnE,MAAMU,0BAA0B,CAAC;EAMtCC,WAAWA,CAACC,MAAsC,EAAEC,cAA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B,GAAG,MAAM;QAC5C,IAAI,CAACC,sBAAsB,EAAE;MAC/B,CAAC;MACD,IAAI,CAAC1B,QAAQ,CAAC2B,uBAAuB,GAAG,MAAM;QAC5C,IAAI,CAACD,sBAAsB,EAAE;MAC/B,CAAC;IACH;IACA;IACAjB,QAAQ,CAACmB,kBAAkB,GAAG,MAAM;MAClC,IAAI,CAACF,sBAAsB,EAAE;IAC/B,CAAC;EACH;EAEQA,sBAAsBA,CAAA,EAAG;IAC/B;IACA,IAAIG,mBAAqC,GAAGzC,uCAAgB,CAACC,MAAM;IACnE,IAAIoB,QAAQ,CAACqB,iBAAiB,KAAK,IAAI,EAAE;MACvCD,mBAAmB,GAAGzC,uCAAgB,CAACS,UAAU;IACnD,CAAC,MAAM,IAAIY,QAAQ,CAACsB,uBAAuB,KAAK,IAAI,EAAE;MACpDF,mBAAmB,GAAGzC,uCAAgB,CAACc,GAAG;IAC5C;;IAEA;IACA,MAAM8B,wBAAwB,GAAG,IAAI,CAACvC,iBAAiB;IACvD,IAAIoC,mBAAmB,KAAKG,wBAAwB,EAAE;MACpD,IAAI,CAACvC,iBAAiB,GAAGoC,mBAAmB;MAC5C,IAAI,CAACtC,eAAe,CAAC0C,aAAa,CAAC,IAAIC,gDAAkC,CAAC,IAAI,CAACzC,iBAAiB,EAAEuC,wBAAwB,CAAC,CAAC;IAC9H;EACF;AACF;AAACG,OAAA,CAAAnD,0BAAA,GAAAA,0BAAA"}
|
|
@@ -4,29 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.NativeContentProtectionRegistry = exports.ContentProtectionRegistry = void 0;
|
|
7
|
-
|
|
8
7
|
var _reactNative = require("react-native");
|
|
9
|
-
|
|
10
8
|
var _NativeLicenseRequest = require("./NativeLicenseRequest");
|
|
11
|
-
|
|
12
9
|
var _NativeLicenseResponse = require("./NativeLicenseResponse");
|
|
13
|
-
|
|
14
10
|
var _NativeCertificateRequest = require("./NativeCertificateRequest");
|
|
15
|
-
|
|
16
11
|
var _NativeCertificateResponse = require("./NativeCertificateResponse");
|
|
17
|
-
|
|
18
12
|
var _TypeUtils = require("../utils/TypeUtils");
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
13
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
22
16
|
class NativeContentProtectionRegistry {
|
|
23
17
|
constructor() {
|
|
24
18
|
_defineProperty(this, "emitter", void 0);
|
|
25
|
-
|
|
26
19
|
_defineProperty(this, "registeredFactories", []);
|
|
27
|
-
|
|
28
20
|
_defineProperty(this, "currentIntegration", undefined);
|
|
29
|
-
|
|
30
21
|
_defineProperty(this, "onBuildIntegrationRequest", event => {
|
|
31
22
|
const {
|
|
32
23
|
requestId,
|
|
@@ -36,14 +27,12 @@ class NativeContentProtectionRegistry {
|
|
|
36
27
|
} = event;
|
|
37
28
|
console.log('ContentProtectionModule', `onBuildIntegrationRequest ${integrationId} ${keySystemId}`);
|
|
38
29
|
const factory = this.getFactory(integrationId, keySystemId);
|
|
39
|
-
|
|
40
30
|
if (factory) {
|
|
41
31
|
this.currentIntegration = {
|
|
42
32
|
integrationId,
|
|
43
33
|
keySystemId,
|
|
44
34
|
integration: factory.build(drmConfig)
|
|
45
35
|
};
|
|
46
|
-
|
|
47
36
|
_reactNative.NativeModules.ContentProtectionModule.onBuildProcessed({
|
|
48
37
|
requestId,
|
|
49
38
|
resultString: 'success'
|
|
@@ -55,7 +44,6 @@ class NativeContentProtectionRegistry {
|
|
|
55
44
|
});
|
|
56
45
|
}
|
|
57
46
|
});
|
|
58
|
-
|
|
59
47
|
_defineProperty(this, "onCertificateRequest", async request => {
|
|
60
48
|
const {
|
|
61
49
|
requestId,
|
|
@@ -64,24 +52,20 @@ class NativeContentProtectionRegistry {
|
|
|
64
52
|
} = request;
|
|
65
53
|
console.log('ContentProtectionModule', `onCertificateRequest ${integrationId} ${keySystemId}`);
|
|
66
54
|
const integration = this.getIntegration(integrationId, keySystemId);
|
|
67
|
-
|
|
68
55
|
if (integration !== null && integration !== void 0 && integration.onCertificateRequest) {
|
|
69
|
-
const result = await integration.onCertificateRequest((0, _NativeCertificateRequest.fromNativeCertificateRequest)(request));
|
|
70
|
-
|
|
56
|
+
const result = await integration.onCertificateRequest((0, _NativeCertificateRequest.fromNativeCertificateRequest)(request));
|
|
57
|
+
// TODO: we also want to support ArrayBufferView results
|
|
71
58
|
if ((0, _TypeUtils.isBufferSource)(result)) {
|
|
72
59
|
const nativeResponse = (0, _NativeCertificateResponse.toNativeCertificateResponseResult)(requestId, integrationId, keySystemId, result);
|
|
73
|
-
|
|
74
60
|
_reactNative.NativeModules.ContentProtectionModule.onCertificateRequestProcessedAsCertificate(nativeResponse);
|
|
75
61
|
} else if (result) {
|
|
76
62
|
const modifiedNativeRequest = (0, _NativeCertificateRequest.toNativeCertificateRequest)(requestId, integrationId, keySystemId, result);
|
|
77
|
-
|
|
78
63
|
_reactNative.NativeModules.ContentProtectionModule.onCertificateRequestProcessedAsRequest(modifiedNativeRequest);
|
|
79
64
|
}
|
|
80
65
|
} else {
|
|
81
66
|
_reactNative.NativeModules.ContentProtectionModule.onCertificateRequestProcessedAsRequest(request);
|
|
82
67
|
}
|
|
83
68
|
});
|
|
84
|
-
|
|
85
69
|
_defineProperty(this, "onCertificateResponse", async response => {
|
|
86
70
|
const {
|
|
87
71
|
requestId,
|
|
@@ -90,18 +74,15 @@ class NativeContentProtectionRegistry {
|
|
|
90
74
|
} = response;
|
|
91
75
|
console.log('ContentProtectionModule', `onCertificateResponse ${integrationId} ${keySystemId}`);
|
|
92
76
|
const integration = this.getIntegration(integrationId, keySystemId);
|
|
93
|
-
|
|
94
77
|
if (integration !== null && integration !== void 0 && integration.onCertificateResponse) {
|
|
95
|
-
const responseResult = await integration.onCertificateResponse((0, _NativeCertificateResponse.fromNativeCertificateResponse)(response));
|
|
96
|
-
|
|
78
|
+
const responseResult = await integration.onCertificateResponse((0, _NativeCertificateResponse.fromNativeCertificateResponse)(response));
|
|
79
|
+
// TODO: we also want to support ArrayBufferView results
|
|
97
80
|
const modifiedNativeResponse = (0, _NativeCertificateResponse.toNativeCertificateResponseResult)(requestId, integrationId, keySystemId, responseResult);
|
|
98
|
-
|
|
99
81
|
_reactNative.NativeModules.ContentProtectionModule.onCertificateResponseProcessed(modifiedNativeResponse);
|
|
100
82
|
} else {
|
|
101
83
|
_reactNative.NativeModules.ContentProtectionModule.onCertificateResponseProcessed(response);
|
|
102
84
|
}
|
|
103
85
|
});
|
|
104
|
-
|
|
105
86
|
_defineProperty(this, "onLicenseRequest", async request => {
|
|
106
87
|
const {
|
|
107
88
|
requestId,
|
|
@@ -109,25 +90,22 @@ class NativeContentProtectionRegistry {
|
|
|
109
90
|
keySystemId
|
|
110
91
|
} = request;
|
|
111
92
|
console.log('ContentProtectionModule', `onLicenseRequest ${integrationId} ${keySystemId}`);
|
|
112
|
-
const integration = this.getIntegration(integrationId, keySystemId);
|
|
113
|
-
|
|
93
|
+
const integration = this.getIntegration(integrationId, keySystemId);
|
|
94
|
+
// Optionally let the custom integration modify the request.
|
|
114
95
|
if (integration !== null && integration !== void 0 && integration.onLicenseRequest) {
|
|
115
|
-
const result = await integration.onLicenseRequest((0, _NativeLicenseRequest.fromNativeLicenseRequest)(request));
|
|
116
|
-
|
|
96
|
+
const result = await integration.onLicenseRequest((0, _NativeLicenseRequest.fromNativeLicenseRequest)(request));
|
|
97
|
+
// TODO: we also want to support ArrayBufferView results
|
|
117
98
|
if ((0, _TypeUtils.isBufferSource)(result)) {
|
|
118
99
|
const nativeResponse = (0, _NativeLicenseResponse.toNativeLicenseResponseResult)(requestId, integrationId, keySystemId, result);
|
|
119
|
-
|
|
120
100
|
_reactNative.NativeModules.ContentProtectionModule.onLicenseRequestProcessedAsLicense(nativeResponse);
|
|
121
101
|
} else if (result) {
|
|
122
102
|
const modifiedNativeRequest = (0, _NativeLicenseRequest.toNativeLicenseRequest)(requestId, integrationId, keySystemId, result);
|
|
123
|
-
|
|
124
103
|
_reactNative.NativeModules.ContentProtectionModule.onLicenseRequestProcessedAsRequest(modifiedNativeRequest);
|
|
125
104
|
}
|
|
126
105
|
} else {
|
|
127
106
|
_reactNative.NativeModules.ContentProtectionModule.onLicenseRequestProcessedAsRequest(request);
|
|
128
107
|
}
|
|
129
108
|
});
|
|
130
|
-
|
|
131
109
|
_defineProperty(this, "onLicenseResponse", async response => {
|
|
132
110
|
const {
|
|
133
111
|
requestId,
|
|
@@ -136,18 +114,15 @@ class NativeContentProtectionRegistry {
|
|
|
136
114
|
} = response;
|
|
137
115
|
console.log('ContentProtectionModule', `onLicenseResponse ${integrationId} ${keySystemId}`);
|
|
138
116
|
const integration = this.getIntegration(integrationId, keySystemId);
|
|
139
|
-
|
|
140
117
|
if (integration !== null && integration !== void 0 && integration.onLicenseResponse) {
|
|
141
|
-
const responseResult = await integration.onLicenseResponse((0, _NativeLicenseResponse.fromNativeLicenseResponse)(response));
|
|
142
|
-
|
|
118
|
+
const responseResult = await integration.onLicenseResponse((0, _NativeLicenseResponse.fromNativeLicenseResponse)(response));
|
|
119
|
+
// TODO: we also want to support ArrayBufferView results
|
|
143
120
|
const modifiedNativeResponse = (0, _NativeLicenseResponse.toNativeLicenseResponseResult)(requestId, integrationId, keySystemId, responseResult);
|
|
144
|
-
|
|
145
121
|
_reactNative.NativeModules.ContentProtectionModule.onLicenseResponseProcessed(modifiedNativeResponse);
|
|
146
122
|
} else {
|
|
147
123
|
_reactNative.NativeModules.ContentProtectionModule.onLicenseResponseProcessed(response);
|
|
148
124
|
}
|
|
149
125
|
});
|
|
150
|
-
|
|
151
126
|
_defineProperty(this, "onExtractFairplayContentId", async event => {
|
|
152
127
|
const {
|
|
153
128
|
integrationId,
|
|
@@ -157,24 +132,20 @@ class NativeContentProtectionRegistry {
|
|
|
157
132
|
} = event;
|
|
158
133
|
console.log('ContentProtectionModule', `onExtractFairplayContentId ${integrationId} ${keySystemId}`);
|
|
159
134
|
const integration = this.getIntegration(integrationId, keySystemId);
|
|
160
|
-
|
|
161
135
|
if (integration !== null && integration !== void 0 && integration.extractFairplayContentId) {
|
|
162
136
|
const contentId = await integration.extractFairplayContentId(fairplaySkdUrl);
|
|
163
|
-
|
|
164
137
|
_reactNative.NativeModules.ContentProtectionModule.onExtractFairplayContentIdProcessed({
|
|
165
138
|
requestId,
|
|
166
139
|
contentId
|
|
167
140
|
});
|
|
168
141
|
} else {
|
|
169
142
|
const contentId = fairplaySkdUrl;
|
|
170
|
-
|
|
171
143
|
_reactNative.NativeModules.ContentProtectionModule.onExtractFairplayContentIdProcessed({
|
|
172
144
|
requestId,
|
|
173
145
|
contentId
|
|
174
146
|
});
|
|
175
147
|
}
|
|
176
148
|
});
|
|
177
|
-
|
|
178
149
|
this.emitter = new _reactNative.NativeEventEmitter(_reactNative.NativeModules.ContentProtectionModule);
|
|
179
150
|
this.emitter.addListener('onBuildIntegration', this.onBuildIntegrationRequest);
|
|
180
151
|
this.emitter.addListener('onCertificateRequest', this.onCertificateRequest);
|
|
@@ -183,31 +154,23 @@ class NativeContentProtectionRegistry {
|
|
|
183
154
|
this.emitter.addListener('onLicenseResponse', this.onLicenseResponse);
|
|
184
155
|
this.emitter.addListener('onExtractFairplayContentId', this.onExtractFairplayContentId);
|
|
185
156
|
}
|
|
186
|
-
|
|
187
157
|
registerContentProtectionIntegration(integrationId, keySystemId, integrationFactory) {
|
|
188
158
|
this.registeredFactories.push({
|
|
189
159
|
integrationId,
|
|
190
160
|
keySystemId,
|
|
191
161
|
integrationFactory
|
|
192
162
|
});
|
|
193
|
-
|
|
194
163
|
_reactNative.NativeModules.ContentProtectionModule.registerContentProtectionIntegration(integrationId, keySystemId);
|
|
195
164
|
}
|
|
196
|
-
|
|
197
165
|
getFactory(integrationId, keySystemId) {
|
|
198
166
|
var _this$registeredFacto;
|
|
199
|
-
|
|
200
167
|
return (_this$registeredFacto = this.registeredFactories.find(init => init.integrationId === integrationId && init.keySystemId === keySystemId)) === null || _this$registeredFacto === void 0 ? void 0 : _this$registeredFacto.integrationFactory;
|
|
201
168
|
}
|
|
202
|
-
|
|
203
169
|
getIntegration(integrationId, keySystemId) {
|
|
204
170
|
var _this$currentIntegrat, _this$currentIntegrat2, _this$currentIntegrat3;
|
|
205
|
-
|
|
206
171
|
return ((_this$currentIntegrat = this.currentIntegration) === null || _this$currentIntegrat === void 0 ? void 0 : _this$currentIntegrat.integrationId) === integrationId && ((_this$currentIntegrat2 = this.currentIntegration) === null || _this$currentIntegrat2 === void 0 ? void 0 : _this$currentIntegrat2.keySystemId) === keySystemId ? (_this$currentIntegrat3 = this.currentIntegration) === null || _this$currentIntegrat3 === void 0 ? void 0 : _this$currentIntegrat3.integration : undefined;
|
|
207
172
|
}
|
|
208
|
-
|
|
209
173
|
}
|
|
210
|
-
|
|
211
174
|
exports.NativeContentProtectionRegistry = NativeContentProtectionRegistry;
|
|
212
175
|
const ContentProtectionRegistry = new NativeContentProtectionRegistry();
|
|
213
176
|
exports.ContentProtectionRegistry = ContentProtectionRegistry;
|