Renamed rewriteRemotePlaylist (#3313)

* Add support for remote serving endpoint on local storage

* Renamed rewriteRemotePlaylist
This commit is contained in:
Tom Funken 2023-09-22 02:58:02 +02:00 committed by Gabe Kangas
parent e4a7a337a3
commit ef04c1fd86
2 changed files with 4 additions and 2 deletions

View File

@ -16,6 +16,7 @@ import (
// LocalStorage represents an instance of the local storage provider for HLS video. // LocalStorage represents an instance of the local storage provider for HLS video.
type LocalStorage struct { type LocalStorage struct {
streamID string streamID string
host string
} }
// NewLocalStorage returns a new LocalStorage instance. // NewLocalStorage returns a new LocalStorage instance.
@ -30,6 +31,7 @@ func (s *LocalStorage) SetStreamId(streamID string) {
// Setup configures this storage provider. // Setup configures this storage provider.
func (s *LocalStorage) Setup() error { func (s *LocalStorage) Setup() error {
s.host = data.GetVideoServingEndpoint()
return nil return nil
} }

View File

@ -12,8 +12,8 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
// rewriteRemotePlaylist will take a local playlist and rewrite it to have absolute URLs to remote locations. // rewritePlaylistLocations will take a local playlist and rewrite it to have absolute URLs to a specified location.
func rewriteRemotePlaylist(localFilePath, remoteServingEndpoint, pathPrefix string) error { func rewritePlaylistLocations(localFilePath, remoteServingEndpoint, pathPrefix string) error {
f, err := os.Open(localFilePath) // nolint f, err := os.Open(localFilePath) // nolint
if err != nil { if err != nil {
log.Fatalln(err) log.Fatalln(err)