Git Product home page Git Product logo

Comments (6)

fherking avatar fherking commented on May 30, 2024 1

​Hello, thanks, for your answer and time, i'm gonna compile now the server with the new code you sent me and see if it works, because i don't have a reverse proxy setup at the moment...
(Yes I know its a couple of lines in apache but , I configured one once upon a time and alzhéimer is kicking in... if It doesn't work I tell you something about my setup ... )

Thanks and
cute-cat-kitten-greeting-cartoon-doodle-background-wallpaper-free-vector

from go-transcode.

m1k1o avatar m1k1o commented on May 30, 2024

Hello, CORS is missing.

It is not part of the codebae but could be added easily. Using this code.

Or you could just make sure that the oriign where you play the video is the same as the go-transcode. By using reverse proxy.

E.g:

  • point /vod/* on your reverse proxy to 192.168.10.3:44444/vod/
  • everything else to your nginx server/backend that will serve player to play the videos.

That means when you play your video on example.com/player.html it needs to request videos from /vod/* and it matches origin policy.

from go-transcode.

fherking avatar fherking commented on May 30, 2024

Ok, its working now (at least it seems) had to :

go import "github.com/go-chi/cors"
modify :
./go-transcode/internal/http/http.go
add imports to that file
"github.com/go-chi/cors"
and the code i used is where the router is created :


	router.Use(cors.Handler(cors.Options{
		AllowOriginFunc:  conf.AllowOrigin, <-deleted this line, giving me errors about conf/config object not having the function.... it seems to be working anyway.
		AllowedMethods:   []string{"GET", "POST", "DELETE", "OPTIONS"},
		AllowedHeaders:   []string{"Accept", "Authorization", "Content-Type", "X-CSRF-Token"},
		ExposedHeaders:   []string{"Link"},
		AllowCredentials: true,
		MaxAge:           300, // Maximum value not ignored by any of major browsers
	}))

I still am not able to play anything in chrome , edge , firefox and firedragon, BUT at least its not complaining about security concerns (all dev tools give ok 200 to all files) and in media player classic and vlc plays ok.

I suppose that it fails for the codec.

For the moment Im trying different js players to see if someone works with this hls file format / codec , if you know anyone that works, that would be a plus.

THANKS for your time and patience

For me this problem is closed as valid.

As always, thanks for your time and help.

from go-transcode.

m1k1o avatar m1k1o commented on May 30, 2024

I use video.js with http-streaming plugin, works most of the time for me:
https://github.com/m1k1o/go-transcode/blob/f7cf54dbf7cde826d8a8be58f18a6375ddbf6f4c/internal/api/play.html

from go-transcode.

fherking avatar fherking commented on May 30, 2024

from go-transcode.

m1k1o avatar m1k1o commented on May 30, 2024

Added cors: [bool] to config.

from go-transcode.

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.