mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-20 12:11:20 -08:00
feat: update artplayerPluginWebsr to support async upscale initialization
- Changed the return function to be async for handling asynchronous operations. - Updated the call to startRealtimeUpscale to await its completion, allowing for proper handling of the upscale process with the specified network size option.
This commit is contained in:
1 parent
210eb94b75
commit
14807e2633
3 files changed
+9
-5
No files matched your search
@@ -6,7 +6,7 @@ export default function artplayerPluginWebsr(
|
||||
compare: false,
|
||||
},
|
||||
) {
|
||||
return (art) => {
|
||||
return async (art) => {
|
||||
const { $video, $player } = art.template;
|
||||
|
||||
const $canvas = document.createElement("canvas");
|
||||
@@ -21,7 +21,11 @@ export default function artplayerPluginWebsr(
|
||||
|
||||
const upscaler = new Upscaler(option);
|
||||
upscaler.init();
|
||||
upscaler.startRealtimeUpscale($video, $canvas);
|
||||
await upscaler.startRealtimeUpscale(
|
||||
$video,
|
||||
$canvas,
|
||||
option.networkSize,
|
||||
);
|
||||
|
||||
// 对比模式
|
||||
let comparePosition = 50;
|
||||
|
||||
Reference in new issue
Block a user