UNPKG

@aidenlx/vidstack-react

Version:

UI component library for building high-quality, accessible video and audio experiences on the web.

38 lines (34 loc) 866 B
"use client" import { scoped } from 'maverick.js'; import { HTMLMediaProvider, HTMLAirPlayAdapter } from './vidstack-B1ySk2FQ.js'; import 'react'; import 'maverick.js/react'; import 'maverick.js/std'; import './vidstack-CPShcCv0.js'; import '@floating-ui/dom'; class AudioProvider extends HTMLMediaProvider { $$PROVIDER_TYPE = "AUDIO"; get type() { return "audio"; } airPlay; constructor(audio, ctx) { super(audio, ctx); scoped(() => { this.airPlay = new HTMLAirPlayAdapter(this.media, ctx); }, this.scope); } setup() { super.setup(); if (this.type === "audio") this.ctx.notify("provider-setup", this); } /** * The native HTML `<audio>` element. * * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement} */ get audio() { return this.media; } } export { AudioProvider };