Play video on 2D screen after button press

Hello,

I am trying to get an instructional video play with sound after a button press. I have everything working except once I click the button the video doesn’t play.

Editor here

https://playcanvas.com/editor/scene/1636350

In the VideoTexture.js script

I changed the code so it wouldn’t auto play, as I need sound with the video.

//IS THIS CORRECT??
 video.play = true;
    //video.autoplay = true;
    video.crossOrigin = 'anonymous';
    //video.loop = true;

    // muted attribute is required for videos to autoplay
    //video.muted = true;

Thanks!

play is a function, not an object property

Thank you @yaustar

For those interested below is some code on how to get the video texture from this tutorial to react to different buttons: play, pause, rewind.

  this.app.on('button:clicked:PlayButton',function (e) {
        video.play();
    }.bind(this));

    this.app.on('button:clicked:PauseButton',function (e) {
        video.pause();
        video.currentTime = 0;
    }.bind(this));

    this.app.on('button:clicked:ReplayButton',function (e) {
        console.log(video.currentTime);
        video.currentTime = video.currentTime - 10;
        console.log(video.currentTime);
    }.bind(this));