From ef04c1fd867f23afba58df270e2f98158af950c1 Mon Sep 17 00:00:00 2001 From: Tom Funken Date: Fri, 22 Sep 2023 02:58:02 +0200 Subject: [PATCH] Renamed rewriteRemotePlaylist (#3313) * Add support for remote serving endpoint on local storage * Renamed rewriteRemotePlaylist --- core/storageproviders/local.go | 2 ++ core/storageproviders/rewriteLocalPlaylist.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/storageproviders/local.go b/core/storageproviders/local.go index 31d517a46..9f4406b16 100644 --- a/core/storageproviders/local.go +++ b/core/storageproviders/local.go @@ -16,6 +16,7 @@ import ( // LocalStorage represents an instance of the local storage provider for HLS video. type LocalStorage struct { streamID string + host string } // NewLocalStorage returns a new LocalStorage instance. @@ -30,6 +31,7 @@ func (s *LocalStorage) SetStreamId(streamID string) { // Setup configures this storage provider. func (s *LocalStorage) Setup() error { + s.host = data.GetVideoServingEndpoint() return nil } diff --git a/core/storageproviders/rewriteLocalPlaylist.go b/core/storageproviders/rewriteLocalPlaylist.go index 76ad57c44..c94c1f42a 100644 --- a/core/storageproviders/rewriteLocalPlaylist.go +++ b/core/storageproviders/rewriteLocalPlaylist.go @@ -12,8 +12,8 @@ import ( log "github.com/sirupsen/logrus" ) -// rewriteRemotePlaylist will take a local playlist and rewrite it to have absolute URLs to remote locations. -func rewriteRemotePlaylist(localFilePath, remoteServingEndpoint, pathPrefix string) error { +// rewritePlaylistLocations will take a local playlist and rewrite it to have absolute URLs to a specified location. +func rewritePlaylistLocations(localFilePath, remoteServingEndpoint, pathPrefix string) error { f, err := os.Open(localFilePath) // nolint if err != nil { log.Fatalln(err)