mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Fix vtt for chapter display in scene players (#263)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user