feat(video): move from ts to fMP4 segments

This commit is contained in:
Gabe Kangas
2026-03-24 11:14:36 -07:00
parent 73206ddf27
commit 9c290fa0d7
22 changed files with 130 additions and 50 deletions
+4 -1
View File
@@ -18,6 +18,7 @@ type FileWriterReceiverServiceCallback interface {
SegmentWritten(localFilePath string)
VariantPlaylistWritten(localFilePath string)
MasterPlaylistWritten(localFilePath string)
InitSegmentWritten(localFilePath string)
}
// FileWriterReceiverService accepts transcoder responses via HTTP and fires the callbacks.
@@ -81,8 +82,10 @@ func (s *FileWriterReceiverService) uploadHandler(w http.ResponseWriter, r *http
func (s *FileWriterReceiverService) fileWritten(path string) {
if utils.GetRelativePathFromAbsolutePath(path) == "hls/stream.m3u8" {
s.callbacks.MasterPlaylistWritten(path)
} else if strings.HasSuffix(path, ".ts") {
} else if strings.HasSuffix(path, ".m4s") {
s.callbacks.SegmentWritten(path)
} else if strings.HasSuffix(path, "init.mp4") {
s.callbacks.InitSegmentWritten(path)
} else if strings.HasSuffix(path, ".m3u8") {
s.callbacks.VariantPlaylistWritten(path)
}