سؤال

I'm loading a YouTube video into popcorn.js. How do I check to see if it fails to load?

This is my current code:

document.addEventListener("DOMContentLoaded", function () {
  // Create a popcorn instance by calling the Youtube player plugin
  var example = Popcorn.youtube(
    '#video',
    'http://www.youtube.com/watch?v=Zm1c2WTD93w&rel=0'
  );
}
هل كانت مفيدة؟

المحلول

As you can see on popcorn's media events page, they have an error event. You can find out how to handle it in on the utility methods page.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top