From 0e3221c329a33c2531a8b74d0db141e1b57c33dd Mon Sep 17 00:00:00 2001 From: Luca Date: Fri, 14 Aug 2020 19:55:25 +0200 Subject: [PATCH] Delegate creation of VTT generation to new function as well as useful information about the values of the url --- src/renderer/views/Watch/Watch.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index a13e008c..f8c12a21 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -301,10 +301,21 @@ export default Vue.extend({ storyboards.splice(0, 1) storyboards.forEach((storyboard, i) => { const [width, height, count, sWidth, sHeight, interval, _, sigh] = storyboard.split('#') - storyboardArray.push(baseUrl.replace('$L', i + 1).replace('$N', 'M0').replace(/<\/?sub>/g, '') + '&sigh=' + sigh) + storyboardArray.push({ + url: baseUrl.replace('$L', i + 1).replace('$N', 'M0').replace(/<\/?sub>/g, '') + '&sigh=' + sigh, + width: Number(width), // Width of one sub image + height: Number(height), // Height of one sub image + sWidth: Number(sWidth), // Number of images vertically (if full) + sHeight: Number(sHeight), // Number of images horizontally (if full) + count: Number(count), // Number of images total + interval: Number(interval) // How long one image is used + }) + console.log(storyboardArray[storyboardArray.length - 1].url) + console.log(storyboardArray[storyboardArray.length - 1]) + console.log(storyboard) }) - - this.videoStoryboardSrc = storyboardArray[0] + const vttFile = this.buildVTTFileLocally(storyboardArray) + // this.videoStoryboardSrc = storyboardArray[0] this.captionSourceList = result.player_response.captions && result.player_response.captions.playerCaptionsTracklistRenderer @@ -358,6 +369,10 @@ export default Vue.extend({ }) }, + buildVTTFileLocally: function(Storyboards) { + // let vttString = 'WEBVTT\n\n' + }, + getVideoInformationInvidious: function() { if (this.firstLoad) { this.isLoading = true