From 0c1a7ca55f90c18a02b16df664436bbe08e0f84f Mon Sep 17 00:00:00 2001 From: Antonio Laguna Date: Thu, 23 Mar 2017 22:36:43 +0100 Subject: [PATCH] Adding more docs --- src/js/plugins/youtube.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/js/plugins/youtube.js b/src/js/plugins/youtube.js index c396d06..4964a05 100644 --- a/src/js/plugins/youtube.js +++ b/src/js/plugins/youtube.js @@ -40,7 +40,7 @@ class Player { } /** - * + * Plays the video. */ play() { if (this.ready) { @@ -54,10 +54,14 @@ class Player { } /** - * + * Pause playing the video if it's already playing. */ pause() { - this.player.pauseVideo(); + if (this.player && + this.player.pauseVideo && + this.player.getPlayerState() === 1) { + this.player.pauseVideo(); + } } /**