@fishjam-cloud/react-native-client 0.20.0 → 0.22.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.
Files changed (76) hide show
  1. package/android/src/main/java/io/fishjam/reactnative/RNFishjamClient.kt +8 -0
  2. package/build/RNFishjamClientModule.d.ts +1 -2
  3. package/build/RNFishjamClientModule.d.ts.map +1 -1
  4. package/build/RNFishjamClientModule.js.map +1 -1
  5. package/build/components/FishjamRoom/index.d.ts +6 -6
  6. package/build/components/FishjamRoom/index.d.ts.map +1 -1
  7. package/build/components/FishjamRoom/index.js +8 -10
  8. package/build/components/FishjamRoom/index.js.map +1 -1
  9. package/build/hooks/internal/useFishjamEvent.d.ts.map +1 -1
  10. package/build/hooks/internal/useFishjamEvent.js +3 -0
  11. package/build/hooks/internal/useFishjamEvent.js.map +1 -1
  12. package/build/hooks/useAudioSettings.d.ts +7 -0
  13. package/build/hooks/useAudioSettings.d.ts.map +1 -1
  14. package/build/hooks/useAudioSettings.js.map +1 -1
  15. package/build/hooks/useConnection.d.ts +20 -16
  16. package/build/hooks/useConnection.d.ts.map +1 -1
  17. package/build/hooks/useConnection.js +10 -11
  18. package/build/hooks/useConnection.js.map +1 -1
  19. package/build/hooks/useSandbox.d.ts +3 -3
  20. package/build/hooks/useSandbox.d.ts.map +1 -1
  21. package/build/hooks/useSandbox.js +10 -12
  22. package/build/hooks/useSandbox.js.map +1 -1
  23. package/build/index.d.ts +2 -17
  24. package/build/index.d.ts.map +1 -1
  25. package/build/index.js +2 -10
  26. package/build/index.js.map +1 -1
  27. package/build/livestream/components/LivestreamStreamer.d.ts +51 -0
  28. package/build/livestream/components/LivestreamStreamer.d.ts.map +1 -0
  29. package/build/livestream/components/LivestreamStreamer.js +36 -0
  30. package/build/livestream/components/LivestreamStreamer.js.map +1 -0
  31. package/build/livestream/components/LivestreamViewer.d.ts.map +1 -0
  32. package/build/{components → livestream/components}/LivestreamViewer.js +1 -1
  33. package/build/livestream/components/LivestreamViewer.js.map +1 -0
  34. package/build/{hooks → livestream/hooks}/useLivestreamStreamer.d.ts +9 -5
  35. package/build/livestream/hooks/useLivestreamStreamer.d.ts.map +1 -0
  36. package/build/livestream/hooks/useLivestreamStreamer.js +30 -0
  37. package/build/livestream/hooks/useLivestreamStreamer.js.map +1 -0
  38. package/build/{hooks → livestream/hooks}/useLivestreamViewer.d.ts +3 -1
  39. package/build/livestream/hooks/useLivestreamViewer.d.ts.map +1 -0
  40. package/build/livestream/hooks/useLivestreamViewer.js +45 -0
  41. package/build/livestream/hooks/useLivestreamViewer.js.map +1 -0
  42. package/build/livestream/index.d.ts +11 -0
  43. package/build/livestream/index.d.ts.map +1 -0
  44. package/build/livestream/index.js +6 -0
  45. package/build/livestream/index.js.map +1 -0
  46. package/build/utils/config.d.ts +6 -0
  47. package/build/utils/config.d.ts.map +1 -0
  48. package/build/utils/config.js +10 -0
  49. package/build/utils/config.js.map +1 -0
  50. package/build/utils/getFishjamUrl.d.ts +2 -0
  51. package/build/utils/getFishjamUrl.d.ts.map +1 -0
  52. package/build/utils/getFishjamUrl.js +10 -0
  53. package/build/utils/getFishjamUrl.js.map +1 -0
  54. package/ios/Events.swift +8 -1
  55. package/ios/RNFishjamClient.podspec +1 -1
  56. package/ios/RNFishjamClient.swift +9 -4
  57. package/ios/VideoPreviewView.swift +1 -0
  58. package/livestream/package.json +4 -0
  59. package/package.json +3 -2
  60. package/build/common/client.d.ts +0 -25
  61. package/build/common/client.d.ts.map +0 -1
  62. package/build/common/client.js +0 -14
  63. package/build/common/client.js.map +0 -1
  64. package/build/components/LivestreamStreamer.d.ts +0 -19
  65. package/build/components/LivestreamStreamer.d.ts.map +0 -1
  66. package/build/components/LivestreamStreamer.js +0 -10
  67. package/build/components/LivestreamStreamer.js.map +0 -1
  68. package/build/components/LivestreamViewer.d.ts.map +0 -1
  69. package/build/components/LivestreamViewer.js.map +0 -1
  70. package/build/hooks/useLivestreamStreamer.d.ts.map +0 -1
  71. package/build/hooks/useLivestreamStreamer.js +0 -31
  72. package/build/hooks/useLivestreamStreamer.js.map +0 -1
  73. package/build/hooks/useLivestreamViewer.d.ts.map +0 -1
  74. package/build/hooks/useLivestreamViewer.js +0 -31
  75. package/build/hooks/useLivestreamViewer.js.map +0 -1
  76. /package/build/{components → livestream/components}/LivestreamViewer.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAGA,YAAY,EACV,eAAe,EACf,WAAW,EACX,eAAe,EACf,aAAa,EACb,KAAK,EACL,QAAQ,GACT,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO;AACL,kBAAkB;AAClB,QAAQ;AACR,kBAAkB;AAClB,SAAS,GACV,MAAM,iBAAiB,CAAC;AAIzB,YAAY,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,YAAY,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,YAAY,EACV,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAIrE,YAAY,EACV,IAAI,EACJ,MAAM,EACN,KAAK,EACL,OAAO,EACP,SAAS,EACT,SAAS,EACT,cAAc,EACd,SAAS,EACT,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,gBA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AW,EAAE,MAAM,gBAAgB,CAAC"}
package/build/index.js CHANGED
@@ -2,15 +2,8 @@ import { initializeWarningListener } from './utils/errorListener';
2
2
  // #endregion
3
3
  // #region methods
4
4
  export { updatePeerMetadata } from './common/metadata';
5
- export {
6
- /** @deprecated */
7
- joinRoom,
8
- /** @deprecated */
9
- leaveRoom, } from './common/client';
10
5
  export { VideoPreviewView } from './components/VideoPreviewView';
11
6
  export { VideoRendererView } from './components/VideoRendererView';
12
- export { LivestreamViewer } from './components/LivestreamViewer';
13
- export { LivestreamStreamer } from './components/LivestreamStreamer';
14
7
  // #endregion
15
8
  // #region hooks
16
9
  export { useAudioSettings } from './hooks/useAudioSettings';
@@ -25,12 +18,11 @@ export { usePeers } from './hooks/usePeers';
25
18
  export { useForegroundService } from './hooks/useForegroundService';
26
19
  export { useConnection } from './hooks/useConnection';
27
20
  export { useUpdatePeerMetadata } from './hooks/useUpdatePeerMetadata';
28
- export { useLivestreamViewer } from './hooks/useLivestreamViewer';
29
- export { useLivestreamStreamer } from './hooks/useLivestreamStreamer';
30
21
  export { useSandbox } from './hooks/useSandbox';
31
- export { cameras } from 'react-native-whip-whep';
32
22
  // #endregion
33
23
  export { useCameraPermissions, useMicrophonePermissions, } from './hooks/usePermissions';
34
24
  export { FishjamRoom } from './components/FishjamRoom';
35
25
  initializeWarningListener();
26
+ // Debug/config API
27
+ export { setOverwriteDebugConfig } from './utils/config';
36
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAYlE,aAAa;AAEb,kBAAkB;AAClB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO;AACL,kBAAkB;AAClB,QAAQ;AACR,kBAAkB;AAClB,SAAS,GACV,MAAM,iBAAiB,CAAC;AAWzB,OAAO,EAAE,gBAAgB,EA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orListener';\n\n// #region types\nexport type {\n SimulcastConfig,\n VideoLayout,\n GenericMetadata,\n TrackMetadata,\n Brand,\n RoomType,\n} from './types';\nexport type { ConnectionConfig } from './common/client';\n// #endregion\n\n// #region methods\nexport { updatePeerMetadata } from './common/metadata';\nexport {\n /** @deprecated */\n joinRoom,\n /** @deprecated */\n leaveRoom,\n} from './common/client';\n// #endregion\n\n// #region components\nexport type { VideoPreviewViewProps } from './components/VideoPreviewView';\nexport type { VideoRendererProps } from './components/VideoRendererView';\nexport type {\n LivestreamViewerProps,\n LivestreamViewerRef,\n} from './components/LivestreamViewer';\n\nexport { VideoPreviewView } from './components/VideoPreviewView';\nexport { VideoRendererView } from './components/VideoRendererView';\nexport { LivestreamViewer } from './components/LivestreamViewer';\nexport { LivestreamStreamer } from './components/LivestreamStreamer';\n// #endregion\n\n// #region types for hooks\nexport type {\n Peer,\n PeerId,\n Track,\n TrackId,\n TrackType,\n VadStatus,\n EncodingReason,\n TrackBase,\n AudioTrack,\n VideoTrack,\n UsePeersResult,\n PeerWithTracks,\n PeerTrackMetadata,\n DistinguishedTracks,\n} from './hooks/usePeers';\n\nexport type {\n AudioOutputDevice,\n AudioOutputDeviceType,\n AudioSessionMode,\n} from './hooks/useAudioSettings';\n\nexport type {\n CameraId,\n Camera,\n CameraConfig,\n VideoQuality,\n CameraFacingDirection,\n CameraConfigBase,\n} from './hooks/useCamera';\n\nexport type {\n ScreenShareOptions,\n ScreenShareQuality,\n} from './hooks/useScreenShare';\nexport type { ForegroundServiceConfig } from './hooks/useForegroundService';\nexport type {\n JoinRoomConfig,\n ReconnectionStatus,\n PeerStatus,\n} from './hooks/useConnection';\nexport type { AppScreenShareData } from './hooks/useAppScreenShare';\nexport type { useLivestreamViewerResult } from './hooks/useLivestreamViewer';\nexport type { useLivestreamStreamerResult } from './hooks/useLivestreamStreamer';\nexport type { UseSandboxProps } from './hooks/useSandbox';\nexport type { LivestreamStreamerProps } from './components/LivestreamStreamer';\nexport type { ConnectViewerConfig } from './hooks/useLivestreamViewer';\n// #endregion\n\n// #region hooks\nexport { useAudioSettings } from './hooks/useAudioSettings';\nexport { useBandwidthEstimation } from './hooks/useBandwidthEstimation';\nexport { useCamera } from './hooks/useCamera';\nexport { useMicrophone } from './hooks/useMicrophone';\nexport { useScreenShare } from './hooks/useScreenShare';\nexport { useAppScreenShare } from './hooks/useAppScreenShare';\nexport { useReconnection } from './hooks/useReconnection';\nexport { usePeerStatus } from './hooks/usePeerStatus';\nexport { usePeers } from './hooks/usePeers';\nexport { useForegroundService } from './hooks/useForegroundService';\nexport { useConnection } from './hooks/useConnection';\nexport { useUpdatePeerMetadata } from './hooks/useUpdatePeerMetadata';\nexport { useLivestreamViewer } from './hooks/useLivestreamViewer';\nexport { useLivestreamStreamer } from './hooks/useLivestreamStreamer';\nexport { useSandbox } from './hooks/useSandbox';\nexport { cameras } from 'react-native-whip-whep';\n// #endregion\n\nexport {\n useCameraPermissions,\n useMicrophonePermissions,\n} from './hooks/usePermissions';\n\nexport type { FishjamRoomProps } from './components/FishjamRoom';\nexport { FishjamRoom } from './components/FishjamRoom';\n\ninitializeWarningListener();\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAWlE,aAAa;AAEb,kBAAkB;AAClB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAMvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAiDnE,aAAa;AAEb,gBAAgB;AAChB,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,aAAa;AAEb,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,yBAAyB,EAAE,CAAC;AAE5B,mBAAmB;AACnB,OAAO,EAAE,uBAAuB,EAAe,MAAM,gBAAgB,CAAC","sourcesContent":["import { initializeWarningListener } from './utils/errorListener';\n\n// #region types\nexport type {\n SimulcastConfig,\n VideoLayout,\n GenericMetadata,\n TrackMetadata,\n Brand,\n RoomType,\n} from './types';\n// #endregion\n\n// #region methods\nexport { updatePeerMetadata } from './common/metadata';\n\n// #region components\nexport type { VideoPreviewViewProps } from './components/VideoPreviewView';\nexport type { VideoRendererProps } from './components/VideoRendererView';\n\nexport { VideoPreviewView } from './components/VideoPreviewView';\nexport { VideoRendererView } from './components/VideoRendererView';\n// #endregion\n\n// #region types for hooks\nexport type {\n Peer,\n PeerId,\n Track,\n TrackId,\n TrackType,\n VadStatus,\n EncodingReason,\n TrackBase,\n AudioTrack,\n VideoTrack,\n UsePeersResult,\n PeerWithTracks,\n PeerTrackMetadata,\n DistinguishedTracks,\n} from './hooks/usePeers';\n\nexport type {\n AudioOutputDevice,\n AudioOutputDeviceType,\n AudioSessionMode,\n} from './hooks/useAudioSettings';\n\nexport type {\n CameraId,\n Camera,\n CameraConfig,\n VideoQuality,\n CameraFacingDirection,\n CameraConfigBase,\n} from './hooks/useCamera';\n\nexport type {\n ScreenShareOptions,\n ScreenShareQuality,\n} from './hooks/useScreenShare';\nexport type { ForegroundServiceConfig } from './hooks/useForegroundService';\nexport type {\n JoinRoomConfig,\n ReconnectionStatus,\n PeerStatus,\n ConnectionConfig,\n} from './hooks/useConnection';\nexport type { AppScreenShareData } from './hooks/useAppScreenShare';\nexport type { UseSandboxProps } from './hooks/useSandbox';\n// #endregion\n\n// #region hooks\nexport { useAudioSettings } from './hooks/useAudioSettings';\nexport { useBandwidthEstimation } from './hooks/useBandwidthEstimation';\nexport { useCamera } from './hooks/useCamera';\nexport { useMicrophone } from './hooks/useMicrophone';\nexport { useScreenShare } from './hooks/useScreenShare';\nexport { useAppScreenShare } from './hooks/useAppScreenShare';\nexport { useReconnection } from './hooks/useReconnection';\nexport { usePeerStatus } from './hooks/usePeerStatus';\nexport { usePeers } from './hooks/usePeers';\nexport { useForegroundService } from './hooks/useForegroundService';\nexport { useConnection } from './hooks/useConnection';\nexport { useUpdatePeerMetadata } from './hooks/useUpdatePeerMetadata';\nexport { useSandbox } from './hooks/useSandbox';\n// #endregion\n\nexport {\n useCameraPermissions,\n useMicrophonePermissions,\n} from './hooks/usePermissions';\n\nexport type { FishjamRoomProps } from './components/FishjamRoom';\nexport { FishjamRoom } from './components/FishjamRoom';\n\ninitializeWarningListener();\n\n// Debug/config API\nexport { setOverwriteDebugConfig, DebugConfig } from './utils/config';\n"]}
@@ -0,0 +1,51 @@
1
+ import { StyleProp, ViewStyle } from 'react-native';
2
+ import { Camera, SenderAudioCodecName, SenderVideoCodecName, VideoParameters, WhipClient } from 'react-native-whip-whep';
3
+ /**
4
+ * Props of the LivestreamView component
5
+ */
6
+ export type LivestreamStreamerProps = {
7
+ /**
8
+ * Styles of the LivestreamView component
9
+ */
10
+ style?: StyleProp<ViewStyle>;
11
+ /**
12
+ * If video track should be enabled.
13
+ */
14
+ videoEnabled: boolean;
15
+ /**
16
+ * If audio track should be enabled.
17
+ */
18
+ audioEnabled: boolean;
19
+ /**
20
+ * Camera to use for the livestream.
21
+ * Use {@link cameras} to get the list of supported cameras.
22
+ */
23
+ camera?: Camera;
24
+ /**
25
+ * Set video parameters for the camera
26
+ */
27
+ videoParameters?: VideoParameters;
28
+ /**
29
+ * Set the preferred video codecs for sending the video.
30
+ * Use {@link WhipClient.getSupportedVideoCodecs} to get the list of supported video codecs.
31
+ */
32
+ preferredVideoCodecs?: SenderVideoCodecName[];
33
+ /**
34
+ * Set the preferred audio codecs for sending the audio.
35
+ * Use {@link WhipClient.getSupportedAudioCodecs} to get the list of supported audio codecs.
36
+ */
37
+ preferredAudioCodecs?: SenderAudioCodecName[];
38
+ /**
39
+ * Reference to the WhipClient instance. Needs to be passed from the {@link useLivestreamStreamer} hook.
40
+ */
41
+ whipClientRef: React.RefObject<WhipClient | null>;
42
+ };
43
+ /**
44
+ * Renders a video player playing the livestream set up with {@link useLivestreamStreamer} hook.
45
+ *
46
+ * @category Components
47
+ * @param {object} props
48
+ * @param {object} props.style
49
+ */
50
+ export declare const LivestreamStreamer: ({ style, whipClientRef, videoEnabled, audioEnabled, camera, videoParameters, preferredVideoCodecs, preferredAudioCodecs, }: LivestreamStreamerProps) => import("react").JSX.Element;
51
+ //# sourceMappingURL=LivestreamStreamer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LivestreamStreamer.d.ts","sourceRoot":"","sources":["../../../src/livestream/components/LivestreamStreamer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EACL,MAAM,EAEN,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,UAAU,EAEX,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAC9C;;;OAGG;IACH,oBAAoB,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAE9C;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;CACnD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,4HAShC,uBAAuB,gCAgCzB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { useEffect, useRef } from 'react';
2
+ import { cameras, WhipClient, WhipClientView, } from 'react-native-whip-whep';
3
+ /**
4
+ * Renders a video player playing the livestream set up with {@link useLivestreamStreamer} hook.
5
+ *
6
+ * @category Components
7
+ * @param {object} props
8
+ * @param {object} props.style
9
+ */
10
+ export const LivestreamStreamer = ({ style, whipClientRef, videoEnabled, audioEnabled, camera, videoParameters, preferredVideoCodecs, preferredAudioCodecs, }) => {
11
+ const whipClient = useRef(null);
12
+ useEffect(() => {
13
+ whipClient.current = new WhipClient({
14
+ audioEnabled,
15
+ videoEnabled,
16
+ videoParameters,
17
+ videoDeviceId: camera?.id ?? cameras[0].id,
18
+ }, preferredVideoCodecs, preferredAudioCodecs);
19
+ whipClientRef.current = whipClient.current;
20
+ return () => {
21
+ whipClient.current?.disconnect();
22
+ whipClient.current?.cleanup();
23
+ whipClientRef.current = null;
24
+ };
25
+ }, [
26
+ camera,
27
+ videoParameters,
28
+ videoEnabled,
29
+ audioEnabled,
30
+ preferredVideoCodecs,
31
+ preferredAudioCodecs,
32
+ whipClientRef,
33
+ ]);
34
+ return <WhipClientView style={style}/>;
35
+ };
36
+ //# sourceMappingURL=LivestreamStreamer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LivestreamStreamer.js","sourceRoot":"","sources":["../../../src/livestream/components/LivestreamStreamer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAEL,OAAO,EAIP,UAAU,EACV,cAAc,GACf,MAAM,wBAAwB,CAAC;AA4ChC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EACjC,KAAK,EACL,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,eAAe,EACf,oBAAoB,EACpB,oBAAoB,GACI,EAAE,EAAE;IAC5B,MAAM,UAAU,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAEnD,SAAS,CAAC,GAAG,EAAE;QACb,UAAU,CAAC,OAAO,GAAG,IAAI,UAAU,CACjC;YACE,YAAY;YACZ,YAAY;YACZ,eAAe;YACf,aAAa,EAAE,MAAM,EAAE,EAAE,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;SAC3C,EACD,oBAAoB,EACpB,oBAAoB,CACrB,CAAC;QACF,aAAa,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;QAE3C,OAAO,GAAG,EAAE;YACV,UAAU,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC;YACjC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC;YAC9B,aAAa,CAAC,OAAO,GAAG,IAAI,CAAC;QAC/B,CAAC,CAAC;IACJ,CAAC,EAAE;QACD,MAAM;QACN,eAAe;QACf,YAAY;QACZ,YAAY;QACZ,oBAAoB;QACpB,oBAAoB;QACpB,aAAa;KACd,CAAC,CAAC;IAEH,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,KAAsB,CAAC,EAAG,CAAC;AAC3D,CAAC,CAAC","sourcesContent":["import { CSSProperties, useEffect, useRef } from 'react';\nimport { StyleProp, ViewStyle } from 'react-native';\nimport {\n Camera,\n cameras,\n SenderAudioCodecName,\n SenderVideoCodecName,\n VideoParameters,\n WhipClient,\n WhipClientView,\n} from 'react-native-whip-whep';\n\n/**\n * Props of the LivestreamView component\n */\nexport type LivestreamStreamerProps = {\n /**\n * Styles of the LivestreamView component\n */\n style?: StyleProp<ViewStyle>;\n /**\n * If video track should be enabled.\n */\n videoEnabled: boolean;\n /**\n * If audio track should be enabled.\n */\n audioEnabled: boolean;\n /**\n * Camera to use for the livestream.\n * Use {@link cameras} to get the list of supported cameras.\n */\n camera?: Camera;\n /**\n * Set video parameters for the camera\n */\n videoParameters?: VideoParameters;\n /**\n * Set the preferred video codecs for sending the video.\n * Use {@link WhipClient.getSupportedVideoCodecs} to get the list of supported video codecs.\n */\n preferredVideoCodecs?: SenderVideoCodecName[];\n /**\n * Set the preferred audio codecs for sending the audio.\n * Use {@link WhipClient.getSupportedAudioCodecs} to get the list of supported audio codecs.\n */\n preferredAudioCodecs?: SenderAudioCodecName[];\n\n /**\n * Reference to the WhipClient instance. Needs to be passed from the {@link useLivestreamStreamer} hook.\n */\n whipClientRef: React.RefObject<WhipClient | null>;\n};\n\n/**\n * Renders a video player playing the livestream set up with {@link useLivestreamStreamer} hook.\n *\n * @category Components\n * @param {object} props\n * @param {object} props.style\n */\nexport const LivestreamStreamer = ({\n style,\n whipClientRef,\n videoEnabled,\n audioEnabled,\n camera,\n videoParameters,\n preferredVideoCodecs,\n preferredAudioCodecs,\n}: LivestreamStreamerProps) => {\n const whipClient = useRef<WhipClient | null>(null);\n\n useEffect(() => {\n whipClient.current = new WhipClient(\n {\n audioEnabled,\n videoEnabled,\n videoParameters,\n videoDeviceId: camera?.id ?? cameras[0].id,\n },\n preferredVideoCodecs,\n preferredAudioCodecs,\n );\n whipClientRef.current = whipClient.current;\n\n return () => {\n whipClient.current?.disconnect();\n whipClient.current?.cleanup();\n whipClientRef.current = null;\n };\n }, [\n camera,\n videoParameters,\n videoEnabled,\n audioEnabled,\n preferredVideoCodecs,\n preferredAudioCodecs,\n whipClientRef,\n ]);\n\n return <WhipClientView style={style as CSSProperties} />;\n};\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LivestreamViewer.d.ts","sourceRoot":"","sources":["../../../src/livestream/components/LivestreamViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,GAAG,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAkB,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3E,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;IACvC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF,GAAG,CAAC,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC;CAChC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,8EAQ9B,qBAAqB,gCASvB,CAAC"}
@@ -6,5 +6,5 @@ import { WhepClientView } from 'react-native-whip-whep';
6
6
  * @param {object} props
7
7
  * @param {object} props.style
8
8
  */
9
- export const LivestreamViewer = ({ style, orientation, pipEnabled, autoStartPip, autoStopPip, pipSize, ref, }) => (<WhepClientView ref={ref} style={style} orientation={orientation} pipEnabled={pipEnabled} autoStartPip={autoStartPip} autoStopPip={autoStopPip} pipSize={pipSize}/>);
9
+ export const LivestreamViewer = ({ style, orientation, pipEnabled, autoStartPip, autoStopPip, pipSize, ref, }) => (<WhepClientView ref={ref} style={style} pipEnabled={pipEnabled} autoStartPip={autoStartPip} autoStopPip={autoStopPip} pipSize={pipSize}/>);
10
10
  //# sourceMappingURL=LivestreamViewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LivestreamViewer.js","sourceRoot":"","sources":["../../../src/livestream/components/LivestreamViewer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAqB,MAAM,wBAAwB,CAAC;AA4C3E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAC/B,KAAK,EACL,WAAW,EACX,UAAU,EACV,YAAY,EACZ,WAAW,EACX,OAAO,EACP,GAAG,GACmB,EAAE,EAAE,CAAC,CAC3B,CAAC,cAAc,CACb,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,KAAK,CAAC,CAAC,KAAsB,CAAC,CAC9B,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,OAAO,CAAC,CAAC,OAAO,CAAC,EACjB,CACH,CAAC","sourcesContent":["import { CSSProperties, Ref } from 'react';\nimport { StyleProp, ViewStyle } from 'react-native';\nimport { WhepClientView, WhepClientViewRef } from 'react-native-whip-whep';\n\nexport type LivestreamViewerRef = WhepClientViewRef;\n\n/**\n * Props of the LivestreamView component\n */\nexport type LivestreamViewerProps = {\n /**\n * Styles of the LivestreamView component\n */\n style?: StyleProp<ViewStyle>;\n /**\n * Used to override the orientation of the video (from metadata).\n * Defaults to \"portrait\".\n */\n orientation?: 'landscape' | 'portrait';\n /**\n * A variable deciding whether the Picture-in-Picture is enabled.\n * Defaults to true.\n */\n pipEnabled?: boolean;\n /**\n * A variable deciding whether the Picture-in-Picture mode should be started automatically after the app is backgrounded.\n * Defaults to false.\n */\n autoStartPip?: boolean;\n /**\n * A variable deciding whether the Picture-in-Picture mode should be stopped automatically on iOS after the app is foregrounded.\n * Always enabled on Android as PiP is not supported in foreground.\n * Defaults to false.\n */\n autoStopPip?: boolean;\n /**\n * A variable deciding the size of the Picture-in-Picture mode.\n */\n pipSize?: {\n width: number;\n height: number;\n };\n\n ref?: Ref<LivestreamViewerRef>;\n};\n\n/**\n * Renders a video player playing the livestream set up with {@link useLivestreamViewer} hook.\n *\n * @category Components\n * @param {object} props\n * @param {object} props.style\n */\nexport const LivestreamViewer = ({\n style,\n orientation,\n pipEnabled,\n autoStartPip,\n autoStopPip,\n pipSize,\n ref,\n}: LivestreamViewerProps) => (\n <WhepClientView\n ref={ref}\n style={style as CSSProperties}\n pipEnabled={pipEnabled}\n autoStartPip={autoStartPip}\n autoStopPip={autoStopPip}\n pipSize={pipSize}\n />\n);\n"]}
@@ -1,4 +1,4 @@
1
- import { Camera } from 'react-native-whip-whep';
1
+ import { WhipClient } from 'react-native-whip-whep';
2
2
  /**
3
3
  * @category Livestream
4
4
  */
@@ -11,14 +11,18 @@ export interface useLivestreamStreamerResult {
11
11
  */
12
12
  connect: (token: string, urlOverride?: string) => Promise<void>;
13
13
  /** Callback to stop publishing anything previously published with {@link connect} */
14
- disconnect: () => void;
14
+ disconnect: () => Promise<void>;
15
+ /** Utility flag which indicates the current connection status */
16
+ isConnected: boolean;
17
+ /**
18
+ * Reference to the WhipClient instance. Needs to be passed to the {@link LivestreamStreamer} component.
19
+ */
20
+ whipClientRef: React.RefObject<WhipClient | null>;
15
21
  }
16
22
  /**
17
23
  * Hook for publishing a livestream, which can be then received with {@link useLivestreamViewer}
18
24
  * @category Livestream
19
25
  * @group Hooks
20
26
  */
21
- export declare const useLivestreamStreamer: ({ camera, }: {
22
- camera?: Camera;
23
- }) => useLivestreamStreamerResult;
27
+ export declare const useLivestreamStreamer: () => useLivestreamStreamerResult;
24
28
  //# sourceMappingURL=useLivestreamStreamer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLivestreamStreamer.d.ts","sourceRoot":"","sources":["../../../src/livestream/hooks/useLivestreamStreamer.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAG5E;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;OAKG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,qFAAqF;IACrF,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,iEAAiE;IACjE,WAAW,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;CACnD;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAAO,2BAwBxC,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { useCallback, useRef } from 'react';
2
+ import { useWhipConnectionState } from 'react-native-whip-whep';
3
+ import { FISHJAM_WHIP_URL } from '../../consts';
4
+ /**
5
+ * Hook for publishing a livestream, which can be then received with {@link useLivestreamViewer}
6
+ * @category Livestream
7
+ * @group Hooks
8
+ */
9
+ export const useLivestreamStreamer = () => {
10
+ const state = useWhipConnectionState();
11
+ const isConnected = state === 'connected';
12
+ const whipClientRef = useRef(null);
13
+ const connect = useCallback(async (token, urlOverride) => {
14
+ const resolvedUrl = urlOverride ?? FISHJAM_WHIP_URL;
15
+ await whipClientRef.current?.connect({
16
+ authToken: token,
17
+ serverUrl: resolvedUrl,
18
+ });
19
+ }, []);
20
+ const disconnect = useCallback(async () => {
21
+ await whipClientRef.current?.disconnect();
22
+ }, []);
23
+ return {
24
+ connect,
25
+ disconnect,
26
+ isConnected,
27
+ whipClientRef,
28
+ };
29
+ };
30
+ //# sourceMappingURL=useLivestreamStreamer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLivestreamStreamer.js","sourceRoot":"","sources":["../../../src/livestream/hooks/useLivestreamStreamer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAc,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAuBhD;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAgC,EAAE;IACrE,MAAM,KAAK,GAAG,sBAAsB,EAAE,CAAC;IACvC,MAAM,WAAW,GAAG,KAAK,KAAK,WAAW,CAAC;IAE1C,MAAM,aAAa,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAEtD,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,EAAE,KAAa,EAAE,WAAoB,EAAE,EAAE;QACxE,MAAM,WAAW,GAAG,WAAW,IAAI,gBAAgB,CAAC;QACpD,MAAM,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC;YACnC,SAAS,EAAE,KAAK;YAChB,SAAS,EAAE,WAAW;SACvB,CAAC,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;QACxC,MAAM,aAAa,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC;IAC5C,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,OAAO;QACP,UAAU;QACV,WAAW;QACX,aAAa;KACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useCallback, useRef } from 'react';\nimport { useWhipConnectionState, WhipClient } from 'react-native-whip-whep';\nimport { FISHJAM_WHIP_URL } from '../../consts';\n\n/**\n * @category Livestream\n */\nexport interface useLivestreamStreamerResult {\n /**\n * Callback used to start publishing the selected audio and video media streams.\n *\n * @remarks\n * Calling {@link connect} multiple times will have the effect of only publishing the **last** specified inputs.\n */\n connect: (token: string, urlOverride?: string) => Promise<void>;\n /** Callback to stop publishing anything previously published with {@link connect} */\n disconnect: () => Promise<void>;\n /** Utility flag which indicates the current connection status */\n isConnected: boolean;\n /**\n * Reference to the WhipClient instance. Needs to be passed to the {@link LivestreamStreamer} component.\n */\n whipClientRef: React.RefObject<WhipClient | null>;\n}\n\n/**\n * Hook for publishing a livestream, which can be then received with {@link useLivestreamViewer}\n * @category Livestream\n * @group Hooks\n */\nexport const useLivestreamStreamer = (): useLivestreamStreamerResult => {\n const state = useWhipConnectionState();\n const isConnected = state === 'connected';\n\n const whipClientRef = useRef<WhipClient | null>(null);\n\n const connect = useCallback(async (token: string, urlOverride?: string) => {\n const resolvedUrl = urlOverride ?? FISHJAM_WHIP_URL;\n await whipClientRef.current?.connect({\n authToken: token,\n serverUrl: resolvedUrl,\n });\n }, []);\n\n const disconnect = useCallback(async () => {\n await whipClientRef.current?.disconnect();\n }, []);\n\n return {\n connect,\n disconnect,\n isConnected,\n whipClientRef,\n };\n};\n"]}
@@ -16,7 +16,9 @@ export interface useLivestreamViewerResult {
16
16
  */
17
17
  connect: (config: ConnectViewerConfig, url?: string) => Promise<void>;
18
18
  /** Disconnect from a stream previously connected to with {@link connect} */
19
- disconnect: () => void;
19
+ disconnect: () => Promise<void>;
20
+ /** Utility flag which indicates the current connection status */
21
+ isConnected: boolean;
20
22
  }
21
23
  /**
22
24
  * Hook for receiving a published livestream.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLivestreamViewer.d.ts","sourceRoot":"","sources":["../../../src/livestream/hooks/useLivestreamViewer.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,mBAAmB,GAC3B;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,GACnC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAOxC;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,OAAO,EAAE,CAAC,MAAM,EAAE,mBAAmB,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,4EAA4E;IAC5E,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,iEAAiE;IACjE,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,QAAO,yBAuCtC,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { useCallback, useEffect, useRef } from 'react';
2
+ import { WhepClient, useWhepConnectionState } from 'react-native-whip-whep';
3
+ import { FISHJAM_WHEP_URL } from '../../consts';
4
+ const urlFromConfig = (config) => {
5
+ if (config.streamId)
6
+ return `${FISHJAM_WHEP_URL}/${config.streamId}`;
7
+ return FISHJAM_WHEP_URL;
8
+ };
9
+ /**
10
+ * Hook for receiving a published livestream.
11
+ * @category Livestream
12
+ * @group Hooks
13
+ */
14
+ export const useLivestreamViewer = () => {
15
+ const state = useWhepConnectionState();
16
+ const isConnected = state === 'connected';
17
+ const whepClient = useRef(null);
18
+ useEffect(() => {
19
+ const createClient = () => {
20
+ whepClient.current = new WhepClient({
21
+ audioEnabled: true,
22
+ videoEnabled: true,
23
+ });
24
+ };
25
+ createClient();
26
+ return () => {
27
+ whepClient.current?.disconnect();
28
+ };
29
+ }, []);
30
+ const connect = useCallback(async (config, url) => {
31
+ await whepClient.current?.connect({
32
+ serverUrl: url ?? urlFromConfig(config),
33
+ authToken: config.token,
34
+ });
35
+ }, []);
36
+ const disconnect = useCallback(async () => {
37
+ await whepClient.current?.disconnect();
38
+ }, []);
39
+ return {
40
+ connect,
41
+ disconnect,
42
+ isConnected,
43
+ };
44
+ };
45
+ //# sourceMappingURL=useLivestreamViewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLivestreamViewer.js","source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CAAC;IACL,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;QACxC,MAAM,UAAU,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC;IACzC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,OAAO;QACP,UAAU;QACV,WAAW;KACZ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useCallback, useEffect, useRef } from 'react';\nimport { WhepClient, useWhepConnectionState } from 'react-native-whip-whep';\nimport { FISHJAM_WHEP_URL } from '../../consts';\n\nexport type ConnectViewerConfig =\n | { token: string; streamId?: never }\n | { streamId: string; token?: never };\n\nconst urlFromConfig = (config: ConnectViewerConfig) => {\n if (config.streamId) return `${FISHJAM_WHEP_URL}/${config.streamId}`;\n return FISHJAM_WHEP_URL;\n};\n\n/**\n * @category Livestream\n */\nexport interface useLivestreamViewerResult {\n /**\n * Callback to start receiving a livestream.\n * If the livestream is private, provide `token`.\n * If the livestream is public, provide `streamId`.\n */\n connect: (config: ConnectViewerConfig, url?: string) => Promise<void>;\n /** Disconnect from a stream previously connected to with {@link connect} */\n disconnect: () => Promise<void>;\n /** Utility flag which indicates the current connection status */\n isConnected: boolean;\n}\n\n/**\n * Hook for receiving a published livestream.\n * @category Livestream\n * @group Hooks\n */\nexport const useLivestreamViewer = (): useLivestreamViewerResult => {\n const state = useWhepConnectionState();\n const isConnected = state === 'connected';\n\n const whepClient = useRef<WhepClient | null>(null);\n\n useEffect(() => {\n const createClient = () => {\n whepClient.current = new WhepClient({\n audioEnabled: true,\n videoEnabled: true,\n });\n };\n createClient();\n\n return () => {\n whepClient.current?.disconnect();\n };\n }, []);\n\n const connect = useCallback(\n async (config: ConnectViewerConfig, url?: string) => {\n await whepClient.current?.connect({\n serverUrl: url ?? urlFromConfig(config),\n authToken: config.token,\n });\n },\n [],\n );\n\n const disconnect = useCallback(async () => {\n await whepClient.current?.disconnect();\n }, []);\n\n return {\n connect,\n disconnect,\n isConnected,\n };\n};\n"]}
@@ -0,0 +1,11 @@
1
+ export { LivestreamStreamer } from './components/LivestreamStreamer';
2
+ export { LivestreamViewer } from './components/LivestreamViewer';
3
+ export { useLivestreamViewer } from './hooks/useLivestreamViewer';
4
+ export { useLivestreamStreamer } from './hooks/useLivestreamStreamer';
5
+ export { cameras, VideoParameters, WhipClient, WhepClient, } from 'react-native-whip-whep';
6
+ export type { LivestreamStreamerProps } from './components/LivestreamStreamer';
7
+ export type { ConnectViewerConfig } from './hooks/useLivestreamViewer';
8
+ export type { useLivestreamViewerResult } from './hooks/useLivestreamViewer';
9
+ export type { useLivestreamStreamerResult } from './hooks/useLivestreamStreamer';
10
+ export type { LivestreamViewerProps, LivestreamViewerRef, } from './components/LivestreamViewer';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/livestream/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EACL,OAAO,EACP,eAAe,EACf,UAAU,EACV,UAAU,GACX,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC/E,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,YAAY,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC7E,YAAY,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACjF,YAAY,EACV,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,+BAA+B,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { LivestreamStreamer } from './components/LivestreamStreamer';
2
+ export { LivestreamViewer } from './components/LivestreamViewer';
3
+ export { useLivestreamViewer } from './hooks/useLivestreamViewer';
4
+ export { useLivestreamStreamer } from './hooks/useLivestreamStreamer';
5
+ export { cameras, VideoParameters, WhipClient, WhepClient, } from 'react-native-whip-whep';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/livestream/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EACL,OAAO,EACP,eAAe,EACf,UAAU,EACV,UAAU,GACX,MAAM,wBAAwB,CAAC","sourcesContent":["export { LivestreamStreamer } from './components/LivestreamStreamer';\nexport { LivestreamViewer } from './components/LivestreamViewer';\nexport { useLivestreamViewer } from './hooks/useLivestreamViewer';\nexport { useLivestreamStreamer } from './hooks/useLivestreamStreamer';\nexport {\n cameras,\n VideoParameters,\n WhipClient,\n WhepClient,\n} from 'react-native-whip-whep';\nexport type { LivestreamStreamerProps } from './components/LivestreamStreamer';\nexport type { ConnectViewerConfig } from './hooks/useLivestreamViewer';\nexport type { useLivestreamViewerResult } from './hooks/useLivestreamViewer';\nexport type { useLivestreamStreamerResult } from './hooks/useLivestreamStreamer';\nexport type {\n LivestreamViewerProps,\n LivestreamViewerRef,\n} from './components/LivestreamViewer';\n"]}
@@ -0,0 +1,6 @@
1
+ export type DebugConfig = {
2
+ validateEventPayloads: boolean;
3
+ };
4
+ export declare function setOverwriteDebugConfig(partial: Partial<DebugConfig>): void;
5
+ export declare function getDebugConfig(): DebugConfig;
6
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,qBAAqB,EAAE,OAAO,CAAC;CAChC,CAAC;AAMF,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAE3E;AAED,wBAAgB,cAAc,IAAI,WAAW,CAE5C"}
@@ -0,0 +1,10 @@
1
+ const debugConfig = {
2
+ validateEventPayloads: process.env.EXPO_PUBLIC_CHECK_EVENT_PAYLOAD ?? false,
3
+ };
4
+ export function setOverwriteDebugConfig(partial) {
5
+ Object.assign(debugConfig, partial);
6
+ }
7
+ export function getDebugConfig() {
8
+ return debugConfig;
9
+ }
10
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,GAAgB;IAC/B,qBAAqB,EAAE,OAAO,CAAC,GAAG,CAAC,+BAA+B,IAAI,KAAK;CAC5E,CAAC;AAEF,MAAM,UAAU,uBAAuB,CAAC,OAA6B;IACnE,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["export type DebugConfig = {\n validateEventPayloads: boolean;\n};\n\nconst debugConfig: DebugConfig = {\n validateEventPayloads: process.env.EXPO_PUBLIC_CHECK_EVENT_PAYLOAD ?? false,\n};\n\nexport function setOverwriteDebugConfig(partial: Partial<DebugConfig>): void {\n Object.assign(debugConfig, partial);\n}\n\nexport function getDebugConfig(): DebugConfig {\n return debugConfig;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const getFishjamUrl: (fishjamId: string) => string;
2
+ //# sourceMappingURL=getFishjamUrl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFishjamUrl.d.ts","sourceRoot":"","sources":["../../src/utils/getFishjamUrl.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,GAAI,WAAW,MAAM,KAAG,MAMjD,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { FISHJAM_HTTP_CONNECT_URL } from '../consts';
2
+ export const getFishjamUrl = (fishjamId) => {
3
+ try {
4
+ return new URL(fishjamId).href;
5
+ }
6
+ catch {
7
+ return `${FISHJAM_HTTP_CONNECT_URL}/${fishjamId}`;
8
+ }
9
+ };
10
+ //# sourceMappingURL=getFishjamUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFishjamUrl.js","sourceRoot":"","sources":["../../src/utils/getFishjamUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAiB,EAAU,EAAE;IACzD,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,wBAAwB,IAAI,SAAS,EAAE,CAAC;IACpD,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { FISHJAM_HTTP_CONNECT_URL } from '../consts';\n\nexport const getFishjamUrl = (fishjamId: string): string => {\n try {\n return new URL(fishjamId).href;\n } catch {\n return `${FISHJAM_HTTP_CONNECT_URL}/${fishjamId}`;\n }\n};\n"]}
package/ios/Events.swift CHANGED
@@ -93,7 +93,14 @@ class EmitableEvent {
93
93
  }
94
94
 
95
95
  static func audioDeviceUpdate(currentRoute: AVAudioSessionRouteDescription) -> EmitableEvent {
96
- let output = currentRoute.outputs[0]
96
+ guard let output = currentRoute.outputs.first else {
97
+ return .init(
98
+ event: .AudioDeviceUpdate,
99
+ eventContent: [
100
+ "selectedDevice": nil,
101
+ "availableDevices": [],
102
+ ])
103
+ }
97
104
  let deviceType = output.portType
98
105
 
99
106
  let deviceTypeString =
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
10
10
  s.license = package['license']
11
11
  s.author = package['author']
12
12
  s.homepage = package['homepage']
13
- s.platform = :ios, '13.0'
13
+ s.platform = :ios, '15.1'
14
14
  s.swift_version = '5.4'
15
15
  s.source = { git: 'https://github.com/fishjam-cloud/mobile-client-sdk/tree/main/packages/react-native-client/ios' }
16
16
  s.static_framework = true
@@ -224,6 +224,11 @@ class RNFishjamClient: FishjamClientListener {
224
224
  url: String, peerToken: String, peerMetadata: [String: Any], config: ConnectConfig,
225
225
  promise: Promise
226
226
  ) {
227
+ guard connectPromise == nil && peerStatus != .connected else {
228
+ promise.reject("E_MEMBRANE_CONNECT", "Room already joined or it's connecting. You must call leaveRoom() before calling joinRoom() again.")
229
+ return
230
+ }
231
+
227
232
  peerStatus = .connecting
228
233
  connectPromise = promise
229
234
 
@@ -240,6 +245,8 @@ class RNFishjamClient: FishjamClientListener {
240
245
  }
241
246
 
242
247
  func leaveRoom() {
248
+ connectPromise?.reject("E_MEMBRANE_CONNECT", "leaveRoom called before connected")
249
+ connectPromise = nil
243
250
  if isScreenShareOn {
244
251
  let screenShareExtensionBundleId =
245
252
  Bundle.main.infoDictionary?["ScreenShareExtensionBundleId"] as? String
@@ -859,10 +866,8 @@ class RNFishjamClient: FishjamClientListener {
859
866
  peerStatus = .idle
860
867
  }
861
868
 
862
- func onSocketError() {
863
- if let connectPromise = connectPromise {
864
- connectPromise.reject("E_MEMBRANE_CONNECT", "Failed to connect: socket error")
865
- }
869
+ func onSocketError(_ errorMessage: String? = nil) {
870
+ connectPromise?.reject("E_MEMBRANE_CONNECT", "Failed to connect: socket error\(errorMessage.map { " - \($0)" } ?? "")")
866
871
  connectPromise = nil
867
872
  peerStatus = .error
868
873
  }
@@ -1,5 +1,6 @@
1
1
  import ExpoModulesCore
2
2
  import FishjamCloudClient
3
+ import os.log
3
4
 
4
5
  class VideoPreviewView: VideoRendererView, LocalCameraTrackChangedListener {
5
6
  private var localVideoTrack: LocalCameraTrack?
@@ -0,0 +1,4 @@
1
+ {
2
+ "main": "../build/livestream/index.js",
3
+ "types": "../build/livestream/index.d.ts"
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishjam-cloud/react-native-client",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "A React Native client for Fishjam",
5
5
  "author": "Fishjam Team",
6
6
  "license": "Apache-2.0",
@@ -42,7 +42,7 @@
42
42
  "dependencies": {
43
43
  "promise-fs": "^2.1.1",
44
44
  "protobufjs": "^7.4.0",
45
- "react-native-whip-whep": "0.2.3",
45
+ "react-native-whip-whep": "0.3.1",
46
46
  "zod": "^3.25.71"
47
47
  },
48
48
  "devDependencies": {
@@ -86,6 +86,7 @@
86
86
  "files": [
87
87
  "build/**",
88
88
  "debug",
89
+ "livestream",
89
90
  "android/build.gradle",
90
91
  "android/src/**",
91
92
  "ios/**/*.swift",
@@ -1,25 +0,0 @@
1
- import { GenericMetadata } from '../types';
2
- export type ConnectionConfig = {
3
- /**
4
- * Configuration for automatic reconnection
5
- * sdk uses a linear backoff algorithm, that is the formula
6
- * for the delay of the nth attempt is
7
- * n * delayMs + initialDelayMs
8
- *
9
- * Pass 0 for maxAttempts to disable automatic reconnection
10
- */
11
- reconnectConfig?: {
12
- maxAttempts?: number;
13
- initialDelayMs?: number;
14
- delayMs?: number;
15
- };
16
- };
17
- /**
18
- * @ignore
19
- */
20
- export declare function joinRoom<PeerMetadata extends GenericMetadata = GenericMetadata>(url: string, peerToken: string, peerMetadata?: PeerMetadata, config?: ConnectionConfig): Promise<void>;
21
- /**
22
- * @ignore
23
- */
24
- export declare function leaveRoom(): Promise<void>;
25
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/common/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG3C,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,YAAY,SAAS,eAAe,GAAG,eAAe,EAEtD,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,YAAY,EAC3B,MAAM,CAAC,EAAE,gBAAgB,iBAQ1B;AACD;;GAEG;AACH,wBAAsB,SAAS,kBAE9B"}
@@ -1,14 +0,0 @@
1
- import RNFishjamClientModule from '../RNFishjamClientModule';
2
- /**
3
- * @ignore
4
- */
5
- export async function joinRoom(url, peerToken, peerMetadata, config) {
6
- await RNFishjamClientModule.joinRoom(url, peerToken, peerMetadata ?? {}, config ?? {});
7
- }
8
- /**
9
- * @ignore
10
- */
11
- export async function leaveRoom() {
12
- await RNFishjamClientModule.leaveRoom();
13
- }
14
- //# sourceMappingURL=client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/common/client.ts"],"names":[],"mappings":"AACA,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAkB7D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAG5B,GAAW,EACX,SAAiB,EACjB,YAA2B,EAC3B,MAAyB;IAEzB,MAAM,qBAAqB,CAAC,QAAQ,CAClC,GAAG,EACH,SAAS,EACT,YAAY,IAAI,EAAE,EAClB,MAAM,IAAI,EAAE,CACb,CAAC;AACJ,CAAC;AACD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,MAAM,qBAAqB,CAAC,SAAS,EAAE,CAAC;AAC1C,CAAC","sourcesContent":["import { GenericMetadata } from '../types';\nimport RNFishjamClientModule from '../RNFishjamClientModule';\n\nexport type ConnectionConfig = {\n /**\n * Configuration for automatic reconnection\n * sdk uses a linear backoff algorithm, that is the formula\n * for the delay of the nth attempt is\n * n * delayMs + initialDelayMs\n *\n * Pass 0 for maxAttempts to disable automatic reconnection\n */\n reconnectConfig?: {\n maxAttempts?: number;\n initialDelayMs?: number;\n delayMs?: number;\n };\n};\n\n/**\n * @ignore\n */\nexport async function joinRoom<\n PeerMetadata extends GenericMetadata = GenericMetadata,\n>(\n url: string,\n peerToken: string,\n peerMetadata?: PeerMetadata,\n config?: ConnectionConfig,\n) {\n await RNFishjamClientModule.joinRoom(\n url,\n peerToken,\n peerMetadata ?? {},\n config ?? {},\n );\n}\n/**\n * @ignore\n */\nexport async function leaveRoom() {\n await RNFishjamClientModule.leaveRoom();\n}\n"]}
@@ -1,19 +0,0 @@
1
- import { StyleProp, ViewStyle } from 'react-native';
2
- /**
3
- * Props of the LivestreamView component
4
- */
5
- export type LivestreamStreamerProps = {
6
- /**
7
- * Styles of the LivestreamView component
8
- */
9
- style?: StyleProp<ViewStyle>;
10
- };
11
- /**
12
- * Renders a video player playing the livestream set up with {@link useLivestreamStreamer} hook.
13
- *
14
- * @category Components
15
- * @param {object} props
16
- * @param {object} props.style
17
- */
18
- export declare const LivestreamStreamer: ({ style }: LivestreamStreamerProps) => import("react").JSX.Element;
19
- //# sourceMappingURL=LivestreamStreamer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LivestreamStreamer.d.ts","sourceRoot":"","sources":["../../src/components/LivestreamStreamer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,WAAW,uBAAuB,gCAEpE,CAAC"}
@@ -1,10 +0,0 @@
1
- import { WhipClientView } from 'react-native-whip-whep';
2
- /**
3
- * Renders a video player playing the livestream set up with {@link useLivestreamStreamer} hook.
4
- *
5
- * @category Components
6
- * @param {object} props
7
- * @param {object} props.style
8
- */
9
- export const LivestreamStreamer = ({ style }) => (<WhipClientView style={style}/>);
10
- //# sourceMappingURL=LivestreamStreamer.js.map