GithubHelp home page GithubHelp logo

ffplayout built-in player has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource about ffplayout HOT 5 CLOSED

JunioCalu avatar JunioCalu commented on June 2, 2024
ffplayout built-in player has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource

from ffplayout.

Comments (5)

jb-alvarado avatar jb-alvarado commented on June 2, 2024

Let's discuss this in the other issue.

from ffplayout.

JunioCalu avatar JunioCalu commented on June 2, 2024

If I change the player_url value from "http://10.145.123.117:8787/live/stream.m3u8 " to http://bntv.space:8787/live/stream.m3u8, the problem is solved. The real problem is that without setting the Access-Control-Allow-Origin header, the browser cannot recognize that 10.145.123.117 and bntv.space is the same host with different "names", so the browser expects that the view stream source address must be the same address that loaded the ffplayout-frontend page to avoid "security" problem.

However there is a network performance issue with this approach, the preview stream will have to be externally routed over the internet before reaching my server, i.e. the preview stream would have to go through an external protocol stack and this results in in delays and dependency on internet connection. I think creating an internal virtual host in /etc/hosts to associate bntv.site with 127.0.0.1 should theoretically solve the problem more efficiently.

from ffplayout.

JunioCalu avatar JunioCalu commented on June 2, 2024

Implementation screen template suggestion for ffplayout's CORS policy.

Screenshot_20230726_124915

from ffplayout.

jb-alvarado avatar jb-alvarado commented on June 2, 2024

Sorry @JunioCalu, I will not integrate this, because to me this is more a workaround then a real solution. I don't think there is any way to dynamically update a cors setting from ffpapi. And when it goes to production and people wants to use a proxy (which is still the recommend way), it can leads to confusion and multiple cors settings on different places.

When you use ffplayout only locally, you can use IP or DNS from your local network. When you use ffplayout public setup a proxy for ssl termination and serving of hls playlists. I don't see any need mixing IP and DNS, but if you need it, use a proxy and setup there your cors rule.

from ffplayout.

JunioCalu avatar JunioCalu commented on June 2, 2024

Good decision. I think maybe it would be useful when the IP of a server has more than one domain name. The example screen was implemented by datarhei/restreamer, in this case they implemented another menu to identify multiple domain names for the same server.

And by the way ffplayout and datarhei/restreamer make a good combination.

from ffplayout.

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.