Skip to content

Commit

Permalink
docs(README.md): update with new architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultBee committed Feb 21, 2024
1 parent 46c3470 commit e2e4991
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,22 @@ Your application must dynamically require android.permission.CAMERA and android.
```jsx
import React, { useRef, useState } from 'react';
import { View, TouchableOpacity } from 'react-native';
import { LiveStreamView } from '@api.video/react-native-livestream';
import { ApiVideoLiveStreamView } from '@api.video/react-native-livestream';

const App = () => {
const ref = useRef(null);
const [streaming, setStreaming] = useState(false);

return (
<View style={{ flex: 1, alignItems: 'center' }}>
<LiveStreamView
<ApiVideoLiveStreamView
style={{ flex: 1, backgroundColor: 'black', alignSelf: 'stretch' }}
ref={ref}
camera="back"
enablePinchedZoom={true}
video={{
fps: 30,
resolution: '720p',
resolution: '720p', // Alternatively, you can specify the resolution in pixels: { width: 1280, height: 720 }
bitrate: 2*1024*1024, // # 2 Mbps
gopDuration: 1, // 1 second
}}
Expand Down Expand Up @@ -169,16 +169,16 @@ export default App;
### Props & Methods
```ts
type LiveStreamProps = {
type ApiVideoLiveStreamProps = {
// Styles for the view containing the preview
style: ViewStyle;
// camera facing orientation
camera?: 'front' | 'back';
video: {
// frame rate
fps: number;
// resolution
resolution: '240p' | '360p' | '480p' | '720p' | '1080p';
// resolution.
resolution: Resolution | PredefinedResolution;
// video bitrate. depends on resolutions.
bitrate: number;
// duration between 2 key frames in seconds
Expand All @@ -204,7 +204,7 @@ type LiveStreamProps = {
onDisconnect?: () => void;
};

type LiveStreamMethods = {
type ApiVideoLiveStreamMethods = {
// Start the stream
// streamKey: your live stream RTMP key
// url: RTMP server url, default: rtmp://broadcast.api.video/s
Expand Down

0 comments on commit e2e4991

Please sign in to comment.