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

Add video fully loaded signal to MoviePicture.js #93

Open
wsVIC opened this issue Aug 7, 2024 · 2 comments
Open

Add video fully loaded signal to MoviePicture.js #93

wsVIC opened this issue Aug 7, 2024 · 2 comments

Comments

@wsVIC
Copy link

wsVIC commented Aug 7, 2024

In some instances, it's beneficial to know when a movie has finished loading, which essentially aligns with the emission of the "canplaythrough" event of the

Following a series of tests, I've observed that when the system is strained or lacks sufficient computational power, the movie loading process can become laggy. This can cause the actual playing time to exceed expectations, resulting in desynchronization with other operations that are designed to run parallel to the film. The attached images illustrate this issue.

By providing a "fully loaded" point, we could enhance synchronization. At present, I'm not aware of any existing solution for this issue, and there seems to be no high-level API that directly caters to this need. One potential solution could be to add an optional parameter to the MP_SET_MOVIE command. This parameter would indicate the switch number to which the movie is attached, and it would be set to true when the movie reaches the 'canplaythrough' state.

image

This problem is especially severe when I try to run a game on Joiplay simulator on my mobile phone, which has poor performance.
Nonetheless I am not an expert at RPGMaker MV. So if there is any existing solutions, please let me know.

@triacontane
Copy link
Owner

Hello!

We are not able to investigate or support the complexity of the plugin for RPG Maker MV, as it has been on the market for some time now.

However, we can implement what you suggest.
I have added a switch that can be turned on when the video has completed loading.

63890f2

@wsVIC
Copy link
Author

wsVIC commented Aug 9, 2024

Thank you very much. It works as intended. However, I've noticed a minor issue: the code to set the switch to true appears to execute twice for every SET operation.

further, I discovered that this is due to the "canplaythrough" event of the video element emitting twice, which is quite wierd. (While the addEventListener function is is called only once so there is only one listener.)

Although this is not an immediately urgent issue, it doesn't seem to be the expected behavior. So this would need some further investigations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants