UNPKG

@aigamo/nostalgic-diva

Version:

React function components for imperatively controlling embedded players (audio, Niconico, SoundCloud and YouTube) using refs.

44 lines (43 loc) 1.07 kB
import a, { memo as s, useCallback as t } from "react"; import { L as c, V as n } from "./index-DzXJDFxB.js"; import { e as y } from "./ensureScriptLoaded-C7IsEn-U.js"; import { P as p } from "./PlayerContainer-BSDtKMGl.js"; const g = s(({ ...o }) => { const { logger: e } = o; e.log(c.Debug, "VimeoPlayer"); const l = t(async () => { await y( "https://player.vimeo.com/api/player.js", e ); }, [e]), m = t( (r) => Promise.resolve(new Vimeo.Player(r)), [] ); return /* @__PURE__ */ a.createElement( p, { ...o, loadScript: l, playerFactory: m, controllerFactory: n }, (r, i) => ( // eslint-disable-next-line jsx-a11y/iframe-has-title /* @__PURE__ */ a.createElement( "iframe", { ref: r, src: `https://player.vimeo.com/video/${i}`, frameBorder: 0, allow: "autoplay", style: { width: "100%", height: "100%" } } ) ) ); }); export { g as default }; //# sourceMappingURL=VimeoPlayer-DhcLwyiy.js.map