Files
_hublib-web/packages/video-player/dist/angular/index.js

43 lines
1.1 KiB
JavaScript
Raw Normal View History

2026-02-27 09:50:13 +03:00
import { VideoPlayerRuntime, } from "../core";
// Angular-friendly wrapper around framework-agnostic runtime.
export class AngularVideoPlayerAdapter {
constructor() {
this.runtime = new VideoPlayerRuntime();
this.input = {};
}
async attach(container, input) {
this.input = { ...input };
const runtime = await this.runtime.init({
container,
...input,
});
return {
input: this.input,
runtime,
};
}
async update(nextInput) {
this.input = {
...this.input,
...nextInput,
};
const runtime = await this.runtime.update(nextInput);
return {
input: this.input,
runtime,
};
}
on(event, handler) {
return this.runtime.on(event, handler);
}
destroy() {
this.runtime.dispose();
}
getState() {
return {
input: this.input,
runtime: this.runtime.getState(),
};
}
}
//# sourceMappingURL=index.js.map