react-native-theoplayer 3.3.2 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/android/build.gradle +9 -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/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/THEOplayerRCTView.swift +5 -2
- package/ios/ui/THEOplayerRCTView+UIConfig.swift +23 -0
- package/lib/commonjs/api/config/PlayerConfiguration.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/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/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/ui/UIConfiguration.ts +18 -0
- package/src/api/ui/barrel.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,24 @@ 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.1] - 23-12-21
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Take the Kotlin Gradle plugin version from the root project, if specified.
|
|
13
|
+
|
|
14
|
+
## [3.4.0] - 23-12-21
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Added `ui` configuration object to `PlayerConfiguration` to configure the ads UI language.
|
|
19
|
+
- Added support for Android 14.
|
|
20
|
+
- Added Expo plugin to support Android dependency configuration.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Changed the Android notification channel name to `Notification channel`. It can be renamed by defining the `notification_channel_name` resource string.
|
|
25
|
+
|
|
8
26
|
## [3.3.2] - 23-12-12
|
|
9
27
|
|
|
10
28
|
### Fixed
|
package/android/build.gradle
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
buildscript {
|
|
2
|
+
ext.safeExtGet = { prop, fallback ->
|
|
3
|
+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
4
|
+
}
|
|
5
|
+
|
|
2
6
|
repositories {
|
|
3
7
|
google()
|
|
4
8
|
mavenCentral()
|
|
5
9
|
}
|
|
6
10
|
|
|
7
11
|
dependencies {
|
|
8
|
-
classpath 'com.android.tools.build:gradle:4.2
|
|
9
|
-
classpath
|
|
12
|
+
classpath 'com.android.tools.build:gradle:7.4.2'
|
|
13
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.8.21')}"
|
|
10
14
|
}
|
|
11
15
|
}
|
|
12
16
|
|
|
@@ -29,11 +33,11 @@ def enabledCast = safeExtGet("THEOplayer_extensionCast", 'false').toBoolean()
|
|
|
29
33
|
def enabledMediaSession = safeExtGet("THEOplayer_extensionMediaSession", 'true').toBoolean()
|
|
30
34
|
|
|
31
35
|
android {
|
|
32
|
-
compileSdk safeExtGet('THEOplayer_compileSdkVersion',
|
|
36
|
+
compileSdk safeExtGet('THEOplayer_compileSdkVersion', 34)
|
|
33
37
|
|
|
34
38
|
defaultConfig {
|
|
35
39
|
minSdkVersion safeExtGet('THEOplayer_minSdkVersion', 21)
|
|
36
|
-
targetSdkVersion safeExtGet('THEOplayer_targetSdkVersion',
|
|
40
|
+
targetSdkVersion safeExtGet('THEOplayer_targetSdkVersion', 34)
|
|
37
41
|
versionCode 1
|
|
38
42
|
versionName "1.0"
|
|
39
43
|
|
|
@@ -101,7 +105,7 @@ repositories {
|
|
|
101
105
|
dependencies {
|
|
102
106
|
//noinspection GradleDynamicVersion
|
|
103
107
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
104
|
-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.
|
|
108
|
+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3"
|
|
105
109
|
implementation "androidx.appcompat:appcompat:1.6.1"
|
|
106
110
|
|
|
107
111
|
// 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
|
*/
|
|
@@ -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
|
+
}
|
|
@@ -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
|
|
@@ -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":""}
|
|
@@ -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":""}
|
|
@@ -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.1",
|
|
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';
|