mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-12-11 09:27: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) {
|
static SourceMap toSourceMap(StreamManifest manifest) {
|
||||||
final m4a = manifest.audioOnly
|
var m4a = manifest.audioOnly
|
||||||
.where((audio) => audio.codec.mimeType == "audio/mp4")
|
.where((audio) => audio.codec.mimeType == "audio/mp4")
|
||||||
.sortByBitrate();
|
.sortByBitrate();
|
||||||
|
|
||||||
final weba = manifest.audioOnly
|
var weba = manifest.audioOnly
|
||||||
.where((audio) => audio.codec.mimeType == "audio/webm")
|
.where((audio) => audio.codec.mimeType == "audio/webm")
|
||||||
.sortByBitrate();
|
.sortByBitrate();
|
||||||
|
|
||||||
|
m4a = m4a.isEmpty ? weba : m4a;
|
||||||
|
weba = weba.isEmpty ? m4a : weba;
|
||||||
|
|
||||||
return SourceMap(
|
return SourceMap(
|
||||||
m4a: SourceQualityMap(
|
m4a: SourceQualityMap(
|
||||||
high: m4a.first.url.toString(),
|
high: m4a.first.url.toString(),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user