aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/players/Youtube.hx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/players/Youtube.hx')
-rw-r--r--src/client/players/Youtube.hx12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/client/players/Youtube.hx b/src/client/players/Youtube.hx
index 14eb3c2..678c34a 100644
--- a/src/client/players/Youtube.hx
+++ b/src/client/players/Youtube.hx
@@ -212,9 +212,11 @@ class Youtube implements IPlayer {
return;
}
if (youtube != null) {
+ isLoaded = false;
youtube.loadVideoById({
videoId: extractVideoId(item.url)
});
+ if (main.lastState.paused) youtube.pauseVideo();
return;
}
isLoaded = false;
@@ -234,8 +236,8 @@ class Youtube implements IPlayer {
events: {
onReady: e -> {
if (!main.isAutoplayAllowed()) e.target.mute();
- isLoaded = true;
if (main.lastState.paused) youtube.pauseVideo();
+ isLoaded = true;
player.onCanBePlayed();
},
onStateChange: e -> {
@@ -243,8 +245,16 @@ class Youtube implements IPlayer {
case UNSTARTED:
case ENDED:
case PLAYING:
+ if (!isLoaded) {
+ isLoaded = true;
+ player.onCanBePlayed();
+ }
player.onPlay();
case PAUSED:
+ if (!isLoaded) {
+ isLoaded = true;
+ player.onCanBePlayed();
+ }
player.onPause();
case BUFFERING:
player.onSetTime();
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage