(w http.ResponseWriter, r *http.Request)
| 327 | } |
| 328 | |
| 329 | func (conf *GlobalConfig) API_replay_mp4(w http.ResponseWriter, r *http.Request) { |
| 330 | q := r.URL.Query() |
| 331 | streamPath := q.Get("streamPath") |
| 332 | if streamPath == "" { |
| 333 | streamPath = "dump/mp4" |
| 334 | } |
| 335 | dumpFile := q.Get("dump") |
| 336 | if dumpFile == "" { |
| 337 | dumpFile = streamPath + ".mp4" |
| 338 | } |
| 339 | var pub MP4Publisher |
| 340 | f, err := os.Open(dumpFile) |
| 341 | if err != nil { |
| 342 | util.ReturnError(util.APIErrorOpen, err.Error(), w, r) |
| 343 | return |
| 344 | } |
| 345 | if err := Engine.Publish(streamPath, &pub); err != nil { |
| 346 | util.ReturnError(util.APIErrorPublish, err.Error(), w, r) |
| 347 | } else { |
| 348 | pub.SetIO(f) |
| 349 | util.ReturnOK(w, r) |
| 350 | go pub.ReadMP4Data(f) |
| 351 | } |
| 352 | } |
nothing calls this directly
no test coverage detected