Skip to content

Commit 6af97bb

Browse files
committed
Cleanup
1 parent bb63ce1 commit 6af97bb

File tree

4 files changed

+51
-10
lines changed

4 files changed

+51
-10
lines changed

App.tsx

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as React from 'react';
2-
32
import {
43
StyleSheet,
54
View,
@@ -14,14 +13,16 @@ import {
1413
TrackReferenceOrPlaceholder,
1514
VideoTrack,
1615
isTrackReference,
16+
registerGlobals,
1717
} from '@livekit/react-native';
18-
1918
import { Track } from 'livekit-client';
2019

21-
// !! Note !!
22-
// This sample hardcodes a token which expires in 2 hours.
23-
const wsURL = "%{wsURL}%"
24-
const token = "%{token}%"
20+
// registerGlobals must be called prior to using LiveKit.
21+
registerGlobals();
22+
23+
// Fill in these values with your own url and token.
24+
const wsURL = "wss://www.example.com"
25+
const token = "your-token-here"
2526
export default function App() {
2627

2728
// Start the audio session first.
@@ -42,6 +43,7 @@ export default function App() {
4243
token={token}
4344
connect={true}
4445
options={{
46+
// Use screen pixel density to handle screens with differing densities.
4547
adaptiveStream: { pixelDensity: 'screen' },
4648
}}
4749
audio={true}
@@ -53,11 +55,11 @@ export default function App() {
5355
};
5456

5557
const RoomView = () => {
56-
// Get all camera tracks
58+
// Get all camera tracks.
5759
const tracks = useTracks([Track.Source.Camera]);
5860

5961
const renderTrack: ListRenderItem<TrackReferenceOrPlaceholder> = ({item}) => {
60-
// Render using the VideoTrack component
62+
// Render using the VideoTrack component.
6163
if(isTrackReference(item)) {
6264
return (<VideoTrack trackRef={item} style={styles.participantView} />)
6365
} else {

package-lock.json

+34-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
"expo-dev-client": "~3.3.11",
1818
"expo-status-bar": "~1.11.1",
1919
"react": "18.2.0",
20-
"react-native": "0.73.6"
20+
"react-native": "0.73.6",
21+
"typescript": "^5.3.0",
22+
"@types/react": "~18.2.45"
2123
},
2224
"devDependencies": {
2325
"@babel/core": "^7.20.0"

tsconfig.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"compilerOptions": {},
3+
"extends": "expo/tsconfig.base"
4+
}

0 commit comments

Comments
 (0)