player icon indicating copy to clipboard operation
player copied to clipboard

Youtube & Vimeo provider throw provider destroyed error

Open Benny739 opened this issue 1 year ago • 5 comments

Current Behavior:

When youtube or vimeo provider are getting destroyed they are throwing a "provider destroyed" error. Problem is already mentioned in a discussion: #1378

Expected Behavior:

No error is thrown when provider gets destroyed

Steps To Reproduce:

  1. Switch to youtube or vimeo in the demo
  2. Switch to some other provider
  3. Error gets thrown

Benny739 avatar Oct 06 '24 20:10 Benny739

I get the same if trying to switch the src from Youtube to Vimeo or the other way around.

If I first set the src = '', and then to the Vimeo src after a timeout, there's no error.

wplit avatar Oct 09 '24 03:10 wplit

I was able to avoid this error by exiting my onProviderChange function before processing the undefined provider:

const onProviderChange = provider => {
  // exit if no provider to prevent error
  if (!provider) {
    return;
  }
  if (isVimeoProvider(provider)) {
      // handle vimeo provider
  }
  if (isYouTubeProvider(provider)) {
    // handle youtube provider
  }
};
  
...

<MediaPlayer 
  onProviderChange={onProviderChange}
  {...}
>
  {...}
</MediaPlayer>

reilnuud avatar Oct 17 '24 04:10 reilnuud

@reilnuud This is not working, showing the same error! Have any one found a fix?

joseph-9900 avatar Feb 13 '25 16:02 joseph-9900

I'm experiencing this issue as well, any fix yet?

stevensecreti avatar Feb 15 '25 19:02 stevensecreti

My original workaround of setting set the src = '' before changing to another source no longer works.

wplit avatar Mar 04 '25 23:03 wplit