From c811a4aaf9ad9778533fb51f2a5639770707c2a1 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Sun, 2 May 2021 00:59:28 +1200 Subject: [PATCH] Fix ?t start time parameter on videos --- api/video.js | 5 +++++ pug/video.pug | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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