简体   繁体   中英

Custom Receiver and Cookies from Akamai

I'm experiencing problem with HLS from Akamai. I'm using HLS from Akamai with tokens, in order to start stream, Cookies should be set after master m3u8 playlist response.

Response from Akamai:

Access-Control-Allow-Credentials:true
Access-Control-Allow-Origin:*
Access-Control-Expose-Headers:Content-Type
Cache-Control:max-age=0, no-cache, no-store
Connection:keep-alive
Content-Length:818
Content-Type:application/vnd.apple.mpegurl
Date:Wed, 17 Sep 2014 12:15:54 GMT
Expires:Wed, 17 Sep 2014 12:15:54 GMT
Mime-Version:1.0
Pragma:no-cache
Server:AkamaiGHost
Set-Cookie:_alid_=/cropped/
Set-Cookie:hdntl=/cropped/

I'm rewriting Host.updateManifestRequestInfo in both scenarios there is a dead end.

If you use requestInfo.withCredentials = true; , response will be:

XMLHttpRequest cannot load /*MEDIA_URL*/. A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. Origin '/*PLAYERS_HOST*/' is therefore not allowed access. 

With requestInfo.withCredentials = false; will be 403 response.

What is correct way in implementation of Custom Player for HLS from Akamai with tokens?

I know it is a very old post, but in case somebody gets the same problem in the future: If you set withCredentials to true, then the Akamai response has to explicitly authorise your ChromeCast receiver through their CORS header.

Please ask Akamai to add the domain of your receiver to their CORS and the issue will be resolved. Please have a look at this page for more info: https://developers.google.com/cast/docs/player .

您需要编写一个自定义接收器(使用MPL),并使用主机重写updateManifestRequestInfo / updateSegmentRequestInfo以实现所需的行为。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM