实现hls按需拉流

This commit is contained in:
xiongziliang
2019-12-29 11:52:02 +08:00
parent 54736859d4
commit 4b4c4e0cec
10 changed files with 69 additions and 56 deletions

View File

@@ -834,7 +834,7 @@ void installWebApi() {
<< allArgs["stream"] << "?vhost="
<< allArgs["vhost"];
addFFmpegSource("http://live.hkstv.hk.lxdns.com/live/hks2/playlist.m3u8",/** ffmpeg拉流支持任意编码格式任意协议 **/
addFFmpegSource("http://hls-ott-zhibo.wasu.tv/live/272/index.m3u8",/** ffmpeg拉流支持任意编码格式任意协议 **/
dst_url,
(1000 * timeout_sec) - 500,
[invoker,val,headerOut](const SockException &ex,const string &key){

View File

@@ -441,7 +441,7 @@ void installWebHook(){
//如果没有url参数客户端又不支持cookie那么会根据ip和端口追踪用户
//追踪用户的目的是为了缓存上次鉴权结果,减少鉴权次数,提高性能
NoticeCenter::Instance().addListener(nullptr,Broadcast::kBroadcastHttpAccess,[](BroadcastHttpAccessArgs){
if(sender.get_peer_ip() == "127.0.0.1" && args._param_strs == hook_adminparams){
if(sender.get_peer_ip() == "127.0.0.1" && parser.Params() == hook_adminparams){
//如果是本机或超级管理员访问那么不做访问鉴权权限有效期1个小时
invoker("","",60 * 60);
return;