UNPKG

@ktt45678/vidstack

Version:

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

34 lines (31 loc) 917 B
import { scoped } from '../chunks/vidstack-fG_Sx3Q9.js'; import { HTMLMediaProvider } from './vidstack-html.js'; import { HTMLAirPlayAdapter } from '../chunks/vidstack-B9iqnZP1.js'; import '../chunks/vidstack-BpOkecTJ.js'; import '../chunks/vidstack-BXMqlVv4.js'; import '../chunks/vidstack-Dihypf8P.js'; class AudioProvider extends HTMLMediaProvider { constructor(audio, ctx) { super(audio, ctx); this.$$PROVIDER_TYPE = "AUDIO"; scoped(() => { this.airPlay = new HTMLAirPlayAdapter(this.media, ctx); }, this.scope); } get type() { return "audio"; } setup() { super.setup(); if (this.type === "audio") this._ctx.delegate._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 };