Fix vtt for chapter display in scene players (#263)

This commit is contained in:
WithoutPants
2019-12-14 07:41:46 +11:00
committed by Leopere
parent da3e91193c
commit f8a760d729
3 changed files with 35 additions and 3 deletions

View File

@@ -5,7 +5,7 @@ import (
"time"
)
// GetVTTTime returns a timestamp appropriate for VTT files (hh:mm:ss)
// GetVTTTime returns a timestamp appropriate for VTT files (hh:mm:ss.mmm)
func GetVTTTime(totalSeconds float64) (s string) {
totalSecondsString := strconv.FormatFloat(totalSeconds, 'f', -1, 64)
secondsDuration, _ := time.ParseDuration(totalSecondsString + "s")
@@ -34,5 +34,8 @@ func GetVTTTime(totalSeconds float64) (s string) {
}
s += strconv.Itoa(seconds)
// videojs requires milliseconds
s += ".000"
return
}