mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-07-28 01:17:30 +08:00
fix(player): 系统媒体控件(SMTC)封面尺寸上限提升至 1024
artwork 增加 1024x1024 档位并改用 getImgUrl 生成 URL,正确处理 data:/local:// 封面与已带参数的图片地址,提升 AMLL 等 SMTC 监听端的封面清晰度。 Closes #595
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import type { AudioOutputDevice } from '@/types/audio';
|
import type { AudioOutputDevice } from '@/types/audio';
|
||||||
import type { SongResult } from '@/types/music';
|
import type { SongResult } from '@/types/music';
|
||||||
import { isElectron } from '@/utils';
|
import { getImgUrl, isElectron } from '@/utils';
|
||||||
|
|
||||||
class AudioService {
|
class AudioService {
|
||||||
private audio: HTMLAudioElement;
|
private audio: HTMLAudioElement;
|
||||||
@@ -145,8 +145,10 @@ class AudioService {
|
|||||||
? track.ar.map((a) => a.name)
|
? track.ar.map((a) => a.name)
|
||||||
: track.song.artists?.map((a) => a.name);
|
: track.song.artists?.map((a) => a.name);
|
||||||
const album = track.al ? track.al.name : track.song.album.name;
|
const album = track.al ? track.al.name : track.song.album.name;
|
||||||
const artwork = ['96', '128', '192', '256', '384', '512'].map((size) => ({
|
// 上限提到 1024 提升 SMTC/AMLL 等系统媒体控件的封面清晰度(#595);
|
||||||
src: `${track.picUrl}?param=${size}y${size}`,
|
// 走 getImgUrl 以正确处理 data:/local:// 封面与已带参数的 URL
|
||||||
|
const artwork = ['96', '128', '192', '256', '384', '512', '1024'].map((size) => ({
|
||||||
|
src: getImgUrl(track.picUrl, `${size}y${size}`),
|
||||||
type: 'image/jpg',
|
type: 'image/jpg',
|
||||||
sizes: `${size}x${size}`
|
sizes: `${size}x${size}`
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user