zhaohappy / libmedia

一个 TypeScript 实现的高性能媒体库,支持 WebCodecs 和 Wasm。 A high-performance media library implemented in TypeScript, support WebCodecs and Wasm.
https://zhaohappy.github.io/libmedia/product/player/player.html
GNU Lesser General Public License v3.0
136 stars 21 forks source link

--ass-border-width与ASS库冲突 #7

Closed imzlh closed 3 months ago

imzlh commented 3 months ago

这一行报错了DOMException: Failed to execute 'registerProperty' on 'CSS': The name provided has already been registered.

        window.CSS.registerProperty && (window.CSS.registerProperty({
            name: "--ass-border-width",
            syntax: "<length>",
            inherits: !0,
            initialValue: "0px"
        }),

在ASS.js库中,这一行定义了这个CSS https://github.com/weizhenye/ASS/blob/c2c0ed5a7cc7513266cc3a49b595b9f92ce406e7/src/renderer/stroke.js#L151 建议:修改--ass-border-width--libmedia-ass-border-width

imzlh commented 3 months ago

我发现了,原来libmedia调用了ASS库 抱歉(溜了)

imzlh commented 3 months ago

我的想法是将window.CSS遮蔽掉,加载完再恢复

window.CSS = {
    ..._CSS,
    registerProperty(def){
        console.debug('Register property:', def.name);
    }
};

只能祈求哪一天libmedia正式与vite交好了