diff --git a/manager.go b/manager.go index f1ca9dbe..390158ec 100644 --- a/manager.go +++ b/manager.go @@ -191,9 +191,9 @@ func (m *Manager) ServeHTTP(w http.ResponseWriter, r *http.Request, chunk string } // Stream full video - mp4Sfx := ".mp4" - if strings.HasSuffix(chunk, mp4Sfx) { - quality := strings.TrimSuffix(chunk, mp4Sfx) + movSfx := ".mov" + if strings.HasSuffix(chunk, movSfx) { + quality := strings.TrimSuffix(chunk, movSfx) if stream, ok := m.streams[quality]; ok { return stream.ServeFullVideo(w) } diff --git a/stream.go b/stream.go index 367b3967..6540fd5c 100644 --- a/stream.go +++ b/stream.go @@ -189,9 +189,9 @@ func (s *Stream) ServeFullVideo(w http.ResponseWriter) error { args = []string{"-loglevel", "warning", "-i", s.m.path, "-c", "copy"} } - // Output mp4 + // Output mov args = append(args, []string{ - "-movflags", "frag_keyframe+empty_moov+faststart", "-f", "mp4", "pipe:1", + "-movflags", "frag_keyframe+empty_moov+faststart", "-f", "mov", "pipe:1", }...) coder := exec.Command(s.c.ffmpeg, args...) @@ -217,8 +217,8 @@ func (s *Stream) ServeFullVideo(w http.ResponseWriter) error { defer cmdStdOut.Close() stdoutReader := bufio.NewReader(cmdStdOut) - // Write mp4 header - w.Header().Set("Content-Type", "video/mp4") + // Write mov headers + w.Header().Set("Content-Type", "video/quicktime") w.WriteHeader(http.StatusOK) flusher, ok := w.(http.Flusher) if !ok {