Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Commit

Permalink
Only set videoId on player if it's ready.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Apr 28, 2014
1 parent de2d6c1 commit 2e01ec9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions yt-video.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@
},
videoIdChanged: function() {
if (this.videoId && this.videoId !== true) {
if (this.player) {
if (this.isPlayerReady) {
this.playerNode.hidden = false;
this.player.loadVideoById(this.videoId);
} else {
this.createPlayer();
this.player.loadVideoById(this.videoId);
}
} else {
this.clearVideo();
Expand Down Expand Up @@ -94,6 +92,7 @@
}
},
playerReady: function(e) {
this.isPlayerReady = true;
this.player = e.target;
this.playerNode.hidden = true;
this.player.loadVideoById(this.videoId);
Expand Down

0 comments on commit 2e01ec9

Please sign in to comment.