尝试修复换集报错
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
## [203.2.1] - 2025-12-20
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- 修复IOS端换集报错播放器初始化失败
|
||||||
|
|
||||||
## [203.2.0] - 2025-12-19
|
## [203.2.0] - 2025-12-19
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
203.2.0
|
203.2.1
|
||||||
+18
-1
@@ -1067,7 +1067,7 @@ function PlayPageClient() {
|
|||||||
// 获取当前弹幕设置的快照,避免循环引用
|
// 获取当前弹幕设置的快照,避免循环引用
|
||||||
const currentDanmakuSettings = danmakuSettingsRef.current;
|
const currentDanmakuSettings = danmakuSettingsRef.current;
|
||||||
const danmakuPluginOption = danmakuPluginRef.current.option;
|
const danmakuPluginOption = danmakuPluginRef.current.option;
|
||||||
|
|
||||||
const currentSettings = {
|
const currentSettings = {
|
||||||
...currentDanmakuSettings,
|
...currentDanmakuSettings,
|
||||||
opacity: danmakuPluginOption.opacity || currentDanmakuSettings.opacity,
|
opacity: danmakuPluginOption.opacity || currentDanmakuSettings.opacity,
|
||||||
@@ -1093,10 +1093,19 @@ function PlayPageClient() {
|
|||||||
artPlayerRef.current.destroy();
|
artPlayerRef.current.destroy();
|
||||||
artPlayerRef.current = null;
|
artPlayerRef.current = null;
|
||||||
|
|
||||||
|
// 清空 DOM 容器,确保没有残留元素
|
||||||
|
if (artRef.current) {
|
||||||
|
artRef.current.innerHTML = '';
|
||||||
|
}
|
||||||
|
|
||||||
console.log('播放器资源已清理');
|
console.log('播放器资源已清理');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn('清理播放器资源时出错:', err);
|
console.warn('清理播放器资源时出错:', err);
|
||||||
artPlayerRef.current = null;
|
artPlayerRef.current = null;
|
||||||
|
// 即使出错也要清空容器
|
||||||
|
if (artRef.current) {
|
||||||
|
artRef.current.innerHTML = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -2920,6 +2929,14 @@ function PlayPageClient() {
|
|||||||
// 异步初始化播放器
|
// 异步初始化播放器
|
||||||
const initPlayer = async () => {
|
const initPlayer = async () => {
|
||||||
try {
|
try {
|
||||||
|
// iOS需要等待DOM完全清理
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 100));
|
||||||
|
|
||||||
|
// 再次确保容器为空
|
||||||
|
if (artRef.current) {
|
||||||
|
artRef.current.innerHTML = '';
|
||||||
|
}
|
||||||
|
|
||||||
// 动态导入播放器库
|
// 动态导入播放器库
|
||||||
const [ArtplayerModule, HlsModule, DanmukuPlugin] = await Promise.all([
|
const [ArtplayerModule, HlsModule, DanmukuPlugin] = await Promise.all([
|
||||||
import('artplayer'),
|
import('artplayer'),
|
||||||
|
|||||||
@@ -11,6 +11,16 @@ export interface ChangelogEntry {
|
|||||||
|
|
||||||
export const changelog: ChangelogEntry[] = [
|
export const changelog: ChangelogEntry[] = [
|
||||||
{
|
{
|
||||||
|
version: '203.2.1',
|
||||||
|
date: '2025-12-20',
|
||||||
|
added: [
|
||||||
|
],
|
||||||
|
changed: [
|
||||||
|
],
|
||||||
|
fixed: [
|
||||||
|
"修复IOS端换集报错播放器初始化失败"
|
||||||
|
]
|
||||||
|
},{
|
||||||
version: '203.2.0',
|
version: '203.2.0',
|
||||||
date: '2025-12-19',
|
date: '2025-12-19',
|
||||||
added: [
|
added: [
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
|
|
||||||
const CURRENT_VERSION = '203.2.0';
|
const CURRENT_VERSION = '203.2.1';
|
||||||
|
|
||||||
// 导出当前版本号供其他地方使用
|
// 导出当前版本号供其他地方使用
|
||||||
export { CURRENT_VERSION };
|
export { CURRENT_VERSION };
|
||||||
|
|||||||
Reference in New Issue
Block a user