Fix Thumbnails on Time Rail depending on video length

This commit is contained in:
PrestonN 2019-05-20 21:27:10 -04:00
parent 1f5f2e3a13
commit 831de883c4
2 changed files with 10 additions and 2 deletions

View File

@ -214,6 +214,7 @@ function playVideo(videoId, playlistId = '') {
playerView.channelName = data.author;
playerView.channelId = data.authorId;
playerView.channelIcon = data.authorThumbnails[2].url;
playerView.lengthSeconds = data.lengthSeconds;
if (playerView.channelIcon.includes('https:') === false) {
playerView.channelIcon = 'https:' + playerView.channelIcon;
@ -629,6 +630,11 @@ function checkDashSettings() {
let checkedDash = false;
let parseDash = true;
let quality = 'Auto';
let thumbnailInterval = 5;
if (playerView.lengthSeconds > 900) {
thumbnailInterval = 10;
}
let declarePlayer = function() {
if (!checkedDash) {
@ -675,6 +681,7 @@ function checkDashSettings() {
defaultQuality: quality,
stretching: 'responsive',
startVolume: currentVolume,
timeRailThumbnailsSeconds: thumbnailInterval,
success: function(mediaElement, originalNode, instance) {
ft.log(mediaElement,originalNode,instance);
@ -692,7 +699,7 @@ function checkDashSettings() {
if (enableSubtitles) {
instance.options.startLanguage = 'en';
}
}, 300);
}, 200);
window.setTimeout(() => {
let qualityOptions = $('.mejs__qualities-selector-input').get();
@ -711,7 +718,7 @@ function checkDashSettings() {
qualityOptions.reverse()[0].click();
}
}, 3000);
}, 2000);
},
error: function(error, originalNode, instance) {

View File

@ -565,6 +565,7 @@ let playerView = new Vue({
validLive: false,
embededHtml: '',
currentSpeed: 1,
lengthSeconds: 0,
videoTitle: '',
videoViews: '',
likePercentage: 0,