P5.js video upload into switch statement

var vid;
function preload(){
  vid=createVideo('back.mp4')
  
}
function setup() {
  createCanvas(300, 150);
  vid.play();
  //print(vid.width,vid.height)
}

function draw() {
  background(220)
 vid.position(0,0);
  
}