@ktt45678/vidstack
Version:
UI component library for building high-quality, accessible video and audio experiences on the web.
60 lines (55 loc) • 1.46 kB
JavaScript
import '../chunks/vidstack-DgZku5BZ.js';
import '@floating-ui/dom';
import '../chunks/vidstack-41uXLVgN.js';
import '../chunks/vidstack-Dv-j8Hw0.js';
import '../chunks/vidstack-DPeH8lGJ.js';
import '../chunks/vidstack-BI9udY6A.js';
import 'media-captions';
class VidstackPlayerLayout {
constructor(props) {
this.props = props;
this.name = "vidstack";
}
async load() {
await import('../define/vidstack-player-default-layout.js');
await import('../define/vidstack-player-ui.js');
}
create() {
const layouts = [
document.createElement("media-audio-layout"),
document.createElement("media-video-layout")
];
if (this.props) {
for (const [prop, value] of Object.entries(this.props)) {
for (const el of layouts) el[prop] = value;
}
}
return layouts;
}
}
class PlyrLayout {
constructor(props) {
this.props = props;
this.name = "plyr";
}
async load() {
await import('../define/plyr-layout.js');
}
create() {
const layout = document.createElement("media-plyr-layout");
if (this.props) {
for (const [prop, value] of Object.entries(this.props)) {
layout[prop] = value;
}
}
return [layout];
}
}
class VidstackPlayer {
static async create({ target, layout, tracks, ...props }) {
{
throw Error("[vidstack] can not create player on server.");
}
}
}
export { PlyrLayout, VidstackPlayer, VidstackPlayerLayout };