oralodabas / google-cast-sdk

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

Cross-origin text track load denied. #186

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Host subtitle/closed caption file from a different server from the 
receiver's.
2. Load subtitle file from the receiver.

What is the expected output? What do you see instead?

I expected no errors but received this in the receiver console:
"Cross-origin text track load denied by Cross-Origin Resource Sharing policy."

Please provide any additional information below.

I used the same code from: 
https://github.com/googlecast/CastClosedCaptioning-chrome
to load the subtitle file
I have 'Access-Control-Allow-Origin "*"' for the files

Original issue reported on code.google.com by Therealw...@gmail.com on 5 Mar 2014 at 1:00

GoogleCodeExporter commented 9 years ago
are you sure that your CORS header is right?

the header needs to look like this: Access-Control-Allow-Origin: *

you are missing the colon and the * must not be quoted

Original comment by p...@zattoo.com on 5 Mar 2014 at 12:15

GoogleCodeExporter commented 9 years ago
Your CORS seems to be incorrect, please correct that.

Original comment by anad...@google.com on 6 Mar 2014 at 12:38

GoogleCodeExporter commented 9 years ago
Same thing happens for me using the CastClosedCaptioning-Sample and changed it 
to use the payload below.

RESPONSE HEADERS:
============
Hanss-MacBook-Pro-2:CastCC hanspeide$ curl -i -X GET 
http://www.corsproxy.com/v7.psapi.nrk.no/programs/mynt17008314/subtitles/tt

HTTP/1.1 200 OK
Access-Control-Allow-Headers: *
Access-Control-Allow-Methods: GET, OPTIONS
Access-Control-Allow-Origin: *
Cache-Control: max-age=60
Content-Type: application/xml; charset=utf-8
Date: Wed, 07 May 2014 22:40:41 GMT
Etag: W/"8fac26a7fd2645dd8d20e6f7c6e3785c"
Last-Modified: Wed, 07 May 2014 22:40:42 GMT
Server: Microsoft-IIS/8.0
Vary: Accept
X-Aspnet-Version: 4.0.30319
X-Nrk-Psapi-Assemblyname: Nrk.Programspiller.Backend.WebAPI
X-Nrk-Psapi-Date: 06.05.2014 12:00:03
X-Nrk-Psapi-Servername: RD00155D589B3F
X-Nrk-Psapi-Version: Pakke70, 7.1.25.1380
X-Powered-By: ASP.NET
Content-Length: 30771
Connection: keep-alive

OUTPUT FROM CHROMECAST DEBUG CONSOLE:
=============================

 [ 36.755s] [cast.receiver.IpcChannel] Received message: {"data":"{\"type\":\"ENABLE_CC\",\"trackNumber\":0}","namespace":"urn:x-cast:com.google.cast.sample.closecaption","senderId":"4:client-60883"}
 cast_receiver.js:18
 [ 36.770s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message [urn:x-cast:com.google.cast.sample.closecaption, 4:client-60883]: {"type":"ENABLE_CC","trackNumber":0}
 cast_receiver.js:18
Message [4:client-60883]: [object Object] closedcaptioningreceiver.html:118
 [ 36.784s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.sample.closecaption","senderId":"4:client-60883","data":"{\"type\":\"ENABLE_CC\",\"trackNumber\":0}"}
 cast_receiver.js:18
showTracks activeTrackIndex=0 window.tracks.length=2 
closedcaptioningreceiver.html:143
showTracks 
trackElement.src=http://www.corsproxy.com/v7.psapi.nrk.no/programs/mynt17008314/
subtitles/tt closedcaptioningreceiver.html:149
Cross-origin text track load denied by Cross-Origin Resource Sharing policy. 

Original comment by hans.petter.eide@gmail.com on 7 May 2014 at 10:44