rename media-input to media

replace set-cursor with cursor which can now get/set cursor position
This commit is contained in:
2026-01-09 19:18:24 +00:00
parent cb4898f2d4
commit f84e126381
4 changed files with 66 additions and 31 deletions

12
util.go
View File

@@ -64,3 +64,15 @@ func parseTimeStringToMilliseconds(timeStr string) (float64, error) {
return duration.Seconds() * 1000, nil
}
func formatMillisecondsToTimeString(ms float64) string {
totalSeconds := int(ms / 1000)
hours := totalSeconds / 3600
minutes := (totalSeconds % 3600) / 60
seconds := totalSeconds % 60
if hours > 0 {
return fmt.Sprintf("%02d:%02d:%02d", hours, minutes, seconds)
}
return fmt.Sprintf("%02d:%02d", minutes, seconds)
}