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

Unavailable This video can't be embedded. #464

Closed
ghost opened this issue Aug 13, 2018 · 3 comments
Closed

Unavailable This video can't be embedded. #464

ghost opened this issue Aug 13, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 13, 2018

Hi @cookpete ,

I'm experiencing a slight problem with react-player on some facebook videos.

If a video cannot be embedded, it causes all the other videos to display the same message. In other words, the [ReactPlayer] fails to work properly and just throws the following message on changing a url, because it will never be loaded: Player.js:179 ReactPlayer: the attempt to load {video} is being deferred until the player has loaded

aug-13-2018 15-32-27

Also, the [ReactPlayer] doesn't throw any errors, so I cannot find a good workaround on that.
In order to avoid this problem, you could pass the key prop with, for example, a new video id. It will lead to unmounting and recreation and, therefore, let the problem go away, but it also leads to a slow performance.

The facebook video ID is 2061408887454620
I'm using react-player@1.6.4

Do you have any thoughts on how we can deal with that?

Thank you in advance

@cookpete
Copy link
Owner

The bug is occurring because of this logic to prevent issues when switching quickly between URLs.

Annoyingly, Facebook's Video Player API doesn't trigger any events when the video can't be embedded, so we can't set isLoading back to false when it happens.

I hacky fix for the meantime would be to manually set the flag on the internal player instance before loading another URL:

class Player extends Component {
  state = {
    url: null
  }
  load (url) {
    if (this.rp.player) {
      this.rp.player.isLoading = false
    }
    this.setState({ url })
  }
  render () {
    return (
      <div>
        <ReactPlayer 
          ref={rp => this.rp = rp}
          url={this.state.url}
        />
        <button onClick={() => this.load(EMBEDDABLE_URL)} />
        <button onClick={() => this.load(NON_EMBEDDABLE_URL)} />
      </div>
    )
  }
}

cookpete added a commit that referenced this issue Sep 20, 2018
Manually set isLoading to false when we know the FB SDK has loaded, even if onReady/onPlay hasn't been called (like when a video is non-embeddable)
#464
@cookpete
Copy link
Owner

Hopefully this is fixed in 1.6.5

david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this issue Dec 23, 2018
Manually set isLoading to false when we know the FB SDK has loaded, even if onReady/onPlay hasn't been called (like when a video is non-embeddable)
cookpete/react-player#464
david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this issue May 23, 2020
Manually set isLoading to false when we know the FB SDK has loaded, even if onReady/onPlay hasn't been called (like when a video is non-embeddable)
cookpete/react-player#464
albanqoku added a commit to albanqoku/react-player that referenced this issue Feb 24, 2021
Manually set isLoading to false when we know the FB SDK has loaded, even if onReady/onPlay hasn't been called (like when a video is non-embeddable)
cookpete/react-player#464
Webmaster1116 added a commit to Webmaster1116/video-player that referenced this issue May 20, 2021
Manually set isLoading to false when we know the FB SDK has loaded, even if onReady/onPlay hasn't been called (like when a video is non-embeddable)
cookpete/react-player#464
webmiraclepro added a commit to webmiraclepro/video-player that referenced this issue Sep 9, 2022
Manually set isLoading to false when we know the FB SDK has loaded, even if onReady/onPlay hasn't been called (like when a video is non-embeddable)
cookpete/react-player#464
@ishantmehta01
Copy link

ishantmehta01 commented Jul 30, 2024

I am using this URL, which says "This video can't be embedded because it may contain content owned by someone else."
URL: https://www.facebook.com/LaMonnaieDeMunt/videos/270512041924875/?ref=embed_video

I can open this Video in incognito mode

https://cookpete.github.io/react-player/

Screenshot 2024-07-30 at 3 30 24 PM Screenshot 2024-07-30 at 3 32 04 PM

@cookpete Could you help here?

philip-luther added a commit to philip-luther/react-player that referenced this issue Nov 22, 2024
Manually set isLoading to false when we know the FB SDK has loaded, even if onReady/onPlay hasn't been called (like when a video is non-embeddable)
cookpete/react-player#464
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

2 participants