bitmovin-player-react-native 0.38.0 → 0.40.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.
@@ -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.85.0"
23
+ s.dependency "BitmovinPlayer", "3.85.2"
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
@@ -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.104.1+jason'
109
- implementation 'com.bitmovin.player:player-media-session:3.104.1+jason'
108
+ implementation 'com.bitmovin.player:player:3.104.2+jason'
109
+ implementation 'com.bitmovin.player:player-media-session:3.104.2+jason'
110
110
  }
@@ -69,6 +69,7 @@ import com.bitmovin.player.reactnative.extensions.putBoolean
69
69
  import com.bitmovin.player.reactnative.extensions.putDouble
70
70
  import com.bitmovin.player.reactnative.extensions.putInt
71
71
  import com.bitmovin.player.reactnative.extensions.set
72
+ import com.bitmovin.player.reactnative.extensions.toBase64DataUri
72
73
  import com.bitmovin.player.reactnative.extensions.toMap
73
74
  import com.bitmovin.player.reactnative.extensions.toMapList
74
75
  import com.bitmovin.player.reactnative.extensions.toReadableMap
@@ -507,12 +508,14 @@ fun PlayerEvent.toJson(): WritableMap {
507
508
  json.putDouble("start", start)
508
509
  json.putDouble("end", end)
509
510
  json.putString("text", text)
511
+ json.putString("image", image?.toBase64DataUri())
510
512
  }
511
513
 
512
514
  is PlayerEvent.CueExit -> {
513
515
  json.putDouble("start", start)
514
516
  json.putDouble("end", end)
515
517
  json.putString("text", text)
518
+ json.putString("image", image?.toBase64DataUri())
516
519
  }
517
520
 
518
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
+ }
@@ -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.38.0",
3
+ "version": "0.40.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 --no-lock",
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
  }