Skip to content

Commit

Permalink
Merge pull request #29 from Numble3/sukyung
Browse files Browse the repository at this point in the history
feat: hls player
  • Loading branch information
hwangyena authored May 12, 2022
2 parents 11dddcc + 6a75fbc commit dc3fe58
Show file tree
Hide file tree
Showing 4 changed files with 627 additions and 457 deletions.
34 changes: 34 additions & 0 deletions components/custom/hls-player.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { useRef } from "react";
import React from "react";
import dynamic from "next/dynamic";

const ReactHlsPlayer = dynamic(() => import("react-hls-player"), {
ssr: false,
});

interface PlayerProps {
width?: string;
height?: string;
controls?: boolean;
videoSrc: string;
}
const HlsPlayer = ({
width = "100%",
height = "auto",
controls = true,
videoSrc,
}: PlayerProps) => {
const playerRef = useRef<HTMLVideoElement>(null);
return (
<ReactHlsPlayer
src={videoSrc}
autoPlay={false}
controls={controls}
width={width}
height={height}
playerRef={playerRef}
/>
);
};

export default HlsPlayer;
Loading

0 comments on commit dc3fe58

Please sign in to comment.