mirror of https://github.com/FreeTubeApp/FreeTube
Trigger checkAspectRatio on loadedmetadata event (#3147)
This commit is contained in:
parent
a6bb002e97
commit
c3867259e9
|
@ -492,7 +492,6 @@ export default defineComponent({
|
|||
|
||||
this.player.on('ready', () => {
|
||||
this.$emit('ready')
|
||||
this.checkAspectRatio()
|
||||
this.createStatsModal()
|
||||
if (this.captionHybridList.length !== 0) {
|
||||
this.transformAndInsertCaptions()
|
||||
|
@ -500,6 +499,10 @@ export default defineComponent({
|
|||
this.toggleScreenshotButton()
|
||||
})
|
||||
|
||||
this.player.one('loadedmetadata', () => {
|
||||
this.checkAspectRatio()
|
||||
})
|
||||
|
||||
this.player.on('ended', () => {
|
||||
this.$emit('ended')
|
||||
|
||||
|
@ -674,13 +677,6 @@ export default defineComponent({
|
|||
const videoWidth = this.player.videoWidth()
|
||||
const videoHeight = this.player.videoHeight()
|
||||
|
||||
if (videoWidth === 0 || videoHeight === 0) {
|
||||
setTimeout(() => {
|
||||
this.checkAspectRatio()
|
||||
}, 200)
|
||||
return
|
||||
}
|
||||
|
||||
if ((videoWidth - videoHeight) <= 240) {
|
||||
this.player.fluid(false)
|
||||
this.player.aspectRatio('16:9')
|
||||
|
|
Loading…
Reference in New Issue