BlackHole
BlackHole copied to clipboard
iOS Youtube playback issue
Hi, i've noticed that only on iOS, in the youtube section sometimes the playback isn't working. Steps to reproduce: 1.Get latest version of blackhole 2.Run blackhole iOS app 3.Go to youtube section 4.Search for a song 5.Play each song in the results 6.Sometimes a song opens but doesn't play, it's stuck at 0:00 with no obvious error message
Has anyone encountered this ?
I've found the issue. The problem occurs when the mime type in the url is webm, apparently audio_service or just_audio miss a codec on ios side or something of this sort. Any ideas on how to get only mp4 urls from youtube?
You can filter out the urls. Each youtube video data contains a container
type and codec
type info. You can use them to check if it's m4a or webm.
Sorry I did not express myself correctly, i've figured out a way to filter out webm urls but i'm wondering if there's a way to get an mp4 alternative url from a webm url. Thanks for the reply!
Every video has both m4a and webm URLs, and they are all available when you access the audio stream of those videos. I guess blackhole takes the top and lowest quality URLs from them. As for m4a and webm I think it prefers m4a, and if m4a isn't available, then it takes webm URLs. Or maybe it just checks bitrate; not sure I forgot; I will have to check the code.
Oooooh, great!!! Thanks! I'll look it up, if i manage to fix it i can do a pull request so that everyone will have the fix.
Sure, the code will most probably in youtube_services.dart file. You can look it up in that where it extracts those audio links.