jps0611 Posted March 30, 2018 Share Posted March 30, 2018 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: https://webkit.org/blog/6784/new-video-policies-for-ios/ 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? Quote Link to comment Share on other sites More sharing options...
Guest Posted March 30, 2018 Share Posted March 30, 2018 This is correct. the video.play call must be initiated from an user interaction (like a button click) Quote Link to comment Share on other sites More sharing options...
jps0611 Posted March 30, 2018 Author Share Posted March 30, 2018 @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'); test.diffuseTexture.video.play(); :thumbs-up: Quote Link to comment Share on other sites More sharing options...
jps0611 Posted March 30, 2018 Author Share Posted March 30, 2018 Working: http://www.babylonjs-playground.com/#1X8NRY#24 Quote Link to comment Share on other sites More sharing options...
Guest Posted March 30, 2018 Share Posted March 30, 2018 This could be a good PR Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.