feat: 支持播放网络音频和加载网络歌曲封面#58
Open
SDCOM-0415 wants to merge 4 commits into
Open
Conversation
添加reqwest依赖,支持通过http/https URL加载音频资源,同时保留本地文件播放能力
扩展了封面路径的处理逻辑,区分本地文件路径和网络URL,不再对网络链接使用convertFileSrc进行转换,同时更新了多处相关的代码逻辑,包括播放列表卡片、本地音乐上下文、播放列表封面组件以及歌曲封面工具函数,新增reqwest依赖用于相关网络处理支持
Member
|
PR 标题和描述和 PR 实际变更内容不符合,PR 描述是歌单刷新与 CORS,但是实际变更是网络音频、网络封面,请更新标题和描述方便继续审查 |
apoint123
marked this pull request as draft
July 13, 2026 19:22
SDCOM-0415
marked this pull request as ready for review
July 14, 2026 09:15
Author
|
已经修改PR内容标题并修复合并冲突 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 变更背景
此前播放器核心及前端封面组件仅支持本地文件路径。本 PR 扩展了对 HTTP/HTTPS 网络资源(网络音频流及网络封面)的支持。
🛠️ 修改内容
后端 (Rust
player-core):引入了
reqwest依赖。在播放音频时,若音频路径为
http://或https://开头,则使用reqwest异步下载并读取为内存字节流进行播放;非网络链接仍按本地文件打开。前端 (TSX
player):LocalMusicContext、NowPlaylistCard、PlaylistCover及useSongCover钩子中,如果是 HTTP/HTTPS 网络封面链接则直接渲染,不再使用convertFileSrc转换。