mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 06:31:20 -08:00
refactor: Update video element in Artplayer to support custom canvas or video
This commit is contained in:
1 parent
66010cb376
commit
7fa69a7de8
6 files changed
+22
-25
No files matched your search
@@ -124,10 +124,15 @@ export default class Template {
|
||||
this.$infoClose = this.query('.art-info-close');
|
||||
this.$contextmenu = this.query('.art-contextmenus');
|
||||
|
||||
if (option.video) {
|
||||
replaceElement(option.video, this.$video);
|
||||
addClass(option.video, 'art-video');
|
||||
this.$video = option.video;
|
||||
if (option.proxy) {
|
||||
const video = option.proxy.call(this.art, this.art);
|
||||
errorHandle(
|
||||
video instanceof HTMLVideoElement || video instanceof HTMLCanvasElement,
|
||||
`Function 'option.proxy' needs to return 'HTMLVideoElement' or 'HTMLCanvasElement'`,
|
||||
);
|
||||
replaceElement(video, this.$video);
|
||||
video.className = 'art-video';
|
||||
this.$video = video;
|
||||
}
|
||||
|
||||
if (option.backdrop) {
|
||||
|
||||
Reference in new issue
Block a user