aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/players
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
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')
-rw-r--r--src/client/players/Raw.hx2
-rw-r--r--src/client/players/Vk.hx2
-rw-r--r--src/client/players/Youtube.hx6
3 files changed, 5 insertions, 5 deletions
diff --git a/src/client/players/Raw.hx b/src/client/players/Raw.hx
index 01752e7..f054f14 100644
--- a/src/client/players/Raw.hx
+++ b/src/client/players/Raw.hx
@@ -76,7 +76,7 @@ class Raw implements IPlayer {
subs: subs,
});
}
- Utils.prepend(playerEl, video);
+ playerEl.prepend(video);
if (isHls) initHlsSource(video, url);
}
diff --git a/src/client/players/Vk.hx b/src/client/players/Vk.hx
index fbcf60c..599b5eb 100644
--- a/src/client/players/Vk.hx
+++ b/src/client/players/Vk.hx
@@ -107,7 +107,7 @@ class Vk implements IPlayer {
frameborder="0" allowfullscreen>
</iframe>'.trim()
);
- Utils.prepend(playerEl, tempVideo);
+ playerEl.prepend(tempVideo);
final tempVkPlayer = createVkPlayer(tempVideo);
tempVkPlayer.on("inited", () -> {
callback({
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