hiukim / mind-ar-js

Web Augmented Reality. Image Tracking, Face Tracking. Tensorflow.js
MIT License
2.24k stars 417 forks source link

Black Video on Android #232

Closed gerickt closed 1 year ago

gerickt commented 2 years ago

My code https://glitch.com/edit/#!/elfin-muddy-brake

te black screen mindar-blackvideo

I'm testing on android

hiukim commented 2 years ago

Does it work without MindAR? I mean as a regular AFRAME application?

endohendo commented 2 years ago

same problem - any guidance greatly appreciated

annamarthin commented 2 years ago

Hi, I have the same problem. Black video on Android, white on iOS

SOLUTION:

So after some googling last night, I found out a solution.

You must add a click on play function. Unfortunately (or luckily) mobile browsers block autoplay videos, because in most of the times those videos are ads or promo videos. So in order to work around this, you just need to add in your code that the video should play on click, not automatically with the loading of the page.

Hope that helps.

positlabs commented 2 years ago

You should be able to autoplay the video with a few extra parameters.

<video src="..." muted autoplay playsinline></video>

skyredmilad commented 1 year ago

I have the same issue. Some browser works but a few browsers such as Xiaomi and Android default browser didn't work However, I use this code and it works for many browsers.

<div dangerouslySetInnerHTML={{ __html: <video webkit-playsinline playsinline muted id="video" > <source src="${videoUrl}" type="video/mp4}"/> </video>, }}></div>

hiukim commented 1 year ago

The issue is stale. feel free to re-open if there is new insight.