Jump to content

Video Texture on iOS/Android

Recommended Posts

I'm trying to get video textures to work on mobile devices and I seem to be running into an issue where the video won't autoplay because it doesn't meet the requirements that Apple has laid out here:  


This can be seen in this playground: http://www.babylonjs-playground.com/#1X8NRY

Is there a way to pass custom attributes to the video element that is contained within the video texture? My hypothesis is the absence of the playsinline data attribute on the video element is preventing this from working correctly. @Deltakosh any insight here?

Link to post
Share on other sites

@Deltakosh Gotcha. I was able to get this working by dynamically adding the appropriate data-attrs:

test.diffuseTexture.video.setAttribute('playsinline', 'true');
test.diffuseTexture.video.setAttribute('muted', 'true');
test.diffuseTexture.video.setAttribute('autoplay', 'true');


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...