✨Allow Video Stream widget to play any video file type. (#835)
* Remove type limitation for video player This allows the video player to play any video source, including m3u8 live streams, mp4, gifs, etc. * Fixed Linting.
This commit is contained in:
@@ -15,7 +15,6 @@ const VideoFeed = ({ source, controls, autoPlay, muted }: VideoFeedProps) => {
|
|||||||
const [player, setPlayer] = useState<ReturnType<typeof videojs>>();
|
const [player, setPlayer] = useState<ReturnType<typeof videojs>>();
|
||||||
|
|
||||||
const { classes, cx } = useStyles();
|
const { classes, cx } = useStyles();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// make sure Video.js player is only initialized once
|
// make sure Video.js player is only initialized once
|
||||||
if (player) {
|
if (player) {
|
||||||
@@ -50,7 +49,7 @@ const VideoFeed = ({ source, controls, autoPlay, muted }: VideoFeedProps) => {
|
|||||||
<LoadingOverlay visible={player === undefined} />
|
<LoadingOverlay visible={player === undefined} />
|
||||||
{/* eslint-disable-next-line jsx-a11y/media-has-caption */}
|
{/* eslint-disable-next-line jsx-a11y/media-has-caption */}
|
||||||
<video className={cx('video-js', classes.video)} ref={videoRef}>
|
<video className={cx('video-js', classes.video)} ref={videoRef}>
|
||||||
<source src={source} type="video/mp4" />
|
<source src={source} />
|
||||||
</video>
|
</video>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user