question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding any events in youtube embedOptions stops the Player onReady event from ever triggering

See original GitHub issue

Current Behavior

Youtube embedOptions are completely overwritten with the config value ( src )

causing this handler to never run.

onReady: () => {
  if (loop) {
    this.player.setLoop(true) // Enable playlist looping
  }
  this.props.onReady()
},

the ready handler never running stops a couple things from working, one of them is changing the url (I’ve ran into this warning, though this particular problem can be circumvented by setting the url to empty first, and then to the new value), and the progress update won’t fire either.

Expected Behavior

both the event handlers passed in through the props, and the event handlers added in the Youtube class are classed

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
cookpetecommented, Oct 28, 2020

I’m going to add a console warning when embedOptions.events is set.

0reactions
mherczegcommented, Sep 17, 2020

fair enough, I guess I can work around using the youtube player events, thanks.

(I would still recommend to either not allow embedOptions.events in the config, or to not overwrite the default ones completely, so people naively trying to use youtube player events won’t break the player.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Youtube iframe player API 'onReady' event does not get ...
I'm using the youtube iframe player API for an app that I'm building. Everything worked fine until about a month ago (Feb 2014)....
Read more >
YouTube Player API Reference for iframe Embeds
It identifies the different types of events that the API can send and explains how to write event listeners to respond to those...
Read more >
JavaScript Player API — Support - Wistia
Runs a callback function when a specific event is triggered. Refer to the Events section to see how to respond to the different...
Read more >
react-player | Yarn - Package Manager
A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion.
Read more >
RPG Maker MV Tutorial #18 - Autorun Events! - YouTube
Autorun events will run automatically without the need for any trigger to occur. Using them, you can create things such as cut-scenes and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found