I am beginner webdeveloper. I have a problem with the movie on the website, the movie takes about 15MB and it takes a long time to load on GSM connections. I know it can be compressed - I already did that. Now I want to display an image on the website, and when the movie is loaded, I hide the image and display the movie.
I made a code like this:
$( document ).ready(function() {
$(".cover-video-splash-video").on("loadstart", function() {
this.show();
});
});
.cover-video-splash{
background-image: url('/assets/front/videos/header/splash.jpg');
height: 1070px;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="cover-video cover-video-splash">
<video width="100%" height="1080" autoplay loop muted class="cover-video-splash-video">
<source src="{{ES::asset('/assets/front/videos/header/hp.mp4')}}" type='video/mp4'>
<source src="{{ES::asset('/assets/front/videos/header/hp.webm')}}" type='video/webm' >
<source src="{{ES::asset('/assets/front/videos/header/hp.ogv')}}" type='video/ogg; codecs="theora, vorbis"'/>
<p>@lang('main.no-video')</p>
</video>
</div>
But it doesn't really work because from freezes the page anyway. How can this be on