oralodabas / google-cast-sdk

Automatically exported from code.google.com/p/google-cast-sdk
0 stars 0 forks source link

CastMediaRouteProviderService ignores EXTRA_ITEM_HTTP_HEADERS #551

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Not sure if this is the right place to report this bug, but I'm assuming some 
of the same people involved with the Cast SDK are also responsible for 
Android's CastMediaRouteProviderService.

I am using RemotePlaybackClient on Android to play media on a Chromecast.

It works fine with regular urls, but not urls that require an Authentication 
header.

Bundle extras = new Bundle();
Bundle httpHeaders = new Bundle();
httpHeaders.putString("Authorization", auth);
extras.putBundle(MediaControlIntent.EXTRA_ITEM_HTTP_HEADERS, httpHeaders);

This extras bundle is then used with RemotePlaybackClient.play();

This is the request that the Chromecast makes to the http server (notice 
missing Authorization header):

GET /test.mp3 HTTP/1.1
Connection: keep-alive
User-Agent: Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like 
Gecko) Chrome/39.0.2171.51 Safari/537.36 CrKey/1.12.27946
Range: bytes=0-
Accept-Encoding: identity;q=1, *;q=0
Accept: */*
Accept-Language: en-US,en;q=0.8
CAST-DEVICE-CAPABILITIES: {"display_supported":true}

Original issue reported on code.google.com by jonljoha...@gmail.com on 1 Apr 2015 at 10:32

GoogleCodeExporter commented 9 years ago
MediaRouter with the generic player which require authorization is not 
supported at this point. Please refer to the chart here: 
https://developers.google.com/cast/docs/receiver_apps. In order to include 
authorization/authentication, you would have to implement Custom Receiver. 

You could get httpHeaders in the receiver LOAD request 
(https://developers.google.com/cast/docs/reference/receiver/cast.receiver.MediaM
anager#onLoad) and custom receiver will need to use them in xhr request to the 
server.

Original comment by na...@google.com on 2 Apr 2015 at 11:40