Loading the video before displaying


#1

Hello Zapmonkeys.

I have a video that will load. the first frame of the video is the tracking image. I would like to first lead the video to avoid the buffering when it is streaming. We put the video in a very fast server so that loads quickly but I wonder if we could have seamless transition without the (“I am loading”)


#2

I did something like that with my ISS one. I set it to play on load but then paused it. You may need to hide the video till your ready.

Steve


#3

You are star Steve! Why didn’t I think about that before ? :wink:


#4

Hi Milenne,

If you are using the Video Player subsymbol you can comment out the buffering event handler that is located within the subsymbols show script on lines 75 - 81.

This will remove the buffer screen (seen below) being activated while the video is in the buffer state.

The video will also emit a ready event. I think you could default the video plane to not visible and use this to show it only when it is ready to play. I haven’t tested this yet but it could be something like this.

myvid.on("ready", () =>{
     Plane0.visible(true);
     myvid.start();
 });

Hope this helps.

George


#5

Thank you George.
It didn’t work. The buffering yes but I still see a black plane just before it plays.

I also added the code inside the subsymbol but the black plane appears before the video:-(


#6

I’m a bit late to this one but hit the same problem. This is how I solved it just in case you need it for future use.

First I turned off the buffering in the video player.

I then coped my target image and placed it over the video.

I then created a script using local variables for both my image and video. The script simply turns off the visibility of the overlay image once the video starts playing and turns it back on once it stops. Seems to work!

YourVideoPlayer.on(“video:playing”, () => {
// Runs when the finish event occurs on the video_player
yourImage.visible(false);
});

YourVideoPlayer.on(“video:finish”, () => {
// Runs when the finish event occurs on the video_player
yourImage.visible(true);
});

Simon


#7

Hi Simon, could you elaborate please? I get the process but I cannot get this script to work

Many thanks!

R


#8

Hello Rich,

I’ll try to but it has been a while since doing this.

I basically turned off the video buffering using the instructions from the conversation above this one.

Then, once your video player has been added to the scene, I then placed (lets say the first frame of that video) over the video player as an image eliminating the black frame.

The first part of the script looks out for the video to start playing and then removes the visibility of the still image you placed over the top.

The second part of the script does the exact opposite. Looks for the video player to finish and then turns your still image visibility back on.

“YourVideoPlayer” and “yourImage” would be replaced with the name that you have given your player and still image within your project.

Hope that makes sense, not had to use this again since.

Simon