Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoaderPlugin: video: Intermittently does not finish loading #4910

Closed
micsun-al opened this issue Dec 16, 2019 · 11 comments
Closed

LoaderPlugin: video: Intermittently does not finish loading #4910

micsun-al opened this issue Dec 16, 2019 · 11 comments

Comments

@micsun-al
Copy link

Version

  • Phaser Version: Phaser v3.21.0-FB (WebGL | Web Audio)
  • Operating system: iOS 13.1.3
  • Browser: Safari 13.1.3

Description

The game seems to intermittently hang inside of preload after a this.load.video call is added to the LoaderPlugin queue.

Checking the this.load.inflight value, the entries only seem to contain the .mp4 file that never seems to complete loading.

This only seems to reproduce on iOS Safari devices so far, but I haven't done extensive device testing. It doesn't ever seem to reproduce on my desktop browsers or Android Chrome.

Example Test Code

preload() {
  this.load.maxParallelDownloads = 1 // This value doesn't seem to affect the change the chance the load will succeed or fail.
  this.load.on(Phaser.Loader.Events.COMPLETE, (loader: Phaser.Loader.LoaderPlugin, totalComplete: integer, totalFailed: integer) => { console.log(`COMPLETE: totalComplete:`, totalComplete, `, totalFailed:`, totalFailed) })
  this.load.on(Phaser.Loader.Events.FILE_LOAD, (file: Phaser.Loader.File) => { console.log(`FILE_LOAD: file:`, file) })
  this.load.on(Phaser.Loader.Events.FILE_LOAD_ERROR, (file: Phaser.Loader.File) => { console.log(`FILE_LOAD_ERROR: file:`, file) }) // This doesn't seem to trigger even if video doesn't load
  this.load.on(Phaser.Loader.Events.PROGRESS, (progress: number) => { console.log(`PROGRESS:`, progress) })

  this.load.on(Phaser.Loader.Events.FILE_COMPLETE, (key: string, type: string, data: any) => {
      console.log(`FILE_COMPLETE: key:`, key, `, type:`, type, `, ${this.load.totalComplete} COMPLETE / ${this.load.totalToLoad} TOTAL (${this.load.totalFailed} FAILED)`)
      console.log(`inflight:`, this.load.inflight)
  })

  this.load.video('someVideoKey', 'someVideo.mp4')
}

create() {
  console.log('it doesn't always get here')
}

This reproduces using the Phaser 3 "Play Video" example (it is intermittent and does not seem to reproduce every refresh).

https://phaser.io/examples/v3/view/game-objects/video/play-video

Notes:

  • Should there be a timeout and retry count type thing?
  • Should the FILE_LOAD_ERROR event be triggered if it does timeout?
  • Thank you! :)
@photonstorm
Copy link
Collaborator

I can make this reproduce on desktop if I add 4 videos to preload and have them all stream load (i.e. non-binary load)

@spayton
Copy link
Contributor

spayton commented Oct 27, 2020

I am also seeing loader hangs with video content on Phaser 3.50-beta9. Haven't done a thorough test across various devices but seems worst on ios.

@photonstorm
Copy link
Collaborator

Everything is worse on iOS :)

I've not touched Video at all in 3.50, so I don't expect any changes to surface yet.

@luvsta
Copy link

luvsta commented Nov 30, 2020

i make the same question in this,video in Wechat can't playing

@daverees4
Copy link

I'm seeing the same issues when loading a series of mp4s in v3.21, and was wondering if there was any update, please. Thanks!

@photonstorm
Copy link
Collaborator

If there was an update it would have been mentioned here I’m afraid. Audio and video will be redone fully next year.

@daverees4
Copy link

Just as an update if anyone finds a similar issue in the future. Reducing the number of loader connections down to 1 so files load in serial rather than parallel and then loading the videos as blobs seems to work most of the time on all my devices. I'm not really sure why this works, but I'm not asking too many questions and calling it a Christmas miracle. Thanks for the brilliant framework!

@ChildLearningClub
Copy link

ChildLearningClub commented Oct 21, 2022

I’m not sure this got any update, but I would be happy to try out a new build or something. I’m having similar issues with loading a project with videos.

Edit: I have videos playing okay now, may have just been my configuration.

@photonstorm
Copy link
Collaborator

The Video Game Object has been fully recoded in v3.60 and now works very differently from before, and this bug is finally no longer present in the testing we've done.

@daverees4
Copy link

Thanks for fixing!

@ChildLearningClub
Copy link

Yes, Thank you @photonstorm

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants