mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
Make setting the offline content optional
This commit is contained in:
parent
15f24b84ce
commit
fe102e7164
@ -25,7 +25,6 @@ instanceDetails:
|
|||||||
videoSettings:
|
videoSettings:
|
||||||
# Change this value and keep it secure. Treat it like a password to your live stream.
|
# Change this value and keep it secure. Treat it like a password to your live stream.
|
||||||
streamingKey: abc123
|
streamingKey: abc123
|
||||||
offlineContent: static/offline.m4v # Is displayed when a stream ends
|
|
||||||
|
|
||||||
// Determine the bitrate of your stream variants.
|
// Determine the bitrate of your stream variants.
|
||||||
// See https://github.com/gabek/owncast/blob/master/doc/configuration.md#video-quality for details.
|
// See https://github.com/gabek/owncast/blob/master/doc/configuration.md#video-quality for details.
|
||||||
|
|||||||
@ -197,6 +197,15 @@ func (c *config) GetMaxNumberOfReferencedSegmentsInPlaylist() int {
|
|||||||
return 20
|
return 20
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *config) GetOfflineContentPath() string {
|
||||||
|
if c.VideoSettings.OfflineContent != "" {
|
||||||
|
return c.VideoSettings.OfflineContent
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is relative to the webroot, not the project root.
|
||||||
|
return "static/offline.m4"
|
||||||
|
}
|
||||||
|
|
||||||
//Load tries to load the configuration file
|
//Load tries to load the configuration file
|
||||||
func Load(filePath string, versionInfo string) error {
|
func Load(filePath string, versionInfo string) error {
|
||||||
Config = new(config)
|
Config = new(config)
|
||||||
|
|||||||
@ -9,6 +9,6 @@ func ShowStreamOfflineState() {
|
|||||||
transcoder := NewTranscoder()
|
transcoder := NewTranscoder()
|
||||||
transcoder.SetSegmentLength(10)
|
transcoder.SetSegmentLength(10)
|
||||||
transcoder.SetAppendToStream(true)
|
transcoder.SetAppendToStream(true)
|
||||||
transcoder.SetInput(config.Config.VideoSettings.OfflineContent)
|
transcoder.SetInput(config.Config.GetOfflineContentPath())
|
||||||
transcoder.Start()
|
transcoder.Start()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user