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

HTML5 video #17

Open
galipmedia opened this issue Jan 27, 2020 · 1 comment
Open

HTML5 video #17

galipmedia opened this issue Jan 27, 2020 · 1 comment

Comments

@galipmedia
Copy link

Is it possible to have a texture that is a playing video? I am trying to use this as part of gl-transitions and i can render 2 videos via a texture but it only grabs the first frame of each. I am waiting for the on play event etc. What am i missing?

@mohsenheydari
Copy link

I know its an old thread but this might be helpful to someone. I recently encountered the same issue. Here is what I did: update the textures in your render loop.

const loop = (t) => {
    requestAnimationFrame(loop);

    from.setPixels(videoFrom);
    to.setPixels(videoTo);

    transition.draw((t/3000)%1, from, to, canvas.width, canvas.height, { persp: 1.5, unzoom: 0.6 });
}
requestAnimationFrame(loop);

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