Link to home
Start Free TrialLog in
Avatar of Yuri Boyz
Yuri BoyzFlag for Uganda

asked on

HTML 5 video shows up as a blank white screen in Android

I am using slick slider and in slick slider I am using pictures and Videos. Videos uses HTML5 video tag.

THe issue:
A blank white screen appears on android devices and mostly videos not loads. It works good on Desktops
The problem arises on Android devices mostly.
Avatar of David Favor
David Favor
Flag of United States of America image

Sounds like this might possibly be an HTML structure problem (HTML syntax errors).

Post the URL of your problem page for testing.

Or you can use https://validator.w3.org/nu/ to do your own testing.

You're looking for output report to be "Document checking completed. No errors or warnings to show."

There may be other problems. This is the first to check + fix.
Be aware the video probably won't auto start on mobile device.

You may need to add different video format mp4, avi, ogv, ogg ...
and you should use poster so in case the video does not display it will display at least an image

<video width="620" controls
  poster="https://upload.wikimedia.org/wikipedia/commons/e/e8/Elephants_Dream_s5_both.jpg" >
  <source
    src="https://archive.org/download/ElephantsDream/ed_1024_512kb.mp4"
    type="video/mp4">
  <source
    src="https://archive.org/download/ElephantsDream/ed_hd.ogv"
    type="video/ogg">
  <source
    src="https://archive.org/download/ElephantsDream/ed_hd.avi"
    type="video/avi">
  Your browser doesn't support HTML5 video tag.
</video>

Open in new window


Ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video
To expand on lenamtl's comment...

Keep in mind, all recent browsers have disabled video + audio autostart.

To accomplish this, you'll have to use a Javascript snippet to fire off a fake start event.

Post your URL for best answers.
Avatar of Yuri Boyz

ASKER

Thanks to both of you. I tried that code but videos not loads on Android Mobile in Chrome. But it shows poster image.
The problem is because it set to be hidden on small device just remove this from your slider class hidden-xs hidden-sm

<div class="slider-video hidden-xs hidden-sm">

Open in new window

to
<div class="slider-video">

Open in new window


Reference: https://getbootstrap.com/docs/3.3/css/#responsive-utilities-classes
if i remove those classes then video will videos will show 2 times. This check is applied so that responsive videos will not show in desktop.
Ok then just keep one DIV that show for all devices..
<div class="slider-video">

Open in new window


or rethink the logical using the helper class
https://getbootstrap.com/docs/3.3/css/#responsive-utilities-classes

You can use the visible or hidden class I do prefer to use the visible class as there is less pitfall to my opinion
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.