javascript – Video background with multiple files (library)

I'm trying to add a video library (I want to use multiple files that can be played in random order) as a background and I can not find a way to do it in js.

my html file includes this js script and i want the script to read multiple files without looking for a way to do it.

// video element
videoEl: document.querySelector (# background_video),

// container element
container: document.querySelector (& # 39; body & # 39;),

// resize
resize: true,

// autoplay: false,

isMobile: window.matchMedia (& # 39; (max-width: 768px) & # 39;). matches,

playButton: document.querySelector (# play #),
pauseButton: document.querySelector (# pause;)

// array of objects containing src and type
// different video formats to add
src: [
  {
    src: 'jews.mp4',
    type: 'video/mp4'
  },
  {
    src: 'jews.webm',
    type: 'video/webm;codecs="vp8, vorbis"'
  }
],
// What to do once the video is loaded (initial image)
onLoad: function () {
document.querySelector (& # 39; # video_cover & # 39;). style.display = 'none';
}