model-viewer icon indicating copy to clipboard operation
model-viewer copied to clipboard

iOS video texture not playing on Safari and Chome

Open b2renger opened this issue 3 years ago • 8 comments

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

  • model-viewer: v3.1.1
  • iOS 16.5
  • chrome : 113.0.5672.1

Browser Affected

  • [x ] Chrome, version: xx.x.xxxx.xx
  • [ ] Edge
  • [ ] Firefox
  • [ ] IE
  • [ x] Safari

OS

  • [ ] Android
  • [ x] iOS
  • [ ] Linux
  • [ ] MacOS
  • [ ] Windows

AR

  • [ ] WebXR
  • [ ] SceneViewer
  • [x ] QuickLook

b2renger avatar May 30 '23 12:05 b2renger

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.

magdazelena avatar Jun 16 '23 07:06 magdazelena

@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 avatar Jun 16 '23 19:06 diegoteran

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

diegoteran avatar Jun 16 '23 19:06 diegoteran

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

Does USDZ support video textures?

mrdoob avatar Jun 27 '23 07:06 mrdoob

@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?).

elalish avatar Jun 27 '23 17:06 elalish

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/

MarkKu666 avatar Oct 28 '23 09:10 MarkKu666

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

Saliiih avatar Jan 15 '24 13:01 Saliiih

A video texture made with createVideoTexture() causes USDZ export to reject with No valid image data found. The failed export also detaches the live model and leaves the AR button disabled. I have a browser-tested cleanup change for that state loss; it does not make video textures exportable to USDZ.

Arthur031221 avatar Oct 02 '26 03:10 Arthur031221