react-native-theoplayer 8.18.0 → 9.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +1 -0
  3. package/android/build.gradle +19 -29
  4. package/android/local/com/theoplayer/theoplayer-sdk-android/ads-wrapper/9.0.0/ads-wrapper-9.0.0.aar +0 -0
  5. package/android/local/com/theoplayer/theoplayer-sdk-android/ads-wrapper/{8.0.0/ads-wrapper-8.0.0.pom → 9.0.0/ads-wrapper-9.0.0.pom} +3 -3
  6. package/android/local/com/theoplayer/theoplayer-sdk-android/ads-wrapper/maven-metadata-local.xml +4 -4
  7. package/android/src/main/java/com/theoplayer/PlayerConfigAdapter.kt +6 -18
  8. package/android/src/main/java/com/theoplayer/ReactTHEOplayerContext.kt +3 -25
  9. package/android/src/main/java/com/theoplayer/ReactTHEOplayerViewManager.kt +1 -8
  10. package/android/src/main/java/com/theoplayer/ads/AdAdapter.kt +24 -31
  11. package/android/src/main/java/com/theoplayer/ads/AdEventAdapter.kt +1 -1
  12. package/android/src/main/java/com/theoplayer/cache/CacheAdapter.kt +12 -0
  13. package/android/src/main/java/com/theoplayer/drm/ContentProtectionAdapter.kt +3 -1
  14. package/android/src/main/java/com/theoplayer/drm/ContentProtectionModule.kt +1 -1
  15. package/android/src/main/java/com/theoplayer/source/SourceAdapter.kt +11 -0
  16. package/android/src/main/java/com/theoplayer/track/TrackListAdapter.kt +1 -1
  17. package/ios/THEOplayerRCTTrackMetadataAggregator.swift +2 -11
  18. package/lib/commonjs/api/cache/CachingTaskParameters.js +17 -0
  19. package/lib/commonjs/api/cache/CachingTaskParameters.js.map +1 -1
  20. package/lib/commonjs/api/source/SourceDescription.js +12 -1
  21. package/lib/commonjs/api/source/SourceDescription.js.map +1 -1
  22. package/lib/commonjs/api/source/ads/Ads.js +0 -2
  23. package/lib/commonjs/api/source/ads/Ads.js.map +1 -1
  24. package/lib/commonjs/internal/THEOplayerView.web.js +2 -15
  25. package/lib/commonjs/internal/THEOplayerView.web.js.map +1 -1
  26. package/lib/commonjs/manifest.json +1 -1
  27. package/lib/module/api/cache/CachingTaskParameters.js +17 -1
  28. package/lib/module/api/cache/CachingTaskParameters.js.map +1 -1
  29. package/lib/module/api/source/SourceDescription.js +12 -0
  30. package/lib/module/api/source/SourceDescription.js.map +1 -1
  31. package/lib/module/api/source/ads/Ads.js +0 -2
  32. package/lib/module/api/source/ads/Ads.js.map +1 -1
  33. package/lib/module/internal/THEOplayerView.web.js +3 -16
  34. package/lib/module/internal/THEOplayerView.web.js.map +1 -1
  35. package/lib/module/manifest.json +1 -1
  36. package/lib/typescript/api/ads/GoogleImaAd.d.ts +8 -0
  37. package/lib/typescript/api/ads/GoogleImaAd.d.ts.map +1 -1
  38. package/lib/typescript/api/cache/CachingTaskParameters.d.ts +34 -0
  39. package/lib/typescript/api/cache/CachingTaskParameters.d.ts.map +1 -1
  40. package/lib/typescript/api/config/PlayerConfiguration.d.ts +14 -25
  41. package/lib/typescript/api/config/PlayerConfiguration.d.ts.map +1 -1
  42. package/lib/typescript/api/source/SourceDescription.d.ts +29 -0
  43. package/lib/typescript/api/source/SourceDescription.d.ts.map +1 -1
  44. package/lib/typescript/api/source/ads/Ads.d.ts +0 -2
  45. package/lib/typescript/api/source/ads/Ads.d.ts.map +1 -1
  46. package/lib/typescript/api/source/ads/ssai/GoogleDAIConfiguration.d.ts +9 -0
  47. package/lib/typescript/api/source/ads/ssai/GoogleDAIConfiguration.d.ts.map +1 -1
  48. package/lib/typescript/api/source/dash/DashPlaybackConfiguration.d.ts +9 -0
  49. package/lib/typescript/api/source/dash/DashPlaybackConfiguration.d.ts.map +1 -1
  50. package/lib/typescript/internal/THEOplayerView.web.d.ts.map +1 -1
  51. package/package.json +4 -4
  52. package/react-native-theoplayer.podspec +7 -7
  53. package/src/api/ads/GoogleImaAd.ts +9 -0
  54. package/src/api/cache/CachingTaskParameters.ts +37 -0
  55. package/src/api/config/PlayerConfiguration.ts +14 -27
  56. package/src/api/source/SourceDescription.ts +32 -0
  57. package/src/api/source/ads/Ads.ts +0 -2
  58. package/src/api/source/ads/ssai/GoogleDAIConfiguration.ts +10 -0
  59. package/src/api/source/dash/DashPlaybackConfiguration.ts +10 -0
  60. package/src/internal/THEOplayerView.web.tsx +3 -20
  61. package/src/manifest.json +1 -1
  62. package/android/local/com/theoplayer/theoplayer-sdk-android/ads-wrapper/8.0.0/ads-wrapper-8.0.0.aar +0 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,36 @@ 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
+ ## [9.0.1] - 25-04-08
9
+
10
+ ### Fixed
11
+
12
+ - Fixed an issue on Android where an app would sometimes crash while receiving the license response when using a custom DRM integration.
13
+
14
+ ### Added
15
+
16
+ - Added supported for multimedia tunneling on Android using the Media3 playback pipeline. More info on the [documentation](./doc/media3.md#multimedia-tunneling) page.
17
+
18
+ ## [9.0.0] - 25-04-04
19
+
20
+ ### Removed
21
+
22
+ - Removed `chromeless` property from `PlayerConfiguration`. Only React Native based UIs are supported.
23
+ - Removed ad integration kind `theo`.
24
+ - Removed `enableTHEOlive` property from `PlayerConfiguration` as THEOlive is always enabled.
25
+
26
+ ### Added
27
+
28
+ - Added `liveOffset` property to `SourceDescription` for Web and Android platforms.
29
+ - Added `description` property for Google IMA ads on Web and Android platforms.
30
+ - Added `networkCode` property for Google DAI configuration on Web platforms.
31
+ - Added `segmentRelativeVttTiming` property on `DashPlaybackConfiguration` for Web to indicate whether segmented WebVTT files' timestamps should be considered relative to the segment start time.
32
+ - Added `storageType` to `CachingTaskParameters` to allow writing to either the legacy cache or Media3 cache on Android.
33
+
34
+ ### Changed
35
+
36
+ - Reverted DataRangeCue timings calculation on iOS (based on programDateTime offset). Correct values are provided by the native SDK.
37
+
8
38
  ## [8.18.0] - 25-04-02
9
39
 
10
40
  ### Changed
package/README.md CHANGED
@@ -182,6 +182,7 @@ This section gives an overview of features, limitations and known issues:
182
182
  - [Digital Rights Management (DRM)](./doc/drm.md)
183
183
  - [Fullscreen presentation](./doc/fullscreen.md)
184
184
  - [Media Caching](./doc/media-caching.md)
185
+ - [Migrating to THEOplayer 9.x🔥](./doc/migrating-to-react-native-theoplayer-9.md)
185
186
  - [Picture-in-Picture (PiP)](./doc/pip.md)
186
187
  - [Subtitles, Closed Captions and Metadata tracks](./doc/texttracks.md)
187
188
  - [Limitations and known issues](./doc/limitations.md)
@@ -40,7 +40,6 @@ def enabledTHEOads = safeExtGet("THEOplayer_extensionTHEOads", 'false').toBoolea
40
40
  def enabledAds = enabledGoogleIMA || enabledGoogleDAI || enabledTHEOads
41
41
  def enabledCast = safeExtGet("THEOplayer_extensionCast", 'false').toBoolean()
42
42
  def enabledMediaSession = safeExtGet("THEOplayer_extensionMediaSession", 'true').toBoolean()
43
- def enabledMedia3 = safeExtGet("THEOplayer_extensionMedia3", 'false').toBoolean()
44
43
 
45
44
  android {
46
45
  compileSdk safeExtGet('THEOplayer_compileSdkVersion', 34)
@@ -76,7 +75,6 @@ android {
76
75
  buildConfigField "boolean", "EXTENSION_ADS", "${enabledAds}"
77
76
  buildConfigField "boolean", "EXTENSION_CAST", "${enabledCast}"
78
77
  buildConfigField "boolean", "EXTENSION_MEDIASESSION", "${enabledMediaSession}"
79
- buildConfigField "boolean", "EXTENSION_MEDIA3", "${enabledMedia3}"
80
78
 
81
79
  buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
82
80
 
@@ -125,70 +123,62 @@ repositories {
125
123
  maven { url "https://maven.theoplayer.com/releases" }
126
124
  }
127
125
 
128
- // The minimum supported THEOplayer version is 8.5.1
129
- def theoplayer_sdk_version = safeExtGet('THEOplayer_sdk', '[8.5.1, 9.0.0)')
130
- def theoplayer_mediasession_version = safeExtGet('THEOplayer_mediasession', '[8.0.0, 9.0.0)')
126
+ // The minimum supported THEOplayer version is 9.0.0
127
+ def theoplayer_sdk_version = safeExtGet('THEOplayer_sdk', '[9.0.0, 10.0.0)')
128
+ def theoplayer_mediasession_version = safeExtGet('THEOplayer_mediasession', '[8.0.0, 10.0.0)')
129
+ def theoplayer_ads_wrapper_version = "9.0.0"
131
130
 
132
131
  dependencies {
133
132
  //noinspection GradleDynamicVersion
134
133
  implementation "com.facebook.react:react-native:+" // From node_modules
135
134
  implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${safeExtGet('coroutinesVersion', '1.7.3')}"
136
135
  implementation "androidx.appcompat:appcompat:${safeExtGet('appcompatVersion', '1.6.1')}"
137
- implementation "androidx.core:core-ktx:${safeExtGet('corektxVersion', '1.10.1')}"
136
+ implementation "androidx.core:core-ktx:${safeExtGet('corektxVersion', '1.13.1')}"
138
137
  implementation "com.google.code.gson:gson:2.11.0"
139
138
 
140
139
  println("Using THEOplayer (${versionString(theoplayer_sdk_version)})")
141
- implementation "com.theoplayer.theoplayer-sdk-android:core:${theoplayer_sdk_version}"
142
- implementation "com.theoplayer.theoplayer-sdk-android:ads-wrapper:8.0.0"
143
- implementation "com.theoplayer.android-connector:mediasession:${theoplayer_mediasession_version}"
140
+ implementation "com.theoplayer.theoplayer-sdk-android:core:$theoplayer_sdk_version"
141
+ implementation "com.theoplayer.theoplayer-sdk-android:ads-wrapper:$theoplayer_ads_wrapper_version"
142
+ implementation "com.theoplayer.android-connector:mediasession:$theoplayer_mediasession_version"
144
143
 
145
144
  if (enabledGoogleIMA) {
146
145
  println('Enable THEOplayer IMA extension.')
147
- implementation "com.theoplayer.theoplayer-sdk-android:integration-ads-ima:${theoplayer_sdk_version}"
146
+ implementation "com.theoplayer.theoplayer-sdk-android:integration-ads-ima:$theoplayer_sdk_version"
148
147
  } else {
149
148
  println('Disable THEOplayer IMA extension.')
150
- compileOnly "com.theoplayer.theoplayer-sdk-android:integration-ads-ima:${theoplayer_sdk_version}"
149
+ compileOnly "com.theoplayer.theoplayer-sdk-android:integration-ads-ima:$theoplayer_sdk_version"
151
150
  }
152
151
 
153
152
  if (enabledGoogleDAI) {
154
153
  println('Enable THEOplayer DAI extension.')
155
- implementation "com.theoplayer.theoplayer-sdk-android:integration-ads-dai:${theoplayer_sdk_version}"
154
+ implementation "com.theoplayer.theoplayer-sdk-android:integration-ads-dai:$theoplayer_sdk_version"
156
155
  } else {
157
156
  println('Disable THEOplayer DAI extension.')
158
- compileOnly "com.theoplayer.theoplayer-sdk-android:integration-ads-dai:${theoplayer_sdk_version}"
157
+ compileOnly "com.theoplayer.theoplayer-sdk-android:integration-ads-dai:$theoplayer_sdk_version"
159
158
  }
160
159
 
161
160
  if (enabledTHEOads) {
162
161
  println('Enable THEOplayer THEOads extension.')
163
- implementation "com.theoplayer.theoplayer-sdk-android:integration-ads-theoads:${theoplayer_sdk_version}"
162
+ implementation "com.theoplayer.theoplayer-sdk-android:integration-ads-theoads:$theoplayer_sdk_version"
164
163
  } else {
165
164
  println('Disable THEOplayer THEOads extension.')
166
- compileOnly "com.theoplayer.theoplayer-sdk-android:integration-ads-theoads:${theoplayer_sdk_version}"
165
+ compileOnly "com.theoplayer.theoplayer-sdk-android:integration-ads-theoads:$theoplayer_sdk_version"
167
166
  }
168
167
 
169
168
  if (enabledCast) {
170
169
  println('Enable THEOplayer cast extension.')
171
- implementation "com.theoplayer.theoplayer-sdk-android:integration-cast:${theoplayer_sdk_version}"
170
+ implementation "com.theoplayer.theoplayer-sdk-android:integration-cast:$theoplayer_sdk_version"
172
171
  } else {
173
172
  println('Disable THEOplayer cast extension.')
174
- compileOnly "com.theoplayer.theoplayer-sdk-android:integration-cast:${theoplayer_sdk_version}"
175
- }
176
-
177
- if (enabledMedia3) {
178
- println('Enable THEOplayer media3 extension.')
179
- implementation "com.theoplayer.theoplayer-sdk-android:integration-media3:${theoplayer_sdk_version}"
180
- } else {
181
- println('Disable THEOplayer media3 extension.')
182
- compileOnly "com.theoplayer.theoplayer-sdk-android:integration-media3:${theoplayer_sdk_version}"
173
+ compileOnly "com.theoplayer.theoplayer-sdk-android:integration-cast:$theoplayer_sdk_version"
183
174
  }
184
175
  }
185
176
 
186
177
  // Make sure to align all ads extension versions
187
178
  configurations.configureEach {
188
179
  resolutionStrategy {
189
- force "com.theoplayer.theoplayer-sdk-android:integration-ads-ima:${theoplayer_sdk_version}"
190
- force "com.theoplayer.theoplayer-sdk-android:integration-ads-dai:${theoplayer_sdk_version}"
191
- force "com.theoplayer.theoplayer-sdk-android:integration-ads-theoads:${theoplayer_sdk_version}"
180
+ force "com.theoplayer.theoplayer-sdk-android:integration-ads-ima:$theoplayer_sdk_version"
181
+ force "com.theoplayer.theoplayer-sdk-android:integration-ads-dai:$theoplayer_sdk_version"
182
+ force "com.theoplayer.theoplayer-sdk-android:integration-ads-theoads:$theoplayer_sdk_version"
192
183
  }
193
184
  }
194
-
@@ -1,17 +1,17 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3
3
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4
- <modelVersion>8.0.0</modelVersion>
4
+ <modelVersion>9.0.0</modelVersion>
5
5
  <groupId>com.theoplayer.theoplayer-sdk-android</groupId>
6
6
  <artifactId>ads-wrapper</artifactId>
7
- <version>8.0.0</version>
7
+ <version>9.0.0</version>
8
8
  <packaging>aar</packaging>
9
9
  <dependencies>
10
10
  <!-- Include transitive dependencies -->
11
11
  <dependency>
12
12
  <groupId>com.theoplayer.theoplayer-sdk-android</groupId>
13
13
  <artifactId>integration-ads-ima</artifactId>
14
- <version>[8.0.0,)</version>
14
+ <version>[9.0.0,10.0.0)</version>
15
15
  <scope>runtime</scope>
16
16
  </dependency>
17
17
  </dependencies>
@@ -3,11 +3,11 @@
3
3
  <groupId>com.theoplayer.theoplayer-sdk-android</groupId>
4
4
  <artifactId>ads-wrapper</artifactId>
5
5
  <versioning>
6
- <latest>8.0.0</latest>
7
- <release>8.0.0</release>
6
+ <latest>9.0.0</latest>
7
+ <release>9.0.0</release>
8
8
  <versions>
9
- <version>8.0.0</version>
9
+ <version>9.0.0</version>
10
10
  </versions>
11
- <lastUpdated>20240909163212</lastUpdated>
11
+ <lastUpdated>20250327163212</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -17,12 +17,9 @@ import com.theoplayer.media.MediaSessionConfigAdapter
17
17
  private const val PROP_LICENSE = "license"
18
18
  private const val PROP_LICENSE_URL = "licenseUrl"
19
19
  private const val PROP_PRELOAD = "preload"
20
- private const val PROP_LIVE_OFFSET = "liveOffset"
21
20
  private const val PROP_UI_ENABLED = "uiEnabled"
22
21
  private const val PROP_CAST_STRATEGY = "strategy"
23
22
  private const val PROP_RETRY_CONFIG = "retryConfiguration"
24
- private const val PROP_HLS_DATE_RANGE = "hlsDateRange"
25
- private const val PROP_USE_MEDIA3 = "useMedia3"
26
23
  private const val PROP_RETRY_MAX_RETRIES = "maxRetries"
27
24
  private const val PROP_RETRY_MIN_BACKOFF = "minimumBackoff"
28
25
  private const val PROP_RETRY_MAX_BACKOFF = "maximumBackoff"
@@ -42,15 +39,10 @@ private const val PROP_ALLOWED_MIMETYPES = "allowedMimeTypes"
42
39
  private const val PROP_THEOLIVE_CONFIG = "theoLive"
43
40
  private const val PROP_THEOLIVE_EXTERNAL_SESSION_ID = "externalSessionId"
44
41
  private const val PROP_THEOLIVE_ANALYTICS_DISABLED = "analyticsDisabled"
42
+ private const val PROP_MULTIMEDIA_TUNNELING_ENABLED = "tunnelingEnabled"
45
43
 
46
44
  class PlayerConfigAdapter(private val configProps: ReadableMap?) {
47
45
 
48
- /**
49
- * Whether the Media3 extension is used for play-out.
50
- */
51
- var useMedia3: Boolean = false
52
- private set
53
-
54
46
  /**
55
47
  * Get general THEOplayerConfig object; these properties apply:
56
48
  * - license: The license for the player.
@@ -69,19 +61,15 @@ class PlayerConfigAdapter(private val configProps: ReadableMap?) {
69
61
  if (hasKey(PROP_RETRY_CONFIG)) {
70
62
  networkConfiguration(networkConfig())
71
63
  }
72
- if (hasKey(PROP_LIVE_OFFSET)) {
73
- liveOffset(getDouble(PROP_LIVE_OFFSET))
74
- }
75
- if (hasKey(PROP_HLS_DATE_RANGE)) {
76
- hlsDateRange(getBoolean(PROP_HLS_DATE_RANGE))
77
- }
78
- if (hasKey(PROP_USE_MEDIA3)) {
79
- useMedia3 = getBoolean(PROP_USE_MEDIA3)
80
- }
81
64
  if (hasKey(PROP_THEOLIVE_CONFIG)) {
82
65
  theoLiveConfiguration(theoLiveConfig())
83
66
  }
84
67
  pipConfiguration(PipConfiguration.Builder().build())
68
+ // Opt-out for auto-integrations for now
69
+ autoIntegrations(false)
70
+ if (hasKey(PROP_MULTIMEDIA_TUNNELING_ENABLED)) {
71
+ tunnelingEnabled(getBoolean(PROP_MULTIMEDIA_TUNNELING_ENABLED))
72
+ }
85
73
  }
86
74
  }.build()
87
75
  }
@@ -17,6 +17,7 @@ import com.facebook.react.uimanager.ThemedReactContext
17
17
  import com.theoplayer.android.api.THEOplayerView
18
18
  import com.theoplayer.android.api.ads.dai.GoogleDaiIntegration
19
19
  import com.theoplayer.android.api.ads.dai.GoogleDaiIntegrationFactory
20
+ import com.theoplayer.android.api.ads.ima.GoogleImaConfiguration
20
21
  import com.theoplayer.android.api.ads.ima.GoogleImaIntegration
21
22
  import com.theoplayer.android.api.ads.ima.GoogleImaIntegrationFactory
22
23
  import com.theoplayer.android.api.ads.theoads.TheoAdDescription
@@ -26,8 +27,6 @@ import com.theoplayer.android.api.cast.CastIntegration
26
27
  import com.theoplayer.android.api.cast.CastIntegrationFactory
27
28
  import com.theoplayer.android.api.event.EventListener
28
29
  import com.theoplayer.android.api.event.player.*
29
- import com.theoplayer.android.api.media3.Media3PlayerIntegration
30
- import com.theoplayer.android.api.media3.Media3PlayerIntegrationFactory
31
30
  import com.theoplayer.android.api.player.Player
32
31
  import com.theoplayer.android.api.player.RenderingTarget
33
32
  import com.theoplayer.android.connector.mediasession.MediaSessionConnector
@@ -90,7 +89,6 @@ class ReactTHEOplayerContext private constructor(
90
89
  private var theoAdsIntegration: TheoAdsIntegration? = null
91
90
  var castIntegration: CastIntegration? = null
92
91
  @Suppress("UnstableApiUsage")
93
- private var media3Integration: Media3PlayerIntegration? = null
94
92
  var wasPlayingOnHostPause: Boolean = false
95
93
  private var isHostPaused: Boolean = false
96
94
 
@@ -290,7 +288,7 @@ class ReactTHEOplayerContext private constructor(
290
288
  try {
291
289
  if (BuildConfig.EXTENSION_GOOGLE_IMA) {
292
290
  imaIntegration = GoogleImaIntegrationFactory.createGoogleImaIntegration(
293
- playerView, configAdapter.imaSdkSettings()
291
+ playerView, GoogleImaConfiguration(configAdapter.imaSdkSettings())
294
292
  ).apply {
295
293
  setAdsRenderingSettings(configAdapter.adsRenderSettings())
296
294
  }.also {
@@ -303,7 +301,7 @@ class ReactTHEOplayerContext private constructor(
303
301
  try {
304
302
  if (BuildConfig.EXTENSION_GOOGLE_DAI) {
305
303
  daiIntegration = GoogleDaiIntegrationFactory.createGoogleDaiIntegration(
306
- playerView, configAdapter.imaSdkSettings()
304
+ playerView, GoogleImaConfiguration(configAdapter.imaSdkSettings())
307
305
  ).apply {
308
306
  setAdsRenderingSettings(configAdapter.adsRenderSettings())
309
307
  }.also {
@@ -335,26 +333,6 @@ class ReactTHEOplayerContext private constructor(
335
333
  } catch (e: Exception) {
336
334
  Log.w(TAG, "Failed to configure Cast integration ${e.message}")
337
335
  }
338
- try {
339
- if (BuildConfig.EXTENSION_MEDIA3) {
340
- @Suppress("UnstableApiUsage")
341
- media3Integration =
342
- Media3PlayerIntegrationFactory.createMedia3PlayerIntegration { _, source ->
343
- // selectedSource -> represents the TypedSource the player picked to play.
344
- // source -> represents the SourceDescription passed to the player.
345
- // return true -> the Media3 integration pipeline will be used to play the selected source.
346
- // return false -> the default pipeline will be used to play the selected source.
347
- //
348
- // @remark If the source contains THEOads, media3 is always enabled.
349
- configAdapter.useMedia3 ||
350
- (BuildConfig.EXTENSION_THEOADS && source.ads.any { it is TheoAdDescription })
351
- }
352
- playerView.player.addIntegration(media3Integration)
353
- }
354
- } catch (e: Exception) {
355
- Log.w(TAG, "Failed to configure Cast integration ${e.message}")
356
- }
357
-
358
336
  // Add other future integrations here.
359
337
  }
360
338
 
@@ -1,12 +1,9 @@
1
- @file:Suppress("unused")
2
-
3
1
  package com.theoplayer
4
2
 
5
3
  import com.facebook.react.uimanager.ViewGroupManager
6
4
  import com.facebook.react.uimanager.ThemedReactContext
7
5
  import com.facebook.react.uimanager.annotations.ReactProp
8
6
  import com.facebook.react.bridge.ReadableMap
9
- import com.facebook.react.common.MapBuilder
10
7
 
11
8
  private const val REACT_CLASS = "THEOplayerRCTView"
12
9
 
@@ -35,10 +32,6 @@ class ReactTHEOplayerViewManager : ViewGroupManager<ReactTHEOplayerView>() {
35
32
  }
36
33
 
37
34
  override fun getExportedCustomDirectEventTypeConstants(): Map<String, Any> {
38
- val builder = MapBuilder.builder<String, Any>()
39
- for (event in PlayerEventEmitter.Events) {
40
- builder.put(event, MapBuilder.of("registrationName", event))
41
- }
42
- return builder.build()
35
+ return PlayerEventEmitter.Events.associateWith { mapOf("registrationName" to it) }
43
36
  }
44
37
  }
@@ -9,7 +9,7 @@ import com.google.ads.interactivemedia.v3.api.UiElement
9
9
  import com.theoplayer.android.api.ads.Ad
10
10
  import com.theoplayer.android.api.ads.AdBreak
11
11
  import com.theoplayer.android.api.ads.CompanionAd
12
- import com.theoplayer.android.api.ads.GoogleImaAd
12
+ import com.theoplayer.android.api.ads.ima.GoogleImaAd
13
13
  import com.theoplayer.android.api.ads.UniversalAdId
14
14
  import com.theoplayer.android.api.event.ads.AdIntegrationKind
15
15
  import java.lang.Exception
@@ -23,6 +23,7 @@ private const val PROP_AD_BREAK = "adBreak"
23
23
  private const val PROP_AD_COMPANIONS = "companions"
24
24
  private const val PROP_AD_SKIPOFFSET = "skipOffset"
25
25
  private const val PROP_AD_CREATIVE_ID = "creativeId"
26
+ private const val PROP_AD_DESCRIPTION = "description"
26
27
  private const val PROP_AD_TRAFFICKING_PARAMETERS = "traffickingParametersString"
27
28
  private const val PROP_AD_BITRATE = "bitrate"
28
29
  private const val PROP_AD_UNIVERSAL_AD_IDS = "universalAdIds"
@@ -95,6 +96,7 @@ object AdAdapter {
95
96
  adPayload.putDouble(PROP_AD_WIDTH, ad.imaAd.vastMediaWidth.toDouble())
96
97
  adPayload.putDouble(PROP_AD_HEIGHT, ad.imaAd.vastMediaHeight.toDouble())
97
98
  adPayload.putString(PROP_AD_CONTENT_TYPE, ad.imaAd.contentType)
99
+ adPayload.putString(PROP_AD_DESCRIPTION, ad.imaAd.description)
98
100
  } catch (ignore: Exception) {
99
101
  // googleImaAd.getImaAd() is not known yet
100
102
  }
@@ -103,9 +105,9 @@ object AdAdapter {
103
105
  val idPayload = Arguments.createMap()
104
106
  idPayload.putString(
105
107
  PROP_UNIVERSAL_AD_ID_REGISTRY,
106
- universalAdId.universalAdIdRegistry
108
+ universalAdId?.universalAdIdRegistry
107
109
  )
108
- idPayload.putString(PROP_UNIVERSAL_AD_ID_VALUE, universalAdId.universalAdIdValue)
110
+ idPayload.putString(PROP_UNIVERSAL_AD_ID_VALUE, universalAdId?.universalAdIdValue)
109
111
  universalAdIdsPayload.pushMap(idPayload)
110
112
  }
111
113
  adPayload.putArray(PROP_AD_UNIVERSAL_AD_IDS, universalAdIdsPayload)
@@ -215,41 +217,32 @@ object AdAdapter {
215
217
  return null
216
218
  }
217
219
 
218
- override fun getImaAd(): com.google.ads.interactivemedia.v3.api.Ad {
219
- return parseImaAd(ad)
220
- }
220
+ override val imaAd: com.google.ads.interactivemedia.v3.api.Ad
221
+ get() = parseImaAd(ad)
221
222
 
222
- override fun getAdSystem(): String {
223
- return ad.getString(PROP_AD_SYSTEM) ?: ""
224
- }
223
+ override val adSystem: String?
224
+ get() = ad.getString(PROP_AD_SYSTEM)
225
225
 
226
- override fun getCreativeId(): String? {
227
- return ad.getString(PROP_AD_CREATIVE_ID)
228
- }
226
+ override val creativeId: String?
227
+ get() = ad.getString(PROP_AD_CREATIVE_ID)
229
228
 
230
- override fun getWrapperAdIds(): List<String> {
231
- return emptyList()
232
- }
229
+ override val wrapperAdIds: List<String?>
230
+ get() = emptyList()
233
231
 
234
- override fun getWrapperAdSystems(): List<String> {
235
- return emptyList()
236
- }
232
+ override val wrapperAdSystems: List<String?>
233
+ get() = emptyList()
237
234
 
238
- override fun getWrapperCreativeIds(): List<String> {
239
- return emptyList()
240
- }
235
+ override val wrapperCreativeIds: List<String?>
236
+ get() = emptyList()
241
237
 
242
- override fun getVastMediaBitrate(): Int {
243
- return if (ad.hasKey(PROP_AD_BITRATE)) ad.getInt(PROP_AD_BITRATE) else 0
244
- }
238
+ override val vastMediaBitrate: Int
239
+ get() = if (ad.hasKey(PROP_AD_BITRATE)) ad.getInt(PROP_AD_BITRATE) else 0
245
240
 
246
- override fun getUniversalAdIds(): List<UniversalAdId> {
247
- return emptyList()
248
- }
241
+ override val universalAdIds: List<UniversalAdId?>
242
+ get() = emptyList()
249
243
 
250
- override fun getTraffickingParameters(): String {
251
- return ad.getString(PROP_AD_TRAFFICKING_PARAMETERS) ?: ""
252
- }
244
+ override val traffickingParameters: String
245
+ get() = ad.getString(PROP_AD_TRAFFICKING_PARAMETERS) ?: ""
253
246
  }
254
247
  }
255
248
 
@@ -399,7 +392,7 @@ object AdAdapter {
399
392
  }
400
393
 
401
394
  override fun getDescription(): String {
402
- return ""
395
+ return ad?.getString(PROP_AD_DESCRIPTION) ?: ""
403
396
  }
404
397
 
405
398
  override fun getSurveyUrl(): String {
@@ -7,7 +7,7 @@ import com.facebook.react.bridge.WritableMap
7
7
  import com.google.ads.interactivemedia.v3.api.AdError
8
8
  import com.theoplayer.android.api.ads.Ad
9
9
  import com.theoplayer.android.api.ads.AdBreak
10
- import com.theoplayer.android.api.ads.GoogleImaAd
10
+ import com.theoplayer.android.api.ads.ima.GoogleImaAd
11
11
  import com.theoplayer.android.api.ads.ima.GoogleImaAdEvent
12
12
  import com.theoplayer.android.api.ads.ima.GoogleImaAdEventType
13
13
  import com.theoplayer.android.api.ads.wrapper.AdEventListener
@@ -6,6 +6,7 @@ import com.facebook.react.bridge.ReadableMap
6
6
  import com.facebook.react.bridge.WritableArray
7
7
  import com.facebook.react.bridge.WritableMap
8
8
  import com.theoplayer.android.api.cache.CacheStatus
9
+ import com.theoplayer.android.api.cache.CacheStorageType
9
10
  import com.theoplayer.android.api.cache.CachingParameters
10
11
  import com.theoplayer.android.api.cache.CachingPreferredTrackSelection
11
12
  import com.theoplayer.android.api.cache.CachingTask
@@ -26,6 +27,7 @@ private const val PROP_PARAMETERS_BANDWIDTH = "bandwidth"
26
27
  private const val PROP_PARAMETERS_PREFERRED_TRACK_SELECTION = "preferredTrackSelection"
27
28
  private const val PROP_PARAMETERS_AUDIO_TRACK_SELECTION = "audioTrackSelection"
28
29
  private const val PROP_PARAMETERS_TEXT_TRACK_SELECTION = "textTrackSelection"
30
+ private const val PROP_PARAMETERS_STORAGE_TYPE = "storageType"
29
31
  private const val PROP_DURATION = "duration"
30
32
  private const val PROP_CACHED = "cached"
31
33
  private const val PROP_SECONDS_CACHED = "secondsCached"
@@ -101,6 +103,12 @@ object CacheAdapter {
101
103
  if (parameters.hasKey(PROP_PARAMETERS_PREFERRED_TRACK_SELECTION)) {
102
104
  preferredTrackSelection(parsePreferredTrackSelection(parameters.getMap(PROP_PARAMETERS_PREFERRED_TRACK_SELECTION)))
103
105
  }
106
+ if (parameters.hasKey(PROP_PARAMETERS_STORAGE_TYPE)) {
107
+ storageType(when (parameters.getString(PROP_PARAMETERS_STORAGE_TYPE)) {
108
+ "legacy" -> CacheStorageType.LEGACY
109
+ else -> CacheStorageType.MEDIA3
110
+ })
111
+ }
104
112
  }.build()
105
113
  }
106
114
 
@@ -121,6 +129,10 @@ object CacheAdapter {
121
129
  putString(PROP_PARAMETERS_AMOUNT, parameters.amount)
122
130
  putDouble(PROP_PARAMETERS_BANDWIDTH, parameters.bandwidth.toDouble())
123
131
  putDouble(PROP_PARAMETERS_EXPIRATION_DATE, parameters.expirationDate.time.toDouble())
132
+ putString(PROP_PARAMETERS_STORAGE_TYPE, when (parameters.storageType) {
133
+ CacheStorageType.LEGACY -> "legacy"
134
+ CacheStorageType.MEDIA3 -> "media3"
135
+ })
124
136
  }
125
137
  }
126
138
  }
@@ -163,7 +163,9 @@ object ContentProtectionAdapter {
163
163
  payload.putString(PROP_STATUS_TEXT, response.statusText)
164
164
  val headers = Arguments.createMap()
165
165
  response.headers.entries.forEach { entry ->
166
- headers.putString(entry.key, entry.value)
166
+ entry.key?.let { key ->
167
+ headers.putString(key, entry.value)
168
+ }
167
169
  }
168
170
  payload.putMap(PROP_HEADERS, headers)
169
171
  payload.putMap(PROP_REQUEST, fromRequest(integrationId, keySystemId, response.request))
@@ -237,7 +237,7 @@ class ContentProtectionModule(private val context: ReactApplicationContext) :
237
237
  Log.d(TAG, "emit $eventName ($requestId)")
238
238
  }
239
239
  payload.putString(PROP_REQUEST_ID, requestId)
240
- val onTimeout = {
240
+ val onTimeout = Runnable {
241
241
  onError(
242
242
  THEOplayerException(ErrorCode.CONTENT_PROTECTION_ERROR, "$eventName time-out.")
243
243
  )
@@ -22,6 +22,7 @@ import com.theoplayer.android.api.ads.theoads.TheoAdsLayoutOverride
22
22
  import com.theoplayer.android.api.cmcd.CMCDTransmissionMode
23
23
  import com.theoplayer.android.api.error.ErrorCode
24
24
  import com.theoplayer.android.api.source.AdIntegration
25
+ import com.theoplayer.android.api.source.PlaybackPipeline
25
26
  import com.theoplayer.android.api.source.dash.DashPlaybackConfiguration
26
27
  import com.theoplayer.android.api.theolive.TheoLiveSource
27
28
  import com.theoplayer.cmcd.CmcdTransmissionMode
@@ -66,7 +67,9 @@ private const val PROP_OVERRIDE_LAYOUT = "overrideLayout"
66
67
  private const val PROP_NETWORK_CODE = "networkCode"
67
68
  private const val PROP_USE_ID3 = "useId3"
68
69
  private const val PROP_RETRIEVE_POD_ID_URI = "retrievePodIdURI"
70
+ private const val PROP_SSE_ENDPOINT = "sseEndpoint"
69
71
  private const val PROP_LATENCY_CONFIGURATION = "latencyConfiguration"
72
+ private const val PROP_PLAYBACK_PIPELINE = "playbackPipeline"
70
73
 
71
74
  private const val ERROR_IMA_NOT_ENABLED = "Google IMA support not enabled."
72
75
  private const val ERROR_THEOADS_NOT_ENABLED = "THEOads support not enabled."
@@ -76,6 +79,7 @@ private const val ERROR_MISSING_CSAI_INTEGRATION = "Missing CSAI integration"
76
79
  private const val PROP_SSAI_INTEGRATION_GOOGLE_DAI = "google-dai"
77
80
 
78
81
  private const val INTEGRATION_THEOLIVE = "theolive"
82
+ private const val PLAYBACK_PIPELINE_LEGACY = "legacy"
79
83
 
80
84
  private const val PROP_CMCD = "cmcd"
81
85
  private const val CMCD_TRANSMISSION_MODE = "transmissionMode"
@@ -227,6 +231,12 @@ class SourceAdapter {
227
231
  tsBuilder.drm(drmConfig)
228
232
  }
229
233
  }
234
+ if (jsonTypedSource.has(PROP_PLAYBACK_PIPELINE)) {
235
+ tsBuilder.playbackPipeline(when(jsonTypedSource.getString(PROP_PLAYBACK_PIPELINE)) {
236
+ PLAYBACK_PIPELINE_LEGACY -> PlaybackPipeline.LEGACY
237
+ else -> PlaybackPipeline.MEDIA3
238
+ })
239
+ }
230
240
  if (cmcdTransmissionMode != null) {
231
241
  tsBuilder.cmcdTransmissionMode(cmcdTransmissionMode)
232
242
  }
@@ -349,6 +359,7 @@ class SourceAdapter {
349
359
  overrideLayout = parseOverrideLayout(jsonAdDescription.optString(PROP_OVERRIDE_LAYOUT)),
350
360
  useId3 = jsonAdDescription.optBoolean(PROP_USE_ID3, false),
351
361
  retrievePodIdURI = jsonAdDescription.optString(PROP_RETRIEVE_POD_ID_URI).takeIf { it.isNotEmpty() },
362
+ sseEndpoint = jsonAdDescription.optString(PROP_SSE_ENDPOINT).takeIf { it.isNotEmpty() },
352
363
  )
353
364
  }
354
365
 
@@ -113,7 +113,7 @@ object TrackListAdapter {
113
113
  cuePayload.putDouble(PROP_PLANNED_DURATION, TypeUtils.encodeInfNan(1e3 * this))
114
114
  }
115
115
  cuePayload.putBoolean(PROP_END_ON_NEXT, cue.isEndOnNext)
116
- cue.customAttributes?.asMap()?.run {
116
+ cue.customAttributes.asMap()?.run {
117
117
  val attributes = Arguments.createMap()
118
118
  forEach { (key, value) ->
119
119
  when (value) {
@@ -105,17 +105,8 @@ class THEOplayerRCTTrackMetadataAggregator {
105
105
  var entry: [String:Any] = [:]
106
106
  entry[PROP_ID] = textTrackCue.id
107
107
  entry[PROP_UID] = textTrackCue.uid
108
- var startTime = textTrackCue.startTime
109
- var endTime = textTrackCue.endTime
110
- if let dateRangeCue = textTrackCue as? DateRangeCue,
111
- let programDateTime = player.currentProgramDateTime?.timeIntervalSince1970 {
112
- let currentTime = player.currentTime
113
- let offset = programDateTime - currentTime
114
- startTime = dateRangeCue.startDate.timeIntervalSince1970 - offset
115
- endTime = dateRangeCue.endDate != nil ? dateRangeCue.endDate!.timeIntervalSince1970 - offset : .infinity
116
- }
117
- entry[PROP_STARTTIME] = THEOplayerRCTTypeUtils.encodeInfNan((startTime ?? 0) * 1000)
118
- entry[PROP_ENDTIME] = THEOplayerRCTTypeUtils.encodeInfNan((endTime ?? 0) * 1000)
108
+ entry[PROP_STARTTIME] = THEOplayerRCTTypeUtils.encodeInfNan(textTrackCue.startTime * 1000)
109
+ entry[PROP_ENDTIME] = THEOplayerRCTTypeUtils.encodeInfNan(textTrackCue.endTime * 1000)
119
110
  if let content = textTrackCue.content {
120
111
  entry[PROP_CUE_CONTENT] = content
121
112
  } else if let contentString = textTrackCue.contentString {
@@ -3,4 +3,21 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.StorageType = void 0;
7
+ /**
8
+ * The types of cache storage supported by THEOplayer.
9
+ *
10
+ * @remarks
11
+ * <br/> - Available only on Android.
12
+ */
13
+ let StorageType = exports.StorageType = /*#__PURE__*/function (StorageType) {
14
+ StorageType["LEGACY"] = "legacy";
15
+ StorageType["MEDIA3"] = "media3";
16
+ return StorageType;
17
+ }({});
18
+ /**
19
+ * Describes the configuration of a caching task.
20
+ *
21
+ * @public
22
+ */
6
23
  //# sourceMappingURL=CachingTaskParameters.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["api/cache/CachingTaskParameters.ts"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":["StorageType","exports"],"sourceRoot":"../../../../src","sources":["api/cache/CachingTaskParameters.ts"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AALA,IAMYA,WAAW,GAAAC,OAAA,CAAAD,WAAA,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAqBvB;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SourceIntegrationId = void 0;
6
+ exports.SourceIntegrationId = exports.PlaybackPipeline = void 0;
7
7
  /**
8
8
  * Represents a media resource.
9
9
  *
@@ -42,6 +42,17 @@ let SourceIntegrationId = exports.SourceIntegrationId = /*#__PURE__*/function (S
42
42
  SourceIntegrationId["THEO_LIVE"] = "theolive";
43
43
  return SourceIntegrationId;
44
44
  }({});
45
+ /**
46
+ * The playback pipeline to use to play a stream.
47
+ *
48
+ * @remarks
49
+ * <br/> - Available on Android only.
50
+ */
51
+ let PlaybackPipeline = exports.PlaybackPipeline = /*#__PURE__*/function (PlaybackPipeline) {
52
+ PlaybackPipeline["LEGACY"] = "legacy";
53
+ PlaybackPipeline["MEDIA3"] = "media3";
54
+ return PlaybackPipeline;
55
+ }({});
45
56
  /**
46
57
  * Describes the configuration of a player's source.
47
58
  *