About the video. Js

Video.js is a network video player with H5 background, supporting BOTH H5 and Flash video playback (loading local static resources video and network link video).

Liverpoolfc.tv: videojs.com/

The installation

npm  install video.jsCopy the code

Introduced in the main. Js

import Video from 'video.js'
import 'video.js/dist/video-js.css'

Vue.prototype.$video = VideoCopy the code

use


<div class="demo1-video">   
 <video id="myVideo"       
     class="video-js vjs-default-skin vjs-big-play-centered"Controls // Determines whether the player has controls that the user can interact with. Without controls, the only way to start a video playing is to use the AutoPlay property or through the Player API. autoplay:"muted", // // autoplay attribute,muted: preload="auto"// Suggest whether the browser should start downloading the video data immediately after the <video> element loads. poster=".. /assets/img/E0531.jpg"> // Set the video cover <source src=".. /assets/video/E0531.mp4" type="video/mp4"</video> </div>Copy the code

You can directly use CSS to control the width and height of the video

Screenshot of the effect achieved




Above: A simple application of video.js is done

If you have any questions about the above use, please leave a comment ~