Black frame at start of video

I still don’t see it

One thing you can try is to upload the texture immediately when the button is pressed or wait a few frames before enabling the plane.

eg :

    this.Button.element.on('click', function () {
        video.play(); 
        this.Button.enabled = false; 
        this.mediaPlayer.enabled = true;

        // Do an upload immediately to try to avoid black frame at start
        this.videoTexture.upload();
    }, this);

Try the project again and see if you can see the black frame: https://playcanvas.com/editor/scene/1250286

That doesn’t do anything but i decide to use the video of you’re project to test and it’s work !

The problem is from my video, i will look for it, thanks for your help !

My bad it’s gone black again for both video, i’m quite confused :confused: :joy:

One day, I will find the solution !

Maybe it’s because the video still loading ?

Hi @Enivort! I think it’s indeed a loading issue. I’m on a bad network at the moment and I see the black screen for almost 10 seconds.

Okay thanks for the answer.

The black screen look like to be only on the phone, when i open it on computer the video start directly so maybe it depend of device too

It’s very possible that the video is not ready yet by the time play is called or needs to buffer. In which case try the project again https://playcanvas.com/editor/scene/1250286

The button is inactive until the video is ready (button turns blue).

No blue button and still a black screen for me.

You should see something like this depending on the network speed:

Ah, the code I used was input on the element, not button.

Fixed now: https://launch.playcanvas.com/1250286?debug=true

Right now the button is not working at all. (No blue color).

The video is not loading for you then or loading so slowly, it’s waiting for the whole video to download/is blocked on your device for some reason. A bit surprised given it’s only 3.4MB :thinking:

I’m on a good network right now.

Hmm wonder if there is a bug on iOS :thinking:

Ah, I forgot about this bug with Safari, MP4s and the launch window: https://github.com/playcanvas/editor/issues/265

Try this published build instead: Video bug from forums - PLAYCANVAS

Yes, this one works exactly as you described. Blue button when ready and no black frames.

1 Like

You find the solution for the black frame ?
I’m still trying to resolve this problem, the link go to the solution ?

Oh i try and yes that work, i will try it on my project

How did you make it ?

Project source in this post: Black frame at start of video - #14 by yaustar

Oh okay, thanks, it’s work perfectly !