React-player: ReactPlayer autoplay muted video on mobile

Created on 6 Jun 2017  路  3Comments  路  Source: cookpete/react-player

I can't manage to autoplay video on mobile browser, I dont have any audio and there is my code :

<div className="react-video" ref={el => this.videoWrapper = el}>
    <ReactPlayer width={this.state.width} height={this.state.height}
        url='https://atmost.fr/assets/video/yosemite720.webm' fileConfig={{ attributes: { "muted": "true", "autoPlay": "true" } }} muted playinline playing={this.state.playing} loop autoplay />
</div>

But when I inspect my page I only see this :
<video src="https://atmost.fr/assets/video/yosemite720.webm" preload="auto" loop autoplay style="width: 100%; height: 100%; display: block;"></video>

What is the problem ?

Most helpful comment

@CookPete I guess this issue is about the fact, that in attributes there is: "muted": "true" but it doesn't show in the video tag. I just ran into the same issue right now and can't find solution.

All 3 comments

have the same issue, apparently ios policy (and implementation) does not allow you to autoplay.

This problem is addressed in the readme. We are at the mercy of how mobile browsers behave, and they tend to deliberately prevent autoplay to stop users from unnecessarily using mobile data.

I am open to any straightforward, reliable, cross-browser solutions but this will be an ongoing battle with mobile browsers in general.

@CookPete I guess this issue is about the fact, that in attributes there is: "muted": "true" but it doesn't show in the video tag. I just ran into the same issue right now and can't find solution.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sedubois picture sedubois  路  6Comments

intelligence picture intelligence  路  3Comments

rockmandash picture rockmandash  路  5Comments

rebelliard picture rebelliard  路  3Comments

zverbatim picture zverbatim  路  8Comments