@100mslive/react-native-hms 1.10.7 → 1.10.9
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/README.md +6 -5
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +47 -8
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +34 -3
- package/android/src/main/java/com/reactnativehmssdk/PipActionReceiver.kt +3 -1
- package/ios/HMSConstants.swift +1 -0
- package/ios/HMSManager.m +39 -0
- package/ios/HMSManager.swift +116 -1
- package/ios/HMSRNSDK.swift +276 -2
- package/ios/PIPMode/HMSPipModel.swift +18 -0
- package/ios/PIPMode/HMSPipView.swift +36 -0
- package/ios/PIPMode/HMSSampleBufferSwiftUIView.swift +45 -0
- package/lib/commonjs/classes/HMSAudioDevice.js +9 -0
- package/lib/commonjs/classes/HMSAudioDevice.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioMixingMode.js +11 -0
- package/lib/commonjs/classes/HMSAudioMixingMode.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioTrack.js +9 -0
- package/lib/commonjs/classes/HMSAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSCameraFacing.js +9 -0
- package/lib/commonjs/classes/HMSCameraFacing.js.map +1 -1
- package/lib/commonjs/classes/HMSConfig.js +27 -0
- package/lib/commonjs/classes/HMSConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSException.js +18 -0
- package/lib/commonjs/classes/HMSException.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSTimedMetadata.js.map +1 -1
- package/lib/commonjs/classes/HMSIOSAudioMode.js +15 -0
- package/lib/commonjs/classes/HMSIOSAudioMode.js.map +1 -1
- package/lib/commonjs/classes/HMSLogAlarmManager.js +12 -0
- package/lib/commonjs/classes/HMSLogAlarmManager.js.map +1 -1
- package/lib/commonjs/classes/HMSLogLevel.js +12 -0
- package/lib/commonjs/classes/HMSLogLevel.js.map +1 -1
- package/lib/commonjs/classes/HMSLogSettings.js +14 -0
- package/lib/commonjs/classes/HMSLogSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSNetworkQuality.js +11 -0
- package/lib/commonjs/classes/HMSNetworkQuality.js.map +1 -1
- package/lib/commonjs/classes/HMSNoiseCancellationPlugin.js +40 -10
- package/lib/commonjs/classes/HMSNoiseCancellationPlugin.js.map +1 -1
- package/lib/commonjs/classes/HMSPIPConfig.js +4 -0
- package/lib/commonjs/classes/HMSPIPConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSPIPListenerActions.js +9 -0
- package/lib/commonjs/classes/HMSPIPListenerActions.js.map +1 -1
- package/lib/commonjs/classes/HMSPeer.js +148 -0
- package/lib/commonjs/classes/HMSPeer.js.map +1 -1
- package/lib/commonjs/classes/HMSPeerType.js +12 -1
- package/lib/commonjs/classes/HMSPeerType.js.map +1 -1
- package/lib/commonjs/classes/HMSRTMPConfig.js +14 -0
- package/lib/commonjs/classes/HMSRTMPConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSRole.js +17 -0
- package/lib/commonjs/classes/HMSRole.js.map +1 -1
- package/lib/commonjs/classes/HMSRtmpVideoResolution.js +13 -0
- package/lib/commonjs/classes/HMSRtmpVideoResolution.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +1153 -233
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/HMSSessionStore.js +14 -15
- package/lib/commonjs/classes/HMSSessionStore.js.map +1 -1
- package/lib/commonjs/classes/HMSTrack.js +13 -0
- package/lib/commonjs/classes/HMSTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackSettings.js +10 -0
- package/lib/commonjs/classes/HMSTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackSettingsInitState.js +9 -0
- package/lib/commonjs/classes/HMSTrackSettingsInitState.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackSource.js +10 -0
- package/lib/commonjs/classes/HMSTrackSource.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackType.js +7 -0
- package/lib/commonjs/classes/HMSTrackType.js.map +1 -1
- package/lib/commonjs/classes/HMSUpdateListenerActions.js +42 -3
- package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoTrack.js +17 -0
- package/lib/commonjs/classes/HMSVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoTrackSettings.js +12 -2
- package/lib/commonjs/classes/HMSVideoTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HmsView.js +42 -0
- package/lib/commonjs/classes/HmsView.js.map +1 -1
- package/lib/module/classes/HMSAudioDevice.js +9 -0
- package/lib/module/classes/HMSAudioDevice.js.map +1 -1
- package/lib/module/classes/HMSAudioMixingMode.js +11 -0
- package/lib/module/classes/HMSAudioMixingMode.js.map +1 -1
- package/lib/module/classes/HMSAudioTrack.js +9 -0
- package/lib/module/classes/HMSAudioTrack.js.map +1 -1
- package/lib/module/classes/HMSCameraFacing.js +9 -0
- package/lib/module/classes/HMSCameraFacing.js.map +1 -1
- package/lib/module/classes/HMSConfig.js +27 -0
- package/lib/module/classes/HMSConfig.js.map +1 -1
- package/lib/module/classes/HMSException.js +18 -0
- package/lib/module/classes/HMSException.js.map +1 -1
- package/lib/module/classes/HMSHLSTimedMetadata.js.map +1 -1
- package/lib/module/classes/HMSIOSAudioMode.js +15 -0
- package/lib/module/classes/HMSIOSAudioMode.js.map +1 -1
- package/lib/module/classes/HMSLogAlarmManager.js +12 -0
- package/lib/module/classes/HMSLogAlarmManager.js.map +1 -1
- package/lib/module/classes/HMSLogLevel.js +12 -0
- package/lib/module/classes/HMSLogLevel.js.map +1 -1
- package/lib/module/classes/HMSLogSettings.js +14 -0
- package/lib/module/classes/HMSLogSettings.js.map +1 -1
- package/lib/module/classes/HMSNetworkQuality.js +11 -0
- package/lib/module/classes/HMSNetworkQuality.js.map +1 -1
- package/lib/module/classes/HMSNoiseCancellationPlugin.js +40 -10
- package/lib/module/classes/HMSNoiseCancellationPlugin.js.map +1 -1
- package/lib/module/classes/HMSPIPConfig.js +1 -1
- package/lib/module/classes/HMSPIPConfig.js.map +1 -1
- package/lib/module/classes/HMSPIPListenerActions.js +9 -0
- package/lib/module/classes/HMSPIPListenerActions.js.map +1 -1
- package/lib/module/classes/HMSPeer.js +149 -0
- package/lib/module/classes/HMSPeer.js.map +1 -1
- package/lib/module/classes/HMSPeerType.js +12 -1
- package/lib/module/classes/HMSPeerType.js.map +1 -1
- package/lib/module/classes/HMSRTMPConfig.js +14 -0
- package/lib/module/classes/HMSRTMPConfig.js.map +1 -1
- package/lib/module/classes/HMSRole.js +17 -0
- package/lib/module/classes/HMSRole.js.map +1 -1
- package/lib/module/classes/HMSRtmpVideoResolution.js +13 -0
- package/lib/module/classes/HMSRtmpVideoResolution.js.map +1 -1
- package/lib/module/classes/HMSSDK.js +1153 -233
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/HMSSessionStore.js +14 -15
- package/lib/module/classes/HMSSessionStore.js.map +1 -1
- package/lib/module/classes/HMSTrack.js +13 -0
- package/lib/module/classes/HMSTrack.js.map +1 -1
- package/lib/module/classes/HMSTrackSettings.js +10 -0
- package/lib/module/classes/HMSTrackSettings.js.map +1 -1
- package/lib/module/classes/HMSTrackSettingsInitState.js +9 -0
- package/lib/module/classes/HMSTrackSettingsInitState.js.map +1 -1
- package/lib/module/classes/HMSTrackSource.js +10 -0
- package/lib/module/classes/HMSTrackSource.js.map +1 -1
- package/lib/module/classes/HMSTrackType.js +7 -0
- package/lib/module/classes/HMSTrackType.js.map +1 -1
- package/lib/module/classes/HMSUpdateListenerActions.js +42 -3
- package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/module/classes/HMSVideoTrack.js +17 -0
- package/lib/module/classes/HMSVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSVideoTrackSettings.js +12 -2
- package/lib/module/classes/HMSVideoTrackSettings.js.map +1 -1
- package/lib/module/classes/HmsView.js +43 -0
- package/lib/module/classes/HmsView.js.map +1 -1
- package/lib/typescript/classes/HMSAudioDevice.d.ts +14 -0
- package/lib/typescript/classes/HMSAudioMixingMode.d.ts +11 -0
- package/lib/typescript/classes/HMSAudioTrack.d.ts +9 -0
- package/lib/typescript/classes/HMSCameraFacing.d.ts +11 -0
- package/lib/typescript/classes/HMSConfig.d.ts +27 -0
- package/lib/typescript/classes/HMSException.d.ts +18 -0
- package/lib/typescript/classes/HMSHLSTimedMetadata.d.ts +12 -0
- package/lib/typescript/classes/HMSIOSAudioMode.d.ts +15 -0
- package/lib/typescript/classes/HMSLogAlarmManager.d.ts +12 -0
- package/lib/typescript/classes/HMSLogLevel.d.ts +12 -0
- package/lib/typescript/classes/HMSLogSettings.d.ts +14 -0
- package/lib/typescript/classes/HMSNetworkQuality.d.ts +11 -0
- package/lib/typescript/classes/HMSNoiseCancellationPlugin.d.ts +36 -6
- package/lib/typescript/classes/HMSPIPConfig.d.ts +40 -0
- package/lib/typescript/classes/HMSPIPListenerActions.d.ts +17 -0
- package/lib/typescript/classes/HMSPeer.d.ts +137 -0
- package/lib/typescript/classes/HMSPeerType.d.ts +11 -0
- package/lib/typescript/classes/HMSRTMPConfig.d.ts +14 -0
- package/lib/typescript/classes/HMSRole.d.ts +17 -0
- package/lib/typescript/classes/HMSRtmpVideoResolution.d.ts +13 -0
- package/lib/typescript/classes/HMSSDK.d.ts +1083 -235
- package/lib/typescript/classes/HMSSessionStore.d.ts +14 -15
- package/lib/typescript/classes/HMSTrack.d.ts +13 -0
- package/lib/typescript/classes/HMSTrackSettings.d.ts +10 -0
- package/lib/typescript/classes/HMSTrackSettingsInitState.d.ts +11 -0
- package/lib/typescript/classes/HMSTrackSource.d.ts +10 -0
- package/lib/typescript/classes/HMSTrackType.d.ts +7 -0
- package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +290 -4
- package/lib/typescript/classes/HMSVideoTrack.d.ts +17 -0
- package/lib/typescript/classes/HMSVideoTrackSettings.d.ts +12 -2
- package/lib/typescript/classes/HmsView.d.ts +16 -0
- package/package.json +1 -1
- package/sdk-versions.json +2 -2
- package/src/classes/HMSAudioDevice.ts +18 -0
- package/src/classes/HMSAudioMixingMode.ts +11 -0
- package/src/classes/HMSAudioTrack.ts +9 -0
- package/src/classes/HMSCameraFacing.ts +11 -0
- package/src/classes/HMSConfig.ts +27 -0
- package/src/classes/HMSException.ts +18 -0
- package/src/classes/HMSHLSTimedMetadata.ts +12 -0
- package/src/classes/HMSIOSAudioMode.ts +15 -0
- package/src/classes/HMSLogAlarmManager.ts +12 -0
- package/src/classes/HMSLogLevel.ts +12 -0
- package/src/classes/HMSLogSettings.ts +14 -0
- package/src/classes/HMSNetworkQuality.ts +11 -0
- package/src/classes/HMSNoiseCancellationPlugin.ts +41 -10
- package/src/classes/HMSPIPConfig.ts +47 -0
- package/src/classes/HMSPIPListenerActions.ts +18 -0
- package/src/classes/HMSPeer.ts +137 -0
- package/src/classes/HMSPeerType.ts +13 -2
- package/src/classes/HMSRTMPConfig.ts +14 -0
- package/src/classes/HMSRole.ts +17 -0
- package/src/classes/HMSRtmpVideoResolution.ts +13 -0
- package/src/classes/HMSSDK.tsx +1211 -269
- package/src/classes/HMSSessionStore.ts +14 -15
- package/src/classes/HMSTrack.ts +13 -0
- package/src/classes/HMSTrackSettings.ts +10 -0
- package/src/classes/HMSTrackSettingsInitState.ts +11 -0
- package/src/classes/HMSTrackSource.ts +10 -0
- package/src/classes/HMSTrackType.ts +7 -0
- package/src/classes/HMSUpdateListenerActions.ts +312 -3
- package/src/classes/HMSVideoTrack.ts +17 -0
- package/src/classes/HMSVideoTrackSettings.ts +12 -2
- package/src/classes/HmsView.tsx +39 -0
package/ios/HMSRNSDK.swift
CHANGED
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
import Foundation
|
|
9
9
|
import HMSSDK
|
|
10
10
|
import ReplayKit
|
|
11
|
+
import AVKit
|
|
12
|
+
import SwiftUI
|
|
11
13
|
|
|
12
|
-
class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
14
|
+
class HMSRNSDK: NSObject, HMSUpdateListener, HMSPreviewListener {
|
|
13
15
|
|
|
14
16
|
var hms: HMSSDK?
|
|
15
17
|
var interactivity: HMSRNInteractivityCenter?
|
|
@@ -38,6 +40,7 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
38
40
|
|
|
39
41
|
// MARK: - Setup
|
|
40
42
|
init(data: NSDictionary?, delegate manager: HMSManager?, uid id: String) {
|
|
43
|
+
super.init()
|
|
41
44
|
preferredExtension = data?.value(forKey: "preferredExtension") as? String
|
|
42
45
|
self.delegate = manager
|
|
43
46
|
self.id = id
|
|
@@ -773,7 +776,7 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
773
776
|
|
|
774
777
|
if remoteAudioTrack != nil {
|
|
775
778
|
remoteAudioTrack?.setVolume(volume)
|
|
776
|
-
resolve?(
|
|
779
|
+
resolve?(nil)
|
|
777
780
|
} else {
|
|
778
781
|
let errorMessage = "setVolume: No remote audio track not available"
|
|
779
782
|
reject?(errorMessage, errorMessage, nil)
|
|
@@ -1535,6 +1538,18 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1535
1538
|
}
|
|
1536
1539
|
}
|
|
1537
1540
|
|
|
1541
|
+
if #available(iOS 15.0, *),
|
|
1542
|
+
useActiveSpeakerInPIP,
|
|
1543
|
+
let controller = pipController,
|
|
1544
|
+
controller.isPictureInPictureActive,
|
|
1545
|
+
track.kind == .video,
|
|
1546
|
+
update == .trackRemoved,
|
|
1547
|
+
pipModel?.track == track {
|
|
1548
|
+
|
|
1549
|
+
pipModel?.text = hms?.localPeer?.name
|
|
1550
|
+
pipModel?.track = nil
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1538
1553
|
if eventsEnableStatus[HMSConstants.ON_TRACK_UPDATE] != true {
|
|
1539
1554
|
return
|
|
1540
1555
|
}
|
|
@@ -1562,6 +1577,35 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1562
1577
|
}
|
|
1563
1578
|
|
|
1564
1579
|
func on(updated speakers: [HMSSpeaker]) {
|
|
1580
|
+
|
|
1581
|
+
if #available(iOS 15.0, *),
|
|
1582
|
+
useActiveSpeakerInPIP,
|
|
1583
|
+
let controller = pipController,
|
|
1584
|
+
controller.isPictureInPictureActive,
|
|
1585
|
+
let peer = speakers.first?.peer,
|
|
1586
|
+
let track = peer.videoTrack {
|
|
1587
|
+
|
|
1588
|
+
if track.isMute() {
|
|
1589
|
+
pipModel?.text = peer.name
|
|
1590
|
+
pipModel?.track = nil
|
|
1591
|
+
} else {
|
|
1592
|
+
if peer.isLocal {
|
|
1593
|
+
if #available(iOS 16.0, *) {
|
|
1594
|
+
if AVCaptureSession().isMultitaskingCameraAccessSupported {
|
|
1595
|
+
pipModel?.text = nil
|
|
1596
|
+
pipModel?.track = track
|
|
1597
|
+
return
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
pipModel?.text = peer.name
|
|
1601
|
+
pipModel?.track = nil
|
|
1602
|
+
} else {
|
|
1603
|
+
pipModel?.text = nil
|
|
1604
|
+
pipModel?.track = track
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1565
1609
|
if eventsEnableStatus[HMSConstants.ON_SPEAKER] != true {
|
|
1566
1610
|
return
|
|
1567
1611
|
}
|
|
@@ -2414,6 +2458,163 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
2414
2458
|
}
|
|
2415
2459
|
}
|
|
2416
2460
|
|
|
2461
|
+
// MARK: - PIP Mode Support
|
|
2462
|
+
|
|
2463
|
+
internal var _pipVideoCallViewController: Any?
|
|
2464
|
+
|
|
2465
|
+
@available(iOS 15.0, *)
|
|
2466
|
+
internal var pipVideoCallViewController: AVPictureInPictureVideoCallViewController? {
|
|
2467
|
+
if _pipVideoCallViewController == nil {
|
|
2468
|
+
_pipVideoCallViewController = AVPictureInPictureVideoCallViewController()
|
|
2469
|
+
}
|
|
2470
|
+
return _pipVideoCallViewController as? AVPictureInPictureVideoCallViewController
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
internal var _pipModel: Any?
|
|
2474
|
+
|
|
2475
|
+
@available(iOS 15.0, *)
|
|
2476
|
+
internal var pipModel: HMSPipModel? {
|
|
2477
|
+
if _pipModel == nil {
|
|
2478
|
+
_pipModel = HMSPipModel()
|
|
2479
|
+
}
|
|
2480
|
+
return _pipModel as? HMSPipModel
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
internal var pipController: AVPictureInPictureController?
|
|
2484
|
+
|
|
2485
|
+
private var useActiveSpeakerInPIP: Bool = true
|
|
2486
|
+
|
|
2487
|
+
@available(iOS 15.0, *)
|
|
2488
|
+
func setPictureInPictureParams(_ data: NSDictionary,
|
|
2489
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2490
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2491
|
+
|
|
2492
|
+
guard AVPictureInPictureController.isPictureInPictureSupported() else {
|
|
2493
|
+
let errorMessage = "\(#function) PIP is not supported on this device"
|
|
2494
|
+
reject?("6004", errorMessage, nil)
|
|
2495
|
+
return
|
|
2496
|
+
}
|
|
2497
|
+
|
|
2498
|
+
guard let uiView = UIApplication.shared.keyWindow?.rootViewController?.view else {
|
|
2499
|
+
let errorMessage = "\(#function) Failed to setup PIP"
|
|
2500
|
+
reject?("6004", errorMessage, nil)
|
|
2501
|
+
return
|
|
2502
|
+
}
|
|
2503
|
+
|
|
2504
|
+
pipModel?.pipViewEnabled = true
|
|
2505
|
+
|
|
2506
|
+
if let scaleType = data["scaleType"] as? String {
|
|
2507
|
+
pipModel?.scaleType = getViewContentMode(scaleType)
|
|
2508
|
+
} else {
|
|
2509
|
+
pipModel?.scaleType = .scaleAspectFill
|
|
2510
|
+
}
|
|
2511
|
+
|
|
2512
|
+
pipModel?.color = .black
|
|
2513
|
+
pipModel?.text = hms?.localPeer?.name
|
|
2514
|
+
|
|
2515
|
+
let controller = UIHostingController(rootView: HMSPipView(model: pipModel!))
|
|
2516
|
+
|
|
2517
|
+
pipVideoCallViewController?.view.addConstrained(subview: controller.view)
|
|
2518
|
+
|
|
2519
|
+
if let ratio = data["aspectRatio"] as? [Int], ratio.count == 2 {
|
|
2520
|
+
pipVideoCallViewController?.preferredContentSize = CGSize(width: ratio[0], height: ratio[1])
|
|
2521
|
+
} else {
|
|
2522
|
+
pipVideoCallViewController?.preferredContentSize = CGSize(width: uiView.frame.size.width, height: uiView.frame.size.height)
|
|
2523
|
+
}
|
|
2524
|
+
|
|
2525
|
+
guard let pipVideoCallViewController = pipVideoCallViewController else {
|
|
2526
|
+
let errorMessage = "\(#function) Failed to setup PIP"
|
|
2527
|
+
reject?("6004", errorMessage, nil)
|
|
2528
|
+
return
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2531
|
+
let pipContentSource = AVPictureInPictureController.ContentSource(activeVideoCallSourceView: uiView, contentViewController: pipVideoCallViewController)
|
|
2532
|
+
|
|
2533
|
+
pipController = AVPictureInPictureController(contentSource: pipContentSource)
|
|
2534
|
+
|
|
2535
|
+
pipController?.delegate = self
|
|
2536
|
+
|
|
2537
|
+
pipController?.canStartPictureInPictureAutomaticallyFromInline = true
|
|
2538
|
+
|
|
2539
|
+
if let autoEnterPIP = data["autoEnterPipMode"] as? Bool {
|
|
2540
|
+
pipController?.canStartPictureInPictureAutomaticallyFromInline = autoEnterPIP
|
|
2541
|
+
}
|
|
2542
|
+
|
|
2543
|
+
NotificationCenter.default.addObserver(forName: UIApplication.didBecomeActiveNotification,
|
|
2544
|
+
object: nil, queue: .main) { [weak self] _ in
|
|
2545
|
+
self?.stopPIP(nil, nil)
|
|
2546
|
+
}
|
|
2547
|
+
|
|
2548
|
+
resolve?(true)
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
func enterPipMode(_ resolve: RCTPromiseResolveBlock?,
|
|
2552
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2553
|
+
pipController?.startPictureInPicture()
|
|
2554
|
+
resolve?(true)
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
func stopPIP(_ resolve: RCTPromiseResolveBlock?,
|
|
2558
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2559
|
+
pipController?.stopPictureInPicture()
|
|
2560
|
+
resolve?(nil)
|
|
2561
|
+
}
|
|
2562
|
+
|
|
2563
|
+
func disposePIP(_ resolve: RCTPromiseResolveBlock?,
|
|
2564
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2565
|
+
pipController = nil
|
|
2566
|
+
_pipModel = nil
|
|
2567
|
+
_pipVideoCallViewController = nil
|
|
2568
|
+
NotificationCenter.default.removeObserver(UIApplication.didBecomeActiveNotification)
|
|
2569
|
+
resolve?(nil)
|
|
2570
|
+
}
|
|
2571
|
+
|
|
2572
|
+
func isPIPActive(_ resolve: RCTPromiseResolveBlock?,
|
|
2573
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2574
|
+
if pipController != nil && pipController!.isPictureInPictureActive {
|
|
2575
|
+
resolve?(true)
|
|
2576
|
+
} else {
|
|
2577
|
+
resolve?(false)
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
/// Change the video track in PIP Mode
|
|
2582
|
+
/// - Parameters:
|
|
2583
|
+
/// - data: Data containing the trackId of the video track to be changed
|
|
2584
|
+
/// - resolve: Promise resolve block
|
|
2585
|
+
/// - reject: Promise reject block
|
|
2586
|
+
@available(iOS 15.0, *)
|
|
2587
|
+
func changeIOSPIPVideoTrack(_ data: NSDictionary,
|
|
2588
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2589
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2590
|
+
|
|
2591
|
+
guard let trackID = data["trackId"] as? String,
|
|
2592
|
+
let room = hms?.room,
|
|
2593
|
+
let track = HMSUtilities.getVideoTrack(for: trackID, in: room)
|
|
2594
|
+
else {
|
|
2595
|
+
let errorMessage = "\(#function) Incorrect data passed for changing track in PIP Mode"
|
|
2596
|
+
reject?("6004", errorMessage, nil)
|
|
2597
|
+
return
|
|
2598
|
+
}
|
|
2599
|
+
|
|
2600
|
+
useActiveSpeakerInPIP = false
|
|
2601
|
+
pipModel?.track = track
|
|
2602
|
+
resolve?(nil)
|
|
2603
|
+
}
|
|
2604
|
+
|
|
2605
|
+
func setActiveSpeakerInIOSPIP(_ data: NSDictionary,
|
|
2606
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2607
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2608
|
+
guard let enabled = data["enable"] as? Bool else {
|
|
2609
|
+
let errorMessage = "\(#function) Incorrect data passed for setActiveSpeakerInIOSPIP in PIP Mode"
|
|
2610
|
+
reject?("6004", errorMessage, nil)
|
|
2611
|
+
return
|
|
2612
|
+
}
|
|
2613
|
+
|
|
2614
|
+
useActiveSpeakerInPIP = enabled
|
|
2615
|
+
resolve?(nil)
|
|
2616
|
+
}
|
|
2617
|
+
|
|
2417
2618
|
// MARK: - Helper Functions
|
|
2418
2619
|
|
|
2419
2620
|
// Handle resetting states and data cleanup
|
|
@@ -2514,6 +2715,19 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
2514
2715
|
static private func getTimeStamp() -> String {
|
|
2515
2716
|
"\(Date().timeIntervalSince1970)"
|
|
2516
2717
|
}
|
|
2718
|
+
|
|
2719
|
+
private func getViewContentMode(_ type: String?) -> UIView.ContentMode {
|
|
2720
|
+
switch type {
|
|
2721
|
+
case "ASPECT_FILL":
|
|
2722
|
+
return .scaleAspectFill
|
|
2723
|
+
case "ASPECT_FIT":
|
|
2724
|
+
return .scaleAspectFit
|
|
2725
|
+
case "ASPECT_BALANCED":
|
|
2726
|
+
return .center
|
|
2727
|
+
default:
|
|
2728
|
+
return .scaleAspectFill
|
|
2729
|
+
}
|
|
2730
|
+
}
|
|
2517
2731
|
}
|
|
2518
2732
|
|
|
2519
2733
|
extension UIImage {
|
|
@@ -2529,3 +2743,63 @@ extension UIImage {
|
|
|
2529
2743
|
return normalizedImage
|
|
2530
2744
|
}
|
|
2531
2745
|
}
|
|
2746
|
+
|
|
2747
|
+
extension HMSRNSDK: AVPictureInPictureControllerDelegate {
|
|
2748
|
+
|
|
2749
|
+
public func pictureInPictureControllerWillStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) {
|
|
2750
|
+
print(#function)
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2753
|
+
public func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) {
|
|
2754
|
+
|
|
2755
|
+
if eventsEnableStatus[HMSConstants.ON_PIP_MODE_CHANGED] != true {
|
|
2756
|
+
return
|
|
2757
|
+
}
|
|
2758
|
+
|
|
2759
|
+
self.delegate?.emitEvent(HMSConstants.ON_PIP_MODE_CHANGED,
|
|
2760
|
+
["event": HMSConstants.ON_PIP_MODE_CHANGED,
|
|
2761
|
+
"id": self.id,
|
|
2762
|
+
"isInPictureInPictureMode": true])
|
|
2763
|
+
}
|
|
2764
|
+
|
|
2765
|
+
public func pictureInPictureControllerWillStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) {
|
|
2766
|
+
print(#function)
|
|
2767
|
+
}
|
|
2768
|
+
|
|
2769
|
+
public func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) {
|
|
2770
|
+
if eventsEnableStatus[HMSConstants.ON_PIP_MODE_CHANGED] != true {
|
|
2771
|
+
return
|
|
2772
|
+
}
|
|
2773
|
+
|
|
2774
|
+
self.delegate?.emitEvent(HMSConstants.ON_PIP_MODE_CHANGED,
|
|
2775
|
+
["event": HMSConstants.ON_PIP_MODE_CHANGED,
|
|
2776
|
+
"id": self.id,
|
|
2777
|
+
"isInPictureInPictureMode": false])
|
|
2778
|
+
}
|
|
2779
|
+
|
|
2780
|
+
public func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, failedToStartPictureInPictureWithError error: Error) {
|
|
2781
|
+
if eventsEnableStatus[HMSConstants.ON_PIP_MODE_CHANGED] != true {
|
|
2782
|
+
return
|
|
2783
|
+
}
|
|
2784
|
+
|
|
2785
|
+
self.delegate?.emitEvent(HMSConstants.ON_PIP_MODE_CHANGED,
|
|
2786
|
+
["event": HMSConstants.ON_PIP_MODE_CHANGED,
|
|
2787
|
+
"id": self.id,
|
|
2788
|
+
"isInPictureInPictureMode": false])
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2791
|
+
public func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) {
|
|
2792
|
+
print(#function)
|
|
2793
|
+
}
|
|
2794
|
+
}
|
|
2795
|
+
|
|
2796
|
+
extension UIView {
|
|
2797
|
+
func addConstrained(subview: UIView) {
|
|
2798
|
+
addSubview(subview)
|
|
2799
|
+
subview.translatesAutoresizingMaskIntoConstraints = false
|
|
2800
|
+
subview.topAnchor.constraint(equalTo: topAnchor).isActive = true
|
|
2801
|
+
subview.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
|
|
2802
|
+
subview.trailingAnchor.constraint(equalTo: trailingAnchor).isActive = true
|
|
2803
|
+
subview.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = true
|
|
2804
|
+
}
|
|
2805
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// HMSPipModel.swift
|
|
3
|
+
// react-native-hms
|
|
4
|
+
//
|
|
5
|
+
// Created by Yogesh Singh on 21/06/24.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import SwiftUI
|
|
9
|
+
import HMSSDK
|
|
10
|
+
|
|
11
|
+
@available(iOS 15.0, *)
|
|
12
|
+
class HMSPipModel: ObservableObject {
|
|
13
|
+
@Published var track: HMSVideoTrack?
|
|
14
|
+
@Published var pipViewEnabled = false
|
|
15
|
+
@Published var scaleType: UIView.ContentMode?
|
|
16
|
+
@Published var text: String?
|
|
17
|
+
@Published var color: Color = Color.black
|
|
18
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//
|
|
2
|
+
// HMSPipView.swift
|
|
3
|
+
// react-native-hms
|
|
4
|
+
//
|
|
5
|
+
// Created by Yogesh Singh on 21/06/24.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import SwiftUI
|
|
9
|
+
import HMSSDK
|
|
10
|
+
|
|
11
|
+
@available(iOS 15.0, *)
|
|
12
|
+
struct HMSPipView: View {
|
|
13
|
+
|
|
14
|
+
@ObservedObject var model: HMSPipModel
|
|
15
|
+
|
|
16
|
+
var body: some View {
|
|
17
|
+
if model.pipViewEnabled {
|
|
18
|
+
VStack {
|
|
19
|
+
if let track = model.track, !(track.isMute()) {
|
|
20
|
+
GeometryReader { geo in
|
|
21
|
+
HMSSampleBufferSwiftUIView(track: track,
|
|
22
|
+
contentMode: .scaleAspectFill,
|
|
23
|
+
preferredSize: geo.size,
|
|
24
|
+
model: model)
|
|
25
|
+
.frame(width: geo.size.width, height: geo.size.height)
|
|
26
|
+
}
|
|
27
|
+
} else if let text = model.text {
|
|
28
|
+
Text(text)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
.foregroundColor(.white)
|
|
32
|
+
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
33
|
+
.background(model.color)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//
|
|
2
|
+
// HMSSampleBufferSwiftUIView.swift
|
|
3
|
+
// react-native-hms
|
|
4
|
+
//
|
|
5
|
+
// Created by Yogesh Singh on 21/06/24.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import SwiftUI
|
|
9
|
+
import HMSSDK
|
|
10
|
+
|
|
11
|
+
@available(iOS 15.0, *)
|
|
12
|
+
public struct HMSSampleBufferSwiftUIView: UIViewRepresentable {
|
|
13
|
+
weak var track: HMSVideoTrack?
|
|
14
|
+
var contentMode: UIView.ContentMode
|
|
15
|
+
var preferredSize: CGSize?
|
|
16
|
+
|
|
17
|
+
@ObservedObject var model: HMSPipModel
|
|
18
|
+
|
|
19
|
+
public func makeUIView(context: UIViewRepresentableContext<HMSSampleBufferSwiftUIView>) -> HMSSampleBufferDisplayView {
|
|
20
|
+
|
|
21
|
+
let sampleBufferView = HMSSampleBufferDisplayView(frame: .zero)
|
|
22
|
+
sampleBufferView.track = track
|
|
23
|
+
|
|
24
|
+
if let preferredSize = preferredSize {
|
|
25
|
+
sampleBufferView.preferredSize = preferredSize
|
|
26
|
+
}
|
|
27
|
+
sampleBufferView.contentMode = contentMode
|
|
28
|
+
sampleBufferView.isEnabled = true
|
|
29
|
+
|
|
30
|
+
return sampleBufferView
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public func updateUIView(_ sampleBufferView: HMSSampleBufferDisplayView, context: UIViewRepresentableContext<HMSSampleBufferSwiftUIView>) {
|
|
34
|
+
|
|
35
|
+
if track != sampleBufferView.track {
|
|
36
|
+
sampleBufferView.track = track
|
|
37
|
+
}
|
|
38
|
+
sampleBufferView.isEnabled = model.pipViewEnabled
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public static func dismantleUIView(_ uiView: HMSSampleBufferDisplayView, coordinator: ()) {
|
|
42
|
+
uiView.isEnabled = false
|
|
43
|
+
uiView.track = nil
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -4,6 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.HMSAudioDevice = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Enum for HMSAudioDevice types.
|
|
9
|
+
*
|
|
10
|
+
* This enum represents the different types of audio devices that can be used
|
|
11
|
+
* in the context of the HMS SDK. It provides a way to specify the preferred
|
|
12
|
+
* audio output device for audio playback.
|
|
13
|
+
*
|
|
14
|
+
* @enum {string}
|
|
15
|
+
*/
|
|
7
16
|
let HMSAudioDevice = exports.HMSAudioDevice = /*#__PURE__*/function (HMSAudioDevice) {
|
|
8
17
|
HMSAudioDevice["SPEAKER_PHONE"] = "SPEAKER_PHONE";
|
|
9
18
|
HMSAudioDevice["WIRED_HEADSET"] = "WIRED_HEADSET";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HMSAudioDevice","exports"],"sources":["HMSAudioDevice.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["HMSAudioDevice","exports"],"sources":["HMSAudioDevice.ts"],"sourcesContent":["/**\n * Enum for HMSAudioDevice types.\n *\n * This enum represents the different types of audio devices that can be used\n * in the context of the HMS SDK. It provides a way to specify the preferred\n * audio output device for audio playback.\n *\n * @enum {string}\n */\nexport enum HMSAudioDevice {\n /** Use the speakerphone for audio output. */\n SPEAKER_PHONE = 'SPEAKER_PHONE',\n\n /** Use a wired headset for audio output, if connected. */\n WIRED_HEADSET = 'WIRED_HEADSET',\n\n /** Use the earpiece for audio output. */\n EARPIECE = 'EARPIECE',\n\n /** Use a Bluetooth device for audio output, if connected. */\n BLUETOOTH = 'BLUETOOTH',\n\n /** Automatically select the best audio output device based on the current state. */\n AUTOMATIC = 'AUTOMATIC',\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IASYA,cAAc,GAAAC,OAAA,CAAAD,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA","ignoreList":[]}
|
|
@@ -4,6 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.HMSAudioMixingMode = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Enum for HMS Audio Mixing Mode options.
|
|
9
|
+
*
|
|
10
|
+
* Defines the modes available for audio mixing in a session. These modes determine how audio tracks are mixed and played back.
|
|
11
|
+
*
|
|
12
|
+
* - `TALK_ONLY`: Only the talk (voice) track is active, suitable for sessions focusing on voice communication.
|
|
13
|
+
* - `TALK_AND_MUSIC`: Both talk and music tracks are active, allowing for background music with clear voice overlay.
|
|
14
|
+
* - `MUSIC_ONLY`: Only the music track is active, ideal for sessions focusing on music playback.
|
|
15
|
+
*
|
|
16
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/local-audio-share
|
|
17
|
+
*/
|
|
7
18
|
let HMSAudioMixingMode = exports.HMSAudioMixingMode = /*#__PURE__*/function (HMSAudioMixingMode) {
|
|
8
19
|
HMSAudioMixingMode["TALK_ONLY"] = "TALK_ONLY";
|
|
9
20
|
HMSAudioMixingMode["TALK_AND_MUSIC"] = "TALK_AND_MUSIC";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HMSAudioMixingMode","exports"],"sources":["HMSAudioMixingMode.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["HMSAudioMixingMode","exports"],"sources":["HMSAudioMixingMode.ts"],"sourcesContent":["/**\n * Enum for HMS Audio Mixing Mode options.\n *\n * Defines the modes available for audio mixing in a session. These modes determine how audio tracks are mixed and played back.\n *\n * - `TALK_ONLY`: Only the talk (voice) track is active, suitable for sessions focusing on voice communication.\n * - `TALK_AND_MUSIC`: Both talk and music tracks are active, allowing for background music with clear voice overlay.\n * - `MUSIC_ONLY`: Only the music track is active, ideal for sessions focusing on music playback.\n *\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/local-audio-share\n */\nexport enum HMSAudioMixingMode {\n TALK_ONLY = 'TALK_ONLY',\n TALK_AND_MUSIC = 'TALK_AND_MUSIC',\n MUSIC_ONLY = 'MUSIC_ONLY',\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,IAWYA,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA","ignoreList":[]}
|
|
@@ -5,6 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.HMSAudioTrack = void 0;
|
|
7
7
|
var _HMSTrack = require("./HMSTrack");
|
|
8
|
+
/**
|
|
9
|
+
* Represents an audio track within the HMS (100ms) system.
|
|
10
|
+
*
|
|
11
|
+
* This class extends `HMSTrack` to provide functionalities specific to audio tracks. It includes a constructor
|
|
12
|
+
* that allows for the initialization of the audio track with various parameters such as track ID, source, description,
|
|
13
|
+
* mute state, ID, and type. These parameters provide detailed information about the audio track and its characteristics.
|
|
14
|
+
*
|
|
15
|
+
* @extends HMSTrack
|
|
16
|
+
*/
|
|
8
17
|
class HMSAudioTrack extends _HMSTrack.HMSTrack {
|
|
9
18
|
constructor(params) {
|
|
10
19
|
if (params) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_HMSTrack","require","HMSAudioTrack","HMSTrack","constructor","params","exports"],"sources":["HMSAudioTrack.ts"],"sourcesContent":["import { HMSTrack } from './HMSTrack';\nimport type { HMSTrackSource } from './HMSTrackSource';\nimport type { HMSTrackType } from './HMSTrackType';\n\nexport class HMSAudioTrack extends HMSTrack {\n constructor(params?: {\n trackId: string;\n source?: HMSTrackSource;\n trackDescription?: string;\n isMute?: boolean;\n id: string;\n type?: HMSTrackType;\n }) {\n if (params) {\n super(params);\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;
|
|
1
|
+
{"version":3,"names":["_HMSTrack","require","HMSAudioTrack","HMSTrack","constructor","params","exports"],"sources":["HMSAudioTrack.ts"],"sourcesContent":["import { HMSTrack } from './HMSTrack';\nimport type { HMSTrackSource } from './HMSTrackSource';\nimport type { HMSTrackType } from './HMSTrackType';\n\n/**\n * Represents an audio track within the HMS (100ms) system.\n *\n * This class extends `HMSTrack` to provide functionalities specific to audio tracks. It includes a constructor\n * that allows for the initialization of the audio track with various parameters such as track ID, source, description,\n * mute state, ID, and type. These parameters provide detailed information about the audio track and its characteristics.\n *\n * @extends HMSTrack\n */\nexport class HMSAudioTrack extends HMSTrack {\n constructor(params?: {\n trackId: string;\n source?: HMSTrackSource;\n trackDescription?: string;\n isMute?: boolean;\n id: string;\n type?: HMSTrackType;\n }) {\n if (params) {\n super(params);\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,aAAa,SAASC,kBAAQ,CAAC;EAC1CC,WAAWA,CAACC,MAOX,EAAE;IACD,IAAIA,MAAM,EAAE;MACV,KAAK,CAACA,MAAM,CAAC;IACf;EACF;AACF;AAACC,OAAA,CAAAJ,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -4,6 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.HMSCameraFacing = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Enum for camera facing directions in a 100ms (HMS) application.
|
|
9
|
+
*
|
|
10
|
+
* This enumeration defines the possible camera facing options for video tracks in a 100ms (HMS) application, allowing developers to specify whether the front or back camera should be used during a video session.
|
|
11
|
+
* This can be particularly useful for applications that need to switch between cameras or provide users with the option to choose their preferred camera.
|
|
12
|
+
*
|
|
13
|
+
* @enum {string}
|
|
14
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/mute#switch-camera
|
|
15
|
+
*/
|
|
7
16
|
let HMSCameraFacing = exports.HMSCameraFacing = /*#__PURE__*/function (HMSCameraFacing) {
|
|
8
17
|
HMSCameraFacing["FRONT"] = "FRONT";
|
|
9
18
|
HMSCameraFacing["BACK"] = "BACK";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HMSCameraFacing","exports"],"sources":["HMSCameraFacing.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["HMSCameraFacing","exports"],"sources":["HMSCameraFacing.ts"],"sourcesContent":["/**\n * Enum for camera facing directions in a 100ms (HMS) application.\n *\n * This enumeration defines the possible camera facing options for video tracks in a 100ms (HMS) application, allowing developers to specify whether the front or back camera should be used during a video session.\n * This can be particularly useful for applications that need to switch between cameras or provide users with the option to choose their preferred camera.\n *\n * @enum {string}\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/mute#switch-camera\n */\nexport enum HMSCameraFacing {\n /** Represents the front camera on a device. */\n FRONT = 'FRONT',\n /** Represents the back camera on a device. */\n BACK = 'BACK',\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IASYA,eAAe,GAAAC,OAAA,CAAAD,eAAA,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA","ignoreList":[]}
|
|
@@ -7,6 +7,33 @@ exports.HMSConfig = void 0;
|
|
|
7
7
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
9
9
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
+
/**
|
|
11
|
+
* Represents the configuration needed to join a room in the HMS ecosystem.
|
|
12
|
+
*
|
|
13
|
+
* This class encapsulates all necessary details required to initiate a connection to a room, including user identification,
|
|
14
|
+
* authentication token, optional endpoint for different server connections, metadata for additional information about the connection,
|
|
15
|
+
* and a flag to capture network quality during the preview phase.
|
|
16
|
+
*
|
|
17
|
+
*
|
|
18
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/join
|
|
19
|
+
*
|
|
20
|
+
* @param {Object} params - The configuration parameters.
|
|
21
|
+
* @param {string} params.username - The username of the participant.
|
|
22
|
+
* @param {string} params.authToken - The authentication token for room access.
|
|
23
|
+
* @param {string} [params.endpoint] - Optional. The endpoint URL for the connection.
|
|
24
|
+
* @param {string} [params.metadata] - Optional. Additional metadata associated with the Local Peer.
|
|
25
|
+
* @param {boolean} [params.captureNetworkQualityInPreview] - Optional. Flag to capture network quality in the preview phase.
|
|
26
|
+
* @constructor
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* const config = new HMSConfig({
|
|
30
|
+
* username: 'username',
|
|
31
|
+
* authToken: 'authToken',
|
|
32
|
+
* metadata: 'metadata',
|
|
33
|
+
* captureNetworkQualityInPreview: true,
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
10
37
|
class HMSConfig {
|
|
11
38
|
constructor(params) {
|
|
12
39
|
_defineProperty(this, "username", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HMSConfig","constructor","params","_defineProperty","username","authToken","endpoint","metadata","captureNetworkQualityInPreview","exports"],"sources":["HMSConfig.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["HMSConfig","constructor","params","_defineProperty","username","authToken","endpoint","metadata","captureNetworkQualityInPreview","exports"],"sources":["HMSConfig.ts"],"sourcesContent":["/**\n * Represents the configuration needed to join a room in the HMS ecosystem.\n *\n * This class encapsulates all necessary details required to initiate a connection to a room, including user identification,\n * authentication token, optional endpoint for different server connections, metadata for additional information about the connection,\n * and a flag to capture network quality during the preview phase.\n *\n *\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/join\n *\n * @param {Object} params - The configuration parameters.\n * @param {string} params.username - The username of the participant.\n * @param {string} params.authToken - The authentication token for room access.\n * @param {string} [params.endpoint] - Optional. The endpoint URL for the connection.\n * @param {string} [params.metadata] - Optional. Additional metadata associated with the Local Peer.\n * @param {boolean} [params.captureNetworkQualityInPreview] - Optional. Flag to capture network quality in the preview phase.\n * @constructor\n *\n * @example\n * const config = new HMSConfig({\n * username: 'username',\n * authToken: 'authToken',\n * metadata: 'metadata',\n * captureNetworkQualityInPreview: true,\n * });\n *\n */\nexport class HMSConfig {\n username: string;\n authToken: string;\n endpoint?: string;\n metadata?: string;\n captureNetworkQualityInPreview?: boolean;\n\n constructor(params: {\n username: string;\n authToken: string;\n endpoint?: string;\n metadata?: string;\n captureNetworkQualityInPreview?: boolean;\n }) {\n this.username = params.username;\n this.authToken = params.authToken;\n this.endpoint = params.endpoint;\n this.metadata = params.metadata;\n this.captureNetworkQualityInPreview = params.captureNetworkQualityInPreview;\n }\n}\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,SAAS,CAAC;EAOrBC,WAAWA,CAACC,MAMX,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACD,IAAI,CAACC,QAAQ,GAAGF,MAAM,CAACE,QAAQ;IAC/B,IAAI,CAACC,SAAS,GAAGH,MAAM,CAACG,SAAS;IACjC,IAAI,CAACC,QAAQ,GAAGJ,MAAM,CAACI,QAAQ;IAC/B,IAAI,CAACC,QAAQ,GAAGL,MAAM,CAACK,QAAQ;IAC/B,IAAI,CAACC,8BAA8B,GAAGN,MAAM,CAACM,8BAA8B;EAC7E;AACF;AAACC,OAAA,CAAAT,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
@@ -7,6 +7,24 @@ exports.HMSException = void 0;
|
|
|
7
7
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
9
9
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
+
/**
|
|
11
|
+
* Represents an exception specific to the HMS SDK in a React Native context.
|
|
12
|
+
*
|
|
13
|
+
* This class encapsulates detailed information about errors that can occur while interacting with the HMS SDK.
|
|
14
|
+
* It includes a numeric code to identify the type of error, a human-readable description, and optionally,
|
|
15
|
+
* a message, name, and action that are primarily available on Android. Additionally, it indicates whether
|
|
16
|
+
* the error is terminal (i.e., cannot be recovered from) and whether a retry might be possible.
|
|
17
|
+
*
|
|
18
|
+
* @class HMSException
|
|
19
|
+
* @property {number} code - Numeric error code representing the type of error.
|
|
20
|
+
* @property {string} description - A brief, human-readable description of the error.
|
|
21
|
+
* @property {string} [message] - Additional message information about the error (Android only).
|
|
22
|
+
* @property {string} [name] - The name of the error (Android only).
|
|
23
|
+
* @property {string} [action] - The action during which the error occurred (Android only).
|
|
24
|
+
* @property {boolean} isTerminal - Indicates whether the error is terminal.
|
|
25
|
+
* @property {boolean} [canRetry] - Indicates whether the operation that caused the error can be retried (Android only).
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
10
28
|
class HMSException {
|
|
11
29
|
// `canRetry` is available only on Android
|
|
12
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HMSException","constructor","params","_defineProperty","code","description","message","name","action","isTerminal","canRetry","exports"],"sources":["HMSException.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["HMSException","constructor","params","_defineProperty","code","description","message","name","action","isTerminal","canRetry","exports"],"sources":["HMSException.ts"],"sourcesContent":["/**\n * Represents an exception specific to the HMS SDK in a React Native context.\n *\n * This class encapsulates detailed information about errors that can occur while interacting with the HMS SDK.\n * It includes a numeric code to identify the type of error, a human-readable description, and optionally,\n * a message, name, and action that are primarily available on Android. Additionally, it indicates whether\n * the error is terminal (i.e., cannot be recovered from) and whether a retry might be possible.\n *\n * @class HMSException\n * @property {number} code - Numeric error code representing the type of error.\n * @property {string} description - A brief, human-readable description of the error.\n * @property {string} [message] - Additional message information about the error (Android only).\n * @property {string} [name] - The name of the error (Android only).\n * @property {string} [action] - The action during which the error occurred (Android only).\n * @property {boolean} isTerminal - Indicates whether the error is terminal.\n * @property {boolean} [canRetry] - Indicates whether the operation that caused the error can be retried (Android only).\n *\n */\nexport class HMSException {\n code: number;\n description: string;\n message?: string; // `message` is available only on Android\n name?: string; // `name` is available only on Android\n action?: string; // `action` is available only on Android\n isTerminal: boolean;\n canRetry?: boolean; // `canRetry` is available only on Android\n\n constructor(params: {\n code: number;\n description: string;\n message?: string;\n name?: string;\n action?: string;\n isTerminal: boolean;\n canRetry?: boolean;\n }) {\n this.code = params.code;\n this.description = params.description;\n this.message = params.message;\n this.name = params.name;\n this.action = params.action;\n this.isTerminal = params.isTerminal;\n this.canRetry = params.canRetry;\n }\n}\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,YAAY,CAAC;EAOJ;;EAEpBC,WAAWA,CAACC,MAQX,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAde;IAAAA,eAAA;IACH;IAAAA,eAAA;IACE;IAAAA,eAAA;IAAAA,eAAA;IAaf,IAAI,CAACC,IAAI,GAAGF,MAAM,CAACE,IAAI;IACvB,IAAI,CAACC,WAAW,GAAGH,MAAM,CAACG,WAAW;IACrC,IAAI,CAACC,OAAO,GAAGJ,MAAM,CAACI,OAAO;IAC7B,IAAI,CAACC,IAAI,GAAGL,MAAM,CAACK,IAAI;IACvB,IAAI,CAACC,MAAM,GAAGN,MAAM,CAACM,MAAM;IAC3B,IAAI,CAACC,UAAU,GAAGP,MAAM,CAACO,UAAU;IACnC,IAAI,CAACC,QAAQ,GAAGR,MAAM,CAACQ,QAAQ;EACjC;AACF;AAACC,OAAA,CAAAX,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["HMSHLSTimedMetadata.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":[],"sources":["HMSHLSTimedMetadata.ts"],"sourcesContent":["/**\n * Defines the structure for HLS (HTTP Live Streaming) timed metadata.\n *\n * This interface is used to represent metadata that can be synchronized with HLS video playback.\n * The metadata includes a payload, which is the content of the metadata, and a duration, specifying how long (in seconds)\n * the metadata should be displayed during the stream.\n * This can be used for a variety of purposes such as displaying song titles, advertisements, or other relevant information at specific times during the stream.\n *\n * @interface HMSHLSTimedMetadata\n * @property {string} payload - The content of the metadata to be displayed.\n * @property {number} duration - The duration (in seconds) for which the metadata should be displayed.\n */\nexport interface HMSHLSTimedMetadata {\n payload: string;\n duration: number;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -4,6 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.HMSIOSAudioMode = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Enum for specifying the audio mode in an iOS environment within a 100ms (HMS) application.
|
|
9
|
+
*
|
|
10
|
+
* This enumeration provides options to configure the audio mode for an iOS application using the 100ms (HMS) SDK.
|
|
11
|
+
* It allows for the selection between `voice` and `music` modes, catering to different use cases such as
|
|
12
|
+
* prioritizing voice clarity or enhancing music quality during a session.
|
|
13
|
+
*
|
|
14
|
+
* @enum {string}
|
|
15
|
+
* @property {string} VOICE - Configures the audio session for optimized voice communication.
|
|
16
|
+
* This mode enhances voice clarity, making it suitable for calls or conferences.
|
|
17
|
+
* @property {string} MUSIC - Configures the audio session for music playback.
|
|
18
|
+
* This mode enhances music fidelity, making it suitable for streams or recordings that prioritize music quality.
|
|
19
|
+
*
|
|
20
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/configure-your-device/microphone/music-mode
|
|
21
|
+
*/
|
|
7
22
|
let HMSIOSAudioMode = exports.HMSIOSAudioMode = /*#__PURE__*/function (HMSIOSAudioMode) {
|
|
8
23
|
HMSIOSAudioMode["VOICE"] = "voice";
|
|
9
24
|
HMSIOSAudioMode["MUSIC"] = "music";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HMSIOSAudioMode","exports"],"sources":["HMSIOSAudioMode.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["HMSIOSAudioMode","exports"],"sources":["HMSIOSAudioMode.ts"],"sourcesContent":["/**\n * Enum for specifying the audio mode in an iOS environment within a 100ms (HMS) application.\n *\n * This enumeration provides options to configure the audio mode for an iOS application using the 100ms (HMS) SDK.\n * It allows for the selection between `voice` and `music` modes, catering to different use cases such as\n * prioritizing voice clarity or enhancing music quality during a session.\n *\n * @enum {string}\n * @property {string} VOICE - Configures the audio session for optimized voice communication.\n * This mode enhances voice clarity, making it suitable for calls or conferences.\n * @property {string} MUSIC - Configures the audio session for music playback.\n * This mode enhances music fidelity, making it suitable for streams or recordings that prioritize music quality.\n *\n * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/configure-your-device/microphone/music-mode\n */\nexport enum HMSIOSAudioMode {\n VOICE = 'voice',\n MUSIC = 'music',\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,IAeYA,eAAe,GAAAC,OAAA,CAAAD,eAAA,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA","ignoreList":[]}
|