react-player icon indicating copy to clipboard operation
react-player copied to clipboard

iOS double-tap needed to start playing the video

Open claudiopedrom opened this issue 6 years ago • 6 comments

Current Behavior

On iOS 13 and 14 (Safari and Chrome), when clicking on a video the "poster" image disappears, but it's still necessary to tap again on the video to start playing. Basically, a double-tap is needed.

This issue seems related to these two:

  1. https://github.com/CookPete/react-player/issues/706
  2. https://github.com/CookPete/react-player/issues/543

Expected Behavior

On tap start the video immediately.

Steps to Reproduce

Looking at the others issues it seems that this issue is related to the use of the light prop.

Current implementation:

<ReactPlayer
ref={ref}
url={src}
light={thumbnail}
config={{ youtube: { playerVars: youtubePlayerParams }, vimeo: { playerOptions: vimeoPlayerParams } }}
playing={true}
playIcon={
  <PlayButton>...</PlayButton>
}
/>

Environment

Other Information

Has anyone faced this issue recently? Any possible solution?

claudiopedrom avatar Sep 28 '20 13:09 claudiopedrom

I set light to false and add absolute positioned element with thumbnail over video.

{isMobile && thumbnail && !isStarted && (
   <div className="mobile-thumbnail" onClick={this.handlePlayPause}>
       <img src={thumbnail}
         alt="video-thumbnail"
         className="thumbnail"
      />
      <PlayButton/>
   </div>
 )}

denny7 avatar Oct 15 '20 14:10 denny7

Hey @denny7 thanks for your suggestion, unfortunately, the issue maintains even without passing the light prop.

claudiopedrom avatar Oct 28 '20 17:10 claudiopedrom

I'd be surprised if there is ever a solution for this.

Mobile browsers are getting more and more strict about when to allow something to be played. Light mode is bound to never work correctly on mobile, because browsers require direct user interaction to "activate" the media element. Using light mode means the media element doesn't exist at the point of user interaction.

I'm more than happy if people find hacks/workarounds for this but I don’t think it will ever be properly solved.

cookpete avatar Oct 28 '20 20:10 cookpete

Thanks @cookpete, if I find any solution I will put it here!

claudiopedrom avatar Oct 29 '20 09:10 claudiopedrom

Thanks @cookpete, if I find any solution I will put it here!

Hi @claudiopedrom, I don't suppose you ever found a solution to this?

mark-tomlinson-dev avatar Apr 13 '22 05:04 mark-tomlinson-dev

Thanks @cookpete, if I find any solution I will put it here!

Hi @claudiopedrom, I don't suppose you ever found a solution to this?

Hey! Unfortunately, it's been a long time and I don't remember and I also no longer have access to the project. 😞

claudiopedrom avatar Apr 13 '22 08:04 claudiopedrom