bitmovin-player-react-native 0.37.0 → 0.39.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/RNBitmovinPlayer.podspec +1 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/bitmovin/player/reactnative/converter/JsonConverter.kt +9 -1
- package/android/src/main/java/com/bitmovin/player/reactnative/extensions/Bitmap.kt +12 -0
- package/ios/Event+JSON.swift +17 -9
- package/lib/index.d.mts +8 -0
- package/lib/index.d.ts +8 -0
- package/package.json +2 -2
- package/src/events.ts +8 -0
package/RNBitmovinPlayer.podspec
CHANGED
|
@@ -20,7 +20,7 @@ Pod::Spec.new do |s|
|
|
|
20
20
|
|
|
21
21
|
s.swift_version = "5.10"
|
|
22
22
|
s.dependency "React-Core"
|
|
23
|
-
s.dependency "BitmovinPlayer", "3.
|
|
23
|
+
s.dependency "BitmovinPlayer", "3.85.0"
|
|
24
24
|
s.ios.dependency "GoogleAds-IMA-iOS-SDK", "3.23.0"
|
|
25
25
|
s.tvos.dependency "GoogleAds-IMA-tvOS-SDK", "4.13.0"
|
|
26
26
|
end
|
package/android/build.gradle
CHANGED
|
@@ -105,6 +105,6 @@ dependencies {
|
|
|
105
105
|
// Bitmovin
|
|
106
106
|
implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.33.0'
|
|
107
107
|
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
|
|
108
|
-
implementation 'com.bitmovin.player:player:3.
|
|
109
|
-
implementation 'com.bitmovin.player:player-media-session:3.
|
|
108
|
+
implementation 'com.bitmovin.player:player:3.104.1+jason'
|
|
109
|
+
implementation 'com.bitmovin.player:player-media-session:3.104.1+jason'
|
|
110
110
|
}
|
|
@@ -5,6 +5,7 @@ import com.bitmovin.analytics.api.AnalyticsConfig
|
|
|
5
5
|
import com.bitmovin.analytics.api.CustomData
|
|
6
6
|
import com.bitmovin.analytics.api.DefaultMetadata
|
|
7
7
|
import com.bitmovin.analytics.api.SourceMetadata
|
|
8
|
+
import com.bitmovin.player.api.BandwidthMeterType
|
|
8
9
|
import com.bitmovin.player.api.DeviceDescription.DeviceName
|
|
9
10
|
import com.bitmovin.player.api.ForceReuseVideoCodecReason
|
|
10
11
|
import com.bitmovin.player.api.PlaybackConfig
|
|
@@ -68,6 +69,7 @@ import com.bitmovin.player.reactnative.extensions.putBoolean
|
|
|
68
69
|
import com.bitmovin.player.reactnative.extensions.putDouble
|
|
69
70
|
import com.bitmovin.player.reactnative.extensions.putInt
|
|
70
71
|
import com.bitmovin.player.reactnative.extensions.set
|
|
72
|
+
import com.bitmovin.player.reactnative.extensions.toBase64DataUri
|
|
71
73
|
import com.bitmovin.player.reactnative.extensions.toMap
|
|
72
74
|
import com.bitmovin.player.reactnative.extensions.toMapList
|
|
73
75
|
import com.bitmovin.player.reactnative.extensions.toReadableMap
|
|
@@ -184,7 +186,11 @@ private fun String.toForceReuseVideoCodecReason(): ForceReuseVideoCodecReason? =
|
|
|
184
186
|
*/
|
|
185
187
|
fun ReadableMap.toTweaksConfig(): TweaksConfig = TweaksConfig().apply {
|
|
186
188
|
withDouble("timeChangedInterval") { timeChangedInterval = it }
|
|
187
|
-
withInt("bandwidthEstimateWeightLimit") {
|
|
189
|
+
withInt("bandwidthEstimateWeightLimit") {
|
|
190
|
+
bandwidthMeterType = BandwidthMeterType.Default(
|
|
191
|
+
bandwidthEstimateWeightLimit = it,
|
|
192
|
+
)
|
|
193
|
+
}
|
|
188
194
|
withMap("devicesThatRequireSurfaceWorkaround") { devices ->
|
|
189
195
|
val deviceNames = devices.withStringArray("deviceNames") {
|
|
190
196
|
it.filterNotNull().map(::DeviceName)
|
|
@@ -502,12 +508,14 @@ fun PlayerEvent.toJson(): WritableMap {
|
|
|
502
508
|
json.putDouble("start", start)
|
|
503
509
|
json.putDouble("end", end)
|
|
504
510
|
json.putString("text", text)
|
|
511
|
+
json.putString("image", image?.toBase64DataUri())
|
|
505
512
|
}
|
|
506
513
|
|
|
507
514
|
is PlayerEvent.CueExit -> {
|
|
508
515
|
json.putDouble("start", start)
|
|
509
516
|
json.putDouble("end", end)
|
|
510
517
|
json.putString("text", text)
|
|
518
|
+
json.putString("image", image?.toBase64DataUri())
|
|
511
519
|
}
|
|
512
520
|
|
|
513
521
|
else -> {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
package com.bitmovin.player.reactnative.extensions
|
|
2
|
+
|
|
3
|
+
import android.graphics.Bitmap
|
|
4
|
+
import android.util.Base64
|
|
5
|
+
import java.io.ByteArrayOutputStream
|
|
6
|
+
|
|
7
|
+
fun Bitmap.toBase64DataUri(): String {
|
|
8
|
+
val byteArrayOutputStream = ByteArrayOutputStream()
|
|
9
|
+
this.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream)
|
|
10
|
+
val byteArray = byteArrayOutputStream.toByteArray()
|
|
11
|
+
return "data:image/png;base64," + Base64.encodeToString(byteArray, Base64.NO_WRAP)
|
|
12
|
+
}
|
package/ios/Event+JSON.swift
CHANGED
|
@@ -28,11 +28,11 @@ extension NSError: JsonConvertible {
|
|
|
28
28
|
|
|
29
29
|
extension DeficiencyData: JsonConvertible {
|
|
30
30
|
func toJSON() -> [AnyHashable: Any] {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
[
|
|
32
|
+
"code": code,
|
|
33
|
+
"message": message,
|
|
34
|
+
"underlyingError": underlyingError.toJSON()
|
|
35
|
+
]
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -417,11 +417,15 @@ extension PlaybackSpeedChangedEvent: JsonConvertible {
|
|
|
417
417
|
extension CueEnterEvent: JsonConvertible {
|
|
418
418
|
func toJSON() -> [AnyHashable: Any] {
|
|
419
419
|
toEventJSON {
|
|
420
|
-
[
|
|
420
|
+
var json: [AnyHashable: Any] = [
|
|
421
421
|
"start": startTime,
|
|
422
422
|
"end": endTime,
|
|
423
|
-
"text": text
|
|
423
|
+
"text": text,
|
|
424
424
|
]
|
|
425
|
+
if let imagePngData = image?.pngData() {
|
|
426
|
+
json["image"] = "data:image/png;base64,\(imagePngData.base64EncodedString())"
|
|
427
|
+
}
|
|
428
|
+
return json
|
|
425
429
|
}
|
|
426
430
|
}
|
|
427
431
|
}
|
|
@@ -429,11 +433,15 @@ extension CueEnterEvent: JsonConvertible {
|
|
|
429
433
|
extension CueExitEvent: JsonConvertible {
|
|
430
434
|
func toJSON() -> [AnyHashable: Any] {
|
|
431
435
|
toEventJSON {
|
|
432
|
-
[
|
|
436
|
+
var json: [AnyHashable: Any] = [
|
|
433
437
|
"start": startTime,
|
|
434
438
|
"end": endTime,
|
|
435
|
-
"text": text
|
|
439
|
+
"text": text,
|
|
436
440
|
]
|
|
441
|
+
if let imagePngData = image?.pngData() {
|
|
442
|
+
json["image"] = "data:image/png;base64,\(imagePngData.base64EncodedString())"
|
|
443
|
+
}
|
|
444
|
+
return json
|
|
437
445
|
}
|
|
438
446
|
}
|
|
439
447
|
}
|
package/lib/index.d.mts
CHANGED
|
@@ -1961,6 +1961,10 @@ interface CueEnterEvent extends Event {
|
|
|
1961
1961
|
* The textual content of this subtitle.
|
|
1962
1962
|
*/
|
|
1963
1963
|
text?: string;
|
|
1964
|
+
/**
|
|
1965
|
+
* Data URI for image data of this subtitle.
|
|
1966
|
+
*/
|
|
1967
|
+
image?: string;
|
|
1964
1968
|
}
|
|
1965
1969
|
/**
|
|
1966
1970
|
* Emitted when an active subtitle entry transitions into the inactive status.
|
|
@@ -1978,6 +1982,10 @@ interface CueExitEvent extends Event {
|
|
|
1978
1982
|
* The textual content of this subtitle.
|
|
1979
1983
|
*/
|
|
1980
1984
|
text?: string;
|
|
1985
|
+
/**
|
|
1986
|
+
* Data URI for image data of this subtitle.
|
|
1987
|
+
*/
|
|
1988
|
+
image?: string;
|
|
1981
1989
|
}
|
|
1982
1990
|
|
|
1983
1991
|
/**
|
package/lib/index.d.ts
CHANGED
|
@@ -1961,6 +1961,10 @@ interface CueEnterEvent extends Event {
|
|
|
1961
1961
|
* The textual content of this subtitle.
|
|
1962
1962
|
*/
|
|
1963
1963
|
text?: string;
|
|
1964
|
+
/**
|
|
1965
|
+
* Data URI for image data of this subtitle.
|
|
1966
|
+
*/
|
|
1967
|
+
image?: string;
|
|
1964
1968
|
}
|
|
1965
1969
|
/**
|
|
1966
1970
|
* Emitted when an active subtitle entry transitions into the inactive status.
|
|
@@ -1978,6 +1982,10 @@ interface CueExitEvent extends Event {
|
|
|
1978
1982
|
* The textual content of this subtitle.
|
|
1979
1983
|
*/
|
|
1980
1984
|
text?: string;
|
|
1985
|
+
/**
|
|
1986
|
+
* Data URI for image data of this subtitle.
|
|
1987
|
+
*/
|
|
1988
|
+
image?: string;
|
|
1981
1989
|
}
|
|
1982
1990
|
|
|
1983
1991
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bitmovin-player-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"description": "Official React Native bindings for Bitmovin's mobile Player SDKs.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.mjs",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"bootstrap": "yarn bootstrap:example && yarn bootstrap:integration-test",
|
|
40
40
|
"bootstrap:example": "yarn && yarn example && yarn example pods && yarn brew",
|
|
41
41
|
"bootstrap:integration-test": "yarn && yarn integration-test && yarn integration-test pods && yarn brew",
|
|
42
|
-
"brew": "[ \"$(uname)\" != Darwin ] || brew bundle install
|
|
42
|
+
"brew": "[ \"$(uname)\" != Darwin ] || brew bundle install",
|
|
43
43
|
"prepare": "husky install",
|
|
44
44
|
"docs": "typedoc"
|
|
45
45
|
},
|
package/src/events.ts
CHANGED
|
@@ -733,6 +733,10 @@ export interface CueEnterEvent extends Event {
|
|
|
733
733
|
* The textual content of this subtitle.
|
|
734
734
|
*/
|
|
735
735
|
text?: string;
|
|
736
|
+
/**
|
|
737
|
+
* Data URI for image data of this subtitle.
|
|
738
|
+
*/
|
|
739
|
+
image?: string;
|
|
736
740
|
}
|
|
737
741
|
|
|
738
742
|
/**
|
|
@@ -751,4 +755,8 @@ export interface CueExitEvent extends Event {
|
|
|
751
755
|
* The textual content of this subtitle.
|
|
752
756
|
*/
|
|
753
757
|
text?: string;
|
|
758
|
+
/**
|
|
759
|
+
* Data URI for image data of this subtitle.
|
|
760
|
+
*/
|
|
761
|
+
image?: string;
|
|
754
762
|
}
|