|
|
@@ -1038,9 +1038,8 @@ export struct LocalMusic {
|
|
|
console.info(`onecold device descriptor size : ${deviceChanged.deviceDescriptors.length}`);
|
|
|
console.info(`onecold device change descriptor : ${deviceChanged.deviceDescriptors[0].deviceRole}`); // 设备角色。
|
|
|
console.info(`onecold device change descriptor : ${deviceChanged.deviceDescriptors[0].deviceType}`);
|
|
|
- if(deviceChanged.type==1&&
|
|
|
- (deviceChanged.deviceDescriptors[0].deviceType== 7||
|
|
|
- deviceChanged.deviceDescriptors[0].deviceType==8)){
|
|
|
+ if(deviceChanged.type==1&&deviceChanged.deviceDescriptors[0].deviceRole==2&&
|
|
|
+ (deviceChanged.deviceDescriptors[0].deviceType==8)){
|
|
|
console.info('heanup onecold 蓝牙音响断开, 暂停播放')
|
|
|
this.pause();
|
|
|
}
|
|
|
@@ -5825,7 +5824,7 @@ export struct LocalMusic {
|
|
|
preview: MenuPreviewMode.IMAGE,
|
|
|
previewAnimationOptions: { scale: [0.8, 1.0] },
|
|
|
})
|
|
|
- .transition(TransitionEffect.asymmetric(TransitionEffect.scale({ x: 0.8, y: 0.8 }).animation({ duration: 500 }),
|
|
|
+ .transition(TransitionEffect.asymmetric(TransitionEffect.scale({ x: 0.9, y: 0.9 }).animation({ duration: 300 }),
|
|
|
TransitionEffect.scale({ x: 0, y: 0 })))
|
|
|
.clickEffect({ level: ClickEffectLevel.LIGHT })
|
|
|
.scale({ x: this.scaleItem === index ? 1.02 : 1, y: this.scaleItem === index ? 1.02 : 1 })
|
|
|
@@ -14045,9 +14044,16 @@ export struct LocalMusic {
|
|
|
if (!!this.mContext) {
|
|
|
this.mIjkMediaPlayer.setContext(this.mContext, 'xcomponentId');
|
|
|
}
|
|
|
- if (this.CONTROL_PlayStatus == PlayStatus.INIT) {
|
|
|
+
|
|
|
+ // 每次播放前都先 reset,防止快速切换歌曲时崩溃
|
|
|
+ // 修复 SIGSEGV 崩溃:确保播放器在设置新数据源前完全停止并释放资源
|
|
|
+ try {
|
|
|
this.mIjkMediaPlayer.reset();
|
|
|
+ Logger.info(TAG, 'IjkPlayer reset 成功');
|
|
|
+ } catch (error) {
|
|
|
+ Logger.error(TAG, `IjkPlayer reset 失败: ${(error as Error).message}`);
|
|
|
}
|
|
|
+
|
|
|
this.CONTROL_PlayStatus = PlayStatus.PLAY;
|
|
|
//设置debug模式(用于EQ日志采集)
|
|
|
this.mIjkMediaPlayer.setDebug(true);
|