Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Can't play video in IOS #57

Open
windystrife opened this issue Apr 3, 2018 · 4 comments
Open

Can't play video in IOS #57

windystrife opened this issue Apr 3, 2018 · 4 comments

Comments

@windystrife
Copy link

i write some demo to play video .mp4 (no AR) , three.js only
but it can't play video in webARonArkit (it's black screen)
can play well on PC.
here it is:
https://windystrife.github.io/three.ar.js/examples/VideoTest.html

@msimpson
Copy link

msimpson commented Apr 27, 2018

@windystrife
Try adding the newer playsinline attribute instead of the legacy webkit-playsinline, like:

video.setAttribute( 'playsinline', '' );

See: https://webkit.org/blog/6784/new-video-policies-for-ios/

I was able to get video playing in a demo I build myself, so I know it works.

@machenmusik
Copy link
Contributor

I encountered some issues with video (and I couldn't use muted, or user gesture), so #59

@erikparr
Copy link

erikparr commented Aug 8, 2018

set your video in html, something like this works for me:

<video id="video" autoplay muted loop crossOrigin="anonymous" playsinline style="display:none">
    <source src="video/ocean.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
  </video>

if on iphone use iphone-inline-video.min.js library and in your init set it like this:

video = document.getElementById('video');
enableInlineVideo(video);

@raywu
Copy link

raywu commented Feb 19, 2019

I tried to enable autoplay and also tried to add a touchstart event to no avail. I looked into iphone-inline-video.min.js but it seems to be a polyfill ish library for iOS 8 and 9. I am using A-Frame and followed its FAQ to add meta tag and inline attributes playsinline. Is there anything else I should be aware of? My video plays on desktop browser but stalls on first frame on WeARonARKit.

I'm on iOS 12.1.4 and XCode 10.1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants