react-native-theoplayer 3.3.1 → 3.4.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 +19 -0
- package/android/build.gradle +5 -5
- package/android/src/main/AndroidManifest.xml +9 -0
- package/android/src/main/java/com/theoplayer/PlayerConfigAdapter.kt +21 -0
- package/android/src/main/java/com/theoplayer/ads/AdAdapter.kt +9 -12
- package/android/src/main/java/com/theoplayer/presentation/PipUtils.kt +15 -4
- package/android/src/main/java/com/theoplayer/presentation/PresentationManager.kt +23 -6
- package/android/src/main/res/values/strings.xml +1 -1
- package/app.plugin.js +57 -0
- package/ios/THEOplayerRCTTypeUtils.swift +2 -0
- package/ios/THEOplayerRCTView.swift +5 -2
- package/ios/ads/THEOplayerRCTAdAdapter.swift +8 -8
- package/ios/ui/THEOplayerRCTView+UIConfig.swift +23 -0
- package/lib/commonjs/api/config/PlayerConfiguration.js.map +1 -1
- package/lib/commonjs/api/track/TextTrack.js +1 -0
- package/lib/commonjs/api/track/TextTrack.js.map +1 -1
- package/lib/commonjs/api/ui/UIConfiguration.js +2 -0
- package/lib/commonjs/api/ui/UIConfiguration.js.map +1 -0
- package/lib/commonjs/api/ui/barrel.js +17 -0
- package/lib/commonjs/api/ui/barrel.js.map +1 -0
- package/lib/module/api/config/PlayerConfiguration.js.map +1 -1
- package/lib/module/api/track/TextTrack.js +1 -0
- package/lib/module/api/track/TextTrack.js.map +1 -1
- package/lib/module/api/ui/UIConfiguration.js +2 -0
- package/lib/module/api/ui/UIConfiguration.js.map +1 -0
- package/lib/module/api/ui/barrel.js +2 -0
- package/lib/module/api/ui/barrel.js.map +1 -0
- package/lib/typescript/api/config/PlayerConfiguration.d.ts +5 -0
- package/lib/typescript/api/track/TextTrack.d.ts +2 -1
- package/lib/typescript/api/ui/UIConfiguration.d.ts +18 -0
- package/lib/typescript/api/ui/barrel.d.ts +1 -0
- package/package.json +2 -1
- package/react-native-theoplayer.podspec +1 -1
- package/src/api/config/PlayerConfiguration.ts +6 -0
- package/src/api/track/TextTrack.ts +1 -0
- package/src/api/ui/UIConfiguration.ts +18 -0
- package/src/api/ui/barrel.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,25 @@ 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
|
+
## [3.4.0] - 23-12-21
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Added `ui` configuration object to `PlayerConfiguration` to configure the ads UI language.
|
|
13
|
+
- Added support for Android 14.
|
|
14
|
+
- Added Expo plugin to support Android dependency configuration.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Changed the Android notification channel name to `Notification channel`. It can be renamed by defining the `notification_channel_name` resource string.
|
|
19
|
+
|
|
20
|
+
## [3.3.2] - 23-12-12
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Fixed an issue on iOS & Android where timestamps in ad events were not consistently defined in seconds.
|
|
25
|
+
- Fixed an issue on tvOS where unknown AdIntegrationKind values resulted in build issues.
|
|
26
|
+
|
|
8
27
|
## [3.3.1] - 23-12-11
|
|
9
28
|
|
|
10
29
|
### Fixed
|
package/android/build.gradle
CHANGED
|
@@ -5,8 +5,8 @@ buildscript {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
dependencies {
|
|
8
|
-
classpath 'com.android.tools.build:gradle:4.2
|
|
9
|
-
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.
|
|
8
|
+
classpath 'com.android.tools.build:gradle:7.4.2'
|
|
9
|
+
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.21'
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -29,11 +29,11 @@ def enabledCast = safeExtGet("THEOplayer_extensionCast", 'false').toBoolean()
|
|
|
29
29
|
def enabledMediaSession = safeExtGet("THEOplayer_extensionMediaSession", 'true').toBoolean()
|
|
30
30
|
|
|
31
31
|
android {
|
|
32
|
-
compileSdk safeExtGet('THEOplayer_compileSdkVersion',
|
|
32
|
+
compileSdk safeExtGet('THEOplayer_compileSdkVersion', 34)
|
|
33
33
|
|
|
34
34
|
defaultConfig {
|
|
35
35
|
minSdkVersion safeExtGet('THEOplayer_minSdkVersion', 21)
|
|
36
|
-
targetSdkVersion safeExtGet('THEOplayer_targetSdkVersion',
|
|
36
|
+
targetSdkVersion safeExtGet('THEOplayer_targetSdkVersion', 34)
|
|
37
37
|
versionCode 1
|
|
38
38
|
versionName "1.0"
|
|
39
39
|
|
|
@@ -101,7 +101,7 @@ repositories {
|
|
|
101
101
|
dependencies {
|
|
102
102
|
//noinspection GradleDynamicVersion
|
|
103
103
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
104
|
-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.
|
|
104
|
+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3"
|
|
105
105
|
implementation "androidx.appcompat:appcompat:1.6.1"
|
|
106
106
|
|
|
107
107
|
// The minimum supported THEOplayer version is 6.0.0
|
|
@@ -25,6 +25,15 @@
|
|
|
25
25
|
-->
|
|
26
26
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
|
27
27
|
|
|
28
|
+
<!--
|
|
29
|
+
Allows a regular application to use Service.startForeground with the type "mediaPlayback".
|
|
30
|
+
Protection level: normal|instant
|
|
31
|
+
|
|
32
|
+
Apps that target Android 14 and use a foreground service must declare a specific
|
|
33
|
+
permission, based on the foreground service type that Android 14 introduces.
|
|
34
|
+
-->
|
|
35
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
|
|
36
|
+
|
|
28
37
|
<application>
|
|
29
38
|
|
|
30
39
|
<!-- Allow background audio playback by registering this service. -->
|
|
@@ -11,10 +11,12 @@ import com.theoplayer.android.api.cast.CastStrategy
|
|
|
11
11
|
import com.theoplayer.android.api.cast.CastConfiguration
|
|
12
12
|
import com.theoplayer.android.api.pip.PipConfiguration
|
|
13
13
|
import com.theoplayer.android.api.player.NetworkConfiguration
|
|
14
|
+
import com.theoplayer.android.api.ui.UIConfiguration
|
|
14
15
|
|
|
15
16
|
private const val PROP_LICENSE = "license"
|
|
16
17
|
private const val PROP_LICENSE_URL = "licenseUrl"
|
|
17
18
|
private const val PROP_PRELOAD = "preload"
|
|
19
|
+
private const val PROP_LANGUAGE = "language"
|
|
18
20
|
private const val PROP_UI_ENABLED = "uiEnabled"
|
|
19
21
|
private const val PROP_CAST_STRATEGY = "strategy"
|
|
20
22
|
private const val PROP_RETRY_CONFIG = "retryConfiguration"
|
|
@@ -24,6 +26,7 @@ private const val PROP_RETRY_MIN_BACKOFF = "minimumBackoff"
|
|
|
24
26
|
private const val PROP_RETRY_MAX_BACKOFF = "maximumBackoff"
|
|
25
27
|
private const val PROP_CAST_CONFIGURATION = "cast"
|
|
26
28
|
private const val PROP_ADS_CONFIGURATION = "ads"
|
|
29
|
+
private const val PROP_UI_CONFIGURATION = "ui"
|
|
27
30
|
|
|
28
31
|
class PlayerConfigAdapter(private val configProps: ReadableMap?) {
|
|
29
32
|
|
|
@@ -45,6 +48,9 @@ class PlayerConfigAdapter(private val configProps: ReadableMap?) {
|
|
|
45
48
|
if (hasKey(PROP_RETRY_CONFIG)) {
|
|
46
49
|
networkConfiguration(networkConfig())
|
|
47
50
|
}
|
|
51
|
+
if (hasKey(PROP_UI_CONFIGURATION)) {
|
|
52
|
+
ui(uiConfig())
|
|
53
|
+
}
|
|
48
54
|
if (hasKey(PROP_HLS_DATE_RANGE)) {
|
|
49
55
|
hlsDateRange(getBoolean(PROP_HLS_DATE_RANGE))
|
|
50
56
|
}
|
|
@@ -96,6 +102,21 @@ class PlayerConfigAdapter(private val configProps: ReadableMap?) {
|
|
|
96
102
|
}.build()
|
|
97
103
|
}
|
|
98
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Get UIConfiguration object; these properties apply:
|
|
107
|
+
* - language: The language used to localize the ui elements.
|
|
108
|
+
*/
|
|
109
|
+
private fun uiConfig(): UIConfiguration {
|
|
110
|
+
return UIConfiguration.Builder().apply {
|
|
111
|
+
configProps?.getMap(PROP_UI_CONFIGURATION)?.run {
|
|
112
|
+
val languageString = getString(PROP_LANGUAGE)
|
|
113
|
+
if (languageString != null && !TextUtils.isEmpty(languageString)) {
|
|
114
|
+
language(languageString)
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}.build()
|
|
118
|
+
}
|
|
119
|
+
|
|
99
120
|
/**
|
|
100
121
|
* Create a AdsRenderingSettings object.
|
|
101
122
|
*/
|
|
@@ -93,7 +93,7 @@ object AdAdapter {
|
|
|
93
93
|
adPayload.putInt(PROP_AD_BITRATE, ad.vastMediaBitrate)
|
|
94
94
|
try {
|
|
95
95
|
adPayload.putString(PROP_AD_TITLE, ad.imaAd.title)
|
|
96
|
-
adPayload.
|
|
96
|
+
adPayload.putDouble(PROP_AD_DURATION, ad.imaAd.duration)
|
|
97
97
|
adPayload.putDouble(PROP_AD_WIDTH, ad.imaAd.vastMediaWidth.toDouble())
|
|
98
98
|
adPayload.putDouble(PROP_AD_HEIGHT, ad.imaAd.vastMediaHeight.toDouble())
|
|
99
99
|
adPayload.putString(PROP_AD_CONTENT_TYPE, ad.imaAd.contentType)
|
|
@@ -139,12 +139,9 @@ object AdAdapter {
|
|
|
139
139
|
return adbreakPayload
|
|
140
140
|
}
|
|
141
141
|
adbreakPayload.putString(PROP_ADBREAK_INTEGRATION, adbreak.integration.type)
|
|
142
|
-
adbreakPayload.putInt(PROP_ADBREAK_MAXDURATION,
|
|
143
|
-
adbreakPayload.putInt(PROP_ADBREAK_TIMEOFFSET,
|
|
144
|
-
adbreakPayload.
|
|
145
|
-
PROP_ADBREAK_MAXREMAININGDURATION,
|
|
146
|
-
(1e3 * adbreak.maxRemainingDuration).toInt()
|
|
147
|
-
)
|
|
142
|
+
adbreakPayload.putInt(PROP_ADBREAK_MAXDURATION,adbreak.maxDuration)
|
|
143
|
+
adbreakPayload.putInt(PROP_ADBREAK_TIMEOFFSET, adbreak.timeOffset)
|
|
144
|
+
adbreakPayload.putDouble(PROP_ADBREAK_MAXREMAININGDURATION, adbreak.maxRemainingDuration)
|
|
148
145
|
val adsPayload = Arguments.createArray()
|
|
149
146
|
for (ad in adbreak.ads) {
|
|
150
147
|
// Some ads in the ad break are possibly not loaded yet.
|
|
@@ -260,21 +257,21 @@ object AdAdapter {
|
|
|
260
257
|
|
|
261
258
|
override fun getMaxDuration(): Int {
|
|
262
259
|
return if (adBreak.hasKey(PROP_ADBREAK_MAXDURATION))
|
|
263
|
-
|
|
260
|
+
adBreak.getInt(PROP_ADBREAK_MAXDURATION)
|
|
264
261
|
else
|
|
265
262
|
INVALID_INT
|
|
266
263
|
}
|
|
267
264
|
|
|
268
265
|
override fun getMaxRemainingDuration(): Double {
|
|
269
266
|
return if (adBreak.hasKey(PROP_ADBREAK_MAXREMAININGDURATION))
|
|
270
|
-
|
|
267
|
+
adBreak.getDouble(PROP_ADBREAK_MAXREMAININGDURATION)
|
|
271
268
|
else
|
|
272
269
|
INVALID_DOUBLE
|
|
273
270
|
}
|
|
274
271
|
|
|
275
272
|
override fun getTimeOffset(): Int {
|
|
276
273
|
return if (adBreak.hasKey(PROP_ADBREAK_TIMEOFFSET))
|
|
277
|
-
|
|
274
|
+
adBreak.getInt(PROP_ADBREAK_TIMEOFFSET)
|
|
278
275
|
else
|
|
279
276
|
0
|
|
280
277
|
}
|
|
@@ -289,13 +286,13 @@ object AdAdapter {
|
|
|
289
286
|
return object: com.google.ads.interactivemedia.v3.api.Ad {
|
|
290
287
|
override fun getDuration(): Double {
|
|
291
288
|
return ad?.run {
|
|
292
|
-
if (hasKey(PROP_AD_DURATION))
|
|
289
|
+
if (hasKey(PROP_AD_DURATION)) getDouble(PROP_AD_DURATION) else INVALID_DOUBLE
|
|
293
290
|
} ?: INVALID_DOUBLE
|
|
294
291
|
}
|
|
295
292
|
|
|
296
293
|
override fun getSkipTimeOffset(): Double {
|
|
297
294
|
return ad?.run {
|
|
298
|
-
if (hasKey(PROP_AD_SKIPOFFSET))
|
|
295
|
+
if (hasKey(PROP_AD_SKIPOFFSET)) getDouble(PROP_AD_SKIPOFFSET) else INVALID_DOUBLE
|
|
299
296
|
} ?: INVALID_DOUBLE
|
|
300
297
|
}
|
|
301
298
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package com.theoplayer.presentation
|
|
2
2
|
|
|
3
|
+
import android.annotation.SuppressLint
|
|
3
4
|
import android.app.PendingIntent
|
|
4
5
|
import android.app.PictureInPictureParams
|
|
5
6
|
import android.app.RemoteAction
|
|
@@ -68,6 +69,7 @@ class PipUtils(
|
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
|
|
72
|
+
@SuppressLint("UnspecifiedRegisterReceiverFlag")
|
|
71
73
|
fun enable() {
|
|
72
74
|
if (enabled) {
|
|
73
75
|
return
|
|
@@ -78,10 +80,19 @@ class PipUtils(
|
|
|
78
80
|
adEvents.forEach { action ->
|
|
79
81
|
player.ads.addEventListener(action, onAdAction)
|
|
80
82
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
|
|
84
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
85
|
+
reactContext.currentActivity?.registerReceiver(
|
|
86
|
+
broadcastReceiver,
|
|
87
|
+
IntentFilter(ACTION_MEDIA_CONTROL), Context.RECEIVER_EXPORTED
|
|
88
|
+
)
|
|
89
|
+
} else {
|
|
90
|
+
reactContext.currentActivity?.registerReceiver(
|
|
91
|
+
broadcastReceiver,
|
|
92
|
+
IntentFilter(ACTION_MEDIA_CONTROL)
|
|
93
|
+
)
|
|
94
|
+
}
|
|
95
|
+
|
|
85
96
|
enabled = true
|
|
86
97
|
}
|
|
87
98
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package com.theoplayer.presentation
|
|
2
2
|
|
|
3
|
+
import android.annotation.SuppressLint
|
|
3
4
|
import android.app.AppOpsManager
|
|
4
5
|
import android.content.BroadcastReceiver
|
|
5
6
|
import android.content.Context
|
|
@@ -18,6 +19,7 @@ import com.theoplayer.android.api.error.ErrorCode
|
|
|
18
19
|
import com.theoplayer.android.api.error.THEOplayerException
|
|
19
20
|
import com.theoplayer.android.api.player.PresentationMode
|
|
20
21
|
|
|
22
|
+
@SuppressLint("UnspecifiedRegisterReceiverFlag")
|
|
21
23
|
class PresentationManager(
|
|
22
24
|
private val viewCtx: ReactTHEOplayerContext,
|
|
23
25
|
private val reactContext: ThemedReactContext,
|
|
@@ -58,12 +60,27 @@ class PresentationManager(
|
|
|
58
60
|
supportsPip =
|
|
59
61
|
reactContext.packageManager.hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE)
|
|
60
62
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
|
|
64
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
65
|
+
reactContext.currentActivity?.registerReceiver(
|
|
66
|
+
onUserLeaveHintReceiver, IntentFilter("onUserLeaveHint"), Context.RECEIVER_EXPORTED
|
|
67
|
+
)
|
|
68
|
+
} else {
|
|
69
|
+
reactContext.currentActivity?.registerReceiver(
|
|
70
|
+
onUserLeaveHintReceiver, IntentFilter("onUserLeaveHint")
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
75
|
+
reactContext.currentActivity?.registerReceiver(
|
|
76
|
+
onPictureInPictureModeChanged, IntentFilter("onPictureInPictureModeChanged"),
|
|
77
|
+
Context.RECEIVER_EXPORTED
|
|
78
|
+
)
|
|
79
|
+
} else {
|
|
80
|
+
reactContext.currentActivity?.registerReceiver(
|
|
81
|
+
onPictureInPictureModeChanged, IntentFilter("onPictureInPictureModeChanged")
|
|
82
|
+
)
|
|
83
|
+
}
|
|
67
84
|
}
|
|
68
85
|
|
|
69
86
|
fun destroy() {
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
|
|
14
14
|
<string name="background_playback_service_description">THEOplayer service providing background playback.</string>
|
|
15
15
|
<string name="notification_channel_id">theoplayer_default_channel</string>
|
|
16
|
-
<string name="notification_channel_name" translatable="true">
|
|
16
|
+
<string name="notification_channel_name" translatable="true">Notification channel</string>
|
|
17
17
|
</resources>
|
package/app.plugin.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expo plugin for react-native-theoplayer.
|
|
3
|
+
*
|
|
4
|
+
* Example:
|
|
5
|
+
* "plugins": [
|
|
6
|
+
* ["react-native-theoplayer", {
|
|
7
|
+
* "extensions": ["ima", "dai", "cast"]
|
|
8
|
+
* }]
|
|
9
|
+
* ]
|
|
10
|
+
*/
|
|
11
|
+
const {withProjectBuildGradle, withGradleProperties} = require('@expo/config-plugins');
|
|
12
|
+
|
|
13
|
+
function mapAndroidExtensionKey(ext) {
|
|
14
|
+
switch (ext) {
|
|
15
|
+
case "ima":
|
|
16
|
+
return "THEOplayer_extensionGoogleIMA";
|
|
17
|
+
case "dai":
|
|
18
|
+
return "THEOplayer_extensionGoogleDAI";
|
|
19
|
+
case "cast":
|
|
20
|
+
return "THEOplayer_extensionCast";
|
|
21
|
+
default:
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const applyAndroidExtensions = (config, extensions) => {
|
|
27
|
+
return withGradleProperties(config, (config) => {
|
|
28
|
+
extensions?.forEach(ext => {
|
|
29
|
+
const key = mapAndroidExtensionKey(ext);
|
|
30
|
+
if (key) {
|
|
31
|
+
config.modResults.push({type: "property", key, value: true});
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return config;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const withAndroidTHEOplayer = (config, props) => {
|
|
39
|
+
// Apply Android extensions
|
|
40
|
+
const {extensions} = props;
|
|
41
|
+
config = applyAndroidExtensions(config, extensions);
|
|
42
|
+
|
|
43
|
+
// Add the localMaven repo to the project's repositories
|
|
44
|
+
return withProjectBuildGradle(config, (config) => {
|
|
45
|
+
const localMaven = 'maven { url("$rootDir/../node_modules/react-native-theoplayer/android/local") }';
|
|
46
|
+
config.modResults.contents = config.modResults.contents.replace(
|
|
47
|
+
/allprojects\s*\{\s*repositories\s*\{/,
|
|
48
|
+
`$&\n\t\t${localMaven}`
|
|
49
|
+
)
|
|
50
|
+
return config;
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
module.exports = (config, props) => {
|
|
55
|
+
// Apply Android modifications
|
|
56
|
+
return withAndroidTHEOplayer(config, props);
|
|
57
|
+
}
|
|
@@ -101,10 +101,12 @@ class THEOplayerRCTTypeUtils {
|
|
|
101
101
|
|
|
102
102
|
class func adIntegrationKind(_ integration: String) -> AdIntegrationKind {
|
|
103
103
|
switch integration {
|
|
104
|
+
#if os(iOS)
|
|
104
105
|
case "theo":
|
|
105
106
|
return AdIntegrationKind.theo
|
|
106
107
|
case "freewheel":
|
|
107
108
|
return AdIntegrationKind.freewheel
|
|
109
|
+
#endif
|
|
108
110
|
case "google-ima":
|
|
109
111
|
return AdIntegrationKind.google_ima
|
|
110
112
|
case "google-dai":
|
|
@@ -19,6 +19,7 @@ public class THEOplayerRCTView: UIView {
|
|
|
19
19
|
var presentationModeContext = THEOplayerRCTPresentationModeContext()
|
|
20
20
|
var adsConfig = AdsConfig()
|
|
21
21
|
var castConfig = CastConfig()
|
|
22
|
+
var uiConfig = UIConfig()
|
|
22
23
|
|
|
23
24
|
var pipConfig = PipConfig() {
|
|
24
25
|
didSet {
|
|
@@ -39,7 +40,6 @@ public class THEOplayerRCTView: UIView {
|
|
|
39
40
|
private var licenseUrl: String?
|
|
40
41
|
private var chromeless: Bool = true
|
|
41
42
|
private var hlsDateRange: Bool = false
|
|
42
|
-
private var config: THEOplayerConfiguration?
|
|
43
43
|
|
|
44
44
|
// MARK: - Initialisation / view setup
|
|
45
45
|
init() {
|
|
@@ -110,6 +110,7 @@ public class THEOplayerRCTView: UIView {
|
|
|
110
110
|
cssPaths: cssPaths,
|
|
111
111
|
pip: self.playerPipConfiguration(),
|
|
112
112
|
ads: self.playerAdsConfiguration(),
|
|
113
|
+
ui: self.playerUIConfiguration(),
|
|
113
114
|
cast: self.playerCastConfiguration(),
|
|
114
115
|
hlsDateRange: self.hlsDateRange,
|
|
115
116
|
license: self.license,
|
|
@@ -127,7 +128,8 @@ public class THEOplayerRCTView: UIView {
|
|
|
127
128
|
hlsDateRange: self.hlsDateRange,
|
|
128
129
|
license: self.license,
|
|
129
130
|
licenseUrl: self.licenseUrl,
|
|
130
|
-
pip: self.playerPipConfiguration()
|
|
131
|
+
pip: self.playerPipConfiguration(),
|
|
132
|
+
ui: self.playerUIConfiguration()))
|
|
131
133
|
self.initAdsIntegration()
|
|
132
134
|
self.initBackgroundAudio()
|
|
133
135
|
self.initPip()
|
|
@@ -176,6 +178,7 @@ public class THEOplayerRCTView: UIView {
|
|
|
176
178
|
self.hlsDateRange = configDict["hlsDateRange"] as? Bool ?? false
|
|
177
179
|
self.parseAdsConfig(configDict: configDict)
|
|
178
180
|
self.parseCastConfig(configDict: configDict)
|
|
181
|
+
self.parseUIConfig(configDict: configDict)
|
|
179
182
|
if DEBUG_VIEW { PrintUtils.printLog(logText: "[NATIVE] config prop updated.") }
|
|
180
183
|
|
|
181
184
|
// Given the bridged config, create the initial THEOplayer instance
|
|
@@ -51,7 +51,7 @@ class THEOplayerRCTAdAdapter {
|
|
|
51
51
|
adData[PROP_AD_RESOURCE_URI] = resourceURI
|
|
52
52
|
}
|
|
53
53
|
if let skipOffset = ad.skipOffset {
|
|
54
|
-
adData[PROP_AD_SKIP_OFFSET] = (skipOffset == -1) ? skipOffset : skipOffset
|
|
54
|
+
adData[PROP_AD_SKIP_OFFSET] = (skipOffset == -1) ? skipOffset : skipOffset
|
|
55
55
|
}
|
|
56
56
|
if processAdBreak,
|
|
57
57
|
let adBreak = ad.adBreak {
|
|
@@ -67,7 +67,7 @@ class THEOplayerRCTAdAdapter {
|
|
|
67
67
|
// Add additional properties for Linear Ads
|
|
68
68
|
if let linearAd = ad as? LinearAd {
|
|
69
69
|
if let adDuration = linearAd.duration {
|
|
70
|
-
adData[PROP_AD_DURATION] = adDuration
|
|
70
|
+
adData[PROP_AD_DURATION] = adDuration
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -170,9 +170,9 @@ class THEOplayerRCTAdAdapter {
|
|
|
170
170
|
|
|
171
171
|
class func fromAdBreak(adBreak: AdBreak) -> [String:Any] {
|
|
172
172
|
var adBreakData: [String:Any] = [:]
|
|
173
|
-
adBreakData[PROP_ADBREAK_MAX_DURATION] = adBreak.maxDuration
|
|
174
|
-
adBreakData[PROP_ADBREAK_TIME_OFFSET] = adBreak.timeOffset
|
|
175
|
-
adBreakData[PROP_ADBREAK_MAX_REMAINING_DURATION] = adBreak.maxRemainingDuration
|
|
173
|
+
adBreakData[PROP_ADBREAK_MAX_DURATION] = adBreak.maxDuration
|
|
174
|
+
adBreakData[PROP_ADBREAK_TIME_OFFSET] = adBreak.timeOffset
|
|
175
|
+
adBreakData[PROP_ADBREAK_MAX_REMAINING_DURATION] = adBreak.maxRemainingDuration
|
|
176
176
|
// process adds when adbreak contains them
|
|
177
177
|
if !adBreak.ads.isEmpty {
|
|
178
178
|
var adList: [[String:Any]] = []
|
|
@@ -203,9 +203,9 @@ class THEOplayerRCTAdAdapter {
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
return NativeAdBreak(ads: ads,
|
|
206
|
-
maxDuration: lround(
|
|
207
|
-
maxRemainingDuration:
|
|
208
|
-
timeOffset: lround(
|
|
206
|
+
maxDuration: lround((adBreakData[PROP_ADBREAK_MAX_DURATION] as? Double) ?? 0),
|
|
207
|
+
maxRemainingDuration: (adBreakData[PROP_ADBREAK_MAX_REMAINING_DURATION] as? Double) ?? 0,
|
|
208
|
+
timeOffset: lround((adBreakData[PROP_ADBREAK_TIME_OFFSET] as? Double) ?? 0))
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
class private func fromCompanionAds(companionAds: [CompanionAd?]) -> [[String:Any]] {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// THEOplayerRCTView+UIConfig.swift
|
|
2
|
+
|
|
3
|
+
import Foundation
|
|
4
|
+
import THEOplayerSDK
|
|
5
|
+
|
|
6
|
+
struct UIConfig {
|
|
7
|
+
var language: String = "en"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
extension THEOplayerRCTView {
|
|
11
|
+
|
|
12
|
+
func parseUIConfig(configDict: NSDictionary) {
|
|
13
|
+
if let uiConfig = configDict["ui"] as? NSDictionary {
|
|
14
|
+
if let uiLanguage = uiConfig["language"] as? String {
|
|
15
|
+
self.uiConfig.language = uiLanguage
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
func playerUIConfiguration() -> UIConfiguration? {
|
|
21
|
+
return UIConfiguration(language: self.uiConfig.language)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["PlayerConfiguration.ts"],"sourcesContent":["import type { AdsConfiguration } from '../ads/AdsConfiguration';\nimport type { CastConfiguration } from '../cast/CastConfiguration';\nimport type { MediaControlConfiguration } from '../media/MediaControlConfiguration';\nimport type { RetryConfiguration } from '../utils/RetryConfiguration';\n\nexport interface PlayerConfiguration {\n /**\n * The directory in which the THEOplayer library worker files are located.\n * These worker files are THEOplayer.transmux.*\n *\n * @remarks\n * <br/> - This parameter is required when using a HLS source and has no default.\n *\n * @example\n * `'/lib/theoplayer/'`\n */\n libraryLocation?: string;\n\n /**\n * The muted autoplay policy for web.\n *\n * @remarks\n * <br/> - The muted autoplay policy is impacted by this property and {@link SourceConfiguration.mutedAutoplay}.\n *\n * @defaultValue `'none'`.\n */\n mutedAutoplay?: MutedAutoplayConfiguration;\n\n /**\n * The ads configuration for the player.\n */\n ads?: AdsConfiguration;\n\n /**\n * The cast configuration for the player.\n */\n cast?: CastConfiguration;\n\n /**\n * The configuration of media controls and media sessions across platforms.\n */\n mediaControl?: MediaControlConfiguration;\n\n /**\n * The license for the player\n */\n readonly license?: string;\n\n /**\n * The url to fetch the license for the player\n */\n readonly licenseUrl?: string;\n\n /**\n * Sets whether the native player is chromeless (without UI).\n *\n * @remarks\n * <br/> - This parameter only applies to Web platforms.\n */\n readonly chromeless?: boolean;\n\n /**\n * Sets whether DateRange tags from the playlists should be imported as a textTrack.\n */\n readonly hlsDateRange?: boolean;\n\n /**\n * The retry configuration for the player.\n *\n * @remarks\n * <br/> - This parameter only applies to Web and Android platforms.\n */\n readonly retryConfiguration?: RetryConfiguration;\n}\n\n/**\n * The muted autoplay policy of a player for web.\n * <br/> - `'none'`: Disallow muted autoplay. If the player is requested to autoplay while unmuted, and the platform does not support unmuted autoplay, the player will not start playback.\n * <br/> - `'all'`: Allow muted autoplay. If the player is requested to autoplay while unmuted, and the platform supports muted autoplay, the player will start muted playback.\n * <br/> - `'content'`: Allow muted autoplay only for the main content. Disallow muted autoplay for e.g. advertisements. (Not yet supported.)\n *\n * @public\n */\nexport type MutedAutoplayConfiguration = 'none' | 'all' | 'content';\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["PlayerConfiguration.ts"],"sourcesContent":["import type { AdsConfiguration } from '../ads/AdsConfiguration';\nimport type { CastConfiguration } from '../cast/CastConfiguration';\nimport type { MediaControlConfiguration } from '../media/MediaControlConfiguration';\nimport type { RetryConfiguration } from '../utils/RetryConfiguration';\nimport type { UIConfiguration } from '../ui/UIConfiguration';\n\nexport interface PlayerConfiguration {\n /**\n * The directory in which the THEOplayer library worker files are located.\n * These worker files are THEOplayer.transmux.*\n *\n * @remarks\n * <br/> - This parameter is required when using a HLS source and has no default.\n *\n * @example\n * `'/lib/theoplayer/'`\n */\n libraryLocation?: string;\n\n /**\n * The muted autoplay policy for web.\n *\n * @remarks\n * <br/> - The muted autoplay policy is impacted by this property and {@link SourceConfiguration.mutedAutoplay}.\n *\n * @defaultValue `'none'`.\n */\n mutedAutoplay?: MutedAutoplayConfiguration;\n\n /**\n * The ads configuration for the player.\n */\n ads?: AdsConfiguration;\n\n /**\n * The cast configuration for the player.\n */\n cast?: CastConfiguration;\n\n /**\n * The ui configuration for the underlying native player. Applies to Ad UI.\n */\n ui?: UIConfiguration;\n\n /**\n * The configuration of media controls and media sessions across platforms.\n */\n mediaControl?: MediaControlConfiguration;\n\n /**\n * The license for the player\n */\n readonly license?: string;\n\n /**\n * The url to fetch the license for the player\n */\n readonly licenseUrl?: string;\n\n /**\n * Sets whether the native player is chromeless (without UI).\n *\n * @remarks\n * <br/> - This parameter only applies to Web platforms.\n */\n readonly chromeless?: boolean;\n\n /**\n * Sets whether DateRange tags from the playlists should be imported as a textTrack.\n */\n readonly hlsDateRange?: boolean;\n\n /**\n * The retry configuration for the player.\n *\n * @remarks\n * <br/> - This parameter only applies to Web and Android platforms.\n */\n readonly retryConfiguration?: RetryConfiguration;\n}\n\n/**\n * The muted autoplay policy of a player for web.\n * <br/> - `'none'`: Disallow muted autoplay. If the player is requested to autoplay while unmuted, and the platform does not support unmuted autoplay, the player will not start playback.\n * <br/> - `'all'`: Allow muted autoplay. If the player is requested to autoplay while unmuted, and the platform supports muted autoplay, the player will start muted playback.\n * <br/> - `'content'`: Allow muted autoplay only for the main content. Disallow muted autoplay for e.g. advertisements. (Not yet supported.)\n *\n * @public\n */\nexport type MutedAutoplayConfiguration = 'none' | 'all' | 'content';\n"],"mappings":""}
|
|
@@ -19,6 +19,7 @@ let TextTrackType = exports.TextTrackType = /*#__PURE__*/function (TextTrackType
|
|
|
19
19
|
TextTrackType["webvtt"] = "webvtt";
|
|
20
20
|
TextTrackType["daterange"] = "daterange";
|
|
21
21
|
TextTrackType["eventstream"] = "eventstream";
|
|
22
|
+
TextTrackType["emsg"] = "emsg";
|
|
22
23
|
return TextTrackType;
|
|
23
24
|
}({});
|
|
24
25
|
let TextTrackKind = exports.TextTrackKind = /*#__PURE__*/function (TextTrackKind) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TextTrackType","exports","TextTrackKind","TextTrackMode","filterRenderableTracks","textTracks","filter","textTrack","kind","filterThumbnailTracks","find","isThumbnailTrack","label","hasTextTrackCue","cue","cues","c","uid","removeTextTrackCue","addTextTrackCue","push","findTextTrackByUid","t"],"sources":["TextTrack.ts"],"sourcesContent":["import type { Track } from './Track';\nimport type { TextTrackCue } from './TextTrackCue';\n\nexport enum TextTrackType {\n cea608 = 'cea608',\n id3 = 'id3',\n srt = 'srt',\n ttml = 'ttml',\n webvtt = 'webvtt',\n daterange = 'daterange',\n eventstream = 'eventstream',\n}\n\nexport enum TextTrackKind {\n captions = 'captions',\n chapters = 'chapters',\n descriptions = 'descriptions',\n metadata = 'metadata',\n subtitles = 'subtitles',\n thumbnails = 'thumbnails',\n}\n\nexport enum TextTrackMode {\n disabled = 'disabled',\n showing = 'showing',\n hidden = 'hidden',\n}\n\nexport interface TextTrack extends Track {\n /**\n * The kind of the text track, represented by a value from the following list:\n * <br/> - `'subtitles'`: The track contains subtitles.\n * <br/> - `'captions'`: The track contains closed captions, a translation of dialogue and sound effects.\n * <br/> - `'descriptions'`: The track contains descriptions, a textual description of the video.\n * <br/> - `'chapters'`: The track contains chapter titles.\n * <br/> - `'metadata'`: The track contains metadata. This track will not serve display purposes.\n */\n readonly kind: TextTrackKind;\n\n /**\n * The label of the text track.\n */\n readonly label: string;\n\n /**\n * The language of the text track.\n */\n readonly language: string;\n\n /**\n * The identifier of the text track.\n *\n * @remarks\n * <br/> - This identifier can be used to distinguish between related tracks, e.g. tracks in the same list.\n */\n readonly id: string;\n\n /**\n * A unique identifier of the text track.\n *\n * @remarks\n * <br/> - This identifier is unique across tracks of a THEOplayer instance and can be used to distinguish between tracks.\n */\n readonly uid: number;\n\n /**\n * The mode of the text track, represented by a value from the following list:\n * <br/> - `'disabled'`: The track is disabled.\n * <br/> - `'showing'`: The track is showing.\n * <br/> - `'hidden'`: The track is enabled and loading cues, but not shown. (used for metadata tracks)\n */\n mode: TextTrackMode;\n\n /**\n * The content type of the text track.\n */\n readonly type: TextTrackType;\n\n /**\n * The list of cues of the track.\n *\n * @remarks\n * <br/> - If the {@link TextTrack.mode} is `'disabled'`, this property is `null`.\n */\n cues: TextTrackCue[] | null;\n\n /**\n * The source of the text track.\n */\n readonly src: string;\n\n /**\n * Indicates whether the track contains Forced Narrative cues.\n * This may only be true for subtitle tracks where\n * <br/> - For DASH: the corresponding AdaptationSet contains a child Role with its value attribute equal to `'forced_subtitle'`\n * <br/> - For HLS: the corresponding #EXT-X-MEDIA tag contains the attributes TYPE=SUBTITLES and FORCED=YES (not supported yet)\n */\n readonly forced: boolean;\n}\n\n/**\n * Retain renderable tracks.\n * https://html.spec.whatwg.org/multipage/embedded-content.html#text-track-showing\n */\nexport function filterRenderableTracks(textTracks: TextTrack[] | undefined): TextTrack[] | undefined {\n return textTracks && textTracks.filter((textTrack) => textTrack.kind === 'subtitles' || textTrack.kind === 'captions');\n}\n\n/**\n * Retain first thumbnail track encountered in the textTracks list.\n */\nexport function filterThumbnailTracks(textTracks: TextTrack[] | undefined): TextTrack | undefined {\n return textTracks && textTracks.find(isThumbnailTrack);\n}\n\n/**\n * Query whether a track is a valid thumbnail track.\n */\nexport function isThumbnailTrack(textTrack: TextTrack | undefined): boolean {\n return !!textTrack && (textTrack.kind === 'thumbnails' || (textTrack.kind === 'metadata' && textTrack.label === 'thumbnails'));\n}\n\nexport function hasTextTrackCue(textTrack: TextTrack, cue: TextTrackCue): boolean {\n return !!(textTrack.cues && cue && textTrack.cues.find((c) => cue.uid === c.uid));\n}\n\nexport function removeTextTrackCue(textTrack?: TextTrack, cue?: TextTrackCue) {\n if (textTrack && textTrack.cues && cue && hasTextTrackCue(textTrack, cue)) {\n textTrack.cues = textTrack.cues.filter((c) => c.uid !== cue.uid);\n }\n}\n\nexport function addTextTrackCue(textTrack?: TextTrack, cue?: TextTrackCue) {\n if (textTrack && textTrack.cues && cue && !hasTextTrackCue(textTrack, cue)) {\n textTrack.cues.push(cue);\n }\n}\n\nexport function findTextTrackByUid(textTracks: TextTrack[], uid: number): TextTrack | undefined {\n return textTracks.find((t) => t.uid === uid);\n}\n"],"mappings":";;;;;;;;;;;;;IAGYA,aAAa,GAAAC,OAAA,CAAAD,aAAA,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAAA,
|
|
1
|
+
{"version":3,"names":["TextTrackType","exports","TextTrackKind","TextTrackMode","filterRenderableTracks","textTracks","filter","textTrack","kind","filterThumbnailTracks","find","isThumbnailTrack","label","hasTextTrackCue","cue","cues","c","uid","removeTextTrackCue","addTextTrackCue","push","findTextTrackByUid","t"],"sources":["TextTrack.ts"],"sourcesContent":["import type { Track } from './Track';\nimport type { TextTrackCue } from './TextTrackCue';\n\nexport enum TextTrackType {\n cea608 = 'cea608',\n id3 = 'id3',\n srt = 'srt',\n ttml = 'ttml',\n webvtt = 'webvtt',\n daterange = 'daterange',\n eventstream = 'eventstream',\n emsg = 'emsg',\n}\n\nexport enum TextTrackKind {\n captions = 'captions',\n chapters = 'chapters',\n descriptions = 'descriptions',\n metadata = 'metadata',\n subtitles = 'subtitles',\n thumbnails = 'thumbnails',\n}\n\nexport enum TextTrackMode {\n disabled = 'disabled',\n showing = 'showing',\n hidden = 'hidden',\n}\n\nexport interface TextTrack extends Track {\n /**\n * The kind of the text track, represented by a value from the following list:\n * <br/> - `'subtitles'`: The track contains subtitles.\n * <br/> - `'captions'`: The track contains closed captions, a translation of dialogue and sound effects.\n * <br/> - `'descriptions'`: The track contains descriptions, a textual description of the video.\n * <br/> - `'chapters'`: The track contains chapter titles.\n * <br/> - `'metadata'`: The track contains metadata. This track will not serve display purposes.\n */\n readonly kind: TextTrackKind;\n\n /**\n * The label of the text track.\n */\n readonly label: string;\n\n /**\n * The language of the text track.\n */\n readonly language: string;\n\n /**\n * The identifier of the text track.\n *\n * @remarks\n * <br/> - This identifier can be used to distinguish between related tracks, e.g. tracks in the same list.\n */\n readonly id: string;\n\n /**\n * A unique identifier of the text track.\n *\n * @remarks\n * <br/> - This identifier is unique across tracks of a THEOplayer instance and can be used to distinguish between tracks.\n */\n readonly uid: number;\n\n /**\n * The mode of the text track, represented by a value from the following list:\n * <br/> - `'disabled'`: The track is disabled.\n * <br/> - `'showing'`: The track is showing.\n * <br/> - `'hidden'`: The track is enabled and loading cues, but not shown. (used for metadata tracks)\n */\n mode: TextTrackMode;\n\n /**\n * The content type of the text track.\n */\n readonly type: TextTrackType;\n\n /**\n * The list of cues of the track.\n *\n * @remarks\n * <br/> - If the {@link TextTrack.mode} is `'disabled'`, this property is `null`.\n */\n cues: TextTrackCue[] | null;\n\n /**\n * The source of the text track.\n */\n readonly src: string;\n\n /**\n * Indicates whether the track contains Forced Narrative cues.\n * This may only be true for subtitle tracks where\n * <br/> - For DASH: the corresponding AdaptationSet contains a child Role with its value attribute equal to `'forced_subtitle'`\n * <br/> - For HLS: the corresponding #EXT-X-MEDIA tag contains the attributes TYPE=SUBTITLES and FORCED=YES (not supported yet)\n */\n readonly forced: boolean;\n}\n\n/**\n * Retain renderable tracks.\n * https://html.spec.whatwg.org/multipage/embedded-content.html#text-track-showing\n */\nexport function filterRenderableTracks(textTracks: TextTrack[] | undefined): TextTrack[] | undefined {\n return textTracks && textTracks.filter((textTrack) => textTrack.kind === 'subtitles' || textTrack.kind === 'captions');\n}\n\n/**\n * Retain first thumbnail track encountered in the textTracks list.\n */\nexport function filterThumbnailTracks(textTracks: TextTrack[] | undefined): TextTrack | undefined {\n return textTracks && textTracks.find(isThumbnailTrack);\n}\n\n/**\n * Query whether a track is a valid thumbnail track.\n */\nexport function isThumbnailTrack(textTrack: TextTrack | undefined): boolean {\n return !!textTrack && (textTrack.kind === 'thumbnails' || (textTrack.kind === 'metadata' && textTrack.label === 'thumbnails'));\n}\n\nexport function hasTextTrackCue(textTrack: TextTrack, cue: TextTrackCue): boolean {\n return !!(textTrack.cues && cue && textTrack.cues.find((c) => cue.uid === c.uid));\n}\n\nexport function removeTextTrackCue(textTrack?: TextTrack, cue?: TextTrackCue) {\n if (textTrack && textTrack.cues && cue && hasTextTrackCue(textTrack, cue)) {\n textTrack.cues = textTrack.cues.filter((c) => c.uid !== cue.uid);\n }\n}\n\nexport function addTextTrackCue(textTrack?: TextTrack, cue?: TextTrackCue) {\n if (textTrack && textTrack.cues && cue && !hasTextTrackCue(textTrack, cue)) {\n textTrack.cues.push(cue);\n }\n}\n\nexport function findTextTrackByUid(textTracks: TextTrack[], uid: number): TextTrack | undefined {\n return textTracks.find((t) => t.uid === uid);\n}\n"],"mappings":";;;;;;;;;;;;;IAGYA,aAAa,GAAAC,OAAA,CAAAD,aAAA,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAAA,IAWbE,aAAa,GAAAD,OAAA,CAAAC,aAAA,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAAA,IASbC,aAAa,GAAAF,OAAA,CAAAE,aAAA,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AA8EzB;AACA;AACA;AACA;AACO,SAASC,sBAAsBA,CAACC,UAAmC,EAA2B;EACnG,OAAOA,UAAU,IAAIA,UAAU,CAACC,MAAM,CAAEC,SAAS,IAAKA,SAAS,CAACC,IAAI,KAAK,WAAW,IAAID,SAAS,CAACC,IAAI,KAAK,UAAU,CAAC;AACxH;;AAEA;AACA;AACA;AACO,SAASC,qBAAqBA,CAACJ,UAAmC,EAAyB;EAChG,OAAOA,UAAU,IAAIA,UAAU,CAACK,IAAI,CAACC,gBAAgB,CAAC;AACxD;;AAEA;AACA;AACA;AACO,SAASA,gBAAgBA,CAACJ,SAAgC,EAAW;EAC1E,OAAO,CAAC,CAACA,SAAS,KAAKA,SAAS,CAACC,IAAI,KAAK,YAAY,IAAKD,SAAS,CAACC,IAAI,KAAK,UAAU,IAAID,SAAS,CAACK,KAAK,KAAK,YAAa,CAAC;AAChI;AAEO,SAASC,eAAeA,CAACN,SAAoB,EAAEO,GAAiB,EAAW;EAChF,OAAO,CAAC,EAAEP,SAAS,CAACQ,IAAI,IAAID,GAAG,IAAIP,SAAS,CAACQ,IAAI,CAACL,IAAI,CAAEM,CAAC,IAAKF,GAAG,CAACG,GAAG,KAAKD,CAAC,CAACC,GAAG,CAAC,CAAC;AACnF;AAEO,SAASC,kBAAkBA,CAACX,SAAqB,EAAEO,GAAkB,EAAE;EAC5E,IAAIP,SAAS,IAAIA,SAAS,CAACQ,IAAI,IAAID,GAAG,IAAID,eAAe,CAACN,SAAS,EAAEO,GAAG,CAAC,EAAE;IACzEP,SAAS,CAACQ,IAAI,GAAGR,SAAS,CAACQ,IAAI,CAACT,MAAM,CAAEU,CAAC,IAAKA,CAAC,CAACC,GAAG,KAAKH,GAAG,CAACG,GAAG,CAAC;EAClE;AACF;AAEO,SAASE,eAAeA,CAACZ,SAAqB,EAAEO,GAAkB,EAAE;EACzE,IAAIP,SAAS,IAAIA,SAAS,CAACQ,IAAI,IAAID,GAAG,IAAI,CAACD,eAAe,CAACN,SAAS,EAAEO,GAAG,CAAC,EAAE;IAC1EP,SAAS,CAACQ,IAAI,CAACK,IAAI,CAACN,GAAG,CAAC;EAC1B;AACF;AAEO,SAASO,kBAAkBA,CAAChB,UAAuB,EAAEY,GAAW,EAAyB;EAC9F,OAAOZ,UAAU,CAACK,IAAI,CAAEY,CAAC,IAAKA,CAAC,CAACL,GAAG,KAAKA,GAAG,CAAC;AAC9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["UIConfiguration.ts"],"sourcesContent":["/**\n * Describes the UI related configuration of the player.\n *\n * @public\n */\nexport interface UIConfiguration {\n /**\n * The language which is used for localization.\n *\n * @example\n * ```\n * ui: {\n * language: 'es',\n * }\n * ```\n */\n language?: string;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _UIConfiguration = require("./UIConfiguration");
|
|
7
|
+
Object.keys(_UIConfiguration).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _UIConfiguration[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _UIConfiguration[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=barrel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_UIConfiguration","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["barrel.ts"],"sourcesContent":["export * from './UIConfiguration';\n"],"mappings":";;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,gBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,gBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,gBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["PlayerConfiguration.ts"],"sourcesContent":["import type { AdsConfiguration } from '../ads/AdsConfiguration';\nimport type { CastConfiguration } from '../cast/CastConfiguration';\nimport type { MediaControlConfiguration } from '../media/MediaControlConfiguration';\nimport type { RetryConfiguration } from '../utils/RetryConfiguration';\n\nexport interface PlayerConfiguration {\n /**\n * The directory in which the THEOplayer library worker files are located.\n * These worker files are THEOplayer.transmux.*\n *\n * @remarks\n * <br/> - This parameter is required when using a HLS source and has no default.\n *\n * @example\n * `'/lib/theoplayer/'`\n */\n libraryLocation?: string;\n\n /**\n * The muted autoplay policy for web.\n *\n * @remarks\n * <br/> - The muted autoplay policy is impacted by this property and {@link SourceConfiguration.mutedAutoplay}.\n *\n * @defaultValue `'none'`.\n */\n mutedAutoplay?: MutedAutoplayConfiguration;\n\n /**\n * The ads configuration for the player.\n */\n ads?: AdsConfiguration;\n\n /**\n * The cast configuration for the player.\n */\n cast?: CastConfiguration;\n\n /**\n * The configuration of media controls and media sessions across platforms.\n */\n mediaControl?: MediaControlConfiguration;\n\n /**\n * The license for the player\n */\n readonly license?: string;\n\n /**\n * The url to fetch the license for the player\n */\n readonly licenseUrl?: string;\n\n /**\n * Sets whether the native player is chromeless (without UI).\n *\n * @remarks\n * <br/> - This parameter only applies to Web platforms.\n */\n readonly chromeless?: boolean;\n\n /**\n * Sets whether DateRange tags from the playlists should be imported as a textTrack.\n */\n readonly hlsDateRange?: boolean;\n\n /**\n * The retry configuration for the player.\n *\n * @remarks\n * <br/> - This parameter only applies to Web and Android platforms.\n */\n readonly retryConfiguration?: RetryConfiguration;\n}\n\n/**\n * The muted autoplay policy of a player for web.\n * <br/> - `'none'`: Disallow muted autoplay. If the player is requested to autoplay while unmuted, and the platform does not support unmuted autoplay, the player will not start playback.\n * <br/> - `'all'`: Allow muted autoplay. If the player is requested to autoplay while unmuted, and the platform supports muted autoplay, the player will start muted playback.\n * <br/> - `'content'`: Allow muted autoplay only for the main content. Disallow muted autoplay for e.g. advertisements. (Not yet supported.)\n *\n * @public\n */\nexport type MutedAutoplayConfiguration = 'none' | 'all' | 'content';\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["PlayerConfiguration.ts"],"sourcesContent":["import type { AdsConfiguration } from '../ads/AdsConfiguration';\nimport type { CastConfiguration } from '../cast/CastConfiguration';\nimport type { MediaControlConfiguration } from '../media/MediaControlConfiguration';\nimport type { RetryConfiguration } from '../utils/RetryConfiguration';\nimport type { UIConfiguration } from '../ui/UIConfiguration';\n\nexport interface PlayerConfiguration {\n /**\n * The directory in which the THEOplayer library worker files are located.\n * These worker files are THEOplayer.transmux.*\n *\n * @remarks\n * <br/> - This parameter is required when using a HLS source and has no default.\n *\n * @example\n * `'/lib/theoplayer/'`\n */\n libraryLocation?: string;\n\n /**\n * The muted autoplay policy for web.\n *\n * @remarks\n * <br/> - The muted autoplay policy is impacted by this property and {@link SourceConfiguration.mutedAutoplay}.\n *\n * @defaultValue `'none'`.\n */\n mutedAutoplay?: MutedAutoplayConfiguration;\n\n /**\n * The ads configuration for the player.\n */\n ads?: AdsConfiguration;\n\n /**\n * The cast configuration for the player.\n */\n cast?: CastConfiguration;\n\n /**\n * The ui configuration for the underlying native player. Applies to Ad UI.\n */\n ui?: UIConfiguration;\n\n /**\n * The configuration of media controls and media sessions across platforms.\n */\n mediaControl?: MediaControlConfiguration;\n\n /**\n * The license for the player\n */\n readonly license?: string;\n\n /**\n * The url to fetch the license for the player\n */\n readonly licenseUrl?: string;\n\n /**\n * Sets whether the native player is chromeless (without UI).\n *\n * @remarks\n * <br/> - This parameter only applies to Web platforms.\n */\n readonly chromeless?: boolean;\n\n /**\n * Sets whether DateRange tags from the playlists should be imported as a textTrack.\n */\n readonly hlsDateRange?: boolean;\n\n /**\n * The retry configuration for the player.\n *\n * @remarks\n * <br/> - This parameter only applies to Web and Android platforms.\n */\n readonly retryConfiguration?: RetryConfiguration;\n}\n\n/**\n * The muted autoplay policy of a player for web.\n * <br/> - `'none'`: Disallow muted autoplay. If the player is requested to autoplay while unmuted, and the platform does not support unmuted autoplay, the player will not start playback.\n * <br/> - `'all'`: Allow muted autoplay. If the player is requested to autoplay while unmuted, and the platform supports muted autoplay, the player will start muted playback.\n * <br/> - `'content'`: Allow muted autoplay only for the main content. Disallow muted autoplay for e.g. advertisements. (Not yet supported.)\n *\n * @public\n */\nexport type MutedAutoplayConfiguration = 'none' | 'all' | 'content';\n"],"mappings":""}
|
|
@@ -6,6 +6,7 @@ export let TextTrackType = /*#__PURE__*/function (TextTrackType) {
|
|
|
6
6
|
TextTrackType["webvtt"] = "webvtt";
|
|
7
7
|
TextTrackType["daterange"] = "daterange";
|
|
8
8
|
TextTrackType["eventstream"] = "eventstream";
|
|
9
|
+
TextTrackType["emsg"] = "emsg";
|
|
9
10
|
return TextTrackType;
|
|
10
11
|
}({});
|
|
11
12
|
export let TextTrackKind = /*#__PURE__*/function (TextTrackKind) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TextTrackType","TextTrackKind","TextTrackMode","filterRenderableTracks","textTracks","filter","textTrack","kind","filterThumbnailTracks","find","isThumbnailTrack","label","hasTextTrackCue","cue","cues","c","uid","removeTextTrackCue","addTextTrackCue","push","findTextTrackByUid","t"],"sources":["TextTrack.ts"],"sourcesContent":["import type { Track } from './Track';\nimport type { TextTrackCue } from './TextTrackCue';\n\nexport enum TextTrackType {\n cea608 = 'cea608',\n id3 = 'id3',\n srt = 'srt',\n ttml = 'ttml',\n webvtt = 'webvtt',\n daterange = 'daterange',\n eventstream = 'eventstream',\n}\n\nexport enum TextTrackKind {\n captions = 'captions',\n chapters = 'chapters',\n descriptions = 'descriptions',\n metadata = 'metadata',\n subtitles = 'subtitles',\n thumbnails = 'thumbnails',\n}\n\nexport enum TextTrackMode {\n disabled = 'disabled',\n showing = 'showing',\n hidden = 'hidden',\n}\n\nexport interface TextTrack extends Track {\n /**\n * The kind of the text track, represented by a value from the following list:\n * <br/> - `'subtitles'`: The track contains subtitles.\n * <br/> - `'captions'`: The track contains closed captions, a translation of dialogue and sound effects.\n * <br/> - `'descriptions'`: The track contains descriptions, a textual description of the video.\n * <br/> - `'chapters'`: The track contains chapter titles.\n * <br/> - `'metadata'`: The track contains metadata. This track will not serve display purposes.\n */\n readonly kind: TextTrackKind;\n\n /**\n * The label of the text track.\n */\n readonly label: string;\n\n /**\n * The language of the text track.\n */\n readonly language: string;\n\n /**\n * The identifier of the text track.\n *\n * @remarks\n * <br/> - This identifier can be used to distinguish between related tracks, e.g. tracks in the same list.\n */\n readonly id: string;\n\n /**\n * A unique identifier of the text track.\n *\n * @remarks\n * <br/> - This identifier is unique across tracks of a THEOplayer instance and can be used to distinguish between tracks.\n */\n readonly uid: number;\n\n /**\n * The mode of the text track, represented by a value from the following list:\n * <br/> - `'disabled'`: The track is disabled.\n * <br/> - `'showing'`: The track is showing.\n * <br/> - `'hidden'`: The track is enabled and loading cues, but not shown. (used for metadata tracks)\n */\n mode: TextTrackMode;\n\n /**\n * The content type of the text track.\n */\n readonly type: TextTrackType;\n\n /**\n * The list of cues of the track.\n *\n * @remarks\n * <br/> - If the {@link TextTrack.mode} is `'disabled'`, this property is `null`.\n */\n cues: TextTrackCue[] | null;\n\n /**\n * The source of the text track.\n */\n readonly src: string;\n\n /**\n * Indicates whether the track contains Forced Narrative cues.\n * This may only be true for subtitle tracks where\n * <br/> - For DASH: the corresponding AdaptationSet contains a child Role with its value attribute equal to `'forced_subtitle'`\n * <br/> - For HLS: the corresponding #EXT-X-MEDIA tag contains the attributes TYPE=SUBTITLES and FORCED=YES (not supported yet)\n */\n readonly forced: boolean;\n}\n\n/**\n * Retain renderable tracks.\n * https://html.spec.whatwg.org/multipage/embedded-content.html#text-track-showing\n */\nexport function filterRenderableTracks(textTracks: TextTrack[] | undefined): TextTrack[] | undefined {\n return textTracks && textTracks.filter((textTrack) => textTrack.kind === 'subtitles' || textTrack.kind === 'captions');\n}\n\n/**\n * Retain first thumbnail track encountered in the textTracks list.\n */\nexport function filterThumbnailTracks(textTracks: TextTrack[] | undefined): TextTrack | undefined {\n return textTracks && textTracks.find(isThumbnailTrack);\n}\n\n/**\n * Query whether a track is a valid thumbnail track.\n */\nexport function isThumbnailTrack(textTrack: TextTrack | undefined): boolean {\n return !!textTrack && (textTrack.kind === 'thumbnails' || (textTrack.kind === 'metadata' && textTrack.label === 'thumbnails'));\n}\n\nexport function hasTextTrackCue(textTrack: TextTrack, cue: TextTrackCue): boolean {\n return !!(textTrack.cues && cue && textTrack.cues.find((c) => cue.uid === c.uid));\n}\n\nexport function removeTextTrackCue(textTrack?: TextTrack, cue?: TextTrackCue) {\n if (textTrack && textTrack.cues && cue && hasTextTrackCue(textTrack, cue)) {\n textTrack.cues = textTrack.cues.filter((c) => c.uid !== cue.uid);\n }\n}\n\nexport function addTextTrackCue(textTrack?: TextTrack, cue?: TextTrackCue) {\n if (textTrack && textTrack.cues && cue && !hasTextTrackCue(textTrack, cue)) {\n textTrack.cues.push(cue);\n }\n}\n\nexport function findTextTrackByUid(textTracks: TextTrack[], uid: number): TextTrack | undefined {\n return textTracks.find((t) => t.uid === uid);\n}\n"],"mappings":"AAGA,WAAYA,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;
|
|
1
|
+
{"version":3,"names":["TextTrackType","TextTrackKind","TextTrackMode","filterRenderableTracks","textTracks","filter","textTrack","kind","filterThumbnailTracks","find","isThumbnailTrack","label","hasTextTrackCue","cue","cues","c","uid","removeTextTrackCue","addTextTrackCue","push","findTextTrackByUid","t"],"sources":["TextTrack.ts"],"sourcesContent":["import type { Track } from './Track';\nimport type { TextTrackCue } from './TextTrackCue';\n\nexport enum TextTrackType {\n cea608 = 'cea608',\n id3 = 'id3',\n srt = 'srt',\n ttml = 'ttml',\n webvtt = 'webvtt',\n daterange = 'daterange',\n eventstream = 'eventstream',\n emsg = 'emsg',\n}\n\nexport enum TextTrackKind {\n captions = 'captions',\n chapters = 'chapters',\n descriptions = 'descriptions',\n metadata = 'metadata',\n subtitles = 'subtitles',\n thumbnails = 'thumbnails',\n}\n\nexport enum TextTrackMode {\n disabled = 'disabled',\n showing = 'showing',\n hidden = 'hidden',\n}\n\nexport interface TextTrack extends Track {\n /**\n * The kind of the text track, represented by a value from the following list:\n * <br/> - `'subtitles'`: The track contains subtitles.\n * <br/> - `'captions'`: The track contains closed captions, a translation of dialogue and sound effects.\n * <br/> - `'descriptions'`: The track contains descriptions, a textual description of the video.\n * <br/> - `'chapters'`: The track contains chapter titles.\n * <br/> - `'metadata'`: The track contains metadata. This track will not serve display purposes.\n */\n readonly kind: TextTrackKind;\n\n /**\n * The label of the text track.\n */\n readonly label: string;\n\n /**\n * The language of the text track.\n */\n readonly language: string;\n\n /**\n * The identifier of the text track.\n *\n * @remarks\n * <br/> - This identifier can be used to distinguish between related tracks, e.g. tracks in the same list.\n */\n readonly id: string;\n\n /**\n * A unique identifier of the text track.\n *\n * @remarks\n * <br/> - This identifier is unique across tracks of a THEOplayer instance and can be used to distinguish between tracks.\n */\n readonly uid: number;\n\n /**\n * The mode of the text track, represented by a value from the following list:\n * <br/> - `'disabled'`: The track is disabled.\n * <br/> - `'showing'`: The track is showing.\n * <br/> - `'hidden'`: The track is enabled and loading cues, but not shown. (used for metadata tracks)\n */\n mode: TextTrackMode;\n\n /**\n * The content type of the text track.\n */\n readonly type: TextTrackType;\n\n /**\n * The list of cues of the track.\n *\n * @remarks\n * <br/> - If the {@link TextTrack.mode} is `'disabled'`, this property is `null`.\n */\n cues: TextTrackCue[] | null;\n\n /**\n * The source of the text track.\n */\n readonly src: string;\n\n /**\n * Indicates whether the track contains Forced Narrative cues.\n * This may only be true for subtitle tracks where\n * <br/> - For DASH: the corresponding AdaptationSet contains a child Role with its value attribute equal to `'forced_subtitle'`\n * <br/> - For HLS: the corresponding #EXT-X-MEDIA tag contains the attributes TYPE=SUBTITLES and FORCED=YES (not supported yet)\n */\n readonly forced: boolean;\n}\n\n/**\n * Retain renderable tracks.\n * https://html.spec.whatwg.org/multipage/embedded-content.html#text-track-showing\n */\nexport function filterRenderableTracks(textTracks: TextTrack[] | undefined): TextTrack[] | undefined {\n return textTracks && textTracks.filter((textTrack) => textTrack.kind === 'subtitles' || textTrack.kind === 'captions');\n}\n\n/**\n * Retain first thumbnail track encountered in the textTracks list.\n */\nexport function filterThumbnailTracks(textTracks: TextTrack[] | undefined): TextTrack | undefined {\n return textTracks && textTracks.find(isThumbnailTrack);\n}\n\n/**\n * Query whether a track is a valid thumbnail track.\n */\nexport function isThumbnailTrack(textTrack: TextTrack | undefined): boolean {\n return !!textTrack && (textTrack.kind === 'thumbnails' || (textTrack.kind === 'metadata' && textTrack.label === 'thumbnails'));\n}\n\nexport function hasTextTrackCue(textTrack: TextTrack, cue: TextTrackCue): boolean {\n return !!(textTrack.cues && cue && textTrack.cues.find((c) => cue.uid === c.uid));\n}\n\nexport function removeTextTrackCue(textTrack?: TextTrack, cue?: TextTrackCue) {\n if (textTrack && textTrack.cues && cue && hasTextTrackCue(textTrack, cue)) {\n textTrack.cues = textTrack.cues.filter((c) => c.uid !== cue.uid);\n }\n}\n\nexport function addTextTrackCue(textTrack?: TextTrack, cue?: TextTrackCue) {\n if (textTrack && textTrack.cues && cue && !hasTextTrackCue(textTrack, cue)) {\n textTrack.cues.push(cue);\n }\n}\n\nexport function findTextTrackByUid(textTracks: TextTrack[], uid: number): TextTrack | undefined {\n return textTracks.find((t) => t.uid === uid);\n}\n"],"mappings":"AAGA,WAAYA,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAWzB,WAAYC,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AASzB,WAAYC,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AA8EzB;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAACC,UAAmC,EAA2B;EACnG,OAAOA,UAAU,IAAIA,UAAU,CAACC,MAAM,CAAEC,SAAS,IAAKA,SAAS,CAACC,IAAI,KAAK,WAAW,IAAID,SAAS,CAACC,IAAI,KAAK,UAAU,CAAC;AACxH;;AAEA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAACJ,UAAmC,EAAyB;EAChG,OAAOA,UAAU,IAAIA,UAAU,CAACK,IAAI,CAACC,gBAAgB,CAAC;AACxD;;AAEA;AACA;AACA;AACA,OAAO,SAASA,gBAAgBA,CAACJ,SAAgC,EAAW;EAC1E,OAAO,CAAC,CAACA,SAAS,KAAKA,SAAS,CAACC,IAAI,KAAK,YAAY,IAAKD,SAAS,CAACC,IAAI,KAAK,UAAU,IAAID,SAAS,CAACK,KAAK,KAAK,YAAa,CAAC;AAChI;AAEA,OAAO,SAASC,eAAeA,CAACN,SAAoB,EAAEO,GAAiB,EAAW;EAChF,OAAO,CAAC,EAAEP,SAAS,CAACQ,IAAI,IAAID,GAAG,IAAIP,SAAS,CAACQ,IAAI,CAACL,IAAI,CAAEM,CAAC,IAAKF,GAAG,CAACG,GAAG,KAAKD,CAAC,CAACC,GAAG,CAAC,CAAC;AACnF;AAEA,OAAO,SAASC,kBAAkBA,CAACX,SAAqB,EAAEO,GAAkB,EAAE;EAC5E,IAAIP,SAAS,IAAIA,SAAS,CAACQ,IAAI,IAAID,GAAG,IAAID,eAAe,CAACN,SAAS,EAAEO,GAAG,CAAC,EAAE;IACzEP,SAAS,CAACQ,IAAI,GAAGR,SAAS,CAACQ,IAAI,CAACT,MAAM,CAAEU,CAAC,IAAKA,CAAC,CAACC,GAAG,KAAKH,GAAG,CAACG,GAAG,CAAC;EAClE;AACF;AAEA,OAAO,SAASE,eAAeA,CAACZ,SAAqB,EAAEO,GAAkB,EAAE;EACzE,IAAIP,SAAS,IAAIA,SAAS,CAACQ,IAAI,IAAID,GAAG,IAAI,CAACD,eAAe,CAACN,SAAS,EAAEO,GAAG,CAAC,EAAE;IAC1EP,SAAS,CAACQ,IAAI,CAACK,IAAI,CAACN,GAAG,CAAC;EAC1B;AACF;AAEA,OAAO,SAASO,kBAAkBA,CAAChB,UAAuB,EAAEY,GAAW,EAAyB;EAC9F,OAAOZ,UAAU,CAACK,IAAI,CAAEY,CAAC,IAAKA,CAAC,CAACL,GAAG,KAAKA,GAAG,CAAC;AAC9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["UIConfiguration.ts"],"sourcesContent":["/**\n * Describes the UI related configuration of the player.\n *\n * @public\n */\nexport interface UIConfiguration {\n /**\n * The language which is used for localization.\n *\n * @example\n * ```\n * ui: {\n * language: 'es',\n * }\n * ```\n */\n language?: string;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["barrel.ts"],"sourcesContent":["export * from './UIConfiguration';\n"],"mappings":"AAAA,cAAc,mBAAmB"}
|
|
@@ -2,6 +2,7 @@ import type { AdsConfiguration } from '../ads/AdsConfiguration';
|
|
|
2
2
|
import type { CastConfiguration } from '../cast/CastConfiguration';
|
|
3
3
|
import type { MediaControlConfiguration } from '../media/MediaControlConfiguration';
|
|
4
4
|
import type { RetryConfiguration } from '../utils/RetryConfiguration';
|
|
5
|
+
import type { UIConfiguration } from '../ui/UIConfiguration';
|
|
5
6
|
export interface PlayerConfiguration {
|
|
6
7
|
/**
|
|
7
8
|
* The directory in which the THEOplayer library worker files are located.
|
|
@@ -31,6 +32,10 @@ export interface PlayerConfiguration {
|
|
|
31
32
|
* The cast configuration for the player.
|
|
32
33
|
*/
|
|
33
34
|
cast?: CastConfiguration;
|
|
35
|
+
/**
|
|
36
|
+
* The ui configuration for the underlying native player. Applies to Ad UI.
|
|
37
|
+
*/
|
|
38
|
+
ui?: UIConfiguration;
|
|
34
39
|
/**
|
|
35
40
|
* The configuration of media controls and media sessions across platforms.
|
|
36
41
|
*/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Describes the UI related configuration of the player.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface UIConfiguration {
|
|
7
|
+
/**
|
|
8
|
+
* The language which is used for localization.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```
|
|
12
|
+
* ui: {
|
|
13
|
+
* language: 'es',
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
language?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './UIConfiguration';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-theoplayer",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "A THEOplayer video component for react-native.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"react-native-theoplayer.podspec",
|
|
17
17
|
"react-native-theoplayer.json",
|
|
18
18
|
"CHANGELOG.md",
|
|
19
|
+
"app.plugin.js",
|
|
19
20
|
"!lib/typescript/example",
|
|
20
21
|
"!android/build",
|
|
21
22
|
"!ios/build",
|
|
@@ -20,7 +20,7 @@ Pod::Spec.new do |s|
|
|
|
20
20
|
s.platforms = { :ios => "12.0", :tvos => "12.0" }
|
|
21
21
|
s.source = { :git => "https://www.theoplayer.com/.git", :tag => "#{s.version}" }
|
|
22
22
|
|
|
23
|
-
s.source_files = 'ios/*.{h,m,swift}', 'ios/ads/*.swift', 'ios/casting/*.swift', 'ios/contentprotection/*.swift', 'ios/pip/*.swift', 'ios/backgroundAudio/*.swift', 'ios/cache/*.swift', 'ios/eventBroadcasting/*.swift'
|
|
23
|
+
s.source_files = 'ios/*.{h,m,swift}', 'ios/ads/*.swift', 'ios/casting/*.swift', 'ios/contentprotection/*.swift', 'ios/pip/*.swift', 'ios/backgroundAudio/*.swift', 'ios/cache/*.swift', 'ios/eventBroadcasting/*.swift' , 'ios/ui/*.swift'
|
|
24
24
|
s.resources = ['ios/*.css']
|
|
25
25
|
|
|
26
26
|
# ReactNative Dependency
|
|
@@ -2,6 +2,7 @@ import type { AdsConfiguration } from '../ads/AdsConfiguration';
|
|
|
2
2
|
import type { CastConfiguration } from '../cast/CastConfiguration';
|
|
3
3
|
import type { MediaControlConfiguration } from '../media/MediaControlConfiguration';
|
|
4
4
|
import type { RetryConfiguration } from '../utils/RetryConfiguration';
|
|
5
|
+
import type { UIConfiguration } from '../ui/UIConfiguration';
|
|
5
6
|
|
|
6
7
|
export interface PlayerConfiguration {
|
|
7
8
|
/**
|
|
@@ -36,6 +37,11 @@ export interface PlayerConfiguration {
|
|
|
36
37
|
*/
|
|
37
38
|
cast?: CastConfiguration;
|
|
38
39
|
|
|
40
|
+
/**
|
|
41
|
+
* The ui configuration for the underlying native player. Applies to Ad UI.
|
|
42
|
+
*/
|
|
43
|
+
ui?: UIConfiguration;
|
|
44
|
+
|
|
39
45
|
/**
|
|
40
46
|
* The configuration of media controls and media sessions across platforms.
|
|
41
47
|
*/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Describes the UI related configuration of the player.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface UIConfiguration {
|
|
7
|
+
/**
|
|
8
|
+
* The language which is used for localization.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```
|
|
12
|
+
* ui: {
|
|
13
|
+
* language: 'es',
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
language?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './UIConfiguration';
|