我正在尝试使用Bideo库将背景视频添加到我的Django网站中,但是当我加载页面时,它为我的视频文件返回404错误,这是我的代码 如何在视频目录中指向bgvideo.mp4?
/mywebsite
/ctrlcntr
/static
/video
bgvideo.mp4
/js
Bideo.js
theme.js
(function () {
var bv = new Bideo();
bv.init({
// Video element
videoEl: document.querySelector('#home_main_pic'),// Container element
container: document.querySelector('body'),// Resize
resize: true,// autoplay: false,isMobile: window.matchMedia('(max-width: 768px)').matches,playButton: document.querySelector('#play'),pauseButton: document.querySelector('#pause'),// Array of objects containing the src and type
// of different video formats to add
src: [
{
src: '../video/bgvideo.mp4',type: 'video/mp4'
},{
src: '../video/bgvideo.webm',type: 'video/webm;codecs="vp8,vorbis"'
}
],// What to do once video loads (initial frame)
onLoad: function () {
document.querySelector('#video_cover').style.display = 'none';
}
});
}());