@@ -59,6 +59,16 @@ export const usePlaySettings = (): SettingConfig => {
5959 } ,
6060 ) ;
6161 }
62+ if ( option . value === "mpv" && option . disabled ) {
63+ return h (
64+ NTooltip ,
65+ { placement : "left" , keepAliveOnHover : false } ,
66+ {
67+ trigger : ( ) => h ( "div" , { style : "cursor: not-allowed;" } , [ node ] ) ,
68+ default : ( ) => "当前环境不支持 MPV 引擎" ,
69+ } ,
70+ ) ;
71+ }
6272 return node ;
6373 } ;
6474
@@ -70,7 +80,11 @@ export const usePlaySettings = (): SettingConfig => {
7080 value : "ffmpeg" ,
7181 disabled : ! checkIsolationSupport ( ) ,
7282 } ,
73- { label : "MPV" , value : "mpv" } ,
83+ {
84+ label : "MPV" ,
85+ value : "mpv" ,
86+ disabled : ! isElectron ,
87+ } ,
7488 ] ;
7589
7690 // 当前选中的引擎值
@@ -98,7 +112,11 @@ export const usePlaySettings = (): SettingConfig => {
98112 }
99113
100114 // 如果切换到 MPV 引擎,先检查是否已安装
101- if ( targetPlaybackEngine === "mpv" && isElectron ) {
115+ if ( targetPlaybackEngine === "mpv" ) {
116+ if ( ! isElectron ) {
117+ window . $message . warning ( "当前环境不支持 MPV 引擎,已回退至默认引擎" ) ;
118+ return ;
119+ }
102120 try {
103121 const result = await window . electron . ipcRenderer . invoke ( "mpv-check-installed" ) ;
104122 if ( ! result . installed ) {
@@ -477,6 +495,7 @@ export const usePlaySettings = (): SettingConfig => {
477495 {
478496 title : "音乐解锁" ,
479497 tags : [ { text : "Beta" , type : "warning" } ] ,
498+ show : isElectron ,
480499 items : [
481500 {
482501 key : "useSongUnlock" ,
@@ -487,7 +506,6 @@ export const usePlaySettings = (): SettingConfig => {
487506 get : ( ) => settingStore . useSongUnlock ,
488507 set : ( v ) => ( settingStore . useSongUnlock = v ) ,
489508 } ) ,
490- show : isElectron ,
491509 } ,
492510 {
493511 key : "songUnlockConfig" ,
@@ -497,7 +515,6 @@ export const usePlaySettings = (): SettingConfig => {
497515 buttonLabel : "配置" ,
498516 action : openSongUnlockManager ,
499517 disabled : computed ( ( ) => ! settingStore . useSongUnlock ) ,
500- show : isElectron ,
501518 } ,
502519 ] ,
503520 } ,
0 commit comments