Skip to content

Commit 04ad1d8

Browse files
authored
Livestream module (#489)
1 parent 5e39fee commit 04ad1d8

File tree

12 files changed

+28
-23
lines changed

12 files changed

+28
-23
lines changed

examples/video-player/App.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ import { setStatusBarHidden } from 'expo-status-bar';
44
import { setVisibilityAsync } from 'expo-navigation-bar';
55
import { useDeviceOrientation } from './hooks/useDeviceOrientation';
66
import FishjamPlayer from './components/FishjamPlayer';
7-
import {
8-
useLivestreamViewer,
9-
useSandbox,
10-
} from '@fishjam-cloud/react-native-client';
7+
import { useSandbox } from '@fishjam-cloud/react-native-client';
8+
import { useLivestreamViewer } from '@fishjam-cloud/react-native-client/livestream';
119

1210
const roomName = 'test';
1311

examples/video-player/components/FishjamPlayer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useMemo } from 'react';
22
import { StyleSheet, View } from 'react-native';
3-
import { LivestreamViewer } from '@fishjam-cloud/react-native-client';
3+
import { LivestreamViewer } from '@fishjam-cloud/react-native-client/livestream';
44

55
interface FishjamPlayerProps {
66
isLandscape: boolean;

internal/fishjam-chat/screens/LivestreamScreen/LivestreamStreamerScreen.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import {
2-
LivestreamStreamer,
3-
useLivestreamStreamer,
42
useSandbox,
53
cameras,
64
WhipClient,
75
} from '@fishjam-cloud/react-native-client';
6+
import {
7+
LivestreamStreamer,
8+
useLivestreamStreamer,
9+
} from '@fishjam-cloud/react-native-client/livestream';
810
import type { NativeStackScreenProps } from '@react-navigation/native-stack';
911
import React, { useCallback, useEffect } from 'react';
1012
import {

internal/fishjam-chat/screens/LivestreamScreen/LivestreamViewerScreen.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { useSandbox } from '@fishjam-cloud/react-native-client';
12
import {
23
LivestreamViewer,
34
useLivestreamViewer,
4-
useSandbox,
5-
} from '@fishjam-cloud/react-native-client';
5+
} from '@fishjam-cloud/react-native-client/livestream';
66
import type { NativeStackScreenProps } from '@react-navigation/native-stack';
77
import React, { useCallback, useEffect } from 'react';
88
import { SafeAreaView, StyleSheet, View } from 'react-native';
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"main": "../build/livestream/index.js",
3+
"types": "../build/livestream/index.d.ts"
4+
}

packages/react-native-client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"files": [
8787
"build/**",
8888
"debug",
89+
"livestream",
8990
"android/build.gradle",
9091
"android/src/**",
9192
"ios/**/*.swift",

packages/react-native-client/src/index.tsx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,9 @@ export { updatePeerMetadata } from './common/metadata';
1717
// #region components
1818
export type { VideoPreviewViewProps } from './components/VideoPreviewView';
1919
export type { VideoRendererProps } from './components/VideoRendererView';
20-
export type {
21-
LivestreamViewerProps,
22-
LivestreamViewerRef,
23-
} from './components/LivestreamViewer';
2420

2521
export { VideoPreviewView } from './components/VideoPreviewView';
2622
export { VideoRendererView } from './components/VideoRendererView';
27-
export { LivestreamViewer } from './components/LivestreamViewer';
28-
export { LivestreamStreamer } from './components/LivestreamStreamer';
2923
// #endregion
3024

3125
// #region types for hooks
@@ -73,11 +67,7 @@ export type {
7367
ConnectionConfig,
7468
} from './hooks/useConnection';
7569
export type { AppScreenShareData } from './hooks/useAppScreenShare';
76-
export type { useLivestreamViewerResult } from './hooks/useLivestreamViewer';
77-
export type { useLivestreamStreamerResult } from './hooks/useLivestreamStreamer';
7870
export type { UseSandboxProps } from './hooks/useSandbox';
79-
export type { LivestreamStreamerProps } from './components/LivestreamStreamer';
80-
export type { ConnectViewerConfig } from './hooks/useLivestreamViewer';
8171
// #endregion
8272

8373
// #region hooks
@@ -93,8 +83,6 @@ export { usePeers } from './hooks/usePeers';
9383
export { useForegroundService } from './hooks/useForegroundService';
9484
export { useConnection } from './hooks/useConnection';
9585
export { useUpdatePeerMetadata } from './hooks/useUpdatePeerMetadata';
96-
export { useLivestreamViewer } from './hooks/useLivestreamViewer';
97-
export { useLivestreamStreamer } from './hooks/useLivestreamStreamer';
9886
export { useSandbox } from './hooks/useSandbox';
9987
export {
10088
cameras,

packages/react-native-client/src/components/LivestreamStreamer.tsx renamed to packages/react-native-client/src/livestream/components/LivestreamStreamer.tsx

File renamed without changes.

packages/react-native-client/src/components/LivestreamViewer.tsx renamed to packages/react-native-client/src/livestream/components/LivestreamViewer.tsx

File renamed without changes.

packages/react-native-client/src/hooks/useLivestreamStreamer.ts renamed to packages/react-native-client/src/livestream/hooks/useLivestreamStreamer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useCallback, useRef } from 'react';
22
import { useWhipConnectionState, WhipClient } from 'react-native-whip-whep';
3-
import { FISHJAM_WHIP_URL } from '../consts';
3+
import { FISHJAM_WHIP_URL } from '../../consts';
44

55
/**
66
* @category Livestream

0 commit comments

Comments
 (0)