/ / Click to play the video
var videoRegion;
$(".visit-btn").on("click", function() {
if(videoRegion){
videoRegion.show(),
videoRegion.play();
}else{
$(document.body).append("<video id="my-video" class="video-region video-js vjs-big-play-centered" loop="loop" autoplay="autoplay" width="100%" height="100%" preload poster="" data-setup="{}" poster="/p/images/company/video.png"> <source src="/p/images/index.mp4" type="video/mp4"><source src="/p/images/index.webm" type="video/webm"></video>"),
videoRegion=videojs("my-video", {
controls: !0,
bigPlayButton: !1,
autoplay: !0
}, function(){
videoRegion.width($(window).width());
videoRegion.height($(window).height());
});
console.log(videoRegion.el_);
$("<div class="fullscreen-close"></div>").appendTo(videoRegion.el_).on("click",
function() {
videoRegion.pause();
videoRegion.exitFullscreen();
videoRegion.hide();
$("video").pause();
})
}
videoRegion.requestFullscreen();
});
after clicking to close the video,
videoRegion.pause ();
videoRegion.exitFullscreen ();
videoRegion.hide ();
$("video"). Pause ();
check out, but still play