feat: release v0.0.1
This commit is contained in:
43
dist/angular/index.js
vendored
Normal file
43
dist/angular/index.js
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
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
|
||||
Reference in New Issue
Block a user