Change seconds display in 360 player?

  • Question
  • Updated 3 years ago
  • Answered
Is it possible to change the display from just seconds to minutes and seconds in the 360 player? It's hard to figure out how long something has been playing when it shows something like "692"!
Photo of Michael SnowMS

Michael Snow

  • 3 Posts
  • 0 Likes

Posted 4 years ago

  • 1
Photo of Scott

Scott, Official Rep

  • 3767 Posts
  • 235 Likes
Indeed, there's a config option for that. I agree, not useful if you have long sounds playing! ;)

In the 360player.js file, set "showHMSTime" to true. By default, it's false.
showHMSTime: false, // hours:minutes:seconds vs. seconds-only
The only thing you may also need to consider here is font size, if you're using the small player UI - the font may not always fit within the circle if you get up to an hour, and so on.
Photo of Michael SnowMS

Michael Snow

  • 3 Posts
  • 0 Likes
I had tried that, but it didn't work. I ended up changing the line
showHMSTime: has_vis
to
showHMSTime: true
in the thisSound._360data section, and then it worked. Is there some sort of bug or bad coding preventing the this.config options from affecting this?
Photo of Scott

Scott, Official Rep

  • 3767 Posts
  • 235 Likes
Ah, right. I remember why this is, now; it's because of the space constraints on the smaller UI mentioned earlier. Using the default font size, space becomes a problem.

If you do "force-enable" H:M:S on the small UI, just be aware that at some point the time may overflow the container on the small UI - so keep that in mind. Smaller font sizes may help, but then legibility could become an issue.
Photo of Michael SnowMS

Michael Snow

  • 3 Posts
  • 0 Likes
I just made the circle bigger so I could enlarge the fonts and show the whole time string. That's easy enough to do.
Photo of Scott

Scott, Official Rep

  • 3767 Posts
  • 235 Likes
Perfect. Glad you were able to sort that out. This code is optimized (I guess :D) for the most common use cases, ie., less-experienced users/developers who want a few layout options to switch. Usually the options are more flexible, the timing and size stuff gets a little tricky here because of the logic around space constraints.
Photo of colinagnewC

colinagnew

  • 3 Posts
  • 0 Likes
I couldnt get this working either it was the only setting in my config that didnt work for me. I changed it to true directly in the 360player.js file and it still didnt work so I looked at the specific lines of code and there must be an error as I had to hack it. I commented it out and just set it to do that regardless of whether it is true or false.

Not nitpciking but for a track you really need track style time. Awesome work!!!

this.updatePlaying = function() {
//var timeNow = (this._360data.showHMSTime?self.getTime(this.position,true):parseInt(this.position/1000, 10));

var timeNow=self.getTime(this.position,true);