react-native-theoplayer 11.6.0 → 11.8.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 +38 -0
- package/README.md +69 -0
- package/android/build.gradle +3 -2
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/gradlew +176 -110
- package/android/gradlew.bat +23 -18
- package/android/src/main/java/com/theoplayer/PlayerConfigAdapter.kt +6 -0
- package/android/src/main/java/com/theoplayer/PlayerEventEmitter.kt +2 -2
- package/android/src/main/java/com/theoplayer/ReactTHEOplayerContext.kt +37 -8
- package/android/src/main/java/com/theoplayer/ReactTHEOplayerPackage.kt +3 -0
- package/android/src/main/java/com/theoplayer/ReactTHEOplayerView.kt +51 -3
- package/android/src/main/java/com/theoplayer/ads/AdEventAdapter.kt +4 -0
- package/android/src/main/java/com/theoplayer/ads/AdsModule.kt +6 -6
- package/android/src/main/java/com/theoplayer/drm/ContentProtectionAdapter.kt +17 -5
- package/android/src/main/java/com/theoplayer/drm/ContentProtectionModule.kt +61 -7
- package/android/src/main/java/com/theoplayer/drm/ProxyContentProtectionIntegration.kt +12 -5
- package/android/src/main/java/com/theoplayer/drm/ProxyContentProtectionIntegrationFactory.kt +3 -1
- package/android/src/main/java/com/theoplayer/integration/Integration.kt +72 -0
- package/android/src/main/java/com/theoplayer/integration/IntegrationRegistration.kt +68 -0
- package/android/src/main/java/com/theoplayer/integration/PlayerFacade.kt +187 -0
- package/android/src/main/java/com/theoplayer/integration/PlayerFacadeAdState.kt +19 -0
- package/android/src/main/java/com/theoplayer/integration/PlayerFacadeAds.kt +73 -0
- package/android/src/main/java/com/theoplayer/integration/PlayerFacadeAdsBridge.kt +112 -0
- package/android/src/main/java/com/theoplayer/integration/PlayerFacadeEventSubscription.kt +11 -0
- package/android/src/main/java/com/theoplayer/integration/PlayerFacadeEvents.kt +139 -0
- package/android/src/main/java/com/theoplayer/metrics/MetricsModule.kt +37 -0
- package/android/src/main/java/com/theoplayer/theoads/THEOadsModule.kt +1 -1
- package/android/src/main/java/com/theoplayer/theolive/EndpointAdapter.kt +33 -0
- package/android/src/test/java/com/theoplayer/integration/PlayerFacadeAdsBridgeTest.kt +250 -0
- package/android/src/test/java/com/theoplayer/integration/PlayerFacadeConfigurationTest.kt +30 -0
- package/android/src/test/java/com/theoplayer/integration/PlayerFacadeTest.kt +507 -0
- package/android/src/test/java/com/theoplayer/integration/PlayerFacadeTestHost.kt +104 -0
- package/ios/THEOplayerRCTBridge.m +19 -0
- package/ios/THEOplayerRCTPlayerAPI.swift +31 -0
- package/ios/Theoplayer-Bridging-Header.h +0 -1
- package/ios/contentprotection/THEOplayerRCTContentProtectionAPI.swift +39 -9
- package/ios/contentprotection/THEOplayerRCTContentProtectionAggregator.swift +15 -11
- package/ios/contentprotection/THEOplayerRCTProxyContentProtectionIntegration.swift +12 -7
- package/ios/metrics/THEOplayerRCTMetricsAPI.swift +31 -0
- package/ios/theolive/THEOplayerRCTTHEOliveEventAdapter.swift +21 -0
- package/lib/commonjs/api/barrel.js +31 -20
- package/lib/commonjs/api/barrel.js.map +1 -1
- package/lib/commonjs/api/metrics/MetricsAPI.js +2 -0
- package/lib/commonjs/api/metrics/MetricsAPI.js.map +1 -0
- package/lib/commonjs/api/metrics/barrel.js +17 -0
- package/lib/commonjs/api/metrics/barrel.js.map +1 -0
- package/lib/commonjs/api/player/Integration.js +2 -0
- package/lib/commonjs/api/player/Integration.js.map +1 -0
- package/lib/commonjs/api/player/PlayerEventMap.js +1 -1
- package/lib/commonjs/api/player/THEOplayer.js.map +1 -1
- package/lib/commonjs/api/player/barrel.js +11 -0
- package/lib/commonjs/api/player/barrel.js.map +1 -1
- package/lib/commonjs/api/track/MediaTrack.js +16 -0
- package/lib/commonjs/api/track/MediaTrack.js.map +1 -1
- package/lib/commonjs/internal/THEOplayerView.js +2 -0
- package/lib/commonjs/internal/THEOplayerView.js.map +1 -1
- package/lib/commonjs/internal/THEOplayerView.web.js +3 -1
- package/lib/commonjs/internal/THEOplayerView.web.js.map +1 -1
- package/lib/commonjs/internal/adapter/DefaultNativePlayerState.js +1 -0
- package/lib/commonjs/internal/adapter/DefaultNativePlayerState.js.map +1 -1
- package/lib/commonjs/internal/adapter/THEOplayerAdapter.js +18 -0
- package/lib/commonjs/internal/adapter/THEOplayerAdapter.js.map +1 -1
- package/lib/commonjs/internal/adapter/THEOplayerWebAdapter.js +21 -4
- package/lib/commonjs/internal/adapter/THEOplayerWebAdapter.js.map +1 -1
- package/lib/commonjs/internal/adapter/WebEventForwarder.js +62 -11
- package/lib/commonjs/internal/adapter/WebEventForwarder.js.map +1 -1
- package/lib/commonjs/internal/adapter/metrics/MetricsNativeAdapter.js +18 -0
- package/lib/commonjs/internal/adapter/metrics/MetricsNativeAdapter.js.map +1 -0
- package/lib/commonjs/internal/adapter/metrics/MetricsWebAdapter.js +16 -0
- package/lib/commonjs/internal/adapter/metrics/MetricsWebAdapter.js.map +1 -0
- package/lib/commonjs/internal/adapter/web/IntegrationRegistration.js +6 -0
- package/lib/commonjs/internal/adapter/web/IntegrationRegistration.js.map +1 -0
- package/lib/commonjs/internal/adapter/web/PlayerFacade.js +258 -0
- package/lib/commonjs/internal/adapter/web/PlayerFacade.js.map +1 -0
- package/lib/commonjs/internal/adapter/web/PlayerFacadeAPI.js +6 -0
- package/lib/commonjs/internal/adapter/web/PlayerFacadeAPI.js.map +1 -0
- package/lib/commonjs/internal/adapter/web/PlayerFacadeAdsEvents.js +114 -0
- package/lib/commonjs/internal/adapter/web/PlayerFacadeAdsEvents.js.map +1 -0
- package/lib/commonjs/internal/adapter/web/PlayerFacadeIntegration.js +6 -0
- package/lib/commonjs/internal/adapter/web/PlayerFacadeIntegration.js.map +1 -0
- package/lib/commonjs/internal/adapter/web/PlayerFacadeTypes.js +6 -0
- package/lib/commonjs/internal/adapter/web/PlayerFacadeTypes.js.map +1 -0
- package/lib/commonjs/internal/drm/ContentProtectionRegistry.js +38 -12
- package/lib/commonjs/internal/drm/ContentProtectionRegistry.js.map +1 -1
- package/lib/commonjs/manifest.json +1 -1
- package/lib/commonjs/plugins/typedoc-platform-icons/package-lock.json +200 -58
- package/lib/commonjs/plugins/typedoc-platform-icons/package.json +1 -1
- package/lib/commonjs/plugins/typedoc-platform-icons/tsconfig.json +2 -1
- package/lib/module/api/barrel.js +1 -0
- package/lib/module/api/barrel.js.map +1 -1
- package/lib/module/api/metrics/MetricsAPI.js +2 -0
- package/lib/module/api/metrics/MetricsAPI.js.map +1 -0
- package/lib/module/api/metrics/barrel.js +4 -0
- package/lib/module/api/metrics/barrel.js.map +1 -0
- package/lib/module/api/player/Integration.js +2 -0
- package/lib/module/api/player/Integration.js.map +1 -0
- package/lib/module/api/player/PlayerEventMap.js +1 -1
- package/lib/module/api/player/THEOplayer.js.map +1 -1
- package/lib/module/api/player/barrel.js +1 -0
- package/lib/module/api/player/barrel.js.map +1 -1
- package/lib/module/api/track/MediaTrack.js +16 -0
- package/lib/module/api/track/MediaTrack.js.map +1 -1
- package/lib/module/internal/THEOplayerView.js +2 -0
- package/lib/module/internal/THEOplayerView.js.map +1 -1
- package/lib/module/internal/THEOplayerView.web.js +3 -1
- package/lib/module/internal/THEOplayerView.web.js.map +1 -1
- package/lib/module/internal/adapter/DefaultNativePlayerState.js +1 -0
- package/lib/module/internal/adapter/DefaultNativePlayerState.js.map +1 -1
- package/lib/module/internal/adapter/THEOplayerAdapter.js +18 -0
- package/lib/module/internal/adapter/THEOplayerAdapter.js.map +1 -1
- package/lib/module/internal/adapter/THEOplayerWebAdapter.js +21 -4
- package/lib/module/internal/adapter/THEOplayerWebAdapter.js.map +1 -1
- package/lib/module/internal/adapter/WebEventForwarder.js +62 -11
- package/lib/module/internal/adapter/WebEventForwarder.js.map +1 -1
- package/lib/module/internal/adapter/metrics/MetricsNativeAdapter.js +13 -0
- package/lib/module/internal/adapter/metrics/MetricsNativeAdapter.js.map +1 -0
- package/lib/module/internal/adapter/metrics/MetricsWebAdapter.js +11 -0
- package/lib/module/internal/adapter/metrics/MetricsWebAdapter.js.map +1 -0
- package/lib/module/internal/adapter/web/IntegrationRegistration.js +4 -0
- package/lib/module/internal/adapter/web/IntegrationRegistration.js.map +1 -0
- package/lib/module/internal/adapter/web/PlayerFacade.js +253 -0
- package/lib/module/internal/adapter/web/PlayerFacade.js.map +1 -0
- package/lib/module/internal/adapter/web/PlayerFacadeAPI.js +4 -0
- package/lib/module/internal/adapter/web/PlayerFacadeAPI.js.map +1 -0
- package/lib/module/internal/adapter/web/PlayerFacadeAdsEvents.js +109 -0
- package/lib/module/internal/adapter/web/PlayerFacadeAdsEvents.js.map +1 -0
- package/lib/module/internal/adapter/web/PlayerFacadeIntegration.js +4 -0
- package/lib/module/internal/adapter/web/PlayerFacadeIntegration.js.map +1 -0
- package/lib/module/internal/adapter/web/PlayerFacadeTypes.js +4 -0
- package/lib/module/internal/adapter/web/PlayerFacadeTypes.js.map +1 -0
- package/lib/module/internal/drm/ContentProtectionRegistry.js +38 -12
- package/lib/module/internal/drm/ContentProtectionRegistry.js.map +1 -1
- package/lib/module/manifest.json +1 -1
- package/lib/module/plugins/typedoc-platform-icons/package-lock.json +200 -58
- package/lib/module/plugins/typedoc-platform-icons/package.json +1 -1
- package/lib/module/plugins/typedoc-platform-icons/tsconfig.json +2 -1
- package/lib/typescript/__tests__/ContentProtectionRegistry.test.d.ts +2 -0
- package/lib/typescript/__tests__/ContentProtectionRegistry.test.d.ts.map +1 -0
- package/lib/typescript/__tests__/PlayerFacade.test.d.ts +2 -0
- package/lib/typescript/__tests__/PlayerFacade.test.d.ts.map +1 -0
- package/lib/typescript/__tests__/PlayerFacadeWebAdapter.test.d.ts +2 -0
- package/lib/typescript/__tests__/PlayerFacadeWebAdapter.test.d.ts.map +1 -0
- package/lib/typescript/__tests__/index.test.d.ts +13 -0
- package/lib/typescript/__tests__/index.test.d.ts.map +1 -1
- package/lib/typescript/api/THEOplayerView.d.ts +4 -0
- package/lib/typescript/api/THEOplayerView.d.ts.map +1 -1
- package/lib/typescript/api/barrel.d.ts +1 -0
- package/lib/typescript/api/barrel.d.ts.map +1 -1
- package/lib/typescript/api/config/PlayerConfiguration.d.ts +15 -0
- package/lib/typescript/api/config/PlayerConfiguration.d.ts.map +1 -1
- package/lib/typescript/api/error/ChromecastError.d.ts +2 -2
- package/lib/typescript/api/event/AdEvent.d.ts +1 -1
- package/lib/typescript/api/metrics/MetricsAPI.d.ts +21 -0
- package/lib/typescript/api/metrics/MetricsAPI.d.ts.map +1 -0
- package/lib/typescript/api/metrics/barrel.d.ts +2 -0
- package/lib/typescript/api/metrics/barrel.d.ts.map +1 -0
- package/lib/typescript/api/player/Integration.d.ts +88 -0
- package/lib/typescript/api/player/Integration.d.ts.map +1 -0
- package/lib/typescript/api/player/PlayerEventMap.d.ts +1 -1
- package/lib/typescript/api/player/THEOplayer.d.ts +19 -0
- package/lib/typescript/api/player/THEOplayer.d.ts.map +1 -1
- package/lib/typescript/api/player/barrel.d.ts +1 -0
- package/lib/typescript/api/player/barrel.d.ts.map +1 -1
- package/lib/typescript/api/theoads/interstitial/Interstitial.d.ts +1 -1
- package/lib/typescript/api/theolive/TheoLiveEndpoint.d.ts +23 -5
- package/lib/typescript/api/theolive/TheoLiveEndpoint.d.ts.map +1 -1
- package/lib/typescript/api/theolive/WebrtcOptions.d.ts +1 -1
- package/lib/typescript/api/track/MediaTrack.d.ts +21 -4
- package/lib/typescript/api/track/MediaTrack.d.ts.map +1 -1
- package/lib/typescript/internal/adapter/DefaultNativePlayerState.d.ts +1 -0
- package/lib/typescript/internal/adapter/DefaultNativePlayerState.d.ts.map +1 -1
- package/lib/typescript/internal/adapter/NativePlayerState.d.ts +1 -0
- package/lib/typescript/internal/adapter/NativePlayerState.d.ts.map +1 -1
- package/lib/typescript/internal/adapter/THEOplayerAdapter.d.ts +6 -1
- package/lib/typescript/internal/adapter/THEOplayerAdapter.d.ts.map +1 -1
- package/lib/typescript/internal/adapter/THEOplayerWebAdapter.d.ts +6 -1
- package/lib/typescript/internal/adapter/THEOplayerWebAdapter.d.ts.map +1 -1
- package/lib/typescript/internal/adapter/WebEventForwarder.d.ts +3 -0
- package/lib/typescript/internal/adapter/WebEventForwarder.d.ts.map +1 -1
- package/lib/typescript/internal/adapter/metrics/MetricsNativeAdapter.d.ts +7 -0
- package/lib/typescript/internal/adapter/metrics/MetricsNativeAdapter.d.ts.map +1 -0
- package/lib/typescript/internal/adapter/metrics/MetricsWebAdapter.d.ts +8 -0
- package/lib/typescript/internal/adapter/metrics/MetricsWebAdapter.d.ts.map +1 -0
- package/lib/typescript/internal/adapter/web/IntegrationRegistration.d.ts +53 -0
- package/lib/typescript/internal/adapter/web/IntegrationRegistration.d.ts.map +1 -0
- package/lib/typescript/internal/adapter/web/PlayerFacade.d.ts +26 -0
- package/lib/typescript/internal/adapter/web/PlayerFacade.d.ts.map +1 -0
- package/lib/typescript/internal/adapter/web/PlayerFacadeAPI.d.ts +33 -0
- package/lib/typescript/internal/adapter/web/PlayerFacadeAPI.d.ts.map +1 -0
- package/lib/typescript/internal/adapter/web/PlayerFacadeAdsEvents.d.ts +21 -0
- package/lib/typescript/internal/adapter/web/PlayerFacadeAdsEvents.d.ts.map +1 -0
- package/lib/typescript/internal/adapter/web/PlayerFacadeIntegration.d.ts +43 -0
- package/lib/typescript/internal/adapter/web/PlayerFacadeIntegration.d.ts.map +1 -0
- package/lib/typescript/internal/adapter/web/PlayerFacadeTypes.d.ts +13 -0
- package/lib/typescript/internal/adapter/web/PlayerFacadeTypes.d.ts.map +1 -0
- package/lib/typescript/internal/drm/ContentProtectionRegistry.d.ts +3 -1
- package/lib/typescript/internal/drm/ContentProtectionRegistry.d.ts.map +1 -1
- package/lib/typescript/internal/drm/NativeContentProtectionEvent.d.ts +5 -0
- package/lib/typescript/internal/drm/NativeContentProtectionEvent.d.ts.map +1 -1
- package/package.json +5 -6
- package/react-native-theoplayer.podspec +7 -7
- package/src/__tests__/ContentProtectionRegistry.test.ts +239 -0
- package/src/__tests__/PlayerFacade.test.ts +579 -0
- package/src/__tests__/PlayerFacadeWebAdapter.test.ts +193 -0
- package/src/__tests__/index.test.tsx +15 -1
- package/src/api/THEOplayerView.ts +5 -0
- package/src/api/barrel.ts +1 -0
- package/src/api/config/PlayerConfiguration.ts +16 -0
- package/src/api/error/ChromecastError.ts +2 -2
- package/src/api/event/AdEvent.ts +1 -1
- package/src/api/metrics/MetricsAPI.ts +20 -0
- package/src/api/metrics/barrel.ts +1 -0
- package/src/api/player/Integration.ts +97 -0
- package/src/api/player/PlayerEventMap.ts +1 -1
- package/src/api/player/THEOplayer.ts +21 -0
- package/src/api/player/barrel.ts +1 -0
- package/src/api/theoads/interstitial/Interstitial.ts +1 -1
- package/src/api/theolive/TheoLiveEndpoint.ts +24 -5
- package/src/api/theolive/WebrtcOptions.ts +1 -1
- package/src/api/track/MediaTrack.ts +21 -4
- package/src/internal/THEOplayerView.tsx +2 -2
- package/src/internal/THEOplayerView.web.tsx +2 -2
- package/src/internal/adapter/DefaultNativePlayerState.ts +1 -0
- package/src/internal/adapter/NativePlayerState.ts +1 -0
- package/src/internal/adapter/THEOplayerAdapter.ts +24 -0
- package/src/internal/adapter/THEOplayerWebAdapter.ts +27 -4
- package/src/internal/adapter/WebEventForwarder.ts +74 -13
- package/src/internal/adapter/metrics/MetricsNativeAdapter.ts +12 -0
- package/src/internal/adapter/metrics/MetricsWebAdapter.ts +14 -0
- package/src/internal/adapter/web/IntegrationRegistration.ts +57 -0
- package/src/internal/adapter/web/PlayerFacade.ts +281 -0
- package/src/internal/adapter/web/PlayerFacadeAPI.ts +35 -0
- package/src/internal/adapter/web/PlayerFacadeAdsEvents.ts +119 -0
- package/src/internal/adapter/web/PlayerFacadeIntegration.ts +45 -0
- package/src/internal/adapter/web/PlayerFacadeTypes.ts +14 -0
- package/src/internal/drm/ContentProtectionRegistry.ts +35 -17
- package/src/internal/drm/NativeContentProtectionEvent.ts +5 -0
- package/src/manifest.json +1 -1
- package/src/plugins/typedoc-platform-icons/package-lock.json +200 -58
- package/src/plugins/typedoc-platform-icons/package.json +1 -1
- package/src/plugins/typedoc-platform-icons/tsconfig.json +2 -1
- package/lib/typescript/plugins/expo/Common.d.ts +0 -13
- package/lib/typescript/plugins/expo/Common.d.ts.map +0 -1
- package/lib/typescript/plugins/expo/withCustomPod.d.ts +0 -2
- package/lib/typescript/plugins/expo/withCustomPod.d.ts.map +0 -1
- package/lib/typescript/plugins/expo/withTHEOplayer.d.ts +0 -4
- package/lib/typescript/plugins/expo/withTHEOplayer.d.ts.map +0 -1
- package/lib/typescript/plugins/expo/withTHEOplayerAndroid.d.ts +0 -4
- package/lib/typescript/plugins/expo/withTHEOplayerAndroid.d.ts.map +0 -1
- package/lib/typescript/plugins/expo/withTHEOplayerIOS.d.ts +0 -4
- package/lib/typescript/plugins/expo/withTHEOplayerIOS.d.ts.map +0 -1
- package/lib/typescript/plugins/typedoc-platform-icons/src/index.d.ts +0 -3
- package/lib/typescript/plugins/typedoc-platform-icons/src/index.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,44 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [11.8.0] - 18-10-21
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Added the `src`, `srcType`, `provider` and `adSystem` properties to the THEOlive `endpoint` object of the `endpointloaded` event on all platforms.
|
|
13
|
+
- Added the `webrtc` playout delay options to `millicastSrc` on Android.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- Raised the minimum supported THEOplayer SDK version to 11.14.0 on all platforms.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- Fixed an issue where re-registering a content protection integration for the same key system kept the previously registered factory active, causing stale DRM integrations to be used for subsequent sources.
|
|
22
|
+
- Fixed an issue on iOS and Android where certificate and license requests from multiple concurrently playing DRM-protected sources could be processed by the wrong content protection integration, or bypass it entirely, causing license acquisition to fail.
|
|
23
|
+
|
|
24
|
+
## [11.7.0] - 18-09-26
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- Added the `Metrics` API, accessible through `player.metrics`, with `currentBandwidthEstimate` returning the player's estimated available bandwidth in bits per second. On iOS/tvOS this value is only reported for THEOlive/HESP streams.
|
|
29
|
+
- Added `THEOplayer.manageContentMatching` to let the player match the display mode (frame rate and dynamic range) of the TV to the content before playback starts on tvOS.
|
|
30
|
+
- Added a `testID` property on `THEOplayerView` to allow locating the player view from UI automation tools.
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- Fixed media track kind typings to accept audio descriptions and other stream- or platform-specific values without type overrides.
|
|
35
|
+
- Fixed an issue on Android where destroying the player during a pending `MediaPlaybackService` bind could cause a crash.
|
|
36
|
+
- Fixed an issue on Android where the player could remain black when its view was attached after React Native had already assigned the layout.
|
|
37
|
+
- Fixed an issue where `player.paused` remained `true` between the `play` and `playing` events.
|
|
38
|
+
- Fixed an issue on Web and iOS Safari where cues already present when a text track was added, including daterange cues, did not produce `addcue` player events.
|
|
39
|
+
- Fixed an issue where text and media track event listeners were not actually removed when a track was removed.
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- Removed the `RCTRootContentView` import from the iOS bridging header, as it is removed in React Native 0.87.
|
|
44
|
+
- Upgraded example app to support React Native v0.87.1.
|
|
45
|
+
|
|
8
46
|
## [11.6.0]
|
|
9
47
|
|
|
10
48
|
### Added
|
package/README.md
CHANGED
|
@@ -33,6 +33,73 @@ by the `@theoplayer/react-native-ui` package.
|
|
|
33
33
|
It also gives a description of the properties of the `THEOplayerView` component, and
|
|
34
34
|
a list of features and known limitations.
|
|
35
35
|
|
|
36
|
+
### Player facade (Web and Android)
|
|
37
|
+
|
|
38
|
+
Set `usePlayerFacade: true` in the player configuration at creation to enable the facade.
|
|
39
|
+
The default is `false`; iOS and tvOS do not support this option.
|
|
40
|
+
On Web, the facade is available at `player.nativeHandle`.
|
|
41
|
+
Integrations can register through `registerIntegration`, dispatch THEOplayer player
|
|
42
|
+
and ad events (including `adclicked`), and supply a clock through `getCurrentTime()` in
|
|
43
|
+
seconds. The wrapper forwards `adclicked` to React Native's ad-event stream.
|
|
44
|
+
Close the registration before replacing an integration. Playback engines and ad
|
|
45
|
+
schedulers should use `facade.contentPlayer`, not the facade's overridden ad clock.
|
|
46
|
+
|
|
47
|
+
Integrations can provide an `ads` object implementing the Ads API and its event
|
|
48
|
+
subscriptions. The stable public `player.ads` delegates to that object, including
|
|
49
|
+
scheduling queries and controls. Existing listeners migrate when an integration
|
|
50
|
+
registers or closes; native Ads behavior returns after removal. The earlier
|
|
51
|
+
`getAdState()` and `shouldConsumeAdEvent(event)` hooks remain available for
|
|
52
|
+
integrations without an Ads object. The facade never reconstructs ad lifecycle.
|
|
53
|
+
|
|
54
|
+
`getMuted()` / `setMuted(value)` and `getVolume()` / `setVolume(value)` route audio
|
|
55
|
+
through an integration. Setters return `true` when handled; otherwise the facade
|
|
56
|
+
falls back to content. Nullish getter results also fall back to content.
|
|
57
|
+
`registration.dispatchEvent(event)` accepts typed THEOplayer player and ad events.
|
|
58
|
+
Ad events route to `player.ads` listeners; player events such as `playing`, `waiting`,
|
|
59
|
+
and `volumechange` route to `player` listeners. Dispatch does not emit on the content
|
|
60
|
+
player or pass through backing-event interceptors. Closed registrations cannot emit.
|
|
61
|
+
`registration.dispatchPlayerEvent(event)` remains a compatible player-event entry point.
|
|
62
|
+
Playback ownership and audio synchronization remain integration responsibilities.
|
|
63
|
+
|
|
64
|
+
`registration.interceptPlayerEvent(type, callback)` lets an integration inspect a
|
|
65
|
+
backing player event once before facade listeners receive it. Return `true` to
|
|
66
|
+
consume the event, or `false` to forward it. Raw player listeners are unaffected.
|
|
67
|
+
The returned disposer removes the interceptor. Existing interceptors remain until
|
|
68
|
+
disposed or the facade is destroyed, allowing an integration to drain already-queued
|
|
69
|
+
events after unregistering; a closed registration cannot install new interceptors.
|
|
70
|
+
`registration.interceptPlayerEvents(callback)` applies the same policy to every
|
|
71
|
+
subscribed backing-player event, including subscriptions added later. Type-specific
|
|
72
|
+
interceptors run first; integration-dispatched events bypass both kinds. Use a
|
|
73
|
+
type-specific interceptor when an event must be observed even without consumers.
|
|
74
|
+
An optional `isSeeking()` integration hook overrides the public seeking state;
|
|
75
|
+
nullish results fall back to the backing player.
|
|
76
|
+
Pause/seek ownership, pending transitions, lifecycle exceptions and ad lifecycle
|
|
77
|
+
decisions belong to the integration, not the facade.
|
|
78
|
+
|
|
79
|
+
On Android, implement `com.theoplayer.integration.Integration` and call
|
|
80
|
+
`ReactTHEOplayerView.registerIntegration(integration)` after the view is initialized.
|
|
81
|
+
The returned `IntegrationRegistration` supports the same dispatch and interception
|
|
82
|
+
semantics using native Android SDK events. Interceptor disposers implement `Closeable`;
|
|
83
|
+
call `close()` to remove them. Access the raw engine through
|
|
84
|
+
`(view.player as PlayerFacade).contentPlayer`. Time values are in seconds on both platforms.
|
|
85
|
+
Android's `getAdState()` returns a `PlayerFacadeAdState`; its nullable result delegates
|
|
86
|
+
to native Ads. The facade permits registration during native ads and does not infer
|
|
87
|
+
state or suppress native ad events merely because an integration is registered.
|
|
88
|
+
Native SDK extensions (`theoAds`, `ima`, `dai`) resolve against the raw player or Ads
|
|
89
|
+
object through the facade-aware extensions in `com.theoplayer.integration`.
|
|
90
|
+
|
|
91
|
+
Custom advertising must not overlap ongoing native IMA/DAI playback on Android.
|
|
92
|
+
Finish or reset native advertising before taking over. Replacing/filtering native
|
|
93
|
+
ad events can suspend the RN bridge's native DAI bookkeeping, so fresh native state
|
|
94
|
+
after hidden native playback is not guaranteed. `ReactTHEOplayerView.adsApi` remains
|
|
95
|
+
the native source-specific adapter/event sink; use `view.player.ads` for facade state.
|
|
96
|
+
React Native Ads queries and controls use a facade-aware bridge with native fallback.
|
|
97
|
+
|
|
98
|
+
Focused facade regression tests (Node 22.18+):
|
|
99
|
+
`node --test src/__tests__/PlayerFacade.test.ts`.
|
|
100
|
+
Android tests, from `example/android`:
|
|
101
|
+
`./gradlew :react-native-theoplayer:testDebugUnitTest --tests 'com.theoplayer.integration.PlayerFacade*Test' --console=plain`.
|
|
102
|
+
|
|
36
103
|
## Prerequisites
|
|
37
104
|
|
|
38
105
|
For each platform, a dependency to the corresponding THEOplayer SDK is included through a dependency manager:
|
|
@@ -183,11 +250,13 @@ This section gives an overview of features, limitations and known issues:
|
|
|
183
250
|
- [Background playback and notifications](./doc/background.md)
|
|
184
251
|
- [Casting with Chromecast and Airplay](./doc/cast.md)
|
|
185
252
|
- [Common Media Client Data (CMCD)](./doc/cmcd.md)
|
|
253
|
+
- [Content matching on tvOS](./doc/content-matching.md)
|
|
186
254
|
- [Digital Rights Management (DRM)](./doc/drm.md)
|
|
187
255
|
- [Expo](./doc/expo.md)
|
|
188
256
|
- [Fullscreen presentation](./doc/fullscreen.md)
|
|
189
257
|
- [Media Control](./doc/mediacontrol.md)
|
|
190
258
|
- [Media Caching](./doc/media-caching.md)
|
|
259
|
+
- [Metrics](./doc/metrics.md)
|
|
191
260
|
- [Migrating to THEOplayer 9.x](./doc/migrating-to-react-native-theoplayer-9.md)
|
|
192
261
|
- [Migrating to THEOplayer 10.x🔥](./doc/migrating-to-react-native-theoplayer-10.md)
|
|
193
262
|
- [Millicast](./doc/millicast.md)
|
package/android/build.gradle
CHANGED
|
@@ -126,8 +126,8 @@ repositories {
|
|
|
126
126
|
mavenLocal()
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
// The minimum supported THEOplayer version is 11.
|
|
130
|
-
def theoVersion = safeExtGet('THEOplayer_sdk', '[11.
|
|
129
|
+
// The minimum supported THEOplayer version is 11.14.0
|
|
130
|
+
def theoVersion = safeExtGet('THEOplayer_sdk', '[11.14.0, 12.0.0)')
|
|
131
131
|
def theoMediaSessionVersion = safeExtGet('THEOplayer_mediasession', '[11.0.0, 12.0.0)')
|
|
132
132
|
def theoAdsWrapperVersion = "11.0.0"
|
|
133
133
|
def coroutinesVersion = safeExtGet('coroutinesVersion', '1.10.2')
|
|
@@ -167,6 +167,7 @@ dependencies {
|
|
|
167
167
|
implementation("com.theoplayer.theoplayer-sdk-android:core:$theoVersion")
|
|
168
168
|
implementation("com.theoplayer.theoplayer-sdk-android:ads-wrapper:$theoAdsWrapperVersion")
|
|
169
169
|
implementation("com.theoplayer.android-connector:mediasession:$theoMediaSessionVersion")
|
|
170
|
+
testImplementation("junit:junit:4.13.2")
|
|
170
171
|
|
|
171
172
|
addOptiViewIntegration(enabledGoogleIMA || enabledGoogleDAI || enabledTHEOads, 'integration-ads-ima')
|
|
172
173
|
addOptiViewIntegration(enabledGoogleDAI || enabledTHEOads, 'integration-ads-dai')
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.6-bin.zip
|
|
4
4
|
zipStoreBase=GRADLE_USER_HOME
|
|
5
5
|
zipStorePath=wrapper/dists
|
package/android/gradlew
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
#!/
|
|
1
|
+
#!/bin/sh
|
|
2
2
|
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2015 the original
|
|
4
|
+
# Copyright © 2015-2021 the original authors.
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -15,81 +15,115 @@
|
|
|
15
15
|
# See the License for the specific language governing permissions and
|
|
16
16
|
# limitations under the License.
|
|
17
17
|
#
|
|
18
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
19
|
+
#
|
|
18
20
|
|
|
19
21
|
##############################################################################
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
#
|
|
23
|
+
# Gradle start up script for POSIX generated by Gradle.
|
|
24
|
+
#
|
|
25
|
+
# Important for running:
|
|
26
|
+
#
|
|
27
|
+
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
|
28
|
+
# noncompliant, but you have some other compliant shell such as ksh or
|
|
29
|
+
# bash, then to run this script, type that shell name before the whole
|
|
30
|
+
# command line, like:
|
|
31
|
+
#
|
|
32
|
+
# ksh Gradle
|
|
33
|
+
#
|
|
34
|
+
# Busybox and similar reduced shells will NOT work, because this script
|
|
35
|
+
# requires all of these POSIX shell features:
|
|
36
|
+
# * functions;
|
|
37
|
+
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
|
38
|
+
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
|
39
|
+
# * compound commands having a testable exit status, especially «case»;
|
|
40
|
+
# * various built-in commands including «command», «set», and «ulimit».
|
|
41
|
+
#
|
|
42
|
+
# Important for patching:
|
|
43
|
+
#
|
|
44
|
+
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
|
45
|
+
# by Bash, Ksh, etc; in particular arrays are avoided.
|
|
46
|
+
#
|
|
47
|
+
# The "traditional" practice of packing multiple parameters into a
|
|
48
|
+
# space-separated string is a well documented source of bugs and security
|
|
49
|
+
# problems, so this is (mostly) avoided, by progressively accumulating
|
|
50
|
+
# options in "$@", and eventually passing that to Java.
|
|
51
|
+
#
|
|
52
|
+
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
|
53
|
+
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
|
54
|
+
# see the in-line comments for details.
|
|
55
|
+
#
|
|
56
|
+
# There are tweaks for specific operating systems such as AIX, CygWin,
|
|
57
|
+
# Darwin, MinGW, and NonStop.
|
|
58
|
+
#
|
|
59
|
+
# (3) This script is generated from the Groovy template
|
|
60
|
+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
|
61
|
+
# within the Gradle project.
|
|
62
|
+
#
|
|
63
|
+
# You can find Gradle at https://github.com/gradle/gradle/.
|
|
64
|
+
#
|
|
23
65
|
##############################################################################
|
|
24
66
|
|
|
25
67
|
# Attempt to set APP_HOME
|
|
68
|
+
|
|
26
69
|
# Resolve links: $0 may be a link
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
70
|
+
app_path=$0
|
|
71
|
+
|
|
72
|
+
# Need this for daisy-chained symlinks.
|
|
73
|
+
while
|
|
74
|
+
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
|
75
|
+
[ -h "$app_path" ]
|
|
76
|
+
do
|
|
77
|
+
ls=$( ls -ld "$app_path" )
|
|
78
|
+
link=${ls#*' -> '}
|
|
79
|
+
case $link in #(
|
|
80
|
+
/*) app_path=$link ;; #(
|
|
81
|
+
*) app_path=$APP_HOME$link ;;
|
|
82
|
+
esac
|
|
37
83
|
done
|
|
38
|
-
SAVED="`pwd`"
|
|
39
|
-
cd "`dirname \"$PRG\"`/" >/dev/null
|
|
40
|
-
APP_HOME="`pwd -P`"
|
|
41
|
-
cd "$SAVED" >/dev/null
|
|
42
84
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
#
|
|
47
|
-
|
|
85
|
+
# This is normally unused
|
|
86
|
+
# shellcheck disable=SC2034
|
|
87
|
+
APP_BASE_NAME=${0##*/}
|
|
88
|
+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
|
89
|
+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
|
48
90
|
|
|
49
91
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
50
|
-
MAX_FD=
|
|
92
|
+
MAX_FD=maximum
|
|
51
93
|
|
|
52
94
|
warn () {
|
|
53
95
|
echo "$*"
|
|
54
|
-
}
|
|
96
|
+
} >&2
|
|
55
97
|
|
|
56
98
|
die () {
|
|
57
99
|
echo
|
|
58
100
|
echo "$*"
|
|
59
101
|
echo
|
|
60
102
|
exit 1
|
|
61
|
-
}
|
|
103
|
+
} >&2
|
|
62
104
|
|
|
63
105
|
# OS specific support (must be 'true' or 'false').
|
|
64
106
|
cygwin=false
|
|
65
107
|
msys=false
|
|
66
108
|
darwin=false
|
|
67
109
|
nonstop=false
|
|
68
|
-
case "
|
|
69
|
-
CYGWIN* )
|
|
70
|
-
|
|
71
|
-
;;
|
|
72
|
-
|
|
73
|
-
darwin=true
|
|
74
|
-
;;
|
|
75
|
-
MINGW* )
|
|
76
|
-
msys=true
|
|
77
|
-
;;
|
|
78
|
-
NONSTOP* )
|
|
79
|
-
nonstop=true
|
|
80
|
-
;;
|
|
110
|
+
case "$( uname )" in #(
|
|
111
|
+
CYGWIN* ) cygwin=true ;; #(
|
|
112
|
+
Darwin* ) darwin=true ;; #(
|
|
113
|
+
MSYS* | MINGW* ) msys=true ;; #(
|
|
114
|
+
NONSTOP* ) nonstop=true ;;
|
|
81
115
|
esac
|
|
82
116
|
|
|
83
|
-
CLASSPATH
|
|
117
|
+
CLASSPATH="\\\"\\\""
|
|
84
118
|
|
|
85
119
|
|
|
86
120
|
# Determine the Java command to use to start the JVM.
|
|
87
121
|
if [ -n "$JAVA_HOME" ] ; then
|
|
88
122
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
|
89
123
|
# IBM's JDK on AIX uses strange locations for the executables
|
|
90
|
-
JAVACMD
|
|
124
|
+
JAVACMD=$JAVA_HOME/jre/sh/java
|
|
91
125
|
else
|
|
92
|
-
JAVACMD
|
|
126
|
+
JAVACMD=$JAVA_HOME/bin/java
|
|
93
127
|
fi
|
|
94
128
|
if [ ! -x "$JAVACMD" ] ; then
|
|
95
129
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
|
@@ -98,88 +132,120 @@ Please set the JAVA_HOME variable in your environment to match the
|
|
|
98
132
|
location of your Java installation."
|
|
99
133
|
fi
|
|
100
134
|
else
|
|
101
|
-
JAVACMD=
|
|
102
|
-
|
|
135
|
+
JAVACMD=java
|
|
136
|
+
if ! command -v java >/dev/null 2>&1
|
|
137
|
+
then
|
|
138
|
+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
103
139
|
|
|
104
140
|
Please set the JAVA_HOME variable in your environment to match the
|
|
105
141
|
location of your Java installation."
|
|
142
|
+
fi
|
|
106
143
|
fi
|
|
107
144
|
|
|
108
145
|
# Increase the maximum file descriptors if we can.
|
|
109
|
-
if
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
146
|
+
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|
147
|
+
case $MAX_FD in #(
|
|
148
|
+
max*)
|
|
149
|
+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
|
150
|
+
# shellcheck disable=SC2039,SC3045
|
|
151
|
+
MAX_FD=$( ulimit -H -n ) ||
|
|
152
|
+
warn "Could not query maximum file descriptor limit"
|
|
153
|
+
esac
|
|
154
|
+
case $MAX_FD in #(
|
|
155
|
+
'' | soft) :;; #(
|
|
156
|
+
*)
|
|
157
|
+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
|
158
|
+
# shellcheck disable=SC2039,SC3045
|
|
159
|
+
ulimit -n "$MAX_FD" ||
|
|
160
|
+
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
|
161
|
+
esac
|
|
122
162
|
fi
|
|
123
163
|
|
|
124
|
-
#
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
164
|
+
# Collect all arguments for the java command, stacking in reverse order:
|
|
165
|
+
# * args from the command line
|
|
166
|
+
# * the main class name
|
|
167
|
+
# * -classpath
|
|
168
|
+
# * -D...appname settings
|
|
169
|
+
# * --module-path (only if needed)
|
|
170
|
+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
|
128
171
|
|
|
129
172
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
|
130
|
-
if
|
|
131
|
-
APP_HOME
|
|
132
|
-
CLASSPATH
|
|
133
|
-
|
|
134
|
-
JAVACMD
|
|
135
|
-
|
|
136
|
-
# We build the pattern for arguments to be converted via cygpath
|
|
137
|
-
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
138
|
-
SEP=""
|
|
139
|
-
for dir in $ROOTDIRSRAW ; do
|
|
140
|
-
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
141
|
-
SEP="|"
|
|
142
|
-
done
|
|
143
|
-
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
144
|
-
# Add a user-defined pattern to the cygpath arguments
|
|
145
|
-
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
146
|
-
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
147
|
-
fi
|
|
173
|
+
if "$cygwin" || "$msys" ; then
|
|
174
|
+
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
|
175
|
+
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
|
176
|
+
|
|
177
|
+
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
|
178
|
+
|
|
148
179
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
180
|
+
for arg do
|
|
181
|
+
if
|
|
182
|
+
case $arg in #(
|
|
183
|
+
-*) false ;; # don't mess with options #(
|
|
184
|
+
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
|
185
|
+
[ -e "$t" ] ;; #(
|
|
186
|
+
*) false ;;
|
|
187
|
+
esac
|
|
188
|
+
then
|
|
189
|
+
arg=$( cygpath --path --ignore --mixed "$arg" )
|
|
158
190
|
fi
|
|
159
|
-
|
|
191
|
+
# Roll the args list around exactly as many times as the number of
|
|
192
|
+
# args, so each arg winds up back in the position where it started, but
|
|
193
|
+
# possibly modified.
|
|
194
|
+
#
|
|
195
|
+
# NB: a `for` loop captures its iteration list before it begins, so
|
|
196
|
+
# changing the positional parameters here affects neither the number of
|
|
197
|
+
# iterations, nor the values presented in `arg`.
|
|
198
|
+
shift # remove old arg
|
|
199
|
+
set -- "$@" "$arg" # push replacement arg
|
|
160
200
|
done
|
|
161
|
-
case $i in
|
|
162
|
-
0) set -- ;;
|
|
163
|
-
1) set -- "$args0" ;;
|
|
164
|
-
2) set -- "$args0" "$args1" ;;
|
|
165
|
-
3) set -- "$args0" "$args1" "$args2" ;;
|
|
166
|
-
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
167
|
-
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
168
|
-
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
169
|
-
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
170
|
-
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
171
|
-
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
172
|
-
esac
|
|
173
201
|
fi
|
|
174
202
|
|
|
175
|
-
# Escape application args
|
|
176
|
-
save () {
|
|
177
|
-
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
|
178
|
-
echo " "
|
|
179
|
-
}
|
|
180
|
-
APP_ARGS=`save "$@"`
|
|
181
203
|
|
|
182
|
-
#
|
|
183
|
-
|
|
204
|
+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
205
|
+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
206
|
+
|
|
207
|
+
# Collect all arguments for the java command:
|
|
208
|
+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
|
209
|
+
# and any embedded shellness will be escaped.
|
|
210
|
+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
|
211
|
+
# treated as '${Hostname}' itself on the command line.
|
|
212
|
+
|
|
213
|
+
set -- \
|
|
214
|
+
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
|
215
|
+
-classpath "$CLASSPATH" \
|
|
216
|
+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
|
217
|
+
"$@"
|
|
218
|
+
|
|
219
|
+
# Stop when "xargs" is not available.
|
|
220
|
+
if ! command -v xargs >/dev/null 2>&1
|
|
221
|
+
then
|
|
222
|
+
die "xargs is not available"
|
|
223
|
+
fi
|
|
224
|
+
|
|
225
|
+
# Use "xargs" to parse quoted args.
|
|
226
|
+
#
|
|
227
|
+
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
|
228
|
+
#
|
|
229
|
+
# In Bash we could simply go:
|
|
230
|
+
#
|
|
231
|
+
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
|
232
|
+
# set -- "${ARGS[@]}" "$@"
|
|
233
|
+
#
|
|
234
|
+
# but POSIX shell has neither arrays nor command substitution, so instead we
|
|
235
|
+
# post-process each arg (as a line of input to sed) to backslash-escape any
|
|
236
|
+
# character that might be a shell metacharacter, then use eval to reverse
|
|
237
|
+
# that process (while maintaining the separation between arguments), and wrap
|
|
238
|
+
# the whole thing up as a single "set" statement.
|
|
239
|
+
#
|
|
240
|
+
# This will of course break if any of these variables contains a newline or
|
|
241
|
+
# an unmatched quote.
|
|
242
|
+
#
|
|
243
|
+
|
|
244
|
+
eval "set -- $(
|
|
245
|
+
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
|
246
|
+
xargs -n1 |
|
|
247
|
+
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
|
248
|
+
tr '\n' ' '
|
|
249
|
+
)" '"$@"'
|
|
184
250
|
|
|
185
251
|
exec "$JAVACMD" "$@"
|
package/android/gradlew.bat
CHANGED
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
@rem See the License for the specific language governing permissions and
|
|
14
14
|
@rem limitations under the License.
|
|
15
15
|
@rem
|
|
16
|
+
@rem SPDX-License-Identifier: Apache-2.0
|
|
17
|
+
@rem
|
|
16
18
|
|
|
17
|
-
@if "%DEBUG%"
|
|
19
|
+
@if "%DEBUG%"=="" @echo off
|
|
18
20
|
@rem ##########################################################################
|
|
19
21
|
@rem
|
|
20
22
|
@rem Gradle startup script for Windows
|
|
@@ -25,7 +27,8 @@
|
|
|
25
27
|
if "%OS%"=="Windows_NT" setlocal
|
|
26
28
|
|
|
27
29
|
set DIRNAME=%~dp0
|
|
28
|
-
if "%DIRNAME%"
|
|
30
|
+
if "%DIRNAME%"=="" set DIRNAME=.
|
|
31
|
+
@rem This is normally unused
|
|
29
32
|
set APP_BASE_NAME=%~n0
|
|
30
33
|
set APP_HOME=%DIRNAME%
|
|
31
34
|
|
|
@@ -40,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
|
|
40
43
|
|
|
41
44
|
set JAVA_EXE=java.exe
|
|
42
45
|
%JAVA_EXE% -version >NUL 2>&1
|
|
43
|
-
if
|
|
46
|
+
if %ERRORLEVEL% equ 0 goto execute
|
|
44
47
|
|
|
45
|
-
echo.
|
|
46
|
-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
47
|
-
echo.
|
|
48
|
-
echo Please set the JAVA_HOME variable in your environment to match the
|
|
49
|
-
echo location of your Java installation.
|
|
48
|
+
echo. 1>&2
|
|
49
|
+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
|
50
|
+
echo. 1>&2
|
|
51
|
+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
|
52
|
+
echo location of your Java installation. 1>&2
|
|
50
53
|
|
|
51
54
|
goto fail
|
|
52
55
|
|
|
@@ -56,32 +59,34 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
|
56
59
|
|
|
57
60
|
if exist "%JAVA_EXE%" goto execute
|
|
58
61
|
|
|
59
|
-
echo.
|
|
60
|
-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
|
61
|
-
echo.
|
|
62
|
-
echo Please set the JAVA_HOME variable in your environment to match the
|
|
63
|
-
echo location of your Java installation.
|
|
62
|
+
echo. 1>&2
|
|
63
|
+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
|
64
|
+
echo. 1>&2
|
|
65
|
+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
|
66
|
+
echo location of your Java installation. 1>&2
|
|
64
67
|
|
|
65
68
|
goto fail
|
|
66
69
|
|
|
67
70
|
:execute
|
|
68
71
|
@rem Setup the command line
|
|
69
72
|
|
|
70
|
-
set CLASSPATH
|
|
73
|
+
set CLASSPATH=
|
|
71
74
|
|
|
72
75
|
|
|
73
76
|
@rem Execute Gradle
|
|
74
|
-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%"
|
|
77
|
+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
|
75
78
|
|
|
76
79
|
:end
|
|
77
80
|
@rem End local scope for the variables with windows NT shell
|
|
78
|
-
if
|
|
81
|
+
if %ERRORLEVEL% equ 0 goto mainEnd
|
|
79
82
|
|
|
80
83
|
:fail
|
|
81
84
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
82
85
|
rem the _cmd.exe /c_ return code!
|
|
83
|
-
|
|
84
|
-
|
|
86
|
+
set EXIT_CODE=%ERRORLEVEL%
|
|
87
|
+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
|
88
|
+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
|
89
|
+
exit /b %EXIT_CODE%
|
|
85
90
|
|
|
86
91
|
:mainEnd
|
|
87
92
|
if "%OS%"=="Windows_NT" endlocal
|
|
@@ -47,6 +47,7 @@ private const val PROP_THEOLIVE_DISCOVERY_URL = "discoveryUrl"
|
|
|
47
47
|
private const val PROP_HLS_DATERANGE = "hlsDateRange"
|
|
48
48
|
private const val PROP_MULTIMEDIA_TUNNELING_ENABLED = "tunnelingEnabled"
|
|
49
49
|
private const val PROP_DEBUG_LOGS_ENABLED = "debugLogsEnabled"
|
|
50
|
+
private const val PROP_USE_PLAYER_FACADE = "usePlayerFacade"
|
|
50
51
|
private const val PROP_SYSTEM_CAPTION_STYLE = "useSystemCaptionStyle"
|
|
51
52
|
private const val PROP_CMCD = "cmcd"
|
|
52
53
|
private const val PROP_CMCD_EXTERNAL_SESSION_ID = "externalSessionId"
|
|
@@ -57,6 +58,11 @@ private const val PROP_CMCD_ENDPOINT_URL = "url"
|
|
|
57
58
|
|
|
58
59
|
class PlayerConfigAdapter(private val configProps: ReadableMap?) {
|
|
59
60
|
|
|
61
|
+
/** Returns whether the player facade is enabled at creation. Missing or null values default to false. */
|
|
62
|
+
fun usePlayerFacade(): Boolean = configProps?.let {
|
|
63
|
+
it.hasKey(PROP_USE_PLAYER_FACADE) && !it.isNull(PROP_USE_PLAYER_FACADE) && it.getBoolean(PROP_USE_PLAYER_FACADE)
|
|
64
|
+
} ?: false
|
|
65
|
+
|
|
60
66
|
/**
|
|
61
67
|
* Whether debug logs from the native SDK should be enabled.
|
|
62
68
|
*/
|
|
@@ -12,7 +12,7 @@ import com.facebook.react.uimanager.common.UIManagerType
|
|
|
12
12
|
import com.theoplayer.ads.AdEventAdapter
|
|
13
13
|
import com.theoplayer.ads.AdEventAdapter.AdEventEmitter
|
|
14
14
|
import com.theoplayer.android.api.THEOplayerGlobal
|
|
15
|
-
import com.theoplayer.
|
|
15
|
+
import com.theoplayer.integration.theoAds
|
|
16
16
|
import com.theoplayer.android.api.error.THEOplayerException
|
|
17
17
|
import com.theoplayer.android.api.event.EventListener
|
|
18
18
|
import com.theoplayer.android.api.event.EventType
|
|
@@ -412,7 +412,7 @@ class PlayerEventEmitter internal constructor(
|
|
|
412
412
|
private fun onPause() {
|
|
413
413
|
val player = playerView.player
|
|
414
414
|
// Do not forward the pause event in case the content player is paused because the ad player starts.
|
|
415
|
-
if (player != null && (!playerView.
|
|
415
|
+
if (player != null && (!playerView.adBridge.isPlaying || player.isPaused)) {
|
|
416
416
|
receiveEvent(EVENT_PAUSE, null)
|
|
417
417
|
}
|
|
418
418
|
}
|