1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

fix #274: http-callback support on_dvr when reap a dvr file. 2.0.89

This commit is contained in:
winlin 2015-01-03 15:33:23 +08:00
parent dd2c7e0b4d
commit dc11418c79
12 changed files with 207 additions and 7 deletions

View file

@ -296,6 +296,11 @@ vhost dvr.srs.com {
# 3. off, disable the time jitter algorithm, like atc.
# default: full
time_jitter full;
# on_dvr
# for the dvr http callback, @see http_hooks.on_dvr of vhost hooks.callback.srs.com
# @read https://github.com/winlinvip/simple-rtmp-server/wiki/v2_CN_DVR#http-callback
# @read https://github.com/winlinvip/simple-rtmp-server/wiki/v2_EN_DVR#http-callback
}
}
@ -338,7 +343,7 @@ vhost ingest.srs.com {
}
}
# vhost for http
# vhost for http server config in each vhost.
vhost http.srs.com {
# http vhost specified config
http {
@ -490,6 +495,20 @@ vhost hooks.callback.srs.com {
# support multiple api hooks, format:
# on_stop http://xxx/api0 http://xxx/api1 http://xxx/apiN
on_stop http://127.0.0.1:8085/api/v1/sessions http://localhost:8085/api/v1/sessions;
# when srs reap a dvr file, call the hook,
# the request in the POST data string is a object encode by json:
# {
# "action": "on_dvr",
# "client_id": 1985,
# "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live",
# "stream": "livestream",
# "cwd": "/usr/local/srs",
# "file": "./objs/nginx/html/live/livestream.1420254068776.flv"
# }
# if valid, the hook must return HTTP code 200(Stauts OK) and response
# an int value specifies the error code(0 corresponding to success):
# 0
on_dvr http://127.0.0.1:8085/api/v1/dvrs http://localhost:8085/api/v1/dvrs;
}
}