Grey screen in videos

Asked

Viewed 368 times

1

I’m playing videos on android (versions above 5 only) using a webview along with the tag <video> of html. The video plays perfectly and triggers all events correctly, but every time a video will play it always displays a preview image similar to this (from to play opening youtube by Chrome on your smartphone) :

inserir a descrição da imagem aqui

Is there any elegant way around this problem ? The only option I thought about, but I didn’t test it, was before the video definitely started playing (timeupdate event tells the time of the video, so if it goes past 0.1 seconds I can know that it’s already playing) make a layer changes with css by putting a div with black background in front, but it seems too gambiarra.

1 answer

0


This image is called "poster". It serves to show something before the video starts playing, it usually appears when the video is being loaded.

I realized the problem by adding the following code to the video element:

<video poster='#' id="video" class="autoAdjust visible"></video>

and in css:

video {
  background: black;
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.