3

I am dynamically loading embedded youtube videos into the http://plyr.io custom player

  player.source({
    type:       'video',
    title:      'Example title',
    sources: [{
        src:    '5WU7oGiwiao', // youtube 11 digit id
        type:   'youtube'
    }]

However I am receiving the following error:

Uncaught TypeError: Cannot read property 'play' of undefined.

This error is blocking other elements of my javascript from executing but I cannot figure out why it is happening.

The error doesn't occur if I load the player statically

<div class="plyr"><div data-type="youtube" data-video-id="5WU7oGiwiao"></div></div>

JSFiddle: http://codepen.io/cwaldau/pen/JbXjKW

Thank you

beaver
  • 17,333
  • 2
  • 40
  • 66
cwal
  • 3,732
  • 3
  • 19
  • 20

0 Answers0