@fishjam-cloud/react-native-client 0.23.0 → 0.25.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -15
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/overrides/RTCPeerConnection.d.ts +8 -0
- package/dist/overrides/RTCPeerConnection.d.ts.map +1 -0
- package/dist/overrides/RTCPeerConnection.js +16 -0
- package/dist/overrides/RTCView.d.ts +11 -0
- package/dist/overrides/RTCView.d.ts.map +1 -0
- package/dist/overrides/RTCView.js +21 -0
- package/dist/polyfills/local-storage.d.ts +10 -0
- package/dist/polyfills/local-storage.d.ts.map +1 -0
- package/dist/polyfills/local-storage.js +24 -0
- package/{build/hooks → dist}/useForegroundService.d.ts +10 -10
- package/dist/useForegroundService.d.ts.map +1 -0
- package/dist/useForegroundService.js +10 -0
- package/dist/webrtc-polyfill.d.ts +2 -0
- package/dist/webrtc-polyfill.d.ts.map +1 -0
- package/dist/webrtc-polyfill.js +14 -0
- package/package.json +44 -92
- package/plugin/broadcastExtensionFiles/Atomic.swift +37 -0
- package/plugin/broadcastExtensionFiles/DarwinNotificationCenter.swift +29 -0
- package/plugin/broadcastExtensionFiles/Info.plist +2 -2
- package/plugin/broadcastExtensionFiles/SampleHandler.swift +104 -0
- package/plugin/broadcastExtensionFiles/SampleUploader.swift +146 -0
- package/plugin/broadcastExtensionFiles/SocketConnection.swift +198 -0
- package/plugin/build/types.d.ts +5 -3
- package/plugin/build/withFishjam.d.ts +31 -2
- package/plugin/build/withFishjam.js +32 -6
- package/plugin/build/withFishjamAndroid.d.ts +2 -2
- package/plugin/build/withFishjamAndroid.js +60 -13
- package/plugin/build/withFishjamIos.d.ts +3 -8
- package/plugin/build/withFishjamIos.js +54 -69
- package/plugin/src/types.ts +19 -0
- package/plugin/src/withFishjam.ts +42 -0
- package/plugin/src/withFishjamAndroid.ts +112 -0
- package/plugin/src/withFishjamIos.ts +336 -0
- package/plugin/tsconfig.json +9 -0
- package/plugin/tsconfig.tsbuildinfo +1 -0
- package/LICENSE.txt +0 -201
- package/android/build.gradle +0 -95
- package/android/src/main/AndroidManifest.xml +0 -2
- package/android/src/main/java/io/fishjam/reactnative/AudioDeviceKind.kt +0 -34
- package/android/src/main/java/io/fishjam/reactnative/AudioSwitchManager.kt +0 -61
- package/android/src/main/java/io/fishjam/reactnative/EmitableEvents.kt +0 -126
- package/android/src/main/java/io/fishjam/reactnative/Errors.kt +0 -31
- package/android/src/main/java/io/fishjam/reactnative/PipContainerView.kt +0 -282
- package/android/src/main/java/io/fishjam/reactnative/PipContainerViewModule.kt +0 -41
- package/android/src/main/java/io/fishjam/reactnative/PipTrackSelector.kt +0 -98
- package/android/src/main/java/io/fishjam/reactnative/PipViewFactory.kt +0 -186
- package/android/src/main/java/io/fishjam/reactnative/RNFishjamClient.kt +0 -1001
- package/android/src/main/java/io/fishjam/reactnative/RNFishjamClientModule.kt +0 -358
- package/android/src/main/java/io/fishjam/reactnative/Utils.kt +0 -11
- package/android/src/main/java/io/fishjam/reactnative/VideoPreviewView.kt +0 -40
- package/android/src/main/java/io/fishjam/reactnative/VideoPreviewViewModule.kt +0 -22
- package/android/src/main/java/io/fishjam/reactnative/VideoRendererView.kt +0 -76
- package/android/src/main/java/io/fishjam/reactnative/VideoRendererViewModule.kt +0 -33
- package/android/src/main/java/io/fishjam/reactnative/VideoView.kt +0 -257
- package/android/src/main/java/io/fishjam/reactnative/extensions/CaptureDevice.kt +0 -17
- package/android/src/main/java/io/fishjam/reactnative/foregroundService/FishjamForegroundService.kt +0 -101
- package/android/src/main/java/io/fishjam/reactnative/foregroundService/ForegroundServiceManager.kt +0 -118
- package/android/src/main/java/io/fishjam/reactnative/foregroundService/ForegroundServiceState.kt +0 -46
- package/android/src/main/java/io/fishjam/reactnative/helpers/PictureInPictureHelperFragment.kt +0 -20
- package/android/src/main/java/io/fishjam/reactnative/managers/ListenerManager.kt +0 -24
- package/android/src/main/java/io/fishjam/reactnative/managers/LocalCameraTracksChangedListenersManager.kt +0 -8
- package/android/src/main/java/io/fishjam/reactnative/managers/LocalTracksSwitchListenersManager.kt +0 -17
- package/android/src/main/java/io/fishjam/reactnative/managers/TracksUpdateListenersManager.kt +0 -7
- package/android/src/main/java/io/fishjam/reactnative/utils/PermissionUtils.kt +0 -45
- package/build/RNFishjamClientModule.d.ts +0 -106
- package/build/RNFishjamClientModule.d.ts.map +0 -1
- package/build/RNFishjamClientModule.js +0 -21
- package/build/RNFishjamClientModule.js.map +0 -1
- package/build/common/metadata.d.ts +0 -9
- package/build/common/metadata.d.ts.map +0 -1
- package/build/common/metadata.js +0 -11
- package/build/common/metadata.js.map +0 -1
- package/build/components/FishjamRoom/GridTrackItem.d.ts +0 -12
- package/build/components/FishjamRoom/GridTrackItem.d.ts.map +0 -1
- package/build/components/FishjamRoom/GridTrackItem.js +0 -56
- package/build/components/FishjamRoom/GridTrackItem.js.map +0 -1
- package/build/components/FishjamRoom/VideosGrid.d.ts +0 -3
- package/build/components/FishjamRoom/VideosGrid.d.ts.map +0 -1
- package/build/components/FishjamRoom/VideosGrid.js +0 -20
- package/build/components/FishjamRoom/VideosGrid.js.map +0 -1
- package/build/components/FishjamRoom/index.d.ts +0 -33
- package/build/components/FishjamRoom/index.d.ts.map +0 -1
- package/build/components/FishjamRoom/index.js +0 -53
- package/build/components/FishjamRoom/index.js.map +0 -1
- package/build/components/FishjamRoom/parsePeersToTracks.d.ts +0 -4
- package/build/components/FishjamRoom/parsePeersToTracks.d.ts.map +0 -1
- package/build/components/FishjamRoom/parsePeersToTracks.js +0 -37
- package/build/components/FishjamRoom/parsePeersToTracks.js.map +0 -1
- package/build/components/PipContainerView.d.ts +0 -48
- package/build/components/PipContainerView.d.ts.map +0 -1
- package/build/components/PipContainerView.js +0 -34
- package/build/components/PipContainerView.js.map +0 -1
- package/build/components/VideoPreviewView.d.ts +0 -28
- package/build/components/VideoPreviewView.d.ts.map +0 -1
- package/build/components/VideoPreviewView.js +0 -17
- package/build/components/VideoPreviewView.js.map +0 -1
- package/build/components/VideoRendererView.d.ts +0 -39
- package/build/components/VideoRendererView.d.ts.map +0 -1
- package/build/components/VideoRendererView.js +0 -25
- package/build/components/VideoRendererView.js.map +0 -1
- package/build/consts/index.d.ts +0 -5
- package/build/consts/index.d.ts.map +0 -1
- package/build/consts/index.js +0 -8
- package/build/consts/index.js.map +0 -1
- package/build/debug/common/webRTC.d.ts +0 -9
- package/build/debug/common/webRTC.d.ts.map +0 -1
- package/build/debug/common/webRTC.js +0 -11
- package/build/debug/common/webRTC.js.map +0 -1
- package/build/debug/index.d.ts +0 -4
- package/build/debug/index.d.ts.map +0 -1
- package/build/debug/index.js +0 -3
- package/build/debug/index.js.map +0 -1
- package/build/debug/stats/types.d.ts +0 -55
- package/build/debug/stats/types.d.ts.map +0 -1
- package/build/debug/stats/types.js +0 -2
- package/build/debug/stats/types.js.map +0 -1
- package/build/debug/stats/useRTCStatistics.d.ts +0 -9
- package/build/debug/stats/useRTCStatistics.d.ts.map +0 -1
- package/build/debug/stats/useRTCStatistics.js +0 -79
- package/build/debug/stats/useRTCStatistics.js.map +0 -1
- package/build/hooks/internal/useFishjamEvent.d.ts +0 -4
- package/build/hooks/internal/useFishjamEvent.d.ts.map +0 -1
- package/build/hooks/internal/useFishjamEvent.js +0 -38
- package/build/hooks/internal/useFishjamEvent.js.map +0 -1
- package/build/hooks/internal/useFishjamEventState.d.ts +0 -3
- package/build/hooks/internal/useFishjamEventState.d.ts.map +0 -1
- package/build/hooks/internal/useFishjamEventState.js +0 -18
- package/build/hooks/internal/useFishjamEventState.js.map +0 -1
- package/build/hooks/useAppScreenShare.d.ts +0 -20
- package/build/hooks/useAppScreenShare.d.ts.map +0 -1
- package/build/hooks/useAppScreenShare.js +0 -54
- package/build/hooks/useAppScreenShare.js.map +0 -1
- package/build/hooks/useAudioSettings.d.ts +0 -49
- package/build/hooks/useAudioSettings.d.ts.map +0 -1
- package/build/hooks/useAudioSettings.js +0 -70
- package/build/hooks/useAudioSettings.js.map +0 -1
- package/build/hooks/useBandwidthEstimation.d.ts +0 -14
- package/build/hooks/useBandwidthEstimation.d.ts.map +0 -1
- package/build/hooks/useBandwidthEstimation.js +0 -19
- package/build/hooks/useBandwidthEstimation.js.map +0 -1
- package/build/hooks/useCallKit.d.ts +0 -121
- package/build/hooks/useCallKit.d.ts.map +0 -1
- package/build/hooks/useCallKit.js +0 -142
- package/build/hooks/useCallKit.js.map +0 -1
- package/build/hooks/useCamera.d.ts +0 -113
- package/build/hooks/useCamera.d.ts.map +0 -1
- package/build/hooks/useCamera.js +0 -95
- package/build/hooks/useCamera.js.map +0 -1
- package/build/hooks/useConnection.d.ts +0 -73
- package/build/hooks/useConnection.d.ts.map +0 -1
- package/build/hooks/useConnection.js +0 -46
- package/build/hooks/useConnection.js.map +0 -1
- package/build/hooks/useForegroundService.d.ts.map +0 -1
- package/build/hooks/useForegroundService.js +0 -66
- package/build/hooks/useForegroundService.js.map +0 -1
- package/build/hooks/useMicrophone.d.ts +0 -16
- package/build/hooks/useMicrophone.d.ts.map +0 -1
- package/build/hooks/useMicrophone.js +0 -31
- package/build/hooks/useMicrophone.js.map +0 -1
- package/build/hooks/usePeerStatus.d.ts +0 -10
- package/build/hooks/usePeerStatus.d.ts.map +0 -1
- package/build/hooks/usePeerStatus.js +0 -13
- package/build/hooks/usePeerStatus.js.map +0 -1
- package/build/hooks/usePeers.d.ts +0 -98
- package/build/hooks/usePeers.d.ts.map +0 -1
- package/build/hooks/usePeers.js +0 -81
- package/build/hooks/usePeers.js.map +0 -1
- package/build/hooks/usePermissions.d.ts +0 -24
- package/build/hooks/usePermissions.d.ts.map +0 -1
- package/build/hooks/usePermissions.js +0 -61
- package/build/hooks/usePermissions.js.map +0 -1
- package/build/hooks/useReconnection.d.ts +0 -11
- package/build/hooks/useReconnection.d.ts.map +0 -1
- package/build/hooks/useReconnection.js +0 -14
- package/build/hooks/useReconnection.js.map +0 -1
- package/build/hooks/useSandbox.d.ts +0 -20
- package/build/hooks/useSandbox.d.ts.map +0 -1
- package/build/hooks/useSandbox.js +0 -54
- package/build/hooks/useSandbox.js.map +0 -1
- package/build/hooks/useScreenShare.d.ts +0 -37
- package/build/hooks/useScreenShare.d.ts.map +0 -1
- package/build/hooks/useScreenShare.js +0 -52
- package/build/hooks/useScreenShare.js.map +0 -1
- package/build/hooks/useUpdatePeerMetadata.d.ts +0 -15
- package/build/hooks/useUpdatePeerMetadata.d.ts.map +0 -1
- package/build/hooks/useUpdatePeerMetadata.js +0 -21
- package/build/hooks/useUpdatePeerMetadata.js.map +0 -1
- package/build/index.d.ts +0 -36
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -30
- package/build/index.js.map +0 -1
- package/build/livestream/components/LivestreamStreamer.d.ts +0 -24
- package/build/livestream/components/LivestreamStreamer.d.ts.map +0 -1
- package/build/livestream/components/LivestreamStreamer.js +0 -12
- package/build/livestream/components/LivestreamStreamer.js.map +0 -1
- package/build/livestream/components/LivestreamViewer.d.ts +0 -46
- package/build/livestream/components/LivestreamViewer.d.ts.map +0 -1
- package/build/livestream/components/LivestreamViewer.js +0 -10
- package/build/livestream/components/LivestreamViewer.js.map +0 -1
- package/build/livestream/hooks/useLivestreamStreamer.d.ts +0 -65
- package/build/livestream/hooks/useLivestreamStreamer.d.ts.map +0 -1
- package/build/livestream/hooks/useLivestreamStreamer.js +0 -72
- package/build/livestream/hooks/useLivestreamStreamer.js.map +0 -1
- package/build/livestream/hooks/useLivestreamViewer.d.ts +0 -36
- package/build/livestream/hooks/useLivestreamViewer.d.ts.map +0 -1
- package/build/livestream/hooks/useLivestreamViewer.js +0 -73
- package/build/livestream/hooks/useLivestreamViewer.js.map +0 -1
- package/build/livestream/index.d.ts +0 -11
- package/build/livestream/index.d.ts.map +0 -1
- package/build/livestream/index.js +0 -6
- package/build/livestream/index.js.map +0 -1
- package/build/protos/fishjam/peer_notifications.d.ts +0 -63
- package/build/protos/fishjam/peer_notifications.d.ts.map +0 -1
- package/build/protos/fishjam/peer_notifications.js +0 -235
- package/build/protos/fishjam/peer_notifications.js.map +0 -1
- package/build/types.d.ts +0 -34
- package/build/types.d.ts.map +0 -1
- package/build/types.js +0 -2
- package/build/types.js.map +0 -1
- package/build/utils/config.d.ts +0 -6
- package/build/utils/config.d.ts.map +0 -1
- package/build/utils/config.js +0 -10
- package/build/utils/config.js.map +0 -1
- package/build/utils/errorListener.d.ts +0 -2
- package/build/utils/errorListener.d.ts.map +0 -1
- package/build/utils/errorListener.js +0 -15
- package/build/utils/errorListener.js.map +0 -1
- package/build/utils/eventPayloadValidator.d.ts +0 -3
- package/build/utils/eventPayloadValidator.d.ts.map +0 -1
- package/build/utils/eventPayloadValidator.js +0 -86
- package/build/utils/eventPayloadValidator.js.map +0 -1
- package/build/utils/getFishjamUrl.d.ts +0 -2
- package/build/utils/getFishjamUrl.d.ts.map +0 -1
- package/build/utils/getFishjamUrl.js +0 -10
- package/build/utils/getFishjamUrl.js.map +0 -1
- package/debug/package.json +0 -4
- package/expo-module.config.json +0 -19
- package/ios/CameraPermissionsRequester.swift +0 -117
- package/ios/Events.swift +0 -152
- package/ios/PictureInPictureManager.swift +0 -215
- package/ios/PipContainerView.swift +0 -56
- package/ios/PipContainerViewModule.swift +0 -48
- package/ios/RNFishjamClient.podspec +0 -30
- package/ios/RNFishjamClient.swift +0 -995
- package/ios/RNFishjamClientModule.swift +0 -289
- package/ios/RNFishjamProxy.swift +0 -12
- package/ios/Utils/PermissionUtils.swift +0 -16
- package/ios/Utils.swift +0 -23
- package/ios/VideoPreviewView.swift +0 -54
- package/ios/VideoPreviewViewModule.swift +0 -21
- package/ios/VideoRendererView.swift +0 -98
- package/ios/VideoRendererViewModule.swift +0 -23
- package/ios/extensions/AVCaptureDevice.swift +0 -20
- package/ios/managers/LocalCameraTracksChangedListenersManager.swift +0 -23
- package/ios/managers/TracksUpdateListenersManager.swift +0 -21
- package/livestream/package.json +0 -4
- package/plugin/broadcastExtensionFiles/FishjamBroadcastSampleHandler.swift +0 -50
- /package/plugin/broadcastExtensionFiles/{FishjamScreenBroadcastExtension.entitlements → ScreenBroadcastExtension.entitlements} +0 -0
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import RNFishjamClientModule, { ReceivableEvents, } from '../RNFishjamClientModule';
|
|
2
|
-
import { useFishjamEventState } from './internal/useFishjamEventState';
|
|
3
|
-
/**
|
|
4
|
-
* Information about reconnection status.
|
|
5
|
-
* Could be used to retrieve connection status, once user will be disconnected
|
|
6
|
-
* @group Hooks
|
|
7
|
-
* @deprecated
|
|
8
|
-
* @ignore
|
|
9
|
-
*/
|
|
10
|
-
export function useReconnection() {
|
|
11
|
-
const reconnectionStatus = useFishjamEventState(ReceivableEvents.ReconnectionStatusChanged, RNFishjamClientModule.reconnectionStatus);
|
|
12
|
-
return { reconnectionStatus };
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=useReconnection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useReconnection.js","sourceRoot":"","sources":["../../src/hooks/useReconnection.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,EAAE,EAC5B,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE;;;;;;GAMG;AACH,MAAM,UAAU,eAAe;IAC7B,MAAM,kBAAkB,GAAG,oBAAoB,CAC7C,gBAAgB,CAAC,yBAAyB,EAC1C,qBAAqB,CAAC,kBAAkB,CACzC,CAAC;IAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAChC,CAAC","sourcesContent":["import RNFishjamClientModule, {\n ReceivableEvents,\n} from '../RNFishjamClientModule';\nimport { useFishjamEventState } from './internal/useFishjamEventState';\n\n/**\n * Information about reconnection status.\n * Could be used to retrieve connection status, once user will be disconnected\n * @group Hooks\n * @deprecated\n * @ignore\n */\nexport function useReconnection() {\n const reconnectionStatus = useFishjamEventState(\n ReceivableEvents.ReconnectionStatusChanged,\n RNFishjamClientModule.reconnectionStatus,\n );\n\n return { reconnectionStatus };\n}\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { RoomType } from '../types';
|
|
2
|
-
export type UseSandboxProps = {
|
|
3
|
-
fishjamId: string;
|
|
4
|
-
sandboxApiUrl?: never;
|
|
5
|
-
} | {
|
|
6
|
-
fishjamId?: never;
|
|
7
|
-
sandboxApiUrl: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const useSandbox: ({ fishjamId, sandboxApiUrl }: UseSandboxProps) => {
|
|
10
|
-
getSandboxPeerToken: (roomName: string, peerName: string, roomType?: RoomType) => Promise<string>;
|
|
11
|
-
getSandboxViewerToken: (roomName: string) => Promise<string>;
|
|
12
|
-
getSandboxLivestream: (roomName: string, isPublic?: boolean) => Promise<{
|
|
13
|
-
streamerToken: string;
|
|
14
|
-
room: {
|
|
15
|
-
id: string;
|
|
16
|
-
name: string;
|
|
17
|
-
};
|
|
18
|
-
}>;
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=useSandbox.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSandbox.d.ts","sourceRoot":"","sources":["../../src/hooks/useSandbox.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAWpC,MAAM,MAAM,eAAe,GACvB;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,KAAK,CAAA;CAAE,GAC5C;IAAE,SAAS,CAAC,EAAE,KAAK,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjD,eAAO,MAAM,UAAU,GAAI,8BAA8B,eAAe;oCAMxD,MAAM,YACN,MAAM,aACN,QAAQ;sCA6BH,MAAM;qCA4BN,MAAM,aAAY,OAAO;uBAevB,MAAM;cACf;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE;;CAWzC,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
|
-
import { getFishjamUrl } from '../utils/getFishjamUrl';
|
|
3
|
-
export const useSandbox = ({ fishjamId, sandboxApiUrl }) => {
|
|
4
|
-
const managerUrl = sandboxApiUrl ?? `${getFishjamUrl(fishjamId)}/room-manager`;
|
|
5
|
-
const getSandboxPeerToken = useCallback(async (roomName, peerName, roomType = 'conference') => {
|
|
6
|
-
try {
|
|
7
|
-
const url = new URL(managerUrl);
|
|
8
|
-
url.searchParams.set('roomName', roomName);
|
|
9
|
-
url.searchParams.set('peerName', peerName);
|
|
10
|
-
url.searchParams.set('roomType', roomType);
|
|
11
|
-
const res = await fetch(url.toString());
|
|
12
|
-
if (!res.ok) {
|
|
13
|
-
throw new Error(`Room '${roomName}' or peer '${peerName}' does not exist or cannot retrieve peer token.`);
|
|
14
|
-
}
|
|
15
|
-
const data = await res.json();
|
|
16
|
-
return data.peerToken;
|
|
17
|
-
}
|
|
18
|
-
catch (error) {
|
|
19
|
-
throw new Error(`Failed to get peer token for room '${roomName}', peer '${peerName}': ${error instanceof Error ? error.message : String(error)}`);
|
|
20
|
-
}
|
|
21
|
-
}, [managerUrl]);
|
|
22
|
-
const getSandboxViewerToken = useCallback(async (roomName) => {
|
|
23
|
-
try {
|
|
24
|
-
const url = new URL(`${managerUrl}/${roomName}/livestream-viewer-token`);
|
|
25
|
-
const res = await fetch(url);
|
|
26
|
-
if (!res.ok) {
|
|
27
|
-
throw new Error(`Room '${roomName}' does not exist or cannot retrieve viewer token.`);
|
|
28
|
-
}
|
|
29
|
-
const data = await res.json();
|
|
30
|
-
return data.token;
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
throw new Error(`Failed to get viewer token for room '${roomName}': ${error instanceof Error ? error.message : String(error)}`);
|
|
34
|
-
}
|
|
35
|
-
}, [managerUrl]);
|
|
36
|
-
const getSandboxLivestream = useCallback(async (roomName, isPublic = false) => {
|
|
37
|
-
const url = new URL(`${managerUrl}/livestream`);
|
|
38
|
-
url.searchParams.set('roomName', roomName);
|
|
39
|
-
url.searchParams.set('public', isPublic.toString());
|
|
40
|
-
const res = await fetch(url);
|
|
41
|
-
if (!res.ok) {
|
|
42
|
-
console.log(await res.json());
|
|
43
|
-
throw new Error(`Failed to retrieve streamer token for '${roomName}' livestream room.`);
|
|
44
|
-
}
|
|
45
|
-
const data = await res.json();
|
|
46
|
-
return data;
|
|
47
|
-
}, [managerUrl]);
|
|
48
|
-
return {
|
|
49
|
-
getSandboxPeerToken,
|
|
50
|
-
getSandboxViewerToken,
|
|
51
|
-
getSandboxLivestream,
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=useSandbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSandbox.js","sourceRoot":"","sources":["../../src/hooks/useSandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAcvD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,SAAS,EAAE,aAAa,EAAmB,EAAE,EAAE;IAC1E,MAAM,UAAU,GACd,aAAa,IAAI,GAAG,aAAa,CAAC,SAAS,CAAC,eAAe,CAAC;IAE9D,MAAM,mBAAmB,GAAG,WAAW,CACrC,KAAK,EACH,QAAgB,EAChB,QAAgB,EAChB,WAAqB,YAAY,EACjC,EAAE;QACF,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;YAChC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YAC3C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YAC3C,GAAG,CAAC,YAAY,CAA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AAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CACvD,EAAE,CACH,CAAC;QACJ,CAAC;IACH,CAAC,EACD,CAAC,UAAU,CAAC,CACb,CAAC;IAEF,MAAM,oBAAoB,GAAG,WAAW,CACtC,KAAK,EAAE,QAAgB,EAAE,WAAoB,KAAK,EAAE,EAAE;QACpD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,UAAU,aAAa,CAAC,CAAC;QAChD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC3C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEpD,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;YAC9B,MAAM,IAAI,KAAK,CACb,0CAA0C,QAAQ,oBAAoB,CACvE,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAC9B,OAAO,IAGN,CAAC;IACJ,CAAC,EACD,CAAC,UAAU,CAAC,CACb,CAAC;IAEF,OAAO;QACL,mBAAmB;QACnB,qBAAqB;QACrB,oBAAoB;KACrB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useCallback } from 'react';\nimport { RoomType } from '../types';\nimport { getFishjamUrl } from '../utils/getFishjamUrl';\n\ntype BasicInfo = { id: string; name: string };\ntype RoomManagerResponse = {\n peerToken: string;\n url: string;\n room: BasicInfo;\n peer: BasicInfo;\n};\n\nexport type UseSandboxProps =\n | { fishjamId: string; sandboxApiUrl?: never }\n | { fishjamId?: never; sandboxApiUrl: string };\n\nexport const useSandbox = ({ fishjamId, sandboxApiUrl }: UseSandboxProps) => {\n const managerUrl =\n sandboxApiUrl ?? `${getFishjamUrl(fishjamId)}/room-manager`;\n\n const getSandboxPeerToken = useCallback(\n async (\n roomName: string,\n peerName: string,\n roomType: RoomType = 'conference',\n ) => {\n try {\n const url = new URL(managerUrl);\n url.searchParams.set('roomName', roomName);\n url.searchParams.set('peerName', peerName);\n url.searchParams.set('roomType', roomType);\n\n const res = await fetch(url.toString());\n\n if (!res.ok) {\n throw new Error(\n `Room '${roomName}' or peer '${peerName}' does not exist or cannot retrieve peer token.`,\n );\n }\n const data: RoomManagerResponse = await res.json();\n return data.peerToken;\n } catch (error) {\n throw new Error(\n `Failed to get peer token for room '${roomName}', peer '${peerName}': ${\n error instanceof Error ? error.message : String(error)\n }`,\n );\n }\n },\n [managerUrl],\n );\n\n const getSandboxViewerToken = useCallback(\n async (roomName: string) => {\n try {\n const url = new URL(\n `${managerUrl}/${roomName}/livestream-viewer-token`,\n );\n const res = await fetch(url);\n\n if (!res.ok) {\n throw new Error(\n `Room '${roomName}' does not exist or cannot retrieve viewer token.`,\n );\n }\n\n const data: { token: string } = await res.json();\n\n return data.token;\n } catch (error) {\n throw new Error(\n `Failed to get viewer token for room '${roomName}': ${\n error instanceof Error ? error.message : String(error)\n }`,\n );\n }\n },\n [managerUrl],\n );\n\n const getSandboxLivestream = useCallback(\n async (roomName: string, isPublic: boolean = false) => {\n const url = new URL(`${managerUrl}/livestream`);\n url.searchParams.set('roomName', roomName);\n url.searchParams.set('public', isPublic.toString());\n\n const res = await fetch(url);\n if (!res.ok) {\n console.log(await res.json());\n throw new Error(\n `Failed to retrieve streamer token for '${roomName}' livestream room.`,\n );\n }\n\n const data = await res.json();\n return data as {\n streamerToken: string;\n room: { id: string; name: string };\n };\n },\n [managerUrl],\n );\n\n return {\n getSandboxPeerToken,\n getSandboxViewerToken,\n getSandboxLivestream,\n };\n};\n"]}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { SimulcastConfig, TrackMetadata } from '../types';
|
|
2
|
-
export type ScreenShareQuality = 'VGA' | 'HD5' | 'HD15' | 'FHD15' | 'FHD30';
|
|
3
|
-
export type ScreenShareOptions = {
|
|
4
|
-
/**
|
|
5
|
-
* Resolution + fps of screen share track, one of: `VGA`, `HD5`, `HD15`, `FHD15`, `FHD30`.
|
|
6
|
-
* Note that quality might be worse than specified due to device capabilities, internet
|
|
7
|
-
* connection etc.
|
|
8
|
-
* @default `HD15`
|
|
9
|
-
*/
|
|
10
|
-
quality: ScreenShareQuality;
|
|
11
|
-
};
|
|
12
|
-
export type ScreenShareOptionsInternal = {
|
|
13
|
-
screenShareMetadata: TrackMetadata & {
|
|
14
|
-
displayName?: string;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* SimulcastConfig of a screen share track. By default simulcast is disabled.
|
|
18
|
-
*/
|
|
19
|
-
simulcastConfig: SimulcastConfig;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* This hook can toggle screen sharing on/off and provides current screen share state.
|
|
23
|
-
* @returns An object with functions to manage screen share.
|
|
24
|
-
* @category Connection
|
|
25
|
-
* @group Hooks
|
|
26
|
-
*/
|
|
27
|
-
export declare function useScreenShare(): {
|
|
28
|
-
isScreenShareOn: boolean;
|
|
29
|
-
simulcastConfig: SimulcastConfig;
|
|
30
|
-
/**
|
|
31
|
-
* Toggles the screen share on/off
|
|
32
|
-
* Emits warning on ios when user is screensharing app screen.
|
|
33
|
-
*/
|
|
34
|
-
toggleScreenShare: (screenShareOptions?: Partial<ScreenShareOptions>) => Promise<void>;
|
|
35
|
-
handleScreenSharePermission: () => Promise<"granted" | "denied">;
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=useScreenShare.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useScreenShare.d.ts","sourceRoot":"","sources":["../../src/hooks/useScreenShare.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAO1D,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAE5E,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;;;OAKG;IACH,OAAO,EAAE,kBAAkB,CAAC;CAC7B,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG;IACvC,mBAAmB,EAAE,aAAa,GAAG;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D;;OAEG;IACH,eAAe,EAAE,eAAe,CAAC;CAClC,CAAC;AASF;;;;;GAKG;AACH,wBAAgB,cAAc;;;IA2C1B;;;OAGG;6CA3BwB,OAAO,CAAC,kBAAkB,CAAC;;EA+BzD"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
|
-
import RNFishjamClientModule, { ReceivableEvents, } from '../RNFishjamClientModule';
|
|
3
|
-
import { Platform } from 'react-native';
|
|
4
|
-
import { useFishjamEventState } from './internal/useFishjamEventState';
|
|
5
|
-
const defaultSimulcastConfig = () => ({
|
|
6
|
-
enabled: false,
|
|
7
|
-
});
|
|
8
|
-
let screenShareSimulcastConfig = defaultSimulcastConfig();
|
|
9
|
-
/**
|
|
10
|
-
* This hook can toggle screen sharing on/off and provides current screen share state.
|
|
11
|
-
* @returns An object with functions to manage screen share.
|
|
12
|
-
* @category Connection
|
|
13
|
-
* @group Hooks
|
|
14
|
-
*/
|
|
15
|
-
export function useScreenShare() {
|
|
16
|
-
const isScreenShareOn = useFishjamEventState(ReceivableEvents.IsScreenShareOn, RNFishjamClientModule.isScreenShareOn);
|
|
17
|
-
const simulcastConfig = useFishjamEventState(ReceivableEvents.SimulcastConfigUpdate, screenShareSimulcastConfig);
|
|
18
|
-
const handleScreenSharePermission = useCallback(async () => {
|
|
19
|
-
if (Platform.OS === 'android') {
|
|
20
|
-
return await RNFishjamClientModule.handleScreenSharePermission();
|
|
21
|
-
}
|
|
22
|
-
return 'denied';
|
|
23
|
-
}, []);
|
|
24
|
-
const toggleScreenShare = useCallback(async (screenShareOptions = {}) => {
|
|
25
|
-
if (Platform.OS === 'android' && !isScreenShareOn) {
|
|
26
|
-
if ((await handleScreenSharePermission()) !== 'granted') {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
const options = {
|
|
31
|
-
...screenShareOptions,
|
|
32
|
-
screenShareMetadata: {
|
|
33
|
-
displayName: 'presenting',
|
|
34
|
-
type: 'screenShareVideo',
|
|
35
|
-
active: !isScreenShareOn,
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
await RNFishjamClientModule.toggleScreenShare(options);
|
|
39
|
-
screenShareSimulcastConfig = defaultSimulcastConfig(); //to do: sync with camera settings
|
|
40
|
-
}, [isScreenShareOn, handleScreenSharePermission]);
|
|
41
|
-
return {
|
|
42
|
-
isScreenShareOn,
|
|
43
|
-
simulcastConfig,
|
|
44
|
-
/**
|
|
45
|
-
* Toggles the screen share on/off
|
|
46
|
-
* Emits warning on ios when user is screensharing app screen.
|
|
47
|
-
*/
|
|
48
|
-
toggleScreenShare,
|
|
49
|
-
handleScreenSharePermission,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=useScreenShare.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useScreenShare.js","sourceRoot":"","sources":["../../src/hooks/useScreenShare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAGpC,OAAO,qBAAqB,EAAE,EAC5B,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAqBvE,MAAM,sBAAsB,GAAG,GAAG,EAAE,CAClC,CAAC;IACC,OAAO,EAAE,KAAK;CACf,CAA2B,CAAC;AAE/B,IAAI,0BAA0B,GA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ig, TrackMetadata } from '../types';\nimport RNFishjamClientModule, {\n ReceivableEvents,\n} from '../RNFishjamClientModule';\nimport { Platform } from 'react-native';\nimport { useFishjamEventState } from './internal/useFishjamEventState';\n\nexport type ScreenShareQuality = 'VGA' | 'HD5' | 'HD15' | 'FHD15' | 'FHD30';\n\nexport type ScreenShareOptions = {\n /**\n * Resolution + fps of screen share track, one of: `VGA`, `HD5`, `HD15`, `FHD15`, `FHD30`.\n * Note that quality might be worse than specified due to device capabilities, internet\n * connection etc.\n * @default `HD15`\n */\n quality: ScreenShareQuality;\n};\nexport type ScreenShareOptionsInternal = {\n screenShareMetadata: TrackMetadata & { displayName?: string };\n /**\n * SimulcastConfig of a screen share track. By default simulcast is disabled.\n */\n simulcastConfig: SimulcastConfig;\n};\n\nconst defaultSimulcastConfig = () =>\n ({\n enabled: false,\n }) satisfies SimulcastConfig;\n\nlet screenShareSimulcastConfig: SimulcastConfig = defaultSimulcastConfig();\n\n/**\n * This hook can toggle screen sharing on/off and provides current screen share state.\n * @returns An object with functions to manage screen share.\n * @category Connection\n * @group Hooks\n */\nexport function useScreenShare() {\n const isScreenShareOn = useFishjamEventState(\n ReceivableEvents.IsScreenShareOn,\n RNFishjamClientModule.isScreenShareOn,\n );\n\n const simulcastConfig = useFishjamEventState(\n ReceivableEvents.SimulcastConfigUpdate,\n screenShareSimulcastConfig,\n );\n\n const handleScreenSharePermission = useCallback(async () => {\n if (Platform.OS === 'android') {\n return await RNFishjamClientModule.handleScreenSharePermission();\n }\n return 'denied';\n }, []);\n\n const toggleScreenShare = useCallback(\n async (screenShareOptions: Partial<ScreenShareOptions> = {}) => {\n if (Platform.OS === 'android' && !isScreenShareOn) {\n if ((await handleScreenSharePermission()) !== 'granted') {\n return;\n }\n }\n const options = {\n ...screenShareOptions,\n screenShareMetadata: {\n displayName: 'presenting',\n type: 'screenShareVideo' as const,\n active: !isScreenShareOn,\n },\n };\n await RNFishjamClientModule.toggleScreenShare(options);\n screenShareSimulcastConfig = defaultSimulcastConfig(); //to do: sync with camera settings\n },\n [isScreenShareOn, handleScreenSharePermission],\n );\n\n return {\n isScreenShareOn,\n simulcastConfig,\n\n /**\n * Toggles the screen share on/off\n * Emits warning on ios when user is screensharing app screen.\n */\n toggleScreenShare,\n handleScreenSharePermission,\n };\n}\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { GenericMetadata } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* This hook provides method to update peer metadata
|
|
4
|
-
* @category Connection
|
|
5
|
-
* @group Hooks
|
|
6
|
-
*/
|
|
7
|
-
export declare const useUpdatePeerMetadata: <PeerMetadata extends GenericMetadata = GenericMetadata>() => {
|
|
8
|
-
/**
|
|
9
|
-
* Updates metadata send to other peers
|
|
10
|
-
* @param peerMetadata string indexed record with metadata, that will be available to all other peers
|
|
11
|
-
* @category Connection
|
|
12
|
-
*/
|
|
13
|
-
updatePeerMetadata: (peerMetadata: PeerMetadata) => Promise<void>;
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=useUpdatePeerMetadata.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useUpdatePeerMetadata.d.ts","sourceRoot":"","sources":["../../src/hooks/useUpdatePeerMetadata.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAChC,YAAY,SAAS,eAAe,GAAG,eAAe;IAOpD;;;;OAIG;uCATuD,YAAY;CAYzE,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
|
-
import RNFishjamClientModule from '../RNFishjamClientModule';
|
|
3
|
-
/**
|
|
4
|
-
* This hook provides method to update peer metadata
|
|
5
|
-
* @category Connection
|
|
6
|
-
* @group Hooks
|
|
7
|
-
*/
|
|
8
|
-
export const useUpdatePeerMetadata = () => {
|
|
9
|
-
const updatePeerMetadata = useCallback(async (peerMetadata) => {
|
|
10
|
-
await RNFishjamClientModule.updatePeerMetadata(peerMetadata);
|
|
11
|
-
}, []);
|
|
12
|
-
return {
|
|
13
|
-
/**
|
|
14
|
-
* Updates metadata send to other peers
|
|
15
|
-
* @param peerMetadata string indexed record with metadata, that will be available to all other peers
|
|
16
|
-
* @category Connection
|
|
17
|
-
*/
|
|
18
|
-
updatePeerMetadata,
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=useUpdatePeerMetadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useUpdatePeerMetadata.js","sourceRoot":"","sources":["../../src/hooks/useUpdatePeerMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAG7D;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAEjC,EAAE;IACJ,MAAM,kBAAkB,GAAG,WAAW,CAAC,KAAK,EAAE,YAA0B,EAAE,EAAE;QAC1E,MAAM,qBAAqB,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAC/D,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL;;;;WAIG;QACH,kBAAkB;KACnB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useCallback } from 'react';\nimport RNFishjamClientModule from '../RNFishjamClientModule';\nimport { GenericMetadata } from '../types';\n\n/**\n * This hook provides method to update peer metadata\n * @category Connection\n * @group Hooks\n */\nexport const useUpdatePeerMetadata = <\n PeerMetadata extends GenericMetadata = GenericMetadata,\n>() => {\n const updatePeerMetadata = useCallback(async (peerMetadata: PeerMetadata) => {\n await RNFishjamClientModule.updatePeerMetadata(peerMetadata);\n }, []);\n\n return {\n /**\n * Updates metadata send to other peers\n * @param peerMetadata string indexed record with metadata, that will be available to all other peers\n * @category Connection\n */\n updatePeerMetadata,\n };\n};\n"]}
|
package/build/index.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export type { SimulcastConfig, VideoLayout, GenericMetadata, TrackMetadata, Brand, RoomType, } from './types';
|
|
2
|
-
export { updatePeerMetadata } from './common/metadata';
|
|
3
|
-
export type { VideoPreviewViewProps } from './components/VideoPreviewView';
|
|
4
|
-
export type { VideoRendererProps } from './components/VideoRendererView';
|
|
5
|
-
export type { PipContainerViewRef, PipContainerViewProps, PictureInPictureConfig, } from './components/PipContainerView';
|
|
6
|
-
export { VideoPreviewView } from './components/VideoPreviewView';
|
|
7
|
-
export { VideoRendererView } from './components/VideoRendererView';
|
|
8
|
-
export { PipContainerView } from './components/PipContainerView';
|
|
9
|
-
export type { Peer, PeerId, Track, TrackId, TrackType, VadStatus, EncodingReason, TrackBase, AudioTrack, VideoTrack, UsePeersResult, PeerWithTracks, PeerTrackMetadata, DistinguishedTracks, } from './hooks/usePeers';
|
|
10
|
-
export type { AudioOutputDevice, AudioOutputDeviceType, AudioSessionMode, } from './hooks/useAudioSettings';
|
|
11
|
-
export type { CameraId, Camera, CameraConfig, VideoQuality, CameraFacingDirection, CameraConfigBase, } from './hooks/useCamera';
|
|
12
|
-
export type { ScreenShareOptions, ScreenShareQuality, } from './hooks/useScreenShare';
|
|
13
|
-
export type { ForegroundServiceConfig } from './hooks/useForegroundService';
|
|
14
|
-
export type { JoinRoomConfig, ReconnectionStatus, PeerStatus, ConnectionConfig, } from './hooks/useConnection';
|
|
15
|
-
export type { AppScreenShareData } from './hooks/useAppScreenShare';
|
|
16
|
-
export type { UseSandboxProps } from './hooks/useSandbox';
|
|
17
|
-
export type { UseCallKitResult, CallKitConfig, CallKitAction, } from './hooks/useCallKit';
|
|
18
|
-
export { useAudioSettings } from './hooks/useAudioSettings';
|
|
19
|
-
export { useBandwidthEstimation } from './hooks/useBandwidthEstimation';
|
|
20
|
-
export { useCamera } from './hooks/useCamera';
|
|
21
|
-
export { useMicrophone } from './hooks/useMicrophone';
|
|
22
|
-
export { useScreenShare } from './hooks/useScreenShare';
|
|
23
|
-
export { useAppScreenShare } from './hooks/useAppScreenShare';
|
|
24
|
-
export { useReconnection } from './hooks/useReconnection';
|
|
25
|
-
export { usePeerStatus } from './hooks/usePeerStatus';
|
|
26
|
-
export { usePeers } from './hooks/usePeers';
|
|
27
|
-
export { useForegroundService } from './hooks/useForegroundService';
|
|
28
|
-
export { useConnection } from './hooks/useConnection';
|
|
29
|
-
export { useUpdatePeerMetadata } from './hooks/useUpdatePeerMetadata';
|
|
30
|
-
export { useSandbox } from './hooks/useSandbox';
|
|
31
|
-
export { useCallKitService, useCallKit, useCallKitEvent, } from './hooks/useCallKit';
|
|
32
|
-
export { useCameraPermissions, useMicrophonePermissions, } from './hooks/usePermissions';
|
|
33
|
-
export type { FishjamRoomProps } from './components/FishjamRoom';
|
|
34
|
-
export { FishjamRoom } from './components/FishjamRoom';
|
|
35
|
-
export { setOverwriteDebugConfig, DebugConfig } from './utils/config';
|
|
36
|
-
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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;AAIjB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGvD,YAAY,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,YAAY,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAA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O,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,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAKvD,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
package/build/index.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { initializeWarningListener } from './utils/errorListener';
|
|
2
|
-
// #endregion
|
|
3
|
-
// #region methods
|
|
4
|
-
export { updatePeerMetadata } from './common/metadata';
|
|
5
|
-
export { VideoPreviewView } from './components/VideoPreviewView';
|
|
6
|
-
export { VideoRendererView } from './components/VideoRendererView';
|
|
7
|
-
export { PipContainerView } from './components/PipContainerView';
|
|
8
|
-
// #endregion
|
|
9
|
-
// #region hooks
|
|
10
|
-
export { useAudioSettings } from './hooks/useAudioSettings';
|
|
11
|
-
export { useBandwidthEstimation } from './hooks/useBandwidthEstimation';
|
|
12
|
-
export { useCamera } from './hooks/useCamera';
|
|
13
|
-
export { useMicrophone } from './hooks/useMicrophone';
|
|
14
|
-
export { useScreenShare } from './hooks/useScreenShare';
|
|
15
|
-
export { useAppScreenShare } from './hooks/useAppScreenShare';
|
|
16
|
-
export { useReconnection } from './hooks/useReconnection';
|
|
17
|
-
export { usePeerStatus } from './hooks/usePeerStatus';
|
|
18
|
-
export { usePeers } from './hooks/usePeers';
|
|
19
|
-
export { useForegroundService } from './hooks/useForegroundService';
|
|
20
|
-
export { useConnection } from './hooks/useConnection';
|
|
21
|
-
export { useUpdatePeerMetadata } from './hooks/useUpdatePeerMetadata';
|
|
22
|
-
export { useSandbox } from './hooks/useSandbox';
|
|
23
|
-
export { useCallKitService, useCallKit, useCallKitEvent, } from './hooks/useCallKit';
|
|
24
|
-
// #endregion
|
|
25
|
-
export { useCameraPermissions, useMicrophonePermissions, } from './hooks/usePermissions';
|
|
26
|
-
export { FishjamRoom } from './components/FishjamRoom';
|
|
27
|
-
initializeWarningListener();
|
|
28
|
-
// Debug/config API
|
|
29
|
-
export { setOverwriteDebugConfig } from './utils/config';
|
|
30
|
-
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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;AAUvD,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;AAsDjE,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,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,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';\nexport type {\n PipContainerViewRef,\n PipContainerViewProps,\n PictureInPictureConfig,\n} from './components/PipContainerView';\nexport { VideoPreviewView } from './components/VideoPreviewView';\nexport { VideoRendererView } from './components/VideoRendererView';\nexport { PipContainerView } from './components/PipContainerView';\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';\nexport type {\n UseCallKitResult,\n CallKitConfig,\n CallKitAction,\n} from './hooks/useCallKit';\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';\nexport {\n useCallKitService,\n useCallKit,\n useCallKitEvent,\n} from './hooks/useCallKit';\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"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
-
import { WhipClientViewRef } 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
|
-
* Reference to the WhipClient instance. Needs to be passed from the {@link useLivestreamStreamer} hook.
|
|
13
|
-
*/
|
|
14
|
-
ref: React.RefObject<WhipClientViewRef | null>;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Renders a video player playing the livestream set up with {@link useLivestreamStreamer} hook.
|
|
18
|
-
*
|
|
19
|
-
* @category Components
|
|
20
|
-
* @param {object} props
|
|
21
|
-
* @param {object} props.style
|
|
22
|
-
*/
|
|
23
|
-
export declare const LivestreamStreamer: ({ style, ref }: LivestreamStreamerProps) => import("react").JSX.Element;
|
|
24
|
-
//# sourceMappingURL=LivestreamStreamer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,EAAkB,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B;;OAEG;IACH,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CAChD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,gBAAgB,uBAAuB,gCAEzE,CAAC"}
|
|
@@ -1,12 +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, ref }) => {
|
|
10
|
-
return <WhipClientView style={style} ref={ref}/>;
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=LivestreamStreamer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LivestreamStreamer.js","sourceRoot":"","sources":["../../../src/livestream/components/LivestreamStreamer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAqB,MAAM,wBAAwB,CAAC;AAiB3E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,EAA2B,EAAE,EAAE;IAC5E,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,KAAsB,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;AACrE,CAAC,CAAC","sourcesContent":["import { CSSProperties } from 'react';\nimport { StyleProp, ViewStyle } from 'react-native';\nimport { WhipClientView, WhipClientViewRef } 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 /**\n * Reference to the WhipClient instance. Needs to be passed from the {@link useLivestreamStreamer} hook.\n */\n ref: React.RefObject<WhipClientViewRef | 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 = ({ style, ref }: LivestreamStreamerProps) => {\n return <WhipClientView style={style as CSSProperties} ref={ref} />;\n};\n"]}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Ref } from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import { WhepClientViewRef } from 'react-native-whip-whep';
|
|
4
|
-
export type LivestreamViewerRef = WhepClientViewRef;
|
|
5
|
-
/**
|
|
6
|
-
* Props of the LivestreamView component
|
|
7
|
-
*/
|
|
8
|
-
export type LivestreamViewerProps = {
|
|
9
|
-
/**
|
|
10
|
-
* Styles of the LivestreamView component
|
|
11
|
-
*/
|
|
12
|
-
style?: StyleProp<ViewStyle>;
|
|
13
|
-
/**
|
|
14
|
-
* A variable deciding whether the Picture-in-Picture is enabled.
|
|
15
|
-
* Defaults to true.
|
|
16
|
-
*/
|
|
17
|
-
pipEnabled?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* A variable deciding whether the Picture-in-Picture mode should be started automatically after the app is backgrounded.
|
|
20
|
-
* Defaults to false.
|
|
21
|
-
*/
|
|
22
|
-
autoStartPip?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* A variable deciding whether the Picture-in-Picture mode should be stopped automatically on iOS after the app is foregrounded.
|
|
25
|
-
* Always enabled on Android as PiP is not supported in foreground.
|
|
26
|
-
* Defaults to false.
|
|
27
|
-
*/
|
|
28
|
-
autoStopPip?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* A variable deciding the size of the Picture-in-Picture mode.
|
|
31
|
-
*/
|
|
32
|
-
pipSize?: {
|
|
33
|
-
width: number;
|
|
34
|
-
height: number;
|
|
35
|
-
};
|
|
36
|
-
ref: Ref<LivestreamViewerRef>;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Renders a video player playing the livestream set up with {@link useLivestreamViewer} hook.
|
|
40
|
-
*
|
|
41
|
-
* @category Components
|
|
42
|
-
* @param {object} props
|
|
43
|
-
* @param {object} props.style
|
|
44
|
-
*/
|
|
45
|
-
export declare const LivestreamViewer: ({ style, pipEnabled, autoStartPip, autoStopPip, pipSize, ref, }: LivestreamViewerProps) => import("react").JSX.Element;
|
|
46
|
-
//# sourceMappingURL=LivestreamViewer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,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,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC;CAC/B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,iEAO9B,qBAAqB,gCASvB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { WhepClientView } from 'react-native-whip-whep';
|
|
2
|
-
/**
|
|
3
|
-
* Renders a video player playing the livestream set up with {@link useLivestreamViewer} hook.
|
|
4
|
-
*
|
|
5
|
-
* @category Components
|
|
6
|
-
* @param {object} props
|
|
7
|
-
* @param {object} props.style
|
|
8
|
-
*/
|
|
9
|
-
export const LivestreamViewer = ({ style, pipEnabled, autoStartPip, autoStopPip, pipSize, ref, }) => (<WhepClientView ref={ref} style={style} pipEnabled={pipEnabled} autoStartPip={autoStartPip} autoStopPip={autoStopPip} pipSize={pipSize}/>);
|
|
10
|
-
//# sourceMappingURL=LivestreamViewer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LivestreamViewer.js","sourceRoot":"","sources":["../../../src/livestream/components/LivestreamViewer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAqB,MAAM,wBAAwB,CAAC;AAuC3E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAC/B,KAAK,EACL,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 * 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 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,65 +0,0 @@
|
|
|
1
|
-
import { Camera, SenderAudioCodecName, SenderVideoCodecName, VideoParameters, WhipClientViewRef } from 'react-native-whip-whep';
|
|
2
|
-
/**
|
|
3
|
-
* @category Livestream
|
|
4
|
-
*/
|
|
5
|
-
export interface useLivestreamStreamerResult {
|
|
6
|
-
/**
|
|
7
|
-
* Callback used to start publishing the selected audio and video media streams.
|
|
8
|
-
*
|
|
9
|
-
* @remarks
|
|
10
|
-
* Calling {@link connect} multiple times will have the effect of only publishing the **last** specified inputs.
|
|
11
|
-
*/
|
|
12
|
-
connect: (token: string, urlOverride?: string) => Promise<void>;
|
|
13
|
-
/** Callback to stop publishing anything previously published with {@link connect} */
|
|
14
|
-
disconnect: () => Promise<void>;
|
|
15
|
-
/** Callback to flip camera */
|
|
16
|
-
flipCamera: () => Promise<void>;
|
|
17
|
-
/** Callback to switch camera to the one passed as arguement */
|
|
18
|
-
switchCamera: (deviceId: string) => Promise<void>;
|
|
19
|
-
/** Callback to get the id of camera which is used for streaming */
|
|
20
|
-
currentCameraDeviceId: () => Promise<string | undefined>;
|
|
21
|
-
/** Utility flag which indicates the current connection status */
|
|
22
|
-
isConnected: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Reference to the WhipClient instance. Needs to be passed to the {@link LivestreamStreamer} component.
|
|
25
|
-
*/
|
|
26
|
-
whipClientRef: React.RefObject<WhipClientViewRef | null>;
|
|
27
|
-
}
|
|
28
|
-
export type UseLivestreamStreamerParams = {
|
|
29
|
-
/**
|
|
30
|
-
* If video track should be enabled.
|
|
31
|
-
* Defaults to true.
|
|
32
|
-
*/
|
|
33
|
-
videoEnabled?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* If audio track should be enabled.
|
|
36
|
-
* Defaults to true.
|
|
37
|
-
*/
|
|
38
|
-
audioEnabled?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Camera to use for the livestream.
|
|
41
|
-
* Use {@link cameras} to get the list of supported cameras.
|
|
42
|
-
*/
|
|
43
|
-
camera?: Camera;
|
|
44
|
-
/**
|
|
45
|
-
* Set video parameters for the camera
|
|
46
|
-
*/
|
|
47
|
-
videoParameters?: VideoParameters;
|
|
48
|
-
/**
|
|
49
|
-
* Set the preferred video codecs for sending the video.
|
|
50
|
-
* Use {@link WhipClient.getSupportedVideoCodecs} to get the list of supported video codecs.
|
|
51
|
-
*/
|
|
52
|
-
preferredVideoCodecs?: SenderVideoCodecName[];
|
|
53
|
-
/**
|
|
54
|
-
* Set the preferred audio codecs for sending the audio.
|
|
55
|
-
* Use {@link WhipClient.getSupportedAudioCodecs} to get the list of supported audio codecs.
|
|
56
|
-
*/
|
|
57
|
-
preferredAudioCodecs?: SenderAudioCodecName[];
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Hook for publishing a livestream, which can be then received with {@link useLivestreamViewer}
|
|
61
|
-
* @category Livestream
|
|
62
|
-
* @group Hooks
|
|
63
|
-
*/
|
|
64
|
-
export declare const useLivestreamStreamer: ({ videoEnabled, audioEnabled, camera, videoParameters, preferredVideoCodecs, preferredAudioCodecs, }?: UseLivestreamStreamerParams) => useLivestreamStreamerResult;
|
|
65
|
-
//# sourceMappingURL=useLivestreamStreamer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLivestreamStreamer.d.ts","sourceRoot":"","sources":["../../../src/livestream/hooks/use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1
|
-
import { useCallback, useRef, useEffect } from 'react';
|
|
2
|
-
import { cameras, 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 = ({ videoEnabled, audioEnabled, camera, videoParameters, preferredVideoCodecs, preferredAudioCodecs, } = {}) => {
|
|
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
|
-
const flipCamera = useCallback(async () => {
|
|
24
|
-
await whipClientRef.current?.flipCamera();
|
|
25
|
-
}, []);
|
|
26
|
-
const switchCamera = useCallback(async (deviceId) => {
|
|
27
|
-
return await whipClientRef.current?.switchCamera(deviceId);
|
|
28
|
-
}, []);
|
|
29
|
-
const currentCameraDeviceId = useCallback(async () => {
|
|
30
|
-
return await whipClientRef.current?.currentCameraDeviceId();
|
|
31
|
-
}, []);
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
try {
|
|
34
|
-
const initializeCamera = async () => {
|
|
35
|
-
await whipClientRef.current?.initializeCamera({
|
|
36
|
-
audioEnabled: audioEnabled ?? true,
|
|
37
|
-
videoEnabled: videoEnabled ?? true,
|
|
38
|
-
videoDeviceId: camera?.id ?? cameras[0].id,
|
|
39
|
-
videoParameters: videoParameters,
|
|
40
|
-
preferredVideoCodecs: preferredVideoCodecs,
|
|
41
|
-
preferredAudioCodecs: preferredAudioCodecs,
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
initializeCamera();
|
|
45
|
-
}
|
|
46
|
-
catch {
|
|
47
|
-
console.error('Failed to initialize camera');
|
|
48
|
-
}
|
|
49
|
-
const ref = whipClientRef.current;
|
|
50
|
-
return () => {
|
|
51
|
-
ref?.disconnect();
|
|
52
|
-
};
|
|
53
|
-
}, [
|
|
54
|
-
camera,
|
|
55
|
-
videoParameters,
|
|
56
|
-
videoEnabled,
|
|
57
|
-
audioEnabled,
|
|
58
|
-
preferredVideoCodecs,
|
|
59
|
-
preferredAudioCodecs,
|
|
60
|
-
whipClientRef,
|
|
61
|
-
]);
|
|
62
|
-
return {
|
|
63
|
-
connect,
|
|
64
|
-
disconnect,
|
|
65
|
-
flipCamera,
|
|
66
|
-
switchCamera,
|
|
67
|
-
currentCameraDeviceId,
|
|
68
|
-
isConnected,
|
|
69
|
-
whipClientRef,
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
//# sourceMappingURL=useLivestreamStreamer.js.map
|