MCPcopy Index your code
hub / github.com/Monibuca/engine / API_replay_mp4

Method API_replay_mp4

http.go:329–352  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

327}
328
329func (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}

Callers

nothing calls this directly

Calls 7

ReadMP4DataMethod · 0.95
ReturnErrorFunction · 0.92
ReturnOKFunction · 0.92
ErrorMethod · 0.65
PublishMethod · 0.65
SetIOMethod · 0.65
GetMethod · 0.45

Tested by

no test coverage detected