Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _drawPlaytime: function (cx, cy) {
- if(this.audio != null){
- var currentTime = this.audio.currentTime || 0
- var duration = this.audio.duration || 1
- const m = Math.floor(currentTime / 60)
- const sec = Math.floor(currentTime) % 60
- const s = sec < 10 ? `0${sec}` : `${sec}`
- const text = `${m}:${s}`
- const tsizew = Math.ceil(this.ctx.measureText(text).width)
- this.ctx.font = this.playtimeFont
- this.ctx.fillStyle = this.playtimeColor
- this.ctx.fillText(text, cx - Math.round(tsizew / 2), cy + 0.25 * parseInt(this.playtimeFont))
- }
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement