refactor: Update video element resizing logic in Artplayer and artplayer-proxy-webav

This commit is contained in:
Harvey Zack committed 2024-08-22 18:29:23 +08:00
1 parent 84986d384a
commit 6f6d49bbae
7 files changed
+16 -11

No files matched your search

@@ -495,6 +495,7 @@ export default class Danmuku {
// 获取准备好发送的弹幕,可能包含ready和wait状态的弹幕
const readys = this.readys;
for (let index = 0; index < readys.length; index++) {
const danmu = readys[index];
@@ -1,5 +1,8 @@
export default function artplayerProxyLibmedia(option) {
export default function artplayerProxyLibmedia(opt = {}) {
return (art) => {
const { option, constructor } = art;
const { createElement, def } = constructor.utils;
return document.createElement('video');
};
}
@@ -7,8 +7,6 @@ type Option = {
//
};
type Result = {
name: 'artplayerProxyLibmedia';
};
type Result = HTMLCanvasElement;
declare const artplayerProxyLibmedia: (option: Option) => (art: Artplayer) => Result;
+2 -2
View File
@@ -1,6 +1,6 @@
import { MP4Clip, Combinator } from '@webav/av-cliper';
export default function artplayerProxyWebAV() {
export default function artplayerProxyWebAV(opt = {}) {
return (art) => {
const { option, constructor } = art;
const { createElement, def } = constructor.utils;
@@ -201,7 +201,7 @@ export default function artplayerProxyWebAV() {
throw new Error('No response body');
}
clip = new MP4Clip(response.body);
clip = new MP4Clip(response.body, opt);
} catch (error) {
art.emit('video:error', error);
throw error;