Stremio / stremio-addon-sdk

🧙 A Node.js SDK for creating and publishing Stremio add-ons
https://www.stremio.com/addon-sdk
MIT License
605 stars 158 forks source link

HLS m3u8 playing fine in desktop and web app but not in android and android tv #261

Closed lpuglia closed 3 months ago

lpuglia commented 4 months ago

i have built my own addon but there seems to be a problem with m3u8 videos. In particular it seems that the desktop app and the web app are able to play HLS files without problem, here is an example:

https://mediapolisvod.rai.it/relinker/relinkerServlet.htm?cont=ssSlashzkaOXKoi7fFvXustUpRBAeeqqEEqualeeqqEEqual

This links play fine on desktop app and web app but not in the tv app. There is no reason for not supporting HLS streams, exoplayer on android TV is able to play them using the correct MediaSource class

rleroi commented 4 months ago

I don't think this is an issue in the Addon SDK

lpuglia commented 4 months ago

i would have gladly opened an issue in the repository for the android TV app if it was opensourced.

mhdzumair commented 4 months ago

I don't think the android app has limitation on playing the HLS m3u8 in android. It's working for me with my add-on. In your case, I think it might be a problem in the Media/ Media URL.

Additionally, I found a bug in android client when the media URL contain unsupported characters. As I tested its only affected in android client. https://github.com/Stremio/stremio-bugs/issues/665

lpuglia commented 4 months ago

@mhdzumair i do have m3u8 streams that works as well, but they are not HLS, the link is correct as it can be open easily using mpv external video player. Can you share an example HLS stream that works for you?

mhdzumair commented 4 months ago

Sorry I only tested HLS m3u8, not other HLS types.

lpuglia commented 4 months ago

m3u8 is just the extension of the manifest, not all the m3u8 streams are HLS encrypted, any chance that the m3u8 you are claiming to work is, in fact, not HLS?

mhdzumair commented 4 months ago

Im not sure about it. You can try to check the streams from mhdtvplay where i scraped and showing in MediaFusion.

lpuglia commented 3 months ago

so, the URL i posted is a redirect to the actual m3u8 file.

It looks like that Exoplayer is able to play the redirect through the class HlsMediaSource (which made me think that my streams were encrypted).

It also looks like that Stremio is using DefaultMediaSource instead (this is just my hyphotesis).

This last class is only able to play m3u8 manifest URLs. A workaround is to provide the manifest URL directly to stremio, i.e. check the redirect response and get the actual manifest URL.

I'm gonna close this but I wouldn't mind a comment from the developers.