2
The script works normal, but the console is giving the following error:
'//@ sourceURL' and '//@ sourceMappingURL' are deprecated, Please use '//# sourceURL=' and '//# sourceMappingURL=' Instead. video.js:86 Uncaught (in Promise) Domexception: The play() request was Interrupted by a new load request.
Javascript:
$(function() {
var myPlayer = videojs("player", {
"controls": false,
"autoplay": true,
"preload": "auto",
"width": 750,
"height": 500
});
myPlayer.src({type: "video/mp4", src: '/videos/video.mp4'});
//;
var video = document.getElementById("player");
video.setAttribute("oncontextmenu", "return false;");
videojs.options.flash.swf = "/swf/video.swf";
$(' .vjs-control-bar').remove();
$('#player,#buttonVideo').click(function() {
if (myPlayer.paused()) {
myPlayer.play();
$('#buttonVideo').hide();
} else {
myPlayer.pause();
$('#buttonVideo').show();
}
});
});
HTML:
<video id="player" class="video-js vjs-default-skin" poster="/imagens/loader.gif"></video>