Mercurial > code > home > repos > light9
changeset 2023:b64a4db527e2
whitespace
Ignore-this: 82ab84810df09d549904116da2c3e4b8
author | drewp@bigasterisk.com |
---|---|
date | Mon, 10 Jun 2019 23:50:04 +0000 |
parents | f5fbc6ec5f87 |
children | 8a8f633e8ccb |
files | light9/web/light9-vidref-replay.js |
diffstat | 1 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/light9/web/light9-vidref-replay.js Mon Jun 10 23:50:00 2019 +0000 +++ b/light9/web/light9-vidref-replay.js Mon Jun 10 23:50:04 2019 +0000 @@ -19,6 +19,7 @@ size: { type: String, attribute: true } }; } + estimateRate() { const n = this.songToVideo.length; const x0 = Math.round(n * .3); @@ -27,6 +28,7 @@ const pt1 = this.songToVideo[x1]; return (pt1[1] - pt0[1]) / (pt1[0] - pt0[0]); } + setVideoTimeFromSongTime(songTime, isPlaying) { if (!this.songToVideo || !this.outVideo || this.outVideo.readyState < 1) { return; @@ -64,6 +66,7 @@ this.timeErr = 0; } } + setRate(r) { this.playRate = Math.max(.1, Math.min(4, r)); this.outVideo.playbackRate = this.playRate; @@ -103,7 +106,7 @@ color: rgb(97, 97, 255); } video { - width: 100%; + width: 100%; } `; } @@ -111,7 +114,8 @@ render() { let details = ''; if (this.size != 'small') { - details = html` <div> + details = html` + <div> take is <a href="${this.uri}">${this.uri}</a> (${Object.keys(this.songToVideo).length} frames) <button @click="${this.onDelete}">Delete</button> @@ -124,12 +128,12 @@ err = <span class="num">${rounding(this.timeErr, 3, 4, true)}</span> rate = <span class="num">${rounding(this.playRate, 3, 3, true)}</span> </div> -`; + `; } return html` - <video id="replay" class="size-${this.size}" src="${this.videoUrl}"></video> -${details} - `; + <video id="replay" class="size-${this.size}" src="${this.videoUrl}"></video> + ${details} + `; } }