OdyseeTeam / player-server

Media server for Odysee
28 stars 12 forks source link

Add CORS headers to transcoded content #63

Closed tzarebczan closed 3 years ago

tzarebczan commented 3 years ago

See slack convo /

2. HTTP Headers
The M3U8 playlists and the TS segments must have proper CORS headers. These are known-good headers for the M3U8 file (with the Content-Length and associated headers of course being altered as needed):
Access-Control-Allow-Methods: GET, OPTIONS
Access-Control-Allow-Origin: *
Connection: close
Content-Length: 844
Content-Range: bytes bytes 0-843/844
Content-Type: application/vnd.apple.mpegurl
These are known-good headers for the TS files:
Access-Control-Allow-Methods: GET, OPTIONS
Access-Control-Allow-Origin: *
Connection: close
Content-Length: 3286804
Content-Range: bytes 0-3286803/3286804
Content-Type: video/mp2t

2.1. Configuring .htaccess
If you are using Apache to serve the files, add this to the .htaccess file:
<FilesMatch "\.(m3u8|ts)$">
  Header set Access-Control-Allow-Origin "*"
  Header set Access-Control-Allow-Methods "GET, OPTIONS"
</FilesMatch>
anbsky commented 3 years ago

Headers added.

tzarebczan commented 3 years ago

tested and no luck.... the m3u8 file should be: application/vnd.apple.mpegurl (or potentially x-mpegurl - that's what we use in app and , and the mentikoned here: https://stackoverflow.com/questions/40502173/chromecast-doesnt-play-hls-in-m3u8-format )

ts files are fine as is. image

Maybe that's it...we can try x-mpegurl first I guess.

anbsky commented 3 years ago

My bad, accidentally forced a content-type on all stream files. Fixed