One, video.js video playback
Github:https://github.com/videojs/video.js
Base code:
<script src= "Https://unpkg.com/video.js/dist/video.js" ></script>
<video
id= "My-player"
class= "Video-js vjs-default-skin vjs-big-play-centered" Controls
preload= "Auto" x5-playsinline= "playsinline=" "webkit-playsinline=" "poster=" "data-setup=" "Example_option
": True} ' >
</video>
var player = Videojs (' My-player ', options, function Onplayerready () {
videojs.log (' Your player is ready! ');
In the, "This" is the player of that being created by Video.js.
This.play ();
How about an event listener?
This.on (' Ended ', function () {
videojs.log (' Awww...over so soon?! ');
});
Turn on AutoPlay (support for Android, IOS, PC):
<video
id= "My-player"
class= "Video-js vjs-default-skin vjs-big-play-centered" Controls
preload= "Auto"
x5-playsinline= "playsinline=" "webkit-playsinline=" "poster=" "data-setup=" "Example_"
Option ": true} ' >
Second, Videojs-contrib-hls live function
Github:https://github.com/videojs/videojs-contrib-hls
<script src= "Https://unpkg.com/videojs-contrib-hls/dist/videojs-contrib-hls.js" ></script>
Android, iOS need to m3u8 format live address
WebKit and other PC browsers need Videojs-flash support playback TRMP
Third, Videojs-flash Chrome and other browser-assisted
Github:https://github.com/videojs/videojs-flash
<script src= "Https://unpkg.com/videojs-flash/dist/videojs-flash.js" ></script>