@100mslive/react-native-hms 1.12.2 → 2.0.0-alpha.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/android/build.gradle +70 -12
- package/android/src/main/java/com/reactnativehmssdk/HMSAudioshareActivity.kt +8 -8
- package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayer.kt +38 -12
- package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayerManagerImpl.kt +185 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +20 -10
- package/android/src/main/java/com/reactnativehmssdk/{HMSManager.kt → HMSManagerImpl.kt} +28 -111
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +3 -3
- package/android/src/main/java/com/reactnativehmssdk/HMSReactNativeEvent.kt +29 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSSDKViewManagerImpl.kt +119 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSView.kt +33 -5
- package/android/src/main/java/com/reactnativehmssdk/HmsScreenshareActivity.kt +9 -9
- package/android/src/main/java/com/reactnativehmssdk/HmssdkPackage.kt +42 -3
- package/android/src/newarch/java/com/reactnativehmssdk/HMSHLSPlayerManager.kt +128 -0
- package/android/src/newarch/java/com/reactnativehmssdk/HMSManager.kt +332 -0
- package/android/src/newarch/java/com/reactnativehmssdk/HMSSDKViewManager.kt +102 -0
- package/android/src/oldarch/java/com/reactnativehmssdk/HMSHLSPlayerManager.kt +61 -0
- package/android/src/oldarch/java/com/reactnativehmssdk/HMSManager.kt +351 -0
- package/android/src/oldarch/java/com/reactnativehmssdk/HMSSDKViewManager.kt +87 -0
- package/ios/HMSHLSPlayerComponentView.mm +325 -0
- package/ios/HMSHLSPlayerManager.m +10 -0
- package/ios/HMSHLSPlayerManager.swift +91 -79
- package/ios/HMSManager.m +13 -0
- package/ios/HMSManager.mm +365 -0
- package/ios/HMSManager.swift +109 -103
- package/ios/HMSView.m +9 -0
- package/ios/HMSView.swift +44 -14
- package/ios/HMSViewComponentView.mm +229 -0
- package/lib/commonjs/classes/HmsView.js +45 -48
- package/lib/commonjs/classes/HmsView.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js +46 -26
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/RCTHMSHLSPlayer.js +5 -4
- package/lib/commonjs/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -1
- package/lib/commonjs/modules/HMSManagerModule.js +3 -10
- package/lib/commonjs/modules/HMSManagerModule.js.map +1 -1
- package/lib/commonjs/specs/HMSHLSPlayerNativeComponent.js +75 -0
- package/lib/commonjs/specs/HMSHLSPlayerNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/HMSViewNativeComponent.js +55 -0
- package/lib/commonjs/specs/HMSViewNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/NativeHMSManager.js +38 -0
- package/lib/commonjs/specs/NativeHMSManager.js.map +1 -0
- package/lib/module/classes/HmsView.js +46 -49
- package/lib/module/classes/HmsView.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js +48 -28
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/RCTHMSHLSPlayer.js +3 -3
- package/lib/module/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -1
- package/lib/module/modules/HMSManagerModule.js +1 -9
- package/lib/module/modules/HMSManagerModule.js.map +1 -1
- package/lib/module/specs/HMSHLSPlayerNativeComponent.js +69 -0
- package/lib/module/specs/HMSHLSPlayerNativeComponent.js.map +1 -0
- package/lib/module/specs/HMSViewNativeComponent.js +49 -0
- package/lib/module/specs/HMSViewNativeComponent.js.map +1 -0
- package/lib/module/specs/NativeHMSManager.js +33 -0
- package/lib/module/specs/NativeHMSManager.js.map +1 -0
- package/lib/typescript/components/HMSHLSPlayer/RCTHMSHLSPlayer.d.ts +6 -9
- package/lib/typescript/specs/HMSHLSPlayerNativeComponent.d.ts +115 -0
- package/lib/typescript/specs/HMSViewNativeComponent.d.ts +97 -0
- package/lib/typescript/specs/NativeHMSManager.d.ts +147 -0
- package/package.json +16 -1
- package/react-native-hms.podspec +43 -0
- package/src/classes/HmsView.tsx +60 -78
- package/src/components/HMSHLSPlayer/HMSHLSPlayer.tsx +62 -128
- package/src/components/HMSHLSPlayer/RCTHMSHLSPlayer.ts +8 -13
- package/src/modules/HMSManagerModule.ts +1 -14
- package/src/specs/HMSHLSPlayerNativeComponent.ts +203 -0
- package/src/specs/HMSViewNativeComponent.ts +119 -0
- package/src/specs/NativeHMSManager.ts +307 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayerManager.kt +0 -144
- package/android/src/main/java/com/reactnativehmssdk/HMSSDKViewManager.kt +0 -111
|
@@ -5,8 +5,8 @@ import AVKit.AVPlayerViewController
|
|
|
5
5
|
typealias HmsHlsPlayer = HMSHLSPlayerSDK.HMSHLSPlayer
|
|
6
6
|
|
|
7
7
|
@objc(HMSHLSPlayerManager)
|
|
8
|
-
class HMSHLSPlayerManager: RCTViewManager {
|
|
9
|
-
override func view() -> (HMSHLSPlayer) {
|
|
8
|
+
public class HMSHLSPlayerManager: RCTViewManager {
|
|
9
|
+
override public func view() -> (HMSHLSPlayer) {
|
|
10
10
|
let view = HMSHLSPlayer()
|
|
11
11
|
let hms = getHmsFromBridge()
|
|
12
12
|
|
|
@@ -19,116 +19,117 @@ class HMSHLSPlayerManager: RCTViewManager {
|
|
|
19
19
|
return HMSManager.shared?.hmsCollection ?? [String: HMSRNSDK]()
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
override class func requiresMainQueueSetup() -> Bool {
|
|
22
|
+
public override class func requiresMainQueueSetup() -> Bool {
|
|
23
23
|
true
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
/// Look up the `HMSHLSPlayer` view for a given React tag and dispatch a
|
|
27
|
+
/// command to it. Logs (instead of silently failing) when:
|
|
28
|
+
/// - `self.bridge` is nil — happens under bridgeless mode where the
|
|
29
|
+
/// Fabric path (HMSHLSPlayerComponentView) handles commands directly.
|
|
30
|
+
/// This old-arch fallback path firing under bridgeless indicates a
|
|
31
|
+
/// misregistration worth surfacing.
|
|
32
|
+
/// - No `HMSHLSPlayer` is found for the given React tag — the view may
|
|
33
|
+
/// have been detached, or the tag is invalid.
|
|
34
|
+
/// Must be called on the main queue.
|
|
35
|
+
private func withComponent(for node: NSNumber, command: String, _ block: (HMSHLSPlayer) -> Void) {
|
|
36
|
+
guard let bridge = self.bridge else {
|
|
37
|
+
NSLog("[HMSHLSPlayerManager] \(command): bridge is nil — Fabric path expected to handle this")
|
|
38
|
+
return
|
|
39
|
+
}
|
|
40
|
+
guard let component = bridge.uiManager.view(forReactTag: node) as? HMSHLSPlayer else {
|
|
41
|
+
NSLog("[HMSHLSPlayerManager] \(command): no HMSHLSPlayer found for reactTag=\(node)")
|
|
42
|
+
return
|
|
43
|
+
}
|
|
44
|
+
block(component)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@objc public func play(_ node: NSNumber, url: String? = nil) {
|
|
27
48
|
DispatchQueue.main.async {
|
|
28
|
-
|
|
29
|
-
component.play(url)
|
|
30
|
-
}
|
|
49
|
+
self.withComponent(for: node, command: "play") { $0.play(url) }
|
|
31
50
|
}
|
|
32
51
|
}
|
|
33
52
|
|
|
34
|
-
@objc func stop(_ node: NSNumber) {
|
|
53
|
+
@objc public func stop(_ node: NSNumber) {
|
|
35
54
|
DispatchQueue.main.async {
|
|
36
|
-
|
|
37
|
-
component.stop()
|
|
38
|
-
}
|
|
55
|
+
self.withComponent(for: node, command: "stop") { $0.stop() }
|
|
39
56
|
}
|
|
40
57
|
}
|
|
41
58
|
|
|
42
|
-
@objc func pause(_ node: NSNumber) {
|
|
59
|
+
@objc public func pause(_ node: NSNumber) {
|
|
43
60
|
DispatchQueue.main.async {
|
|
44
|
-
|
|
45
|
-
component.pause()
|
|
46
|
-
}
|
|
61
|
+
self.withComponent(for: node, command: "pause") { $0.pause() }
|
|
47
62
|
}
|
|
48
63
|
}
|
|
49
64
|
|
|
50
|
-
@objc func resume(_ node: NSNumber) {
|
|
65
|
+
@objc public func resume(_ node: NSNumber) {
|
|
51
66
|
DispatchQueue.main.async {
|
|
52
|
-
|
|
53
|
-
component.resume()
|
|
54
|
-
}
|
|
67
|
+
self.withComponent(for: node, command: "resume") { $0.resume() }
|
|
55
68
|
}
|
|
56
69
|
}
|
|
57
70
|
|
|
58
|
-
@objc func seekToLivePosition(_ node: NSNumber) {
|
|
71
|
+
@objc public func seekToLivePosition(_ node: NSNumber) {
|
|
59
72
|
DispatchQueue.main.async {
|
|
60
|
-
|
|
61
|
-
component.seekToLivePosition()
|
|
62
|
-
}
|
|
73
|
+
self.withComponent(for: node, command: "seekToLivePosition") { $0.seekToLivePosition() }
|
|
63
74
|
}
|
|
64
75
|
}
|
|
65
76
|
|
|
66
|
-
@objc func seekForward(_ node: NSNumber, seconds: NSNumber) {
|
|
77
|
+
@objc public func seekForward(_ node: NSNumber, seconds: NSNumber) {
|
|
67
78
|
DispatchQueue.main.async {
|
|
68
|
-
|
|
69
|
-
component.seekForward(Double(truncating: seconds))
|
|
70
|
-
}
|
|
79
|
+
self.withComponent(for: node, command: "seekForward") { $0.seekForward(Double(truncating: seconds)) }
|
|
71
80
|
}
|
|
72
81
|
}
|
|
73
82
|
|
|
74
|
-
@objc func seekBackward(_ node: NSNumber, seconds: NSNumber) {
|
|
83
|
+
@objc public func seekBackward(_ node: NSNumber, seconds: NSNumber) {
|
|
75
84
|
DispatchQueue.main.async {
|
|
76
|
-
|
|
77
|
-
component.seekBackward(Double(truncating: seconds))
|
|
78
|
-
}
|
|
85
|
+
self.withComponent(for: node, command: "seekBackward") { $0.seekBackward(Double(truncating: seconds)) }
|
|
79
86
|
}
|
|
80
87
|
}
|
|
81
88
|
|
|
82
|
-
@objc func setVolume(_ node: NSNumber, level: NSNumber) {
|
|
89
|
+
@objc public func setVolume(_ node: NSNumber, level: NSNumber) {
|
|
83
90
|
DispatchQueue.main.async {
|
|
84
|
-
|
|
85
|
-
component.setVolume(Int(truncating: level))
|
|
86
|
-
}
|
|
91
|
+
self.withComponent(for: node, command: "setVolume") { $0.setVolume(Int(truncating: level)) }
|
|
87
92
|
}
|
|
88
93
|
}
|
|
89
94
|
|
|
90
|
-
@objc func areClosedCaptionSupported(_ node: NSNumber, requestId: NSNumber) {
|
|
95
|
+
@objc public func areClosedCaptionSupported(_ node: NSNumber, requestId: NSNumber) {
|
|
91
96
|
DispatchQueue.main.async {
|
|
92
|
-
|
|
93
|
-
|
|
97
|
+
self.withComponent(for: node, command: "areClosedCaptionSupported") {
|
|
98
|
+
$0.areClosedCaptionSupported(requestId: UInt(truncating: requestId))
|
|
94
99
|
}
|
|
95
100
|
}
|
|
96
101
|
}
|
|
97
102
|
|
|
98
|
-
@objc func isClosedCaptionEnabled(_ node: NSNumber, requestId: NSNumber) {
|
|
103
|
+
@objc public func isClosedCaptionEnabled(_ node: NSNumber, requestId: NSNumber) {
|
|
99
104
|
DispatchQueue.main.async {
|
|
100
|
-
|
|
101
|
-
|
|
105
|
+
self.withComponent(for: node, command: "isClosedCaptionEnabled") {
|
|
106
|
+
$0.isClosedCaptionEnabled(requestId: UInt(truncating: requestId))
|
|
102
107
|
}
|
|
103
108
|
}
|
|
104
109
|
}
|
|
105
110
|
|
|
106
|
-
@objc func enableClosedCaption(_ node: NSNumber) {
|
|
111
|
+
@objc public func enableClosedCaption(_ node: NSNumber) {
|
|
107
112
|
DispatchQueue.main.async {
|
|
108
|
-
|
|
109
|
-
component.enableClosedCaption()
|
|
110
|
-
}
|
|
113
|
+
self.withComponent(for: node, command: "enableClosedCaption") { $0.enableClosedCaption() }
|
|
111
114
|
}
|
|
112
115
|
}
|
|
113
116
|
|
|
114
|
-
@objc func disableClosedCaption(_ node: NSNumber) {
|
|
117
|
+
@objc public func disableClosedCaption(_ node: NSNumber) {
|
|
115
118
|
DispatchQueue.main.async {
|
|
116
|
-
|
|
117
|
-
component.disableClosedCaption()
|
|
118
|
-
}
|
|
119
|
+
self.withComponent(for: node, command: "disableClosedCaption") { $0.disableClosedCaption() }
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
122
|
|
|
122
|
-
@objc func getPlayerDurationDetails(_ node: NSNumber, requestId: NSNumber) {
|
|
123
|
+
@objc public func getPlayerDurationDetails(_ node: NSNumber, requestId: NSNumber) {
|
|
123
124
|
DispatchQueue.main.async {
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
self.withComponent(for: node, command: "getPlayerDurationDetails") {
|
|
126
|
+
$0.getPlayerDurationDetails(requestId: UInt(truncating: requestId))
|
|
126
127
|
}
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
131
|
|
|
131
|
-
class HMSHLSPlayer: UIView {
|
|
132
|
+
public class HMSHLSPlayer: UIView {
|
|
132
133
|
// MARK: class instance properties
|
|
133
134
|
var hlsStatsTimerRef: Timer?
|
|
134
135
|
var eventController: HLSPlaybackEventController?
|
|
@@ -136,27 +137,38 @@ class HMSHLSPlayer: UIView {
|
|
|
136
137
|
lazy var hmsHLSPlayer = HmsHlsPlayer()
|
|
137
138
|
|
|
138
139
|
// MARK: Handle HMSRNSDK Instance in HMSHLSPlayer instance
|
|
139
|
-
|
|
140
|
+
// Read live from HMSManager.shared on every access. Previously this was a
|
|
141
|
+
// stored snapshot taken at view creation time (via `setHms`), which left
|
|
142
|
+
// the view holding references to destroyed HMSRNSDK instances after a
|
|
143
|
+
// leave → rejoin cycle (the SDK destroys & recreates instances; the
|
|
144
|
+
// snapshot stayed stale → HLS streaming state lookup returned nil →
|
|
145
|
+
// playback broken on rejoin). Same fix as `HmssdkDisplayView`.
|
|
146
|
+
var hmsCollection: [String: HMSRNSDK] {
|
|
147
|
+
return HMSManager.shared?.hmsCollection ?? [String: HMSRNSDK]()
|
|
148
|
+
}
|
|
140
149
|
|
|
150
|
+
// Kept as a no-op for backward compatibility with the paper view
|
|
151
|
+
// manager's `view()` factory, which still calls this. The actual lookup
|
|
152
|
+
// is now live via the computed `hmsCollection` above.
|
|
141
153
|
func setHms(_ hmsInstance: [String: HMSRNSDK]) {
|
|
142
|
-
hmsCollection
|
|
154
|
+
// Intentionally empty — hmsCollection is now computed.
|
|
143
155
|
}
|
|
144
156
|
|
|
145
157
|
// MARK: Handle HMSHLSPlayer RN Component props
|
|
146
158
|
|
|
147
|
-
@objc var onDataReturned: RCTDirectEventBlock?
|
|
159
|
+
@objc public var onDataReturned: RCTDirectEventBlock?
|
|
148
160
|
|
|
149
|
-
@objc var onHmsHlsPlaybackEvent: RCTDirectEventBlock?
|
|
161
|
+
@objc public var onHmsHlsPlaybackEvent: RCTDirectEventBlock?
|
|
150
162
|
|
|
151
|
-
@objc var onHmsHlsStatsEvent: RCTDirectEventBlock?
|
|
163
|
+
@objc public var onHmsHlsStatsEvent: RCTDirectEventBlock?
|
|
152
164
|
|
|
153
|
-
@objc var url: String? {
|
|
165
|
+
@objc public var url: String? {
|
|
154
166
|
didSet {
|
|
155
167
|
play(url)
|
|
156
168
|
}
|
|
157
169
|
}
|
|
158
170
|
|
|
159
|
-
@objc var enableStats: Bool = false {
|
|
171
|
+
@objc public var enableStats: Bool = false {
|
|
160
172
|
didSet {
|
|
161
173
|
if enableStats == true {
|
|
162
174
|
attachHLSPlayerStatsListener()
|
|
@@ -170,7 +182,7 @@ class HMSHLSPlayer: UIView {
|
|
|
170
182
|
}
|
|
171
183
|
}
|
|
172
184
|
|
|
173
|
-
@objc var enableControls: Bool = true {
|
|
185
|
+
@objc public var enableControls: Bool = true {
|
|
174
186
|
didSet {
|
|
175
187
|
hmsHLSPlayerViewController?.showsPlaybackControls = enableControls
|
|
176
188
|
}
|
|
@@ -178,7 +190,7 @@ class HMSHLSPlayer: UIView {
|
|
|
178
190
|
|
|
179
191
|
// MARK: Handle HMSHLSPlayer RN Component methods
|
|
180
192
|
|
|
181
|
-
@objc func play(_ url: String?) {
|
|
193
|
+
@objc public func play(_ url: String?) {
|
|
182
194
|
if let validURLString = url, !validURLString.isEmpty {
|
|
183
195
|
if let urlInstance = URL(string: validURLString) {
|
|
184
196
|
hmsHLSPlayer.play(urlInstance)
|
|
@@ -195,7 +207,7 @@ class HMSHLSPlayer: UIView {
|
|
|
195
207
|
}
|
|
196
208
|
}
|
|
197
209
|
|
|
198
|
-
@objc func stop() {
|
|
210
|
+
@objc public func stop() {
|
|
199
211
|
hmsHLSPlayer.stop()
|
|
200
212
|
}
|
|
201
213
|
|
|
@@ -223,19 +235,19 @@ class HMSHLSPlayer: UIView {
|
|
|
223
235
|
return selectedOption != nil
|
|
224
236
|
}
|
|
225
237
|
|
|
226
|
-
@objc func areClosedCaptionSupported(requestId: UInt) {
|
|
238
|
+
@objc public func areClosedCaptionSupported(requestId: UInt) {
|
|
227
239
|
let supported = isCCSupported()
|
|
228
240
|
|
|
229
241
|
sendRequestedDataToJS(requestId, supported)
|
|
230
242
|
}
|
|
231
243
|
|
|
232
|
-
@objc func isClosedCaptionEnabled(requestId: UInt) {
|
|
244
|
+
@objc public func isClosedCaptionEnabled(requestId: UInt) {
|
|
233
245
|
let enabled = isCCEnabled()
|
|
234
246
|
|
|
235
247
|
sendRequestedDataToJS(requestId, enabled)
|
|
236
248
|
}
|
|
237
249
|
|
|
238
|
-
@objc func enableClosedCaption() {
|
|
250
|
+
@objc public func enableClosedCaption() {
|
|
239
251
|
if !isCCSupported() {
|
|
240
252
|
print("#func Closed Caption is not supported")
|
|
241
253
|
return
|
|
@@ -256,7 +268,7 @@ class HMSHLSPlayer: UIView {
|
|
|
256
268
|
playerItem.select(firstSubtitleTrack, in: subtitle)
|
|
257
269
|
}
|
|
258
270
|
|
|
259
|
-
@objc func disableClosedCaption() {
|
|
271
|
+
@objc public func disableClosedCaption() {
|
|
260
272
|
if !isCCSupported() {
|
|
261
273
|
print("#func Closed Caption is not supported")
|
|
262
274
|
return
|
|
@@ -274,7 +286,7 @@ class HMSHLSPlayer: UIView {
|
|
|
274
286
|
playerItem.select(nil, in: subtitle)
|
|
275
287
|
}
|
|
276
288
|
|
|
277
|
-
@objc func getPlayerDurationDetails(requestId: UInt) {
|
|
289
|
+
@objc public func getPlayerDurationDetails(requestId: UInt) {
|
|
278
290
|
var map = [String: Any?]()
|
|
279
291
|
guard let playerItem = hmsHLSPlayer._nativePlayer.currentItem else {
|
|
280
292
|
sendRequestedDataToJS(requestId, map)
|
|
@@ -290,27 +302,27 @@ class HMSHLSPlayer: UIView {
|
|
|
290
302
|
sendRequestedDataToJS(requestId, map)
|
|
291
303
|
}
|
|
292
304
|
|
|
293
|
-
@objc func pause() {
|
|
305
|
+
@objc public func pause() {
|
|
294
306
|
hmsHLSPlayer.pause()
|
|
295
307
|
}
|
|
296
308
|
|
|
297
|
-
@objc func resume() {
|
|
309
|
+
@objc public func resume() {
|
|
298
310
|
hmsHLSPlayer.resume()
|
|
299
311
|
}
|
|
300
312
|
|
|
301
|
-
@objc func seekForward(_ seconds: Double) {
|
|
313
|
+
@objc public func seekForward(_ seconds: Double) {
|
|
302
314
|
hmsHLSPlayer.seekForward(seconds: seconds)
|
|
303
315
|
}
|
|
304
316
|
|
|
305
|
-
@objc func seekBackward(_ seconds: Double) {
|
|
317
|
+
@objc public func seekBackward(_ seconds: Double) {
|
|
306
318
|
hmsHLSPlayer.seekBackward(seconds: seconds)
|
|
307
319
|
}
|
|
308
320
|
|
|
309
|
-
@objc func seekToLivePosition() {
|
|
321
|
+
@objc public func seekToLivePosition() {
|
|
310
322
|
hmsHLSPlayer.seekToLivePosition()
|
|
311
323
|
}
|
|
312
324
|
|
|
313
|
-
@objc func setVolume(_ level: Int) {
|
|
325
|
+
@objc public func setVolume(_ level: Int) {
|
|
314
326
|
hmsHLSPlayer.volume = level
|
|
315
327
|
}
|
|
316
328
|
|
|
@@ -353,7 +365,7 @@ class HMSHLSPlayer: UIView {
|
|
|
353
365
|
}
|
|
354
366
|
|
|
355
367
|
// MARK: Utility functions
|
|
356
|
-
func cleanup() {
|
|
368
|
+
public func cleanup() {
|
|
357
369
|
hmsHLSPlayer.stop()
|
|
358
370
|
|
|
359
371
|
// Remove HLS player playback events
|
|
@@ -488,19 +500,19 @@ class HLSPlaybackEventController: HMSHLSPlayerDelegate {
|
|
|
488
500
|
self.hmsHlsPlayerDelegate = hmsPlayerDelegate
|
|
489
501
|
}
|
|
490
502
|
|
|
491
|
-
func onPlaybackStateChanged(state: HMSHLSPlaybackState) {
|
|
503
|
+
public func onPlaybackStateChanged(state: HMSHLSPlaybackState) {
|
|
492
504
|
hmsHlsPlayerDelegate?.onPlaybackStateChanged(state: state)
|
|
493
505
|
}
|
|
494
506
|
|
|
495
|
-
func onCue(cue: HMSHLSCue) {
|
|
507
|
+
public func onCue(cue: HMSHLSCue) {
|
|
496
508
|
hmsHlsPlayerDelegate?.onCue(cue: cue)
|
|
497
509
|
}
|
|
498
510
|
|
|
499
|
-
func onPlaybackFailure(error: Error) {
|
|
511
|
+
public func onPlaybackFailure(error: Error) {
|
|
500
512
|
hmsHlsPlayerDelegate?.onPlaybackFailure(error: error)
|
|
501
513
|
}
|
|
502
514
|
|
|
503
|
-
func onResolutionChanged(videoSize: CGSize) {
|
|
515
|
+
public func onResolutionChanged(videoSize: CGSize) {
|
|
504
516
|
hmsHlsPlayerDelegate?.onResolutionChanged(videoSize: videoSize)
|
|
505
517
|
}
|
|
506
518
|
}
|
package/ios/HMSManager.m
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
#import <Foundation/Foundation.h>
|
|
2
2
|
#import <React/RCTEventEmitter.h>
|
|
3
3
|
|
|
4
|
+
// Under the New Architecture (RCT_NEW_ARCH_ENABLED), the TurboModule
|
|
5
|
+
// registration happens in HMSManager.mm via the category-based
|
|
6
|
+
// `getTurboModule:` factory. The legacy `RCT_EXTERN_MODULE` +
|
|
7
|
+
// `RCT_EXTERN_METHOD` declarations below would conflict with that
|
|
8
|
+
// registration, so we guard the entire block with #if !RCT_NEW_ARCH_ENABLED.
|
|
9
|
+
//
|
|
10
|
+
// The Swift HMSManager class itself is unchanged — only its
|
|
11
|
+
// registration path differs between old arch (this file) and new arch
|
|
12
|
+
// (HMSManager.mm).
|
|
13
|
+
#if !RCT_NEW_ARCH_ENABLED
|
|
14
|
+
|
|
4
15
|
@interface RCT_EXTERN_MODULE (HMSManager, RCTEventEmitter)
|
|
5
16
|
|
|
6
17
|
RCT_EXTERN_METHOD(join : (NSDictionary)credentials)
|
|
@@ -433,3 +444,5 @@ RCT_EXTERN_METHOD(setActiveSpeakerInIOSPIP
|
|
|
433
444
|
: (RCTPromiseRejectBlock)reject)
|
|
434
445
|
|
|
435
446
|
@end
|
|
447
|
+
|
|
448
|
+
#endif // !RCT_NEW_ARCH_ENABLED
|