feat: 优化视频插件
This commit is contained in:
1 parent
8d738ef3f9
commit
5173b28ec5
6 files changed
+122
-28
No files matched your search
@@ -0,0 +1,36 @@
|
||||
import { App, Component, createApp } from "vue";
|
||||
import { BasePlugin } from "xgplayer";
|
||||
import fakeApp from "./fakeRoot.vue";
|
||||
|
||||
const useXGPlayerVueFrame = (App: Component) => {
|
||||
return class XGPlayerVueFrame extends BasePlugin {
|
||||
static get pluginName() {
|
||||
return "xgplayerVueFrame";
|
||||
}
|
||||
|
||||
private root: HTMLDivElement | null = null;
|
||||
private app: App<Element> | null = null;
|
||||
|
||||
constructor(args: any) {
|
||||
super(args);
|
||||
}
|
||||
|
||||
afterCreate() {
|
||||
console.log({fakeApp})
|
||||
this.createVueFrame();
|
||||
}
|
||||
|
||||
private createVueFrame() {
|
||||
this.root = document.createElement("div");
|
||||
this.app = createApp(fakeApp, { player: this.player, root: this.root, App })
|
||||
this.app.mount(this.root);
|
||||
// this.app.mount(this.player.root);
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this.app?.unmount()
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export default useXGPlayerVueFrame;
|
||||
Reference in new issue
Block a user