# Video Playback Problem

**URL:** <https://discourse.processing.org/t/video-playback-problem/16520>\
**Category:** Coding Questions\
**Created:** [December 19, 2019, 5:27pm UTC](https://discourse.processing.org/t/video-playback-problem/16520 "2019-12-19T17:27:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Comradetony](https://avatars.discourse-cdn.com/v4/letter/c/a698b9/32.png) [@Comradetony](https://discourse.processing.org/u/Comradetony)\
**Post date:** [December 19, 2019, 5:27pm UTC](https://discourse.processing.org/t/video-playback-problem/16520/1 "2019-12-19T17:27:06Z")

</div>

Hi. I’m trying to make it so this sketch plays videos upon clicking the images, but so far I have not been able to make the videos play at all, let alone swap between them freely.

```auto
var immol;
var i = 'Immolation1.mp4';
var erf;
var venus;
var vv1;
var vv2;
var vv3;
var v1;
var v2;
var v3;
var f1;
var f2;
var f4;
var f3;

function preload(){
  immol = createVideo(i,onLoad);
  erf = createVideo(['erf.mp4']);
  venus = createVideo(['venus.mp4']);
  //immol.size(640, 336)
  //erf.size(640, 336)
  //venus.size(640,336)

}

function setup() {

  immol.loop();
  immol.hide();
  immol.showControls();
  erf.loop();
  erf.hide();
  erf.showControls();
  venus.loop();
  venus.hide();
  venus.showControls();
  //fill('black');
//createCanvas(640, 336);
noCanvas()
}

function draw() {
background(0);
v1 = createImg('Immolation.jpg');
v1.position(660, 40);
//image(immol, 0, 0);
v1.mousePressed(immol);
v2 = createImg('erf.PNG');
v2.position(660, 140);
//
v3 = createImg('venus.PNG');
v3.position(660, 240);
//
}
function onLoad() {
  immol.play()
}

```

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [December 20, 2019, 2:12am UTC](https://discourse.processing.org/t/video-playback-problem/16520/2 "2019-12-20T02:12:37Z")

</div>

why not start from a working example?  
[https://editor.p5js.org/p5/sketches/Dom:\_Video](https://editor.p5js.org/p5/sketches/Dom:_Video)
