Replies: 1 comment
-
@makarna35 there are multiple solutions: //Let's say currentTime is equal to 28.069908
player.currentTime()|0; // returns an int -> 28
player.currentTime().toFixed(0) // returns a string -> "28"
player.currentTime().toString().split('.') // returns an array of string -> [ "28", "069908" ]
// you can also use videojs formatTime
videojs.time.formatTime(player.currentTime()) // returns a string -> "0:28"
videojs.time.formatTime(player.currentTime(), 600) // returns a string -> "00:28"
videojs.time.formatTime(player.currentTime(), 3601) // returns a string -> "0:00:28" There is also |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need split from dot myPlayer.currentTime(); value. How can I do this?
var whereYouAt = myPlayer.currentTime(); // I need split whereYouAt value from . (dot)
Beta Was this translation helpful? Give feedback.
All reactions