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

Video texture example shows black screen #658

Open
CarstenHoyer opened this issue Sep 19, 2022 · 3 comments
Open

Video texture example shows black screen #658

CarstenHoyer opened this issue Sep 19, 2022 · 3 comments

Comments

@CarstenHoyer
Copy link

CarstenHoyer commented Sep 19, 2022

Hi

Video example shows balck screen: https://regl-project.github.io/regl/www/gallery/video.js.html

I looked at #469, and it seems like the fix is not working anymore. At least for me in Safari 15 and Chrome 105 I am seeing a black screen.

Autoplay without sound gives me a video that plays, but it doesn't seem to go into the sampler2D.

Shortened example:

const frag = glsl(`
  precision highp float;

  uniform float time;
  uniform sampler2D video;

  varying vec2 vUv;

  void main () {
    vec4 t = texture2D(video, vUv);
    vec3 color = 0.5 + 0.5 * cos(time + vUv.xyx + vec3(0.0, 2.0, 4.0));
    gl_FragColor = vec4(color, 1.0);
  }
`);

createShader({
    gl,
    frag,
    uniforms: {
      video: regl.texture(video).subimage(video),
      time: ({ time }) => time
    }
  });
}
@CarstenHoyer
Copy link
Author

Chrome gives this error: Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD

@CarstenHoyer
Copy link
Author

Safari gives this error today: resl error: – "error loading asset "video""

But I got a black screen in Safari yesterday

@CarstenHoyer
Copy link
Author

Tried loading an mp4 file in the example, and it worked without problems

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

1 participant