Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

three.js video textures in ios play back in a separately launched player - ideas?

I'm trying to get a video texture to play on geometry in iOS using three.js but instead of playing the video as a texture, the browser launches the video in a player that covers the window. I have tried this loading the mp4 directly in the texture, loading it first through a canvas, etc. If I pause the video with the player's controls, and "pinch", the player goes away leaving a paused texture on the geo at the paused frame.

Examples on line such as: http://jeromeetienne.github.io/threex.videotexture/examples/videotexture.html exhibit the same issue. So I'm assuming this is a new "feature" in iOS.

Is this an iOS issue, a Safari issue? If anyone has a workaround I would appreciate it. thanks

like image 673
Scott Singer Avatar asked Nov 22 '22 21:11

Scott Singer


1 Answers

I fixed this issue by setting the 'playsinline' attribute on the video element. There is also a polyfill: https://www.npmjs.com/package/iphone-inline-video

like image 70
mikebolt Avatar answered Nov 24 '22 13:11

mikebolt