(w http.ResponseWriter, r *http.Request)
| 298 | } |
| 299 | |
| 300 | func (conf *GlobalConfig) API_replay_ts(w http.ResponseWriter, r *http.Request) { |
| 301 | q := r.URL.Query() |
| 302 | streamPath := q.Get("streamPath") |
| 303 | if streamPath == "" { |
| 304 | streamPath = "dump/ts" |
| 305 | } |
| 306 | dumpFile := q.Get("dump") |
| 307 | if dumpFile == "" { |
| 308 | dumpFile = streamPath + ".ts" |
| 309 | } |
| 310 | f, err := os.Open(dumpFile) |
| 311 | if err != nil { |
| 312 | util.ReturnError(util.APIErrorOpen, err.Error(), w, r) |
| 313 | return |
| 314 | } |
| 315 | var pub TSPublisher |
| 316 | if err := Engine.Publish(streamPath, &pub); err != nil { |
| 317 | util.ReturnError(util.APIErrorPublish, err.Error(), w, r) |
| 318 | } else { |
| 319 | tsReader := NewTSReader(&pub) |
| 320 | pub.SetIO(f) |
| 321 | go func() { |
| 322 | tsReader.Feed(f) |
| 323 | tsReader.Close() |
| 324 | }() |
| 325 | util.ReturnOK(w, r) |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | func (conf *GlobalConfig) API_replay_mp4(w http.ResponseWriter, r *http.Request) { |
| 330 | q := r.URL.Query() |
nothing calls this directly
no test coverage detected