Video and Sound speeding up and slowing down

For Code of Music class I created a video and sound player in P5js that allows you to speed up and slow down a video along with it’s sound. The video and sound mix is something I recorded and created this summer as part of a series I created using Processing to learn how to manipulate video with sound. The chord is from freesound user named Polo25. I couldn’t get a clean video recording.

Screen Shot 2018-10-22 at 2.52.17 PM.png

Since Tone.js appears to not have a video library, I used P5js. Instead of Tone’s playbackRate I used P5’s function called speed and tried to map it to mouse position but it did not work. I was able to create buttons that allow the speeding up and slowing down, however.

function vidLoad() {
  //trying to use a gradual playback rate 
  ele.speed = (map(mouseX, 0, width, 0.1, 1));
//maybe it has to be in draw?
function draw(){
    ele.playbackRate = (map(mouseX, 0, width, 0.1, 1));

Turns out you cannot map speed. I got the following error:

Uncaught TypeError: ele.speed is not a function (sketch: line 61)