react-native-theoplayer 9.5.0 → 9.7.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.
Files changed (81) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/android/build.gradle +126 -156
  3. package/android/src/main/java/com/theoplayer/PlayerConfigAdapter.kt +8 -1
  4. package/ios/THEOplayerRCTBridge.m +15 -0
  5. package/ios/THEOplayerRCTDebug.swift +3 -0
  6. package/ios/THEOplayerRCTTrackMetadataAggregator.swift +4 -0
  7. package/ios/THEOplayerRCTView.swift +11 -2
  8. package/ios/ads/THEOplayerRCTSourceDescriptionBuilder+Ads.swift +1 -1
  9. package/ios/theoAds/THEOplayerRCTSourceDescriptionBuilder+TheoAds.swift +2 -2
  10. package/ios/theoAds/THEOplayerRCTView+TheoAds.swift +4 -4
  11. package/ios/theolive/THEOplayerRCTTHEOliveAPI.swift +85 -0
  12. package/ios/theolive/THEOplayerRCTView+THEOlive.swift +28 -0
  13. package/ios/theolive/THEOplayerRCTView+THEOliveConfig.swift +21 -0
  14. package/lib/commonjs/api/player/THEOplayer.js.map +1 -1
  15. package/lib/commonjs/api/theolive/TheoLiveAPI.js +2 -0
  16. package/lib/commonjs/api/theolive/TheoLiveAPI.js.map +1 -0
  17. package/lib/commonjs/api/theolive/barrel.js +11 -0
  18. package/lib/commonjs/api/theolive/barrel.js.map +1 -1
  19. package/lib/commonjs/api/track/MediaTrack.js.map +1 -1
  20. package/lib/commonjs/api/track/TextTrack.js.map +1 -1
  21. package/lib/commonjs/internal/adapter/THEOplayerAdapter.js +5 -0
  22. package/lib/commonjs/internal/adapter/THEOplayerAdapter.js.map +1 -1
  23. package/lib/commonjs/internal/adapter/THEOplayerWebAdapter.js +5 -0
  24. package/lib/commonjs/internal/adapter/THEOplayerWebAdapter.js.map +1 -1
  25. package/lib/commonjs/internal/adapter/theolive/TheoLiveNativeAdapter.js +34 -0
  26. package/lib/commonjs/internal/adapter/theolive/TheoLiveNativeAdapter.js.map +1 -0
  27. package/lib/commonjs/internal/adapter/theolive/TheoLiveWebAdapter.js +30 -0
  28. package/lib/commonjs/internal/adapter/theolive/TheoLiveWebAdapter.js.map +1 -0
  29. package/lib/commonjs/manifest.json +1 -1
  30. package/lib/module/api/player/THEOplayer.js.map +1 -1
  31. package/lib/module/api/theolive/TheoLiveAPI.js +2 -0
  32. package/lib/module/api/theolive/TheoLiveAPI.js.map +1 -0
  33. package/lib/module/api/theolive/barrel.js +1 -0
  34. package/lib/module/api/theolive/barrel.js.map +1 -1
  35. package/lib/module/api/track/MediaTrack.js.map +1 -1
  36. package/lib/module/api/track/TextTrack.js.map +1 -1
  37. package/lib/module/internal/adapter/THEOplayerAdapter.js +5 -0
  38. package/lib/module/internal/adapter/THEOplayerAdapter.js.map +1 -1
  39. package/lib/module/internal/adapter/THEOplayerWebAdapter.js +5 -0
  40. package/lib/module/internal/adapter/THEOplayerWebAdapter.js.map +1 -1
  41. package/lib/module/internal/adapter/theolive/TheoLiveNativeAdapter.js +29 -0
  42. package/lib/module/internal/adapter/theolive/TheoLiveNativeAdapter.js.map +1 -0
  43. package/lib/module/internal/adapter/theolive/TheoLiveWebAdapter.js +25 -0
  44. package/lib/module/internal/adapter/theolive/TheoLiveWebAdapter.js.map +1 -0
  45. package/lib/module/manifest.json +1 -1
  46. package/lib/typescript/api/ads/GoogleImaConfiguration.d.ts +8 -0
  47. package/lib/typescript/api/ads/GoogleImaConfiguration.d.ts.map +1 -1
  48. package/lib/typescript/api/player/THEOplayer.d.ts +5 -0
  49. package/lib/typescript/api/player/THEOplayer.d.ts.map +1 -1
  50. package/lib/typescript/api/theolive/TheoLiveAPI.d.ts +41 -0
  51. package/lib/typescript/api/theolive/TheoLiveAPI.d.ts.map +1 -0
  52. package/lib/typescript/api/theolive/TheoLiveConfiguration.d.ts +14 -0
  53. package/lib/typescript/api/theolive/TheoLiveConfiguration.d.ts.map +1 -1
  54. package/lib/typescript/api/theolive/barrel.d.ts +1 -0
  55. package/lib/typescript/api/theolive/barrel.d.ts.map +1 -1
  56. package/lib/typescript/api/track/MediaTrack.d.ts +6 -0
  57. package/lib/typescript/api/track/MediaTrack.d.ts.map +1 -1
  58. package/lib/typescript/api/track/TextTrack.d.ts +6 -0
  59. package/lib/typescript/api/track/TextTrack.d.ts.map +1 -1
  60. package/lib/typescript/internal/adapter/THEOplayerAdapter.d.ts +3 -1
  61. package/lib/typescript/internal/adapter/THEOplayerAdapter.d.ts.map +1 -1
  62. package/lib/typescript/internal/adapter/THEOplayerWebAdapter.d.ts +3 -2
  63. package/lib/typescript/internal/adapter/THEOplayerWebAdapter.d.ts.map +1 -1
  64. package/lib/typescript/internal/adapter/theolive/TheoLiveNativeAdapter.d.ts +8 -0
  65. package/lib/typescript/internal/adapter/theolive/TheoLiveNativeAdapter.d.ts.map +1 -0
  66. package/lib/typescript/internal/adapter/theolive/TheoLiveWebAdapter.d.ts +9 -0
  67. package/lib/typescript/internal/adapter/theolive/TheoLiveWebAdapter.d.ts.map +1 -0
  68. package/package.json +1 -1
  69. package/react-native-theoplayer.podspec +11 -11
  70. package/src/api/ads/GoogleImaConfiguration.ts +10 -0
  71. package/src/api/player/THEOplayer.ts +6 -0
  72. package/src/api/theolive/TheoLiveAPI.ts +47 -0
  73. package/src/api/theolive/TheoLiveConfiguration.ts +17 -0
  74. package/src/api/theolive/barrel.ts +1 -0
  75. package/src/api/track/MediaTrack.ts +7 -0
  76. package/src/api/track/TextTrack.ts +7 -0
  77. package/src/internal/adapter/THEOplayerAdapter.ts +8 -0
  78. package/src/internal/adapter/THEOplayerWebAdapter.ts +9 -1
  79. package/src/internal/adapter/theolive/TheoLiveNativeAdapter.ts +29 -0
  80. package/src/internal/adapter/theolive/TheoLiveWebAdapter.ts +25 -0
  81. package/src/manifest.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,20 @@ 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.7.0] - 25-07-01
9
+
10
+ ### Added
11
+
12
+ - Added the theolive discoveryUrl to the PlayerConfiguration's theolive properties.
13
+ - Added focusguides (@THEOplayer/react-native-ui feature) to the example app for tvOS.
14
+
15
+ ## [9.6.0] - 25-06-27
16
+
17
+ ### Added
18
+
19
+ - Added, for HLS on iOS, the `unlocalizedLabel` to the text-, audio- and videoTracks API, which contains the unmodified label as extracted from the manifest.
20
+ - Added a flag `focusSkipButtonWhenAvailable` to `GoogleImaConfiguration`.
21
+
8
22
  ## [9.5.0] - 25-06-20
9
23
 
10
24
  ### Added
@@ -1,36 +1,36 @@
1
1
  buildscript {
2
- ext.safeExtGet = { prop, fallback ->
3
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
4
- }
2
+ ext.safeExtGet = { prop, fallback ->
3
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
4
+ }
5
5
 
6
- repositories {
7
- google()
8
- mavenCentral()
9
- }
6
+ repositories {
7
+ google()
8
+ mavenCentral()
9
+ }
10
10
 
11
- dependencies {
12
- classpath "com.android.tools.build:gradle:${safeExtGet('gradlePluginVersion', '8.3.2')}"
13
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.9.21')}"
14
- }
11
+ dependencies {
12
+ classpath "com.android.tools.build:gradle:${safeExtGet('gradlePluginVersion', '8.3.2')}"
13
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.9.21')}"
14
+ }
15
15
  }
16
16
 
17
17
  apply plugin: 'com.android.library'
18
18
  apply plugin: 'kotlin-android'
19
19
 
20
20
  def safeExtGet(prop, fallback) {
21
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
21
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
22
22
  }
23
23
 
24
24
  static def versionString(version) {
25
- return "${version == '+' ? 'latest' : version}"
25
+ return "${version == '+' ? 'latest' : version}"
26
26
  }
27
27
 
28
28
  def isNewArchitectureEnabled() {
29
- // To opt-in for the New Architecture, you can either:
30
- // - Set `newArchEnabled` to true inside the `gradle.properties` file
31
- // - Invoke gradle with `-newArchEnabled=true`
32
- // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
33
- return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
29
+ // To opt-in for the New Architecture, you can either:
30
+ // - Set `newArchEnabled` to true inside the `gradle.properties` file
31
+ // - Invoke gradle with `-newArchEnabled=true`
32
+ // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
33
+ return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
34
34
  }
35
35
 
36
36
  // Extensions
@@ -43,155 +43,125 @@ def enabledMediaSession = safeExtGet("THEOplayer_extensionMediaSession", 'true')
43
43
  def enabledMillicast = safeExtGet("THEOplayer_extensionMillicast", 'false').toBoolean()
44
44
 
45
45
  android {
46
- compileSdk safeExtGet('THEOplayer_compileSdkVersion', 34)
47
- namespace "com.theoplayer"
48
-
49
- defaultConfig {
50
- minSdkVersion safeExtGet('THEOplayer_minSdkVersion', 21)
51
- targetSdkVersion safeExtGet('THEOplayer_targetSdkVersion', 34)
52
- versionCode 1
53
- versionName "1.0"
54
-
55
- // Optionally limit timeUpdate rate. Possible values:
56
- // - "com.theoplayer.TimeUpdateRate.UNLIMITED"
57
- // - "com.theoplayer.TimeUpdateRate.LIMITED_ONE_HZ"
58
- // - "com.theoplayer.TimeUpdateRate.LIMITED_TWO_HZ"
59
- // - "com.theoplayer.TimeUpdateRate.LIMITED_THREE_HZ"
60
- def TimeUpdateRate = "com.theoplayer.TimeUpdateRate"
61
- buildConfigField TimeUpdateRate, "TIMEUPDATE_RATE", safeExtGet('THEOplayer_timeUpdateRate', "${TimeUpdateRate}.UNLIMITED")
62
-
63
- // Optionally re-parent player view on fullscreen or PiP event
64
- buildConfigField "boolean", "REPARENT_ON_FULLSCREEN", "${safeExtGet('THEOplayer_reparent_on_fullscreen', 'true')}"
65
- buildConfigField "boolean", "REPARENT_ON_PIP", "${safeExtGet('THEOplayer_reparent_on_PiP', 'false')}"
66
-
67
- // Optionally log events to logcat
68
- buildConfigField "boolean", "LOG_PLAYER_EVENTS", "${safeExtGet('THEOplayer_logPlayerEvents', 'false')}"
69
- buildConfigField "boolean", "LOG_VIEW_EVENTS", "${safeExtGet('THEOplayer_logViewEvents', 'false')}"
70
- buildConfigField "boolean", "LOG_MEDIASESSION_EVENTS", "${safeExtGet('THEOplayer_logMediaSessionEvents', 'false')}"
71
- buildConfigField "boolean", "USE_PLAYBACK_SERVICE", "${safeExtGet('THEOplayer_usePlaybackService', 'true')}"
72
-
73
- // Extension buildConfig fields
74
- buildConfigField "boolean", "EXTENSION_GOOGLE_IMA", "${enabledGoogleIMA}"
75
- buildConfigField "boolean", "EXTENSION_GOOGLE_DAI", "${enabledGoogleDAI}"
76
- buildConfigField "boolean", "EXTENSION_THEOADS", "${enabledTHEOads}"
77
- buildConfigField "boolean", "EXTENSION_ADS", "${enabledAds}"
78
- buildConfigField "boolean", "EXTENSION_CAST", "${enabledCast}"
79
- buildConfigField "boolean", "EXTENSION_MEDIASESSION", "${enabledMediaSession}"
80
- buildConfigField "boolean", "EXTENSION_MILLICAST", "${enabledMillicast}"
81
-
82
- buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
83
-
84
- consumerProguardFiles 'proguard-rules.pro'
85
- }
86
-
87
- buildTypes {
88
- debug {
89
- minifyEnabled false
46
+ compileSdk safeExtGet('THEOplayer_compileSdkVersion', 34)
47
+ namespace "com.theoplayer"
48
+
49
+ defaultConfig {
50
+ minSdkVersion safeExtGet('THEOplayer_minSdkVersion', 21)
51
+ targetSdkVersion safeExtGet('THEOplayer_targetSdkVersion', 34)
52
+ versionCode 1
53
+ versionName "1.0"
54
+
55
+ // Optionally limit timeUpdate rate. Possible values:
56
+ // - "com.theoplayer.TimeUpdateRate.UNLIMITED"
57
+ // - "com.theoplayer.TimeUpdateRate.LIMITED_ONE_HZ"
58
+ // - "com.theoplayer.TimeUpdateRate.LIMITED_TWO_HZ"
59
+ // - "com.theoplayer.TimeUpdateRate.LIMITED_THREE_HZ"
60
+ def TimeUpdateRate = "com.theoplayer.TimeUpdateRate"
61
+ buildConfigField TimeUpdateRate, "TIMEUPDATE_RATE", safeExtGet('THEOplayer_timeUpdateRate', "${TimeUpdateRate}.UNLIMITED")
62
+
63
+ // Optionally re-parent player view on fullscreen or PiP event
64
+ buildConfigField "boolean", "REPARENT_ON_FULLSCREEN", "${safeExtGet('THEOplayer_reparent_on_fullscreen', 'true')}"
65
+ buildConfigField "boolean", "REPARENT_ON_PIP", "${safeExtGet('THEOplayer_reparent_on_PiP', 'false')}"
66
+
67
+ // Optionally log events to logcat
68
+ buildConfigField "boolean", "LOG_PLAYER_EVENTS", "${safeExtGet('THEOplayer_logPlayerEvents', 'false')}"
69
+ buildConfigField "boolean", "LOG_VIEW_EVENTS", "${safeExtGet('THEOplayer_logViewEvents', 'false')}"
70
+ buildConfigField "boolean", "LOG_MEDIASESSION_EVENTS", "${safeExtGet('THEOplayer_logMediaSessionEvents', 'false')}"
71
+ buildConfigField "boolean", "USE_PLAYBACK_SERVICE", "${safeExtGet('THEOplayer_usePlaybackService', 'true')}"
72
+
73
+ // Extension buildConfig fields
74
+ buildConfigField "boolean", "EXTENSION_GOOGLE_IMA", "${enabledGoogleIMA}"
75
+ buildConfigField "boolean", "EXTENSION_GOOGLE_DAI", "${enabledGoogleDAI}"
76
+ buildConfigField "boolean", "EXTENSION_THEOADS", "${enabledTHEOads}"
77
+ buildConfigField "boolean", "EXTENSION_ADS", "${enabledAds}"
78
+ buildConfigField "boolean", "EXTENSION_CAST", "${enabledCast}"
79
+ buildConfigField "boolean", "EXTENSION_MEDIASESSION", "${enabledMediaSession}"
80
+ buildConfigField "boolean", "EXTENSION_MILLICAST", "${enabledMillicast}"
81
+
82
+ buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
83
+
84
+ consumerProguardFiles 'proguard-rules.pro'
85
+ }
86
+
87
+ buildTypes {
88
+ debug {
89
+ minifyEnabled false
90
+ }
91
+ release {
92
+ minifyEnabled false
93
+ }
94
+ }
95
+ lint {
96
+ disable 'GradleCompatible'
90
97
  }
91
- release {
92
- minifyEnabled false
98
+ compileOptions {
99
+ sourceCompatibility JavaVersion.VERSION_1_8
100
+ targetCompatibility JavaVersion.VERSION_1_8
101
+ }
102
+ packagingOptions {
103
+ exclude 'META-INF/kotlin-stdlib.kotlin_module'
104
+ exclude 'META-INF/annotation-experimental_release.kotlin_module'
93
105
  }
94
- }
95
- lint {
96
- disable 'GradleCompatible'
97
- }
98
- compileOptions {
99
- sourceCompatibility JavaVersion.VERSION_1_8
100
- targetCompatibility JavaVersion.VERSION_1_8
101
- }
102
- packagingOptions {
103
- exclude 'META-INF/kotlin-stdlib.kotlin_module'
104
- exclude 'META-INF/annotation-experimental_release.kotlin_module'
105
- }
106
106
  }
107
107
 
108
+ // Make sure all subprojects can resolve THEOplayer modules
108
109
  rootProject.allprojects {
109
- repositories {
110
- mavenLocal()
111
- maven { url "https://maven.theoplayer.com/releases" }
112
- maven { url "https://maven.theoplayer.com/snapshots" }
113
- maven { url("$rootDir/../node_modules/react-native-theoplayer/android/local") }
114
- }
110
+ repositories {
111
+ maven { url "https://maven.theoplayer.com/releases" }
112
+ maven { url "https://maven.theoplayer.com/snapshots" }
113
+ maven { url("$rootDir/../node_modules/react-native-theoplayer/android/local") }
114
+ mavenLocal()
115
+ }
115
116
  }
116
117
 
117
118
  repositories {
118
- mavenLocal()
119
- maven {
120
- // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
121
- url("$rootDir/../node_modules/react-native/android")
122
- }
123
- google()
124
- mavenCentral()
125
- maven { url("local") }
126
- maven { url "https://maven.theoplayer.com/releases" }
119
+ google()
120
+ mavenCentral()
127
121
  }
128
122
 
129
- // The minimum supported THEOplayer version is 9.5.0
130
- def theoplayer_sdk_version = safeExtGet('THEOplayer_sdk', '[9.5.0, 10.0.0)')
131
- def theoplayer_mediasession_version = safeExtGet('THEOplayer_mediasession', '[8.0.0, 10.0.0)')
132
- def theoplayer_ads_wrapper_version = "9.0.0"
123
+ // The minimum supported THEOplayer version is 9.6.0
124
+ def theoVersion = safeExtGet('THEOplayer_sdk', '[9.6.0, 10.0.0)')
125
+ def theoMediaSessionVersion = safeExtGet('THEOplayer_mediasession', '[8.0.0, 10.0.0)')
126
+ def theoAdsWrapperVersion = "9.0.0"
127
+ def coroutinesVersion = safeExtGet('coroutinesVersion', '1.7.3')
128
+ def appcompatVersion = safeExtGet('appcompatVersion', '1.7.1')
129
+ def corektxVersion = safeExtGet('corektxVersion', '1.13.1')
130
+ def gsonVersion = "2.12.1"
131
+ def millicastVersion = safeExtGet('millicastVersion', '2.0.0')
133
132
 
134
133
  dependencies {
135
- //noinspection GradleDynamicVersion
136
- implementation "com.facebook.react:react-native:+" // From node_modules
137
- implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${safeExtGet('coroutinesVersion', '1.7.3')}"
138
- implementation "androidx.appcompat:appcompat:${safeExtGet('appcompatVersion', '1.6.1')}"
139
- implementation "androidx.core:core-ktx:${safeExtGet('corektxVersion', '1.13.1')}"
140
- implementation "com.google.code.gson:gson:2.11.0"
141
-
142
- println("Using THEOplayer (${versionString(theoplayer_sdk_version)})")
143
- implementation "com.theoplayer.theoplayer-sdk-android:core:$theoplayer_sdk_version"
144
- implementation "com.theoplayer.theoplayer-sdk-android:ads-wrapper:$theoplayer_ads_wrapper_version"
145
- implementation "com.theoplayer.android-connector:mediasession:$theoplayer_mediasession_version"
146
-
147
- if (enabledGoogleIMA) {
148
- println('Enable THEOplayer IMA extension.')
149
- implementation "com.theoplayer.theoplayer-sdk-android:integration-ads-ima:$theoplayer_sdk_version"
150
- } else {
151
- println('Disable THEOplayer IMA extension.')
152
- compileOnly "com.theoplayer.theoplayer-sdk-android:integration-ads-ima:$theoplayer_sdk_version"
153
- }
154
-
155
- if (enabledGoogleDAI) {
156
- println('Enable THEOplayer DAI extension.')
157
- implementation "com.theoplayer.theoplayer-sdk-android:integration-ads-dai:$theoplayer_sdk_version"
158
- } else {
159
- println('Disable THEOplayer DAI extension.')
160
- compileOnly "com.theoplayer.theoplayer-sdk-android:integration-ads-dai:$theoplayer_sdk_version"
161
- }
162
-
163
- if (enabledTHEOads) {
164
- println('Enable THEOplayer THEOads extension.')
165
- implementation "com.theoplayer.theoplayer-sdk-android:integration-ads-theoads:$theoplayer_sdk_version"
166
- } else {
167
- println('Disable THEOplayer THEOads extension.')
168
- compileOnly "com.theoplayer.theoplayer-sdk-android:integration-ads-theoads:$theoplayer_sdk_version"
169
- }
170
-
171
- if (enabledCast) {
172
- println('Enable THEOplayer cast extension.')
173
- implementation "com.theoplayer.theoplayer-sdk-android:integration-cast:$theoplayer_sdk_version"
174
- } else {
175
- println('Disable THEOplayer cast extension.')
176
- compileOnly "com.theoplayer.theoplayer-sdk-android:integration-cast:$theoplayer_sdk_version"
177
- }
178
-
179
- if (enabledMillicast) {
180
- println('Enable THEOplayer millicast extension.')
181
- implementation "com.theoplayer.theoplayer-sdk-android:integration-millicast:${theoplayer_sdk_version}"
182
- implementation "com.millicast:millicast-sdk-android:2.0.0"
183
- } else {
184
- println('Disable THEOplayer millicast extension.')
185
- compileOnly "com.theoplayer.theoplayer-sdk-android:integration-millicast:${theoplayer_sdk_version}"
186
- compileOnly "com.millicast:millicast-sdk-android:2.0.0"
187
- }
188
- }
134
+ def addOptiViewIntegration = { enabled, notation, additional = null ->
135
+ if (enabled) {
136
+ println("Enable $notation.")
137
+ implementation("com.theoplayer.theoplayer-sdk-android:$notation:$theoVersion") {
138
+ version {
139
+ strictly theoVersion
140
+ }
141
+ }
142
+ if (additional) implementation "$additional"
143
+ } else {
144
+ println("Disable $notation.")
145
+ compileOnly("com.theoplayer.theoplayer-sdk-android:$notation:$theoVersion")
146
+ if (additional) compileOnly "$additional"
147
+ }
148
+ }
189
149
 
190
- // Make sure to align all ads extension versions
191
- configurations.configureEach {
192
- resolutionStrategy {
193
- force "com.theoplayer.theoplayer-sdk-android:integration-ads-ima:$theoplayer_sdk_version"
194
- force "com.theoplayer.theoplayer-sdk-android:integration-ads-dai:$theoplayer_sdk_version"
195
- force "com.theoplayer.theoplayer-sdk-android:integration-ads-theoads:$theoplayer_sdk_version"
196
- }
150
+ //noinspection GradleDynamicVersion
151
+ implementation("com.facebook.react:react-native:+")
152
+ implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")
153
+ implementation("androidx.appcompat:appcompat:$appcompatVersion")
154
+ implementation("androidx.core:core-ktx:$corektxVersion")
155
+ implementation("com.google.code.gson:gson:$gsonVersion")
156
+
157
+ println("Using THEOplayer (${versionString(theoVersion)})")
158
+ implementation("com.theoplayer.theoplayer-sdk-android:core:$theoVersion")
159
+ implementation("com.theoplayer.theoplayer-sdk-android:ads-wrapper:$theoAdsWrapperVersion")
160
+ implementation("com.theoplayer.android-connector:mediasession:$theoMediaSessionVersion")
161
+
162
+ addOptiViewIntegration(enabledGoogleIMA || enabledGoogleDAI || enabledTHEOads, 'integration-ads-ima')
163
+ addOptiViewIntegration(enabledGoogleDAI || enabledTHEOads, 'integration-ads-dai')
164
+ addOptiViewIntegration(enabledTHEOads, 'integration-ads-theoads')
165
+ addOptiViewIntegration(enabledCast, 'integration-cast')
166
+ addOptiViewIntegration(enabledMillicast, 'integration-millicast', "com.millicast:millicast-sdk-android:$millicastVersion")
197
167
  }
@@ -27,6 +27,7 @@ private const val PROP_CAST_CONFIGURATION = "cast"
27
27
  private const val PROP_ADS_CONFIGURATION = "ads"
28
28
  private const val PROP_IMA_CONFIGURATION = "ima"
29
29
  private const val PROP_IMA_AD_LOAD_TIMEOUT = "adLoadTimeout"
30
+ private const val PROP_IMA_FOCUS_SKIP_BUTTON_WHEN_AVAILABLE = "focusSkipButtonWhenAvailable"
30
31
  private const val PROP_MEDIA_CONTROL = "mediaControl"
31
32
  private const val PROP_PPID = "ppid"
32
33
  private const val PROP_MAX_REDIRECTS = "maxRedirects"
@@ -39,6 +40,7 @@ private const val PROP_ALLOWED_MIMETYPES = "allowedMimeTypes"
39
40
  private const val PROP_THEOLIVE_CONFIG = "theoLive"
40
41
  private const val PROP_THEOLIVE_EXTERNAL_SESSION_ID = "externalSessionId"
41
42
  private const val PROP_THEOLIVE_ANALYTICS_DISABLED = "analyticsDisabled"
43
+ private const val PROP_THEOLIVE_DISCOVERY_URL = "discoveryUrl"
42
44
  private const val PROP_MULTIMEDIA_TUNNELING_ENABLED = "tunnelingEnabled"
43
45
 
44
46
  class PlayerConfigAdapter(private val configProps: ReadableMap?) {
@@ -176,6 +178,10 @@ class PlayerConfigAdapter(private val configProps: ReadableMap?) {
176
178
  if (hasKey(PROP_IMA_AD_LOAD_TIMEOUT)) {
177
179
  setLoadVideoTimeout(getInt(PROP_IMA_AD_LOAD_TIMEOUT) * 1000)
178
180
  }
181
+
182
+ if (hasKey(PROP_IMA_FOCUS_SKIP_BUTTON_WHEN_AVAILABLE)) {
183
+ focusSkipButtonWhenAvailable = getBoolean(PROP_IMA_FOCUS_SKIP_BUTTON_WHEN_AVAILABLE)
184
+ }
179
185
  }
180
186
  }
181
187
  }
@@ -219,7 +225,8 @@ class PlayerConfigAdapter(private val configProps: ReadableMap?) {
219
225
  externalSessionId = config?.getString(PROP_THEOLIVE_EXTERNAL_SESSION_ID),
220
226
  analyticsDisabled = if (config?.hasKey(PROP_THEOLIVE_ANALYTICS_DISABLED) == true)
221
227
  config.getBoolean(PROP_THEOLIVE_ANALYTICS_DISABLED)
222
- else false
228
+ else false,
229
+ discoveryUrl = config?.getString(PROP_THEOLIVE_DISCOVERY_URL)
223
230
  ).build()
224
231
  }
225
232
  }
@@ -266,3 +266,18 @@ RCT_EXTERN_METHOD(broadcastEvent:(nonnull NSNumber *)node
266
266
  event:(NSDictionary)event)
267
267
 
268
268
  @end
269
+
270
+ // ----------------------------------------------------------------------------
271
+ // THEOlive Module
272
+ // ----------------------------------------------------------------------------
273
+ @interface RCT_EXTERN_REMAP_MODULE(THEORCTTHEOliveModule, THEOplayerRCTTHEOliveAPI, NSObject)
274
+
275
+ RCT_EXTERN_METHOD(currentLatency:(nonnull NSNumber *)node
276
+ resolver:(RCTPromiseResolveBlock)resolve
277
+ rejecter:(RCTPromiseRejectBlock)reject)
278
+
279
+ RCT_EXTERN_METHOD(latencies:(nonnull NSNumber *)node
280
+ resolver:(RCTPromiseResolveBlock)resolve
281
+ rejecter:(RCTPromiseRejectBlock)reject)
282
+
283
+ @end
@@ -45,5 +45,8 @@ let DEBUG_CACHE_EVENTS = DEBUG && false
45
45
  // Debug flag to monitor cache API usage
46
46
  let DEBUG_CACHE_API = DEBUG && false
47
47
 
48
+ // Debug flag to monitor theolive API usage
49
+ let DEBUG_THEOLIVE_API = DEBUG && false
50
+
48
51
  // Debug flag to monitor AudioSession interruptions (e.g. phone cll)
49
52
  let DEBUG_INTERRUPTIONS = DEBUG && false
@@ -16,6 +16,7 @@ let PROP_KIND: String = "kind"
16
16
  let PROP_LANGUAGE: String = "language"
17
17
  let PROP_MODE: String = "mode"
18
18
  let PROP_LABEL: String = "label"
19
+ let PROP_UNLOCALIZED_LABEL: String = "unlocalizedLabel"
19
20
  let PROP_ENABLED: String = "enabled"
20
21
  let PROP_TYPE: String = "type"
21
22
  let PROP_QUALITIES: String = "qualities"
@@ -73,6 +74,7 @@ class THEOplayerRCTTrackMetadataAggregator {
73
74
  entry[PROP_LANGUAGE] = textTrack.language
74
75
  entry[PROP_MODE] = textTrack.mode._rawValue
75
76
  entry[PROP_LABEL] = textTrack.label
77
+ entry[PROP_UNLOCALIZED_LABEL] = textTrack.unlocalizedLabel
76
78
  entry[PROP_TYPE] = textTrack.type
77
79
  entry[PROP_SRC] = textTrack.src
78
80
  entry[PROP_FORCED] = textTrack.forced
@@ -175,6 +177,7 @@ class THEOplayerRCTTrackMetadataAggregator {
175
177
  entry[PROP_KIND] = audioTrack.kind
176
178
  entry[PROP_LANGUAGE] = audioTrack.language
177
179
  entry[PROP_LABEL] = audioTrack.label
180
+ entry[PROP_UNLOCALIZED_LABEL] = audioTrack.unlocalizedLabel
178
181
  entry[PROP_ENABLED] = audioTrack.enabled
179
182
  entry[PROP_QUALITIES] = [] // empty: qualities are not being exposed on iOS
180
183
  //entry[PROP_ACTIVE_QUALITY] = // undefined: qualities are not being exposed on iOS
@@ -216,6 +219,7 @@ class THEOplayerRCTTrackMetadataAggregator {
216
219
  entry[PROP_KIND] = videoTrack.kind
217
220
  entry[PROP_LANGUAGE] = videoTrack.language
218
221
  entry[PROP_LABEL] = videoTrack.label
222
+ entry[PROP_UNLOCALIZED_LABEL] = videoTrack.unlocalizedLabel
219
223
  entry[PROP_ENABLED] = videoTrack.enabled
220
224
  entry[PROP_QUALITIES] = [] // empty: qualities are not being exposed on iOS
221
225
  //entry[PROP_ACTIVE_QUALITY] = // undefined: qualities are not being exposed on iOS
@@ -17,6 +17,9 @@ import THEOplayerGoogleCastIntegration
17
17
  #if canImport(THEOplayerMillicastIntegration)
18
18
  import THEOplayerMillicastIntegration
19
19
  #endif
20
+ #if canImport(THEOplayerTHEOliveIntegration)
21
+ import THEOplayerTHEOliveIntegration
22
+ #endif
20
23
 
21
24
  public class THEOplayerRCTView: UIView {
22
25
  // MARK: Members
@@ -38,10 +41,11 @@ public class THEOplayerRCTView: UIView {
38
41
  var adsConfig = AdsConfig()
39
42
  var castConfig = CastConfig()
40
43
  var uiConfig = UIConfig()
44
+ var theoliveConfig = THEOliveConfig()
41
45
 
42
46
  // integrations
43
47
  #if canImport(THEOplayerTHEOadsIntegration)
44
- var theoAdsIntegration: THEOplayerTHEOadsIntegration.THEOadsIntegration?
48
+ var THEOadsIntegration: THEOplayerTHEOadsIntegration.THEOadsIntegration?
45
49
  #endif
46
50
  #if canImport(THEOplayerGoogleIMAIntegration)
47
51
  var imaIntegration: THEOplayerGoogleIMAIntegration.GoogleImaIntegration?
@@ -52,6 +56,9 @@ public class THEOplayerRCTView: UIView {
52
56
  #if canImport(THEOplayerMillicastIntegration)
53
57
  var millicastIntegration: THEOplayerMillicastIntegration.MillicastIntegration?
54
58
  #endif
59
+ #if canImport(THEOplayerTHEOliveIntegration)
60
+ var THEOliveIntegration: THEOplayerTHEOliveIntegration.THEOliveIntegration?
61
+ #endif
55
62
 
56
63
  var mediaControlConfig = MediaControlConfig() {
57
64
  didSet {
@@ -178,7 +185,8 @@ public class THEOplayerRCTView: UIView {
178
185
 
179
186
  self.initAdsIntegration()
180
187
  self.initCastIntegration()
181
- self.initTheoAdsIntegration()
188
+ self.initTHEOadsIntegration()
189
+ self.initTHEOliveIntegration()
182
190
  self.initMillicastIntegration()
183
191
  self.initBackgroundAudio()
184
192
  self.initPip()
@@ -205,6 +213,7 @@ public class THEOplayerRCTView: UIView {
205
213
  self.parseCastConfig(configDict: configDict)
206
214
  self.parseUIConfig(configDict: configDict)
207
215
  self.parseMediaControlConfig(configDict: configDict)
216
+ self.parseTHEOliveConfig(configDict: configDict)
208
217
  if DEBUG_VIEW { PrintUtils.printLog(logText: "[NATIVE] config prop updated.") }
209
218
 
210
219
  // Given the bridged config, create the initial THEOplayer instance
@@ -56,7 +56,7 @@ extension THEOplayerRCTSourceDescriptionBuilder {
56
56
  case "google-ima":
57
57
  return THEOplayerRCTSourceDescriptionBuilder.buildSingleGoogleIMAAdsDescription(adsData)
58
58
  case "theoads":
59
- return THEOplayerRCTSourceDescriptionBuilder.buildSingleTheoAdsDescription(adsData)
59
+ return THEOplayerRCTSourceDescriptionBuilder.buildSingleTHEOadsDescription(adsData)
60
60
  default:
61
61
  if DEBUG_SOURCE_DESCRIPTION_BUIDER { PrintUtils.printLog(logText: "[NATIVE] We currently require and only support the 'google-ima' or 'sgai' integration in the 'ads' description.") }
62
62
  }
@@ -1,4 +1,4 @@
1
- // THEOplayerRCTSourceDescriptionBuilder+TheoAds.swift
1
+ // THEOplayerRCTSourceDescriptionBuilder+THEOads.swift
2
2
 
3
3
  import Foundation
4
4
  import THEOplayerSDK
@@ -14,7 +14,7 @@ extension THEOplayerRCTSourceDescriptionBuilder {
14
14
  Creates a THEOplayer GoogleImaAdDescription. This requires an ads property in the RN source description.
15
15
  - returns: a THEOplayer GoogleImaAdDescription
16
16
  */
17
- static func buildSingleTheoAdsDescription(_ adsData: [String:Any]) -> AdDescription? {
17
+ static func buildSingleTHEOadsDescription(_ adsData: [String:Any]) -> AdDescription? {
18
18
  #if canImport(THEOplayerTHEOadsIntegration)
19
19
  //...
20
20
  let networkCode = adsData[SD_PROP_NETWORK_CODE] as? String
@@ -1,4 +1,4 @@
1
- // THEOplayerRCTView+TheoAds.swift
1
+ // THEOplayerRCTView+THEOads.swift
2
2
 
3
3
  import Foundation
4
4
  import THEOplayerSDK
@@ -8,15 +8,15 @@ import THEOplayerTHEOadsIntegration
8
8
  #endif
9
9
 
10
10
  extension THEOplayerRCTView {
11
- func initTheoAdsIntegration() {
11
+ func initTHEOadsIntegration() {
12
12
  guard let player = self.player else {
13
13
  return
14
14
  }
15
15
 
16
16
  #if canImport(THEOplayerTHEOadsIntegration)
17
17
  // setup integration
18
- self.theoAdsIntegration = THEOadsIntegrationFactory.createIntegration(on: player)
19
- player.addIntegration(self.theoAdsIntegration!)
18
+ self.THEOadsIntegration = THEOadsIntegrationFactory.createIntegration(on: player)
19
+ player.addIntegration(self.THEOadsIntegration!)
20
20
  #endif
21
21
 
22
22
  }
@@ -0,0 +1,85 @@
1
+ //
2
+ // THEOplayerRCTTHEOliveAPI.swift
3
+ // Theoplayer
4
+ //
5
+ import Foundation
6
+
7
+ #if canImport(THEOplayerTHEOliveIntegration)
8
+ import THEOplayerTHEOliveIntegration
9
+ #endif
10
+
11
+ let ERROR_MESSAGE_THEOLIVE_UNSUPPORTED_FEATURE = "This functionality is not supported by the provided iOS SDKs"
12
+ let ERROR_CODE_THEOLIVE_ACCESS_FAILURE = "theolive_access_failure"
13
+ let ERROR_MESSAGE_THEOLIVE_ACCESS_FAILURE = "Could not access THEOplayer THEOlive Module"
14
+
15
+ @objc(THEOplayerRCTTHEOliveAPI)
16
+ class THEOplayerRCTTHEOliveAPI: NSObject, RCTBridgeModule {
17
+ @objc var bridge: RCTBridge!
18
+
19
+ static func moduleName() -> String! {
20
+ return "THEORCTTHEOliveModule"
21
+ }
22
+
23
+ static func requiresMainQueueSetup() -> Bool {
24
+ return false
25
+ }
26
+
27
+ #if canImport(THEOplayerTHEOliveIntegration)
28
+ @objc(currentLatency:resolver:rejecter:)
29
+ func currentLatency(_ node: NSNumber, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
30
+ DispatchQueue.main.async {
31
+ if let theView = self.bridge.uiManager.view(forReactTag: node) as? THEOplayerRCTView,
32
+ let player = theView.player,
33
+ let theolive = player.theoLive {
34
+ var foundLatency: Double = -1
35
+ /*if let currentLatency = theolive.currentLatency {
36
+ foundLatency = currentLatency
37
+ }*/
38
+ resolve(foundLatency)
39
+ } else {
40
+ if DEBUG_THEOLIVE_API { PrintUtils.printLog(logText: "[NATIVE] Could not get currentLatency (THEOlive module unavailable).") }
41
+ reject(ERROR_CODE_THEOLIVE_ACCESS_FAILURE, ERROR_MESSAGE_THEOLIVE_ACCESS_FAILURE, nil)
42
+ }
43
+ }
44
+ }
45
+
46
+ @objc(latencies:resolver:rejecter:)
47
+ func latencies(_ node: NSNumber, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
48
+ DispatchQueue.main.async {
49
+ if let theView = self.bridge.uiManager.view(forReactTag: node) as? THEOplayerRCTView,
50
+ let player = theView.player,
51
+ let theolive = player.theoLive {
52
+ var foundLatencies: [String:Any] = [:]
53
+ /*if let latencies = theolive.latencies {
54
+ foundLatencies = [
55
+ "engineLatency": latencies.engineLatency,
56
+ "distributionLatency": latencies.distributionLatency,
57
+ "playerLatency": latencies.playerLatency,
58
+ "theoliveLatency": latencies.theoliveLatency
59
+ ]
60
+ }*/
61
+ resolve(foundLatencies)
62
+ } else {
63
+ if DEBUG_THEOLIVE_API { PrintUtils.printLog(logText: "[NATIVE] Could not get latencies (THEOlive module unavailable).") }
64
+ reject(ERROR_CODE_THEOLIVE_ACCESS_FAILURE, ERROR_MESSAGE_THEOLIVE_ACCESS_FAILURE, nil)
65
+ }
66
+ }
67
+ }
68
+
69
+ #else
70
+
71
+ @objc(currentLatency:resolver:rejecter:)
72
+ func currentLatency(_ node: NSNumber, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
73
+ if DEBUG_THEOLIVE_API { print(ERROR_MESSAGE_THEOLIVE_UNSUPPORTED_FEATURE) }
74
+ reject(ERROR_CODE_THEOLIVE_ACCESS_FAILURE, ERROR_MESSAGE_THEOLIVE_ACCESS_FAILURE, nil)
75
+ }
76
+
77
+ @objc(latencies:resolver:rejecter:)
78
+ func latencies(_ node: NSNumber, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
79
+ if DEBUG_THEOLIVE_API { print(ERROR_MESSAGE_THEOLIVE_UNSUPPORTED_FEATURE) }
80
+ reject(ERROR_CODE_THEOLIVE_ACCESS_FAILURE, ERROR_MESSAGE_THEOLIVE_ACCESS_FAILURE, nil)
81
+ }
82
+
83
+ #endif
84
+
85
+ }