Skip to content

Commit

Permalink
fix type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
czerwiukk committed Dec 19, 2024
1 parent 2229e30 commit bb8ea28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { RefObject } from "react";
import { useEffect, useRef } from "react";

type Props = {
Expand All @@ -7,11 +6,11 @@ type Props = {
};

const VideoPlayer = ({ stream, peerId }: Props) => {
const videoRef: RefObject<HTMLVideoElement> = useRef<HTMLVideoElement>(null);
const videoRef = useRef<HTMLVideoElement>(null);

useEffect(() => {
if (!videoRef.current) return;
videoRef.current.srcObject = stream || null;
videoRef.current.srcObject = stream ?? null;
}, [stream]);

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { RefObject } from "react";
import { useEffect, useRef } from "react";

type Props = {
stream: MediaStream | null | undefined;
};

const VideoPlayer = ({ stream }: Props) => {
const videoRef: RefObject<HTMLVideoElement> = useRef<HTMLVideoElement>(null);
const videoRef = useRef<HTMLVideoElement>(null);

useEffect(() => {
if (!videoRef.current) return;
Expand Down

0 comments on commit bb8ea28

Please sign in to comment.