Error loading HLS playlist in Cast Receiver

2019-08-30 07:03发布

问题:

I am using the example custom receiver from this sample GitHub project and running into an error while loading an m3u8 master playlist.

I am not able to tell what the problem is based on the error passed into onMediaError after making my load request:

code: "session_error"
description: "LOAD_FAILED"
details: null

I have created a gist of the full log output from my receiver, just replacing my domain with "mycompany.com" since the content is protected.

回答1:

I looked at your log and it looks like your hls might be returning bad headers?

I would recommend using (https://github.com/googlecast/cast-support-media-server) which I wrote to test HLS. There is a link in the readme of that project to some media (HLS, PlayReady, MPEG-DASH) - try running the sample custom receiver https://github.com/googlecast/cast-custom-receiver (I wrote that too) against the support media server using the media samples. Then take your HLS content from your server and run it in the support media server to make sure it's not something to do with your headers (CORS).

From the log output I would surmise there is an issue with the metadata your server is providing for the media.



回答2:

You need to use our Media Player Library, the Github project you had referenced does not support HLS.