kim-company / kim_hls

M3U8 marshaler and unmarshaler. Playlist tracker
Apache License 2.0
2 stars 6 forks source link

Support relative path on remote URLs #8

Closed alexandremcosta closed 11 months ago

alexandremcosta commented 11 months ago

If a master playlist with HTTP urls contains relative paths, it cannot find the media playlists

22:35:45.768 [error] GenServer #PID<0.1329.0> terminating
** (MatchError) no match of right hand side value: {:error, {:no_scheme}}
    (kim_hls 0.1.0) lib/hls/playlist/media/tracker.ex:56: HLS.Playlist.Media.Tracker.read_media_playlist/2
    (kim_hls 0.1.0) lib/hls/playlist/media/tracker.ex:62: HLS.Playlist.Media.Tracker.handle_refresh/2

I'm researching the code, but if you can give me a clue on where to fix that, it would save us a lot of time.

dmorn commented 11 months ago

Hi @alexandremcosta! Could you please provide some more context? In the meanwhile:

Let me know how it goes. At some point it might be useful to make an examples directory I guess, if there is interest on the library

dmorn commented 11 months ago

I saw the linked issue on membrane_hls_plugin but I still don't understand :D could you write a failing test, show me snippet that reproduces/explains the behaviour or something like that?

alexandremcosta commented 11 months ago

Ok, I will work on a runnable example from kim_hls. But here is the m3u8 file that failed, which I tried to run with HLS.FS.HTTP.new() since it isn't on local.

alexandremcosta commented 11 months ago

Actually, my bad. I didn't understood who to use the lib correctly. build_media_uri perfectly solves my problem.