react-native-theoplayer 9.1.0 → 9.1.2
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 +13 -1
- package/android/src/main/java/com/theoplayer/ReactTHEOplayerContext.kt +12 -3
- package/android/src/main/java/com/theoplayer/audio/AudioFocusManager.kt +9 -1
- package/ios/THEOplayerRCTView.swift +0 -1
- package/lib/commonjs/manifest.json +1 -1
- package/lib/module/manifest.json +1 -1
- package/package.json +1 -1
- package/src/manifest.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,12 +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
|
+
## [9.1.2] - 25-05-14
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Prevented a possible crash on iOS/tvOS by deallocating the player instance without calling an explicit 'destroy' that brings the native player API at risk. The erroneous destroy method will be deprecated on the native SDK.
|
|
13
|
+
|
|
14
|
+
## [9.1.1] - 25-04-24
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Fixed an issue on Android where a muted player would still be paused by the `AudioFocusManager`.
|
|
19
|
+
|
|
8
20
|
## [9.1.0] - 25-04-23
|
|
9
21
|
|
|
10
22
|
### Added
|
|
11
23
|
|
|
12
24
|
- Added iOS support for `sseEndpoint` property to `TheoAdDescription`.
|
|
13
|
-
- Added iOS support for
|
|
25
|
+
- Added iOS support for side-loaded chapter TextTracks.
|
|
14
26
|
|
|
15
27
|
### Changed
|
|
16
28
|
|
|
@@ -20,7 +20,6 @@ import com.theoplayer.android.api.ads.dai.GoogleDaiIntegrationFactory
|
|
|
20
20
|
import com.theoplayer.android.api.ads.ima.GoogleImaConfiguration
|
|
21
21
|
import com.theoplayer.android.api.ads.ima.GoogleImaIntegration
|
|
22
22
|
import com.theoplayer.android.api.ads.ima.GoogleImaIntegrationFactory
|
|
23
|
-
import com.theoplayer.android.api.ads.theoads.TheoAdDescription
|
|
24
23
|
import com.theoplayer.android.api.ads.theoads.TheoAdsIntegration
|
|
25
24
|
import com.theoplayer.android.api.ads.theoads.TheoAdsIntegrationFactory
|
|
26
25
|
import com.theoplayer.android.api.cast.CastIntegration
|
|
@@ -354,7 +353,7 @@ class ReactTHEOplayerContext private constructor(
|
|
|
354
353
|
binder?.updateNotification(PlaybackStateCompat.STATE_PLAYING)
|
|
355
354
|
applyAllowedMediaControls()
|
|
356
355
|
audioBecomingNoisyManager.setEnabled(true)
|
|
357
|
-
audioFocusManager?.
|
|
356
|
+
audioFocusManager?.requestAudioFocus()
|
|
358
357
|
}
|
|
359
358
|
|
|
360
359
|
private val onPause = EventListener<PauseEvent> {
|
|
@@ -368,6 +367,14 @@ class ReactTHEOplayerContext private constructor(
|
|
|
368
367
|
audioFocusManager?.abandonAudioFocus()
|
|
369
368
|
}
|
|
370
369
|
|
|
370
|
+
private val onVolumeChange = EventListener<VolumeChangeEvent> {
|
|
371
|
+
if (player.isMuted) {
|
|
372
|
+
audioFocusManager?.abandonAudioFocus()
|
|
373
|
+
} else {
|
|
374
|
+
audioFocusManager?.requestAudioFocus()
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
371
378
|
private fun addListeners() {
|
|
372
379
|
player.apply {
|
|
373
380
|
addEventListener(PlayerEventTypes.SOURCECHANGE, onSourceChange)
|
|
@@ -375,6 +382,7 @@ class ReactTHEOplayerContext private constructor(
|
|
|
375
382
|
addEventListener(PlayerEventTypes.PAUSE, onPause)
|
|
376
383
|
addEventListener(PlayerEventTypes.PLAY, onPlay)
|
|
377
384
|
addEventListener(PlayerEventTypes.ENDED, onEnded)
|
|
385
|
+
addEventListener(PlayerEventTypes.VOLUMECHANGE, onVolumeChange)
|
|
378
386
|
}
|
|
379
387
|
}
|
|
380
388
|
|
|
@@ -385,6 +393,7 @@ class ReactTHEOplayerContext private constructor(
|
|
|
385
393
|
removeEventListener(PlayerEventTypes.PAUSE, onPause)
|
|
386
394
|
removeEventListener(PlayerEventTypes.PLAY, onPlay)
|
|
387
395
|
removeEventListener(PlayerEventTypes.ENDED, onEnded)
|
|
396
|
+
removeEventListener(PlayerEventTypes.VOLUMECHANGE, onVolumeChange)
|
|
388
397
|
}
|
|
389
398
|
}
|
|
390
399
|
|
|
@@ -416,7 +425,7 @@ class ReactTHEOplayerContext private constructor(
|
|
|
416
425
|
mediaSessionConnector?.setActive(BuildConfig.EXTENSION_MEDIASESSION)
|
|
417
426
|
playerView.onResume()
|
|
418
427
|
if (!player.isPaused) {
|
|
419
|
-
audioFocusManager?.
|
|
428
|
+
audioFocusManager?.requestAudioFocus()
|
|
420
429
|
}
|
|
421
430
|
}
|
|
422
431
|
|
|
@@ -120,6 +120,10 @@ class AudioFocusManager(
|
|
|
120
120
|
if (player?.ads?.isPlaying == true) {
|
|
121
121
|
return
|
|
122
122
|
}
|
|
123
|
+
// Don't pause when the player is muted
|
|
124
|
+
if (player?.isMuted == true) {
|
|
125
|
+
return
|
|
126
|
+
}
|
|
123
127
|
synchronized(focusLock) {
|
|
124
128
|
// We should only resume if playback was interrupted
|
|
125
129
|
resumeOnFocusGain = transient && !(player?.isPaused ?: true)
|
|
@@ -153,7 +157,11 @@ class AudioFocusManager(
|
|
|
153
157
|
*
|
|
154
158
|
* @return True if audio focus is granted, false otherwise.
|
|
155
159
|
*/
|
|
156
|
-
fun
|
|
160
|
+
fun requestAudioFocus(): Boolean {
|
|
161
|
+
if (player?.isMuted == true) {
|
|
162
|
+
// There is no point requesting audio focus when the player is muted.
|
|
163
|
+
return true
|
|
164
|
+
}
|
|
157
165
|
val result = audioManager?.let {
|
|
158
166
|
AudioManagerCompat.requestAudioFocus(it, audioFocusRequest)
|
|
159
167
|
}
|
|
@@ -112,7 +112,6 @@ public class THEOplayerRCTView: UIView {
|
|
|
112
112
|
|
|
113
113
|
self.destroyBackgroundAudio()
|
|
114
114
|
self.player?.removeAllIntegrations()
|
|
115
|
-
self.player?.destroy()
|
|
116
115
|
self.player = nil
|
|
117
116
|
if DEBUG_THEOPLAYER_INTERACTION { PrintUtils.printLog(logText: "[NATIVE] THEOplayer instance destroyed.") }
|
|
118
117
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"9.1.
|
|
1
|
+
{"version":"9.1.2","buildDate":"2025-05-14T13:39:57.943Z"}
|
package/lib/module/manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"9.1.
|
|
1
|
+
{"version":"9.1.2","buildDate":"2025-05-14T13:39:57.943Z"}
|
package/package.json
CHANGED
package/src/manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"9.1.
|
|
1
|
+
{"version":"9.1.2","buildDate":"2025-05-14T13:39:57.943Z"}
|