How to Using React ( Nextjs ) #177
Unanswered
bogordesaincom
asked this question in
Q&A
Replies: 2 comments 3 replies
-
this my code const canvas = useRef(null);
const RelayRtsp = () => {
if (!canvas.current) throw new Error('Ref is null');
loadPlayer({
url: 'ws://localhost:2000/api/stream/2',
canvas: canvas.current,
});
};
useEffect(() => {
RelayRtsp();
}, []);
// console.log(data);
return (
<>
<Layout>
<div className="canvas" ref={canvas}></div>
</Layout>
<Script src="https://cdn.jsdelivr.net/npm/rtsp-relay@1.6.1/browser/index.js" />
</>
); |
Beta Was this translation helpful? Give feedback.
0 replies
-
the react example works fine for me using nextjs. Could you post your entire code, not just that snippet please? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using nextjs and follow instruction this https://github.com/k-yle/rtsp-relay/blob/main/examples/react.md but this result
Beta Was this translation helpful? Give feedback.
All reactions