google / model-viewer

Easily display interactive 3D models on the web and in AR!
https://modelviewer.dev
Apache License 2.0
7.04k stars 824 forks source link

iOS video texture not playing on Safari and Chome #4300

Open b2renger opened 1 year ago

b2renger commented 1 year ago

Description

The example with video texture doesn't work on iOS devices. On the example 'Material & Scenes' => 'Animated Textures' the video loads and plays but nothing happens when clicking the AR button. The button just disapears, but no ar view displays. Only on iOS !

Live Demo

https://modelviewer.dev/examples/scenegraph/#animatedTexturesExample https://replit.com/@b2renger/model-viewer-immersive-cubeOneVidPerFace

Version

Browser Affected

OS

AR

magdazelena commented 1 year ago

I have a similar issue, similar code (except rendered by React).

iOS Safari outputs: [Log] Attempting to present in AR with Quick Look... (model-viewer.min.js, line 1094)

For me the QuickLook starts up, but the AR option is faded out. I can only use the "Object" view.

The model viewer code:

    <model-viewer
      shadow-intensity="1"
      camera-controls
      ar
      autoPlay
      ar-mode="webxr scene-viewer quick-look fallback"
      poster="[poster src]"
      touch-action="pan-y"
      reveal="manual"
      src={[glb model src]}
    >
      <button slot="ar-button" id="ar-button">
        View in your space
      </button>
    </model-viewer>

The versions of all are the same as above.

I also use meshoptimizer, whether that matters on not.

Any tips how to tackle that appreciated. Android works flawless.

diegoteran commented 1 year ago

@b2renger It seems that the Video Texture Type is not able to be exported to USDZ (through three.js exporter). Lottie and Canvas Textures should work, but even then, in QuickLook AR there would be no animations, just a static frame.

@mrdoob Looks like USDZExporter is not able to read pixel data from video.

diegoteran commented 1 year ago

@magdazelena This might be a different issue, do you have a live demo that we can take a look at?

mrdoob commented 1 year ago

@mrdoob Looks like USDZExporter is not able to read pixel data from video.

Does USDZ support video textures?

elalish commented 1 year ago

@mrdoob Looks like USDZExporter is not able to read pixel data from video.

Does USDZ support video textures?

I doubt it, but the comment was more that it also couldn't take a single image out of the video and use that as an image texture (I assume this is a DRM problem?).

MarkKu666 commented 1 year ago

it’s work for us. Hope it can help you too. https://blog.markkulab.net/resolve-three-js-video-texture-is-not-working-in-ios/

Saliiih commented 10 months ago

@MarkKu666 You mean it works in AR mode? if it is yes could you help