react-player
Version:
A React component for playing a variety of URLs, including file paths, Mux, YouTube, Vimeo, and Wistia
11 lines (10 loc) • 379 B
JavaScript
import React from "react";
import { AUDIO_EXTENSIONS } from "./patterns.js";
const HtmlPlayer = React.forwardRef((props, ref) => {
const Media = AUDIO_EXTENSIONS.test(`${props.src}`) ? "audio" : "video";
return /* @__PURE__ */ React.createElement(Media, { ...props, ref }, props.children);
});
var HtmlPlayer_default = HtmlPlayer;
export {
HtmlPlayer_default as default
};