Comments (6)
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 ... )
from go-transcode.
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 to192.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.
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.
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.
from go-transcode.
Added cors: [bool]
to config.
from go-transcode.
Related Issues (20)
- 2nd+ streams lead to errors that can cause some players to not work. HOT 12
- Some freezes with static files HOT 28
- Error on probe HOT 1
- Closing ffmpeg when isn't used HOT 4
- ffprobe cache HOT 9
- Custom m3u8 for map audio HOT 5
- Usage examples HOT 29
- Problem in the first segment in ffmpeg HOT 4
- add HLS decryptor
- static file access HOT 8
- Unrecognized option 'hls_wrap' from ffmpeg HOT 3
- Ffmpeg does not force key frames as expected HOT 6
- Add hardware acceleration support for static files HOT 2
- Questions on simultaneous ffmpeg processes (NVENC job concurrency) and segment buffering behavior HOT 8
- hlsvod: add cleanup strategy
- hlsvod: add NVIDIA GPU support
- Adaptiv Bitrates HOT 6
- Dreambox (Enigma2) as live Input HOT 2
- Question: mp4 proxy HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-transcode.