Replies: 1 comment 2 replies
-
Why would you want to do this? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As title says, i tried to stream from canvas to video tag, and first time i tried this, it worked, then i refreshed the page it wont show anything in video tag just black, same happens in all browsers but firefox wont even open the page it gives this error 'Uncaught
Exception { name: "NS_ERROR_NOT_INITIALIZED",'The above error occurred in the component:
StreamVideo@webpack:///./src/StreamVideo.js?:19:71
div'
Any idea how to fix this ?
import React, { useRef, useEffect, useState } from 'react';
import ReactDOM from 'react-dom';
import { loadPlayer } from 'rtsp-relay/browser';
const StreamVideo = () => {
const canvasRef = useRef(null);
const videoRef = useRef(null);
useEffect(() => {
if (!canvasRef.current) throw new Error('Ref is null');
}, []);
return (
<div style={{ border: '5px solid red' }}>
<canvas
ref={canvasRef}
style={{ width: '100%', height: '100%', border: '1px solid blue' }}
/>
<video
ref={videoRef}
style={{ width: '100%', height: '100%', border: '1px solid blue' }}
autoPlay
/>
< /div>
);
};
export default StreamVideo;
`
Beta Was this translation helpful? Give feedback.
All reactions