aboutsummaryrefslogtreecommitdiffstats
path: root/res/client.js
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-03-02 20:17:31 +0300
committerRblSb <msrblsb@gmail.com>2020-03-02 20:17:31 +0300
commit5975bccc39f941044649d0ba72f43e5340396c66 (patch)
tree3adfec93e9acc2568bcbfdcae230a2196b684c7c /res/client.js
parent22aa8b4a4a0ec8bf6c082e75858b2c2803b1904c (diff)
Fix youtube player control
Diffstat (limited to 'res/client.js')
-rw-r--r--res/client.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/res/client.js b/res/client.js
index c197ff2..224cb9e 100644
--- a/res/client.js
+++ b/res/client.js
@@ -1891,10 +1891,11 @@ client_players_Youtube.prototype = {
this.video = window.document.createElement("div");
this.video.id = "videoplayer";
this.playerEl.appendChild(this.video);
- this.youtube = new YT.Player(this.video.id,{ videoId : client_players_Youtube.extractVideoId(item.url), playerVars : { autoplay : 1, modestbranding : 1, rel : 0, showinfo : 0}, events : { onStateChange : function(e) {
- switch(e.data) {
+ this.youtube = new YT.Player(this.video.id,{ videoId : client_players_Youtube.extractVideoId(item.url), playerVars : { autoplay : 1, modestbranding : 1, rel : 0, showinfo : 0, start : 0}, events : { onReady : function(e) {
+ return _gthis.isLoaded = true;
+ }, onStateChange : function(e1) {
+ switch(e1.data) {
case -1:
- _gthis.isLoaded = true;
_gthis.player.onCanBePlayed();
break;
case 0:
@@ -1918,7 +1919,9 @@ client_players_Youtube.prototype = {
if(this.video == null) {
return;
}
- this.playerEl.removeChild(this.video);
+ if(this.playerEl.contains(this.video)) {
+ this.playerEl.removeChild(this.video);
+ }
this.video = null;
}
,play: function() {
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage