tkloht/react-video-cover

How to mute the video & loop on it ?

aloysius-tim opened this issue · 1 comments

Hi there !

Thanks for this cool plugin.

I try to use it but have the following error:

Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD

Video do not play alone while having the play() in componentDidMount

Thanks

componentDidMount() {
    this.videoRef.muted = true;
    this.videoRef.loop = true;
    this.videoRef.play();
  }

const videoOptions = {
      src: '/intro.mp4',
      ref: videoRef => {
        this.videoRef = videoRef;
      },
    };

<VideoCover videoOptions={videoOptions}/>