3

I'm using a service for live-streaming videos that provides a link (say https://example.com/video.m3u8) to the relevant file in order to cast it. Following the link manually, I go through a 302 redirect (to e.g. https://anotherdomain.com/video.m3u8), and get to the video file. When I try to cast the link (both chrome & android sender sdk's, the latter through a cordova plugin) I see an error if I use the example.com url, but succeed using the anotherdomain.com url.

I can check for redirects manually before casting, but ideally the default receiver would do that for me. Is this failing on a redirect the expected behaviour? Is there any way to configure it so that it follows redirects?

I'm not sure if the redirect being of the wrong Content-Type (text/html rather than application/x-mpegURL) could be part of the cause

iCantC
  • 2,852
  • 1
  • 19
  • 34
J Mead
  • 63
  • 5
  • Did you manage to solve your issue ? I'm having the same issue, I have a 302 redirecting to an HLS stream and I can't get it to work. ``received unexpected error: Invalid Request`` – Charly Lafon Jun 29 '21 at 13:36
  • 1
    I had to manually make a request to the relevant URL and check out the where the redirects ended, and then only pass the final link to the Chromecast, and use that final link for Chromecast [E.g. I used something like in this answer for that in JS](https://stackoverflow.com/questions/16430901/get-final-url-from-xhr-object-after-redirect) – J Mead Jun 30 '21 at 15:07
  • Even my custom cast receiver is unable to play video url having redirection. Since it is a common usecase, I hope that the cast receiver library has a configurable way to handle this redirection. Although, the docs mentioned nothing about it – iCantC Jan 28 '22 at 06:05

0 Answers0