Generate a static thumbnail png every 20s

This commit is contained in:
Gabe Kangas
2020-06-10 01:16:17 -07:00
parent 33278fc2c5
commit 9ebec675b5
3 changed files with 80 additions and 4 deletions

View File

@@ -13,14 +13,13 @@ var configuration = getConfig()
var server *Server
var online = false
var usingExternalStorage = false
func main() {
log.Println("Starting up. Please wait...")
resetDirectories(configuration)
checkConfig(configuration)
var usingExternalStorage = false
if configuration.IPFS.Enabled {
storage = &IPFSStorage{}
usingExternalStorage = true
@@ -66,6 +65,11 @@ func getStatus(w http.ResponseWriter, r *http.Request) {
func streamConnected() {
online = true
chunkPath := configuration.PublicHLSPath
if usingExternalStorage {
chunkPath = configuration.PrivateHLSPath
}
startThumbnailGenerator(chunkPath)
}
func streamDisconnected() {