diff --git a/api/video.js b/api/video.js index 3db5cc4..9a27a26 100644 --- a/api/video.js +++ b/api/video.js @@ -160,6 +160,11 @@ module.exports = [ video.second__viewCountText = converters.viewCountToText(video.viewCount) } + // apply media fragment to all sources + for (const format of formats) { + format.url += mediaFragment + } + // rewrite description video.descriptionHtml = converters.rewriteVideoDescription(video.descriptionHtml, id) diff --git a/pug/video.pug b/pug/video.pug index f1f375e..c56ac83 100644 --- a/pug/video.pug +++ b/pug/video.pug @@ -25,7 +25,7 @@ block content - const format = formats[0] if format video(controls preload="auto" width=format.second__width height=format.second__height data-itag=format.itag autoplay=continuous||autoplay)#video.video - source(src=format.url+mediaFragment type=format.type) + source(src=format.url type=format.type) each t in video.captions track(label=t.label kind="subtitles" srclang=t.languageCode src=t.url) else