rtsp on react native (vlc player)
import React from 'react';
import { View } from 'react-native';
import VLCPlayer from 'react-native-vlc-player';
const CameraScreen = () => {
const ipCameraUrl = 'rtsp://YOUR_IP_CAMERA_URL';
return (
<View style={{ flex: 1 }}>
<VLCPlayer
ref={(ref) => (this.vlcPlayer = ref)}
style={{ flex: 1 }}
source={{
uri: ipCameraUrl,
autoplay: true,
initOptions: ['--rtsp-tcp'],
}}
/>
</View>
);
};
export default CameraScreen;
Comments
Post a Comment