diff options
Diffstat (limited to 'src/media-timeline.js')
| -rw-r--r-- | src/media-timeline.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/media-timeline.js b/src/media-timeline.js index 8b6045e..d8ae008 100644 --- a/src/media-timeline.js +++ b/src/media-timeline.js @@ -85,7 +85,7 @@ export function markAt(seconds, duration) { // with closures pointing at a detached player. What was said, reacted or // zapped at a moment sits on the bar at that moment; replies, reactions and // zaps made while a clip plays carry its time on their own (see momentOf). -export function mediaTimeline(player, url, { h, event, moments, glyph, label }) { +export function mediaTimeline(player, url, { h, event, moments, glyph, label, onMarks = null }) { const audio = player.tagName === 'AUDIO'; const box = h('div', { class: 'media-timeline', onClick: e => e.stopPropagation(), onPointerdown: e => e.stopPropagation() }); box._skipMorph = true; @@ -123,6 +123,10 @@ export function mediaTimeline(player, url, { h, event, moments, glyph, label }) } const items = ev && finite ? moments(ev.id, url) : []; const next = items.map(x => x.id).join(',') + '@' + (finite ? player.duration : 0); + // a video has its own seek bar: this one shows under it only to carry + // what was said at a moment (two bars read as a glitch on a phone) + box.classList.toggle('has-marks', items.length > 0); + if (onMarks) onMarks(items.length > 0); if (signature !== next) { signature = next; marks.replaceChildren(...items.map(x => h('button', { type: 'button', class: 'media-mark', title: mediaClock(x.moment.seconds) + ' ' + x.text, |
