服务器我用的srs,不过没找到跨域的配置,而flv.js需要播放跨域的flv直播视频流,不知大家都用的什么技术
使用nginx 反向代理 来添加允许跨域的头信息
两边端口不能冲突
location ^~ /live/ {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET';
proxy_pass http://127.0.0.1:8502/live/;
}
https://github.com/gwuhaolin/...
https://github.com/gwuhaolin/...
livego
live streaming server write in pure go, simple efficient and can run in any platform.
Support
Transport protocol
[x] RTMP
[x] AMF
[x] HLS
[x] HTTP-FLV
File container
[x] FLV
[x] TS
AV coder
[x] H264
[x] AAC
[x] MP3
Install
Download Bin
releases
Docker
TODO
Install System Service
TODO
Build From Source code
run
git clone https://github.com/gwuhaolin/livego.git
cd to livego dir then run
go build
Use
run
livego
to start livego serverpush
RTMP
stream tortmp://localhost:1935/live/movie
, eg useffmpeg -re -i demo.flv -c copy -f flv rtmp://localhost:1935/live/movie
play live stream form:
RTMP
:rtmp://localhost:1935/live/movie
FLV
:http://127.0.0.1:7001/live/movie.flv
HLS
:http://127.0.0.1:7002/live/movie.m3u8