mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-12-10 17:07:30 +00:00
Fix song not playing when m4a or weba is not available for that song
This commit is contained in:
parent
2b0d17e9ca
commit
412af5d9ec
@ -79,14 +79,17 @@ class YoutubeSourcedTrack extends SourcedTrack {
|
||||
}
|
||||
|
||||
static SourceMap toSourceMap(StreamManifest manifest) {
|
||||
final m4a = manifest.audioOnly
|
||||
var m4a = manifest.audioOnly
|
||||
.where((audio) => audio.codec.mimeType == "audio/mp4")
|
||||
.sortByBitrate();
|
||||
|
||||
final weba = manifest.audioOnly
|
||||
var weba = manifest.audioOnly
|
||||
.where((audio) => audio.codec.mimeType == "audio/webm")
|
||||
.sortByBitrate();
|
||||
|
||||
m4a = m4a.isEmpty ? weba : m4a;
|
||||
weba = weba.isEmpty ? m4a : weba;
|
||||
|
||||
return SourceMap(
|
||||
m4a: SourceQualityMap(
|
||||
high: m4a.first.url.toString(),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user