The script works fine, 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>