aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/players/Youtube.hx
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2025-01-25 15:32:55 +0300
committerRblSb <msrblsb@gmail.com>2025-01-25 22:52:14 +0300
commitc7518e58788c17ad2ca8340ab5c7633489aa9518 (patch)
tree79b283db70952fef4d9d930cb1dab4a554a377d1 /src/client/players/Youtube.hx
parent6ead98595d71afba9d11d3300756b46f18fd6bda (diff)
Add experimental unpauseWithoutLeader option
Also extended requestLeaderOnPause, so you can unpause when someone else is a leader by video click with this one. Only works for raw videos and doesn't work in FF, so there is new unsafe option that can break everything with enough clients. There is also leader button hints when you touch player as non-leader for easier ux.
Diffstat (limited to 'src/client/players/Youtube.hx')
-rw-r--r--src/client/players/Youtube.hx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/players/Youtube.hx b/src/client/players/Youtube.hx
index b30dfb3..f5fb88c 100644
--- a/src/client/players/Youtube.hx
+++ b/src/client/players/Youtube.hx
@@ -175,7 +175,7 @@ class Youtube implements IPlayer {
}
final video = document.createDivElement();
video.id = "temp-videoplayer";
- Utils.prepend(playerEl, video);
+ playerEl.prepend(video);
var tempYoutube:YoutubePlayer = null;
tempYoutube = new YoutubePlayer(video.id, {
videoId: extractVideoId(url),
@@ -232,12 +232,12 @@ class Youtube implements IPlayer {
onReady: e -> {
if (!main.isAutoplayAllowed()) e.target.mute();
isLoaded = true;
- youtube.pauseVideo();
+ if (main.lastState.paused) youtube.pauseVideo();
+ player.onCanBePlayed();
},
onStateChange: e -> {
switch (e.data) {
case UNSTARTED:
- player.onCanBePlayed();
case ENDED:
case PLAYING:
player.onPlay();
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage