天天看点

H5视频video

H5视频video

<video id="video"  preload='auto' webkit-playsinline='true' playsinline='true' x-webkit-airplay='true' x5-video-player-type='h5' x5-video-player-fullscreen='true' x5-video-ignore-metadata='true' preload='auto'  type="video/mp4"    width='100%'  src="./img/618.mp4">
        <p>不支持video</p>
        </video>
           
#video{ 
    object-fit: cover;  
    object-position: center center;   
}
           

监听视频是否加载完毕

var $video=document.getElementById('video');
$video.oncanplaythrough=function(){
        LoadSuccess=true;
        if(ISclick){
             $loading.style.display='none';
        }     
    };
           
js