Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoplay isn't working every time #460

Closed
Aarbel opened this issue Aug 5, 2018 · 9 comments
Closed

Autoplay isn't working every time #460

Aarbel opened this issue Aug 5, 2018 · 9 comments

Comments

@Aarbel
Copy link

Aarbel commented Aug 5, 2018

Hi @cookpete,

I'm facing some issue with autoplay and basic prop playing={true}.

This happens when the navigator opens from an external link

To reproduce :

  • Click on your app link from outside your navigator (for me i clicked from VScode, and that opens the link inside Chrome) - The video doesn't autoplay and is in paused mode, even if the prop playing is true.
  • Reload the page - The autoplay works

How could i force play ?

@yoiang
Copy link

yoiang commented Aug 5, 2018

@Aarbel I had the same issue and a quick search turned this up, which helped me out!

TLDR: Chrome makes you choose to either not autoplay or autoplay muted, so web developers are building pages that can annoy their users. Adding muted to my react-player tag works consistently!

@Aarbel
Copy link
Author

Aarbel commented Aug 5, 2018

thanks a lot @yoiang, did you found a workaround to allow both autoplay and not muted ? (like a Timeout hack, or something like that)

@yoiang
Copy link

yoiang commented Aug 6, 2018

I haven't explored that yet!

@MatanBobi
Copy link

@Aarbel Unfortunately there is no such way. An unmuted video can be played (for 100% of the use cases) only after a user interaction.

@cookpete
Copy link
Owner

Even if there was a hack to enable unmuted autoplay, soon enough Chrome would release a patch so the hack would no longer work.

I agree that unmuted autoplay can be useful when used responsibly, but the unfortunate reality is that the majority of companies use it to create a negative, annoying experience for the user that needlessly uses up bandwidth. Safari on iOS started the trend, Chrome is catching up, and eventually the rest will too.

@softmarshmallow
Copy link

softmarshmallow commented May 29, 2021

adding muted tag does not allow safari / mobile chrome to autoplay.
Any alternative theory?

https://github.com/bridgedxyz/bridged.xyz

<ReactPlayer
            url="https://www.youtube.com/watch?v=RIZjZFoDhRc&ab_channel=Bridged"
            width="100%"
            height="100%"
            playing
            loop
            muted
            onStart={handleOnYoutubePlayStart}
            onEnded={handleOnYoutubePlayEnd}
            config={{
              file: {
                attributes: {
                  preload: "auto",
                },
              },
            }}
          />

@muchirajunior
Copy link

my player cannot auto play still even when i sett playing to true

@codebravotech
Copy link

Add the playsinline attribute to your ReactPlayer instance (make sure it's all lowercase- the react-player module doesn't follow the camel case React convention in this case 👍🏻)

@muchirajunior
Copy link

okey thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants