Code Monkey home page Code Monkey logo

Comments (10)

tomjohnson916 avatar tomjohnson916 commented on August 24, 2024

@dmlap - CORS?

from videojs-contrib-hls.

jsanford-bc avatar jsanford-bc commented on August 24, 2024

CORS should be enabled on that entire bucket.

The stream plays correctly in Safari using the same player configuration that fails in Chrome

from videojs-contrib-hls.

tomjohnson916 avatar tomjohnson916 commented on August 24, 2024

@jsanford-bc - CORS does not appear to be setup. This can be confirmed by curl -XGET - i http://bc-jsanford.s3.amazonaws.com/instant_play_demo/1402004163/index.m3u8

That returns the following headers;

HTTP/1.1 200 OK
x-amz-id-2: 14I9fiMW8q5lNkQxeS4XqdgOsDB07ozR0wX991IX5fuRAiTzzVIq7donicxfHeRV
x-amz-request-id: BE97BF8D7B9D88F7
Date: Thu, 05 Jun 2014 21:56:56 GMT
Last-Modified: Thu, 05 Jun 2014 21:36:36 GMT
ETag: "d9e7529f7643820ac9e6134804ccfd08"
Accept-Ranges: bytes
Content-Type: application/vnd.apple.mpegurl
Content-Length: 272
Server: AmazonS3

What you should see in addition are the headers for;

Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: X-Requested-With
Access-Control-Allow-Origin: *

from videojs-contrib-hls.

tomjohnson916 avatar tomjohnson916 commented on August 24, 2024

@jsanford-bc - for a positive path example try the following. I know solutions.brightcove.com does have CORS;

curl -XGET -i http://solutions.brightcove.com/jwhisenant/hls/brightcove/fishtank/16x9-fishtank-master.m3u8

Also, just an FYI as to why Safari plays it but Chrome does not; HLS is natively supported in Safari so the player is not using the XHR requests of this plugin and therefore does not require CORS.

from videojs-contrib-hls.

jsanford-bc avatar jsanford-bc commented on August 24, 2024

@seniorflexdeveloper - As I understand S3 CORS, those headers are only returned if there is an Origin header in the request. For example, see the below CURL call. Is there a way to force S3 to return those headers all the time? I couldn't find it online, but I definitely could be mistaken.

jsanford$ curl --header "Origin: google.com" -XGET -i http://bc-jsanford.s3.amazonaws.com/instant_play_demo/1402004163/index.m3u8
HTTP/1.1 200 OK
x-amz-id-2: 5QLGmDW6cWl+VK5hOHDcg9517FogTzu4v71r4TGsKfKsNFvq8lU9khkT7q2/yh2a
x-amz-request-id: 65AA97EA1C115F91
Date: Thu, 05 Jun 2014 22:37:23 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET
Vary: Origin, Access-Control-Request-Headers, Access-Control-Request-Method
Last-Modified: Thu, 05 Jun 2014 21:36:36 GMT
ETag: "d9e7529f7643820ac9e6134804ccfd08"
Accept-Ranges: bytes
Content-Type: application/vnd.apple.mpegurl
Content-Length: 272
Server: AmazonS3

from videojs-contrib-hls.

tomjohnson916 avatar tomjohnson916 commented on August 24, 2024

I'm not the right resource for S3 configurations unfortunately. That being said, I'm confident that is the root of your playback issue.

from videojs-contrib-hls.

jsanford-bc avatar jsanford-bc commented on August 24, 2024

Hey Tom - I tried this through a CDN, which always returns the headers for CORS. The new URL is http://bcjsanford.com.global.prod.fastly.net/instant_play_demo/1402013949/index.m3u8

I still can't get this to work with the HLS player. I am trying to load the manifest in dynamically through the player.src method, but I always get the following errors in the console:

Uncaught TypeError: Cannot read property 'currentTime' of null -- video.js:105
Uncaught TypeError: Cannot read property 'vdata1402014589192' of null -- video.js:12

from videojs-contrib-hls.

tomjohnson916 avatar tomjohnson916 commented on August 24, 2024

Hey Justin - I am going to take a look at this and see what I can find. I do a curl on that new URL and get the required headers.

from videojs-contrib-hls.

dmlap avatar dmlap commented on August 24, 2024

We've made a lot of changes since this bug was filed. I think it needs a re-test so I removed the "confirmed" label.

from videojs-contrib-hls.

dmlap avatar dmlap commented on August 24, 2024

Just checked and the master M3U8 is missing Allow-Origin headers. Closing since this is quite old.

from videojs-contrib-hls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.