Video player events

Hello everyone,
I have a video which i’m playing in the start of the game on touch event. The video is playing but the problem is a grey screen comes before playing the video when the network is slow. Is there any way to check whether the video is loaded or not.
I used playing, meta-loaded, and ready-to-play still the issue is present.
Thank you

What version of Cocos Creator?

Do you have a demo that we can test?

Currently it is based on these events to listen to the loading progress of the file, this side in Google Chrome with a weak network test did not see that gray background, how can I reproduce it?
image

If you check in mobile devices using hosted links, that can be seen or the video buffers.
Please find the link for project zip file: cocos creator - Google Drive
I have also hosted in github to check in devices: https://maheshnnaik.github.io/
What I want is add an event to check if the video is loaded or not, and then play the video so that the gray screen wont appear or the video wont buffer in mobile devices. I tried the events but didn’t work for me.
cocos creator version 2.4.4 - @slackmoehrle
Thank you

I have also uploaded a video recording in the drive link with similar setting in chrome, you can see the gray screen before the video is played and video buffers.
drive link: cocos creator - Google Drive

Thank you

demo:VideoTest.zip (250.5 KB)
The gray screen is caused by the initialization of the video component, which can be displayed normally after a few frames of delayed playback.
This is a test demo, I removed the video file from the project (the file is too big to upload), you need to put the video file in again when testing.

@Koei Thank you for demo. I implemented it and it is working fine in android browser but not in safari. Should we add any attribute for video element specially if the browser is safari?
In this website, Apple Developer Documentation it says Safari honors the preload="metadata" attribute, allowing <video> and <audio> elements to load enough media data to determine that media’s size, duration, and available tracks.
Can you please take a look at this?
Thank you

try this:
VideoTest.zip (249.3 KB)
The video file was temporarily removed by me, remember to put the video file back when testing.

1 Like

Thank you for the demo. Will check this. I have added this to github repo so that it can be used later. I will also try different events and will add it the repo.
Github link: GitHub - maheshnnaik/cocos-creator-video-player-test

@Koei I’m getting the below error in the latest safari browser and the video is not playing. browser version 15.1

And It started with safari 14.1.2, gave the below error for audio(cc.audioEngine.play())


but this error was not there in safarai 15.1
Thank you