diff --git a/components-eleventy/video/player.js b/components-eleventy/video/player.js index 6492630..ebadb86 100644 --- a/components-eleventy/video/player.js +++ b/components-eleventy/video/player.js @@ -1,6 +1,9 @@ import renderPoster from './poster.js' function renderTimestamps ( video ) { + + if ( video.timestamps.length > 0 ) return '' + const timestampsForRender = video.timestamps.map( timestamp => { const [ minutes, seconds ] = timestamp.time.split(':') @@ -10,13 +13,21 @@ function renderTimestamps ( video ) { } }) - return timestampsForRender.map( timestamp => (/* html */` + const timestampButtonsHtml = timestampsForRender.map( timestamp => (/* html */` `) ).join('') + + return /* html */` +
+ ` } export default async function ( video, options = {} ) { @@ -66,11 +77,9 @@ export default async function ( video, options = {} ) { - + + ${ timestampsHtml } + ` }