This should eliminate this race condition by using (#2493)
the seconds length value provided by the API rather than trying to pull the time from the video element. This is related to FreeTubeApp#2492 and MarmadileManteater#9.
This commit is contained in:
parent
bc3aaa4536
commit
166fe004b2
|
@ -73,6 +73,10 @@ export default Vue.extend({
|
||||||
videoId: {
|
videoId: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true
|
required: true
|
||||||
|
},
|
||||||
|
lengthSeconds: {
|
||||||
|
type: Number,
|
||||||
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data: function () {
|
data: function () {
|
||||||
|
@ -566,6 +570,10 @@ export default Vue.extend({
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
}).catch((error) => {
|
||||||
|
this.showToast({
|
||||||
|
message: error.message
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -627,8 +635,8 @@ export default Vue.extend({
|
||||||
markerDiv.style.position = 'absolute'
|
markerDiv.style.position = 'absolute'
|
||||||
markerDiv.style.opacity = '0.6'
|
markerDiv.style.opacity = '0.6'
|
||||||
markerDiv.style['background-color'] = marker.color
|
markerDiv.style['background-color'] = marker.color
|
||||||
markerDiv.style.width = (marker.duration / this.player.duration()) * 100 + '%'
|
markerDiv.style.width = (marker.duration / this.lengthSeconds) * 100 + '%'
|
||||||
markerDiv.style.marginLeft = (marker.time / this.player.duration()) * 100 + '%'
|
markerDiv.style.marginLeft = (marker.time / this.lengthSeconds) * 100 + '%'
|
||||||
markerDiv.title = this.sponsorBlockTranslatedCategory(marker.category)
|
markerDiv.title = this.sponsorBlockTranslatedCategory(marker.category)
|
||||||
|
|
||||||
this.player.el().querySelector('.vjs-progress-holder').appendChild(markerDiv)
|
this.player.el().querySelector('.vjs-progress-holder').appendChild(markerDiv)
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
:format="activeFormat"
|
:format="activeFormat"
|
||||||
:thumbnail="thumbnail"
|
:thumbnail="thumbnail"
|
||||||
:video-id="videoId"
|
:video-id="videoId"
|
||||||
|
:length-seconds="videoLengthSeconds"
|
||||||
class="videoPlayer"
|
class="videoPlayer"
|
||||||
:class="{ theatrePlayer: useTheatreMode }"
|
:class="{ theatrePlayer: useTheatreMode }"
|
||||||
@ready="checkIfWatched"
|
@ready="checkIfWatched"
|
||||||
|
|
Loading…
Reference in New Issue