diff --git a/package.json b/package.json index cf6245b..0f24a22 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "@xmldom/xmldom": "^0.9.10", "anime4k-webgpu": "^1.0.0", "artplayer": "^5.4.0", + "artplayer-plugin-auto-thumbnail": "^1.1.0", "artplayer-plugin-danmuku": "^5.2.0", "better-sqlite3": "^12.6.2", "bs58": "^6.0.0", diff --git a/src/app/play/page.tsx b/src/app/play/page.tsx index 5740680..a3588da 100644 --- a/src/app/play/page.tsx +++ b/src/app/play/page.tsx @@ -6142,15 +6142,17 @@ function PlayPageClient() { } // 动态导入播放器库 - const [ArtplayerModule, HlsModule, DanmukuPlugin] = await Promise.all([ + const [ArtplayerModule, HlsModule, DanmukuPlugin, AutoThumbnailPlugin] = await Promise.all([ import('artplayer'), import('hls.js'), import('artplayer-plugin-danmuku'), + import('artplayer-plugin-auto-thumbnail'), ]); const Artplayer = ArtplayerModule.default; const Hls = HlsModule.default; const artplayerPluginDanmuku = DanmukuPlugin.default as any; + const artplayerPluginAutoThumbnail = AutoThumbnailPlugin.default as any; const playerTimeouts = new Set(); const clearTrackedTimeout = (timeoutId: number | null) => { if (timeoutId == null) { @@ -6563,8 +6565,13 @@ function PlayPageClient() { }); }, }, - // 弹幕插件 plugins: [ + artplayerPluginAutoThumbnail({ + url: videoUrl, + width: 160, + number: 100, + scale: 1, + }), artplayerPluginDanmuku({ danmuku: [], speed: danmakuSettingsRef.current.speed,