react-native-theoplayer 2.12.0 → 2.13.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 CHANGED
@@ -5,6 +5,19 @@ 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
+ ## [2.13.0] - 23-09-15
9
+
10
+ ### Fixed
11
+
12
+ - Fixed an issue where setting a new source on iOS, during DRM handling, would crash the application due to unsafe array access by different threads.
13
+
14
+ ## [2.12.1] - 23-09-14
15
+
16
+ ### Fixed
17
+
18
+ - Fixed an issue on Android where the player SDK dependency could resolve to version 6.+.
19
+ - Fixed an issue on iOS where the player integration dependencies could resolve to version 6.+.
20
+
8
21
  ## [2.12.0] - 23-09-04
9
22
 
10
23
  ### Added
package/README.md CHANGED
@@ -9,9 +9,9 @@ This projects falls under the license as defined in https://github.com/THEOplaye
9
9
  ## Table of Contents
10
10
 
11
11
  1. [Overview](#overview)
12
- 1. [How to use these guides](#how-to-use-these-guides)
13
- 1. [Prerequisites](#prerequisites)
14
- 2. [Getting Started](#getting-started)
12
+ 2. [How to use these guides](#how-to-use-these-guides)
13
+ 3. [Prerequisites](#prerequisites)
14
+ 4. [Getting Started](#getting-started)
15
15
 
16
16
  ## Overview
17
17
 
@@ -58,9 +58,11 @@ functionality. Currently, the following connectors are available:
58
58
  | Package name | Purpose | Registry |
59
59
  |---------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
60
60
  | [`@theoplayer/react-native-analytics-adobe`](https://github.com/THEOplayer/react-native-theoplayer-analytics) | Adobe analytics connector | [![npm](https://img.shields.io/npm/v/@theoplayer/react-native-analytics-adobe)](https://www.npmjs.com/package/@theoplayer/react-native-analytics-adobe) |
61
+ | [`@theoplayer/react-native-analytics-agama`](https://github.com/THEOplayer/react-native-theoplayer-analytics) | Agama analytics connector | [![npm](https://img.shields.io/npm/v/@theoplayer/react-native-analytics-agama)](https://www.npmjs.com/package/@theoplayer/react-native-analytics-agama) |
61
62
  | [`@theoplayer/react-native-analytics-comscore`](https://github.com/THEOplayer/react-native-theoplayer-analytics) | Comscore analytics connector | [![npm](https://img.shields.io/npm/v/@theoplayer/react-native-analytics-comscore)](https://www.npmjs.com/package/@theoplayer/react-native-analytics-comscore) |
62
63
  | [`@theoplayer/react-native-analytics-conviva`](https://github.com/THEOplayer/react-native-theoplayer-analytics) | Conviva analytics connector | [![npm](https://img.shields.io/npm/v/@theoplayer/react-native-analytics-conviva)](https://www.npmjs.com/package/@theoplayer/react-native-analytics-conviva) |
63
64
  | [`@theoplayer/react-native-analytics-nielsen`](https://github.com/THEOplayer/react-native-theoplayer-analytics) | Nielsen analytics connector | [![npm](https://img.shields.io/npm/v/@theoplayer/react-native-analytics-nielsen)](https://www.npmjs.com/package/@theoplayer/react-native-analytics-nielsen) |
65
+ | [`@theoplayer/react-native-analytics-youbora`](https://github.com/THEOplayer/react-native-theoplayer-analytics) | Youbora analytics connector | [![npm](https://img.shields.io/npm/v/@theoplayer/react-native-analytics-youbora)](https://www.npmjs.com/package/@theoplayer/react-native-analytics-youbora) |
64
66
  | [`@theoplayer/react-native-drm`](https://github.com/THEOplayer/react-native-theoplayer-drm) | Content protection (DRM) connectors | [![npm](https://img.shields.io/npm/v/@theoplayer/react-native-drm)](https://www.npmjs.com/package/@theoplayer/react-native-drm) |
65
67
  | [`@theoplayer/react-native-ui`](https://github.com/THEOplayer/react-native-theoplayer-ui) | React Native user interface | [![npm](https://img.shields.io/npm/v/@theoplayer/react-native-ui)](https://www.npmjs.com/package/@theoplayer/react-native-ui) |
66
68
  | [`@theoplayer/react-native-connector-template`](https://github.com/THEOplayer/react-native-theoplayer-connector-template) | A template for `react-native-theoplayer` connectors. | [![npm](https://img.shields.io/npm/v/@theoplayer/react-native-connector-template)](https://www.npmjs.com/package/@theoplayer/react-native-connector-template) |
@@ -105,8 +105,8 @@ dependencies {
105
105
  implementation "com.theoplayer.theoplayer-sdk-android:ads-wrapper:4.8.0"
106
106
  implementation "androidx.appcompat:appcompat:1.4.+"
107
107
 
108
- // The minimum supported version is 5.0.1
109
- def theoplayer_sdk_version = safeExtGet('THEOplayer_sdk', '[5.0.1,)')
108
+ // The minimum supported version is 5.10.0
109
+ def theoplayer_sdk_version = safeExtGet('THEOplayer_sdk', '[5.10,6.0)')
110
110
 
111
111
  // def theoplayer_mediasession_version = safeExtGet('THEOplayer_mediasession', theoplayer_sdk_version)
112
112
  def theoplayer_mediasession_version = "5.2.0-local"
@@ -3,7 +3,6 @@
3
3
  // Theoplayer
4
4
  //
5
5
  // Created by William van Haevre on 14/01/2022.
6
- // Copyright © 2022 Facebook. All rights reserved.
7
6
  //
8
7
 
9
8
  #import <React/RCTViewManager.h>
@@ -2,8 +2,6 @@
2
2
  // THEOplayerRCTNetworkUtils.swift
3
3
  // Theoplayer
4
4
  //
5
- // Created by William van Haevre on 14/11/2022.
6
- //
7
5
 
8
6
  import Foundation
9
7
 
@@ -2,9 +2,6 @@
2
2
  // Printing.swift
3
3
  // THEOliveSDK
4
4
  //
5
- // Created by William van Haevre on 21/06/2021.
6
- //
7
-
8
5
  import Foundation
9
6
 
10
7
  class PrintUtils {
@@ -2,9 +2,6 @@
2
2
  // THEOplayerRCTViewManager.swift
3
3
  // Theoplayer
4
4
  //
5
- // Created by William van Haevre on 14/01/2022.
6
- // Copyright © 2022 Facebook. All rights reserved.
7
- //
8
5
 
9
6
  import Foundation
10
7
  import UIKit
@@ -2,10 +2,6 @@
2
2
  // THEOplayerRCTAdsAPI.swift
3
3
  // Theoplayer
4
4
  //
5
- // Created by William van Haevre on 09/09/2022.
6
- // Copyright © 2022 Facebook. All rights reserved.
7
- //
8
-
9
5
  import Foundation
10
6
  import UIKit
11
7
  #if canImport(THEOplayerGoogleIMAIntegration)
@@ -2,9 +2,6 @@
2
2
  // THEOplayerRCTAdsAPI.swift
3
3
  // Theoplayer
4
4
  //
5
- // Created by William van Haevre on 09/09/2022.
6
- // Copyright © 2022 Facebook. All rights reserved.
7
- //
8
5
 
9
6
  import Foundation
10
7
 
@@ -2,9 +2,6 @@
2
2
  // THEOplayerRCTContentProtectionAPI.swift
3
3
  // Theoplayer
4
4
  //
5
- // Created by William van Haevre on 09/09/2022.
6
- // Copyright © 2022 Facebook. All rights reserved.
7
- //
8
5
 
9
6
  import Foundation
10
7
  import UIKit
@@ -22,16 +19,15 @@ let BRIDGE_REQUEST_TIMEOUT = 10.0
22
19
  @objc(THEOplayerRCTContentProtectionAPI)
23
20
  class THEOplayerRCTContentProtectionAPI: RCTEventEmitter {
24
21
 
25
- private var buildIntegrationCompletions: [String:(Bool) -> Void] = [:] // [requestId : completion]
26
- private var certificateRequestCompletions: [String:(Data?, Error?) -> Void] = [:] // [requestId : completion]
27
- private var certificateResponseCompletions: [String:(Data?, Error?) -> Void] = [:] // [requestId : completion]
28
- private var licenseRequestCompletions: [String:(Data?, Error?) -> Void] = [:] // [requestId : completion]
29
- private var licenseResponseCompletions: [String:(Data?, Error?) -> Void] = [:] // [requestId : completion]
30
- private var extractFairplayCompletions: [String:(String, Error?) -> Void] = [:] // [requestId : completion]
31
- private var requestTimers: [String:Timer] = [:] // [requestId : Timer]
32
- private var requestIntegrationIds: [String:String] = [:] // [requestId : integrationId]
33
- private var requestKeySystemIds: [String:String] = [:] // [requestId : keySystemId]
34
-
22
+ private var buildIntegrationCompletions: THEOplayerRCTSafeMap<String, (Bool) -> Void> = THEOplayerRCTSafeMap<String, (Bool) -> Void>() // [requestId : completion]
23
+ private var certificateRequestCompletions: THEOplayerRCTSafeMap<String, (Data?, Error?) -> Void> = THEOplayerRCTSafeMap<String, (Data?, Error?) -> Void>() // [requestId : completion]
24
+ private var certificateResponseCompletions: THEOplayerRCTSafeMap<String, (Data?, Error?) -> Void> = THEOplayerRCTSafeMap<String, (Data?, Error?) -> Void>() // [requestId : completion]
25
+ private var licenseRequestCompletions: THEOplayerRCTSafeMap<String, (Data?, Error?) -> Void> = THEOplayerRCTSafeMap<String, (Data?, Error?) -> Void>() // [requestId : completion]
26
+ private var licenseResponseCompletions: THEOplayerRCTSafeMap<String, (Data?, Error?) -> Void> = THEOplayerRCTSafeMap<String, (Data?, Error?) -> Void>() // [requestId : completion]
27
+ private var extractFairplayCompletions: THEOplayerRCTSafeMap<String, (String, Error?) -> Void> = THEOplayerRCTSafeMap<String, (String, Error?) -> Void>() // [requestId : completion]
28
+ private var requestTimers: THEOplayerRCTSafeMap<String, Timer> = THEOplayerRCTSafeMap<String, Timer>() // [requestId : Timer]
29
+ private var requestIntegrationIds: THEOplayerRCTSafeMap<String, String> = THEOplayerRCTSafeMap<String, String>() // [requestId : integrationId]
30
+ private var requestKeySystemIds: THEOplayerRCTSafeMap<String, String> = THEOplayerRCTSafeMap<String, String>() // [requestId : keySystemId]
35
31
 
36
32
  override static func moduleName() -> String! {
37
33
  return "ContentProtectionModule"
@@ -54,7 +50,7 @@ class THEOplayerRCTContentProtectionAPI: RCTEventEmitter {
54
50
  private func invalidateRequestWithId(_ requestId: String) {
55
51
  if let timer = self.requestTimers[requestId] {
56
52
  timer.invalidate()
57
- self.requestTimers.removeValue(forKey: requestId)
53
+ _ = self.requestTimers.removeValue(forKey: requestId)
58
54
  }
59
55
  }
60
56
 
@@ -71,7 +67,7 @@ class THEOplayerRCTContentProtectionAPI: RCTEventEmitter {
71
67
  self.requestTimers[requestId] = Timer.scheduledTimer(withTimeInterval: BRIDGE_REQUEST_TIMEOUT, repeats: false, block: { t in
72
68
  if DEBUG_CONTENT_PROTECTION_API { print(CPI_TAG, "Build timeout reached: removing completion for request with Id \(requestId)") }
73
69
  self.invalidateRequestWithId(requestId)
74
- self.buildIntegrationCompletions.removeValue(forKey: requestId)
70
+ _ = self.buildIntegrationCompletions.removeValue(forKey: requestId)
75
71
  })
76
72
  }
77
73
 
@@ -89,9 +85,9 @@ class THEOplayerRCTContentProtectionAPI: RCTEventEmitter {
89
85
  self.requestTimers[requestId] = Timer.scheduledTimer(withTimeInterval: BRIDGE_REQUEST_TIMEOUT, repeats: false, block: { t in
90
86
  if DEBUG_CONTENT_PROTECTION_API { print(CPI_TAG, "onCertificateRequest timeout reached: removing completion for request with Id \(requestId)") }
91
87
  self.invalidateRequestWithId(requestId)
92
- self.requestIntegrationIds.removeValue(forKey: requestId)
93
- self.requestKeySystemIds.removeValue(forKey: requestId)
94
- self.certificateRequestCompletions.removeValue(forKey: requestId)
88
+ _ = self.requestIntegrationIds.removeValue(forKey: requestId)
89
+ _ = self.requestKeySystemIds.removeValue(forKey: requestId)
90
+ _ = self.certificateRequestCompletions.removeValue(forKey: requestId)
95
91
  })
96
92
  }
97
93
 
@@ -107,7 +103,7 @@ class THEOplayerRCTContentProtectionAPI: RCTEventEmitter {
107
103
  self.requestTimers[requestId] = Timer.scheduledTimer(withTimeInterval: BRIDGE_REQUEST_TIMEOUT, repeats: false, block: { t in
108
104
  if DEBUG_CONTENT_PROTECTION_API { print(CPI_TAG, "onCertificateResponse timeout reached: removing completion for request with Id \(requestId)") }
109
105
  self.invalidateRequestWithId(requestId)
110
- self.certificateResponseCompletions.removeValue(forKey: requestId)
106
+ _ = self.certificateResponseCompletions.removeValue(forKey: requestId)
111
107
  })
112
108
  }
113
109
 
@@ -125,9 +121,9 @@ class THEOplayerRCTContentProtectionAPI: RCTEventEmitter {
125
121
  self.requestTimers[requestId] = Timer.scheduledTimer(withTimeInterval: BRIDGE_REQUEST_TIMEOUT, repeats: false, block: { t in
126
122
  if DEBUG_CONTENT_PROTECTION_API { print(CPI_TAG, "onLicenseRequest timeout reached: removing completion for request with Id \(requestId)") }
127
123
  self.invalidateRequestWithId(requestId)
128
- self.requestIntegrationIds.removeValue(forKey: requestId)
129
- self.requestKeySystemIds.removeValue(forKey: requestId)
130
- self.licenseRequestCompletions.removeValue(forKey: requestId)
124
+ _ = self.requestIntegrationIds.removeValue(forKey: requestId)
125
+ _ = self.requestKeySystemIds.removeValue(forKey: requestId)
126
+ _ = self.licenseRequestCompletions.removeValue(forKey: requestId)
131
127
  })
132
128
  }
133
129
 
@@ -143,7 +139,7 @@ class THEOplayerRCTContentProtectionAPI: RCTEventEmitter {
143
139
  self.requestTimers[requestId] = Timer.scheduledTimer(withTimeInterval: BRIDGE_REQUEST_TIMEOUT, repeats: false, block: { t in
144
140
  if DEBUG_CONTENT_PROTECTION_API { print(CPI_TAG, "onLicenseResponse timeout reached: removing completion for request with Id \(requestId)") }
145
141
  self.invalidateRequestWithId(requestId)
146
- self.licenseResponseCompletions.removeValue(forKey: requestId)
142
+ _ = self.licenseResponseCompletions.removeValue(forKey: requestId)
147
143
  })
148
144
  }
149
145
 
@@ -160,7 +156,7 @@ class THEOplayerRCTContentProtectionAPI: RCTEventEmitter {
160
156
  self.requestTimers[requestId] = Timer.scheduledTimer(withTimeInterval: BRIDGE_REQUEST_TIMEOUT, repeats: false, block: { t in
161
157
  if DEBUG_CONTENT_PROTECTION_API { print(CPI_TAG, "Fairplay contentId extraction timeout reached: removing completion for request with Id \(requestId)") }
162
158
  self.invalidateRequestWithId(requestId)
163
- self.extractFairplayCompletions.removeValue(forKey: requestId)
159
+ _ = self.extractFairplayCompletions.removeValue(forKey: requestId)
164
160
  })
165
161
  }
166
162
 
@@ -2,8 +2,6 @@
2
2
  // THEOplayerRCTContentProtectionIntegration.swift
3
3
  // Theoplayer
4
4
  //
5
- // Created by William van Haevre on 28/10/2022.
6
- //
7
5
 
8
6
  import Foundation
9
7
  import THEOplayerSDK
@@ -2,8 +2,6 @@
2
2
  // THEOplayerRCTContentProtectionIntegrationFactory.swift
3
3
  // Theoplayer
4
4
  //
5
- // Created by William van Haevre on 28/10/2022.
6
- //
7
5
 
8
6
  import Foundation
9
7
  import THEOplayerSDK
@@ -0,0 +1,64 @@
1
+ //
2
+ // THEOplayerRCTSafeMap.swift
3
+ // Theoplayer
4
+ //
5
+
6
+ import Foundation
7
+
8
+ class THEOplayerRCTSafeMap<K: Hashable,V>: Collection {
9
+ private var unsafeMap: [K: V]
10
+ private let concurrentQueue = DispatchQueue(label: "Safe Queue", attributes: .concurrent)
11
+
12
+ var startIndex: Dictionary<K, V>.Index {
13
+ self.concurrentQueue.sync {
14
+ return self.unsafeMap.startIndex
15
+ }
16
+ }
17
+
18
+ var endIndex: Dictionary<K, V>.Index {
19
+ self.concurrentQueue.sync {
20
+ return self.unsafeMap.endIndex
21
+ }
22
+ }
23
+
24
+ init(dict: [K: V] = [K: V]()) {
25
+ self.unsafeMap = dict
26
+ }
27
+
28
+ func index(after i: Dictionary<K, V>.Index) -> Dictionary<K, V>.Index {
29
+ self.concurrentQueue.sync {
30
+ return self.unsafeMap.index(after: i)
31
+ }
32
+ }
33
+
34
+ subscript(key: K) -> V? {
35
+ set(newValue) {
36
+ self.concurrentQueue.sync(flags: .barrier) {[weak self] in
37
+ self?.unsafeMap[key] = newValue
38
+ }
39
+ }
40
+ get {
41
+ self.concurrentQueue.sync {
42
+ return self.unsafeMap[key]
43
+ }
44
+ }
45
+ }
46
+
47
+ subscript(index: Dictionary<K, V>.Index) -> Dictionary<K, V>.Element {
48
+ self.concurrentQueue.sync {
49
+ return self.unsafeMap[index]
50
+ }
51
+ }
52
+
53
+ func removeValue(forKey key: K) -> V? {
54
+ self.concurrentQueue.sync(flags: .barrier) {[weak self] in
55
+ return self?.unsafeMap.removeValue(forKey: key)
56
+ }
57
+ }
58
+
59
+ func removeAll() {
60
+ self.concurrentQueue.sync(flags: .barrier) {[weak self] in
61
+ self?.unsafeMap.removeAll()
62
+ }
63
+ }
64
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-theoplayer",
3
- "version": "2.12.0",
3
+ "version": "2.13.0",
4
4
  "description": "A THEOplayer video component for react-native.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -36,18 +36,18 @@ Pod::Spec.new do |s|
36
36
  }
37
37
  else
38
38
  puts "Using THEOplayer-core SDK"
39
- s.dependency "THEOplayerSDK-core", "~> 5.9"
39
+ s.dependency "THEOplayerSDK-core", "~> 5.11"
40
40
  if theofeatures.include?("GOOGLE_IMA")
41
41
  puts "Adding THEOplayer-Integration-GoogleIMA"
42
- s.dependency "THEOplayer-Integration-GoogleIMA"
42
+ s.dependency "THEOplayer-Integration-GoogleIMA", "~> 5.11"
43
43
  end
44
44
  if theofeatures.include?("CHROMECAST")
45
45
  puts "Adding THEOplayer-Integration-GoogleCast"
46
- s.ios.dependency "THEOplayer-Integration-GoogleCast"
46
+ s.ios.dependency "THEOplayer-Integration-GoogleCast", "~> 5.11"
47
47
  end
48
48
  if theofeatures.include?("SIDELOADED_TEXTTRACKS")
49
49
  puts "Adding THEOplayer-Connector-SideloadedSubtitle"
50
- s.dependency "THEOplayer-Connector-SideloadedSubtitle"
50
+ s.dependency "THEOplayer-Connector-SideloadedSubtitle", "~> 5.11"
51
51
  end
52
52
  end
53
53