aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/Buttons.hx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/Buttons.hx')
-rw-r--r--src/client/Buttons.hx24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/client/Buttons.hx b/src/client/Buttons.hx
index 7df6486..86a7d82 100644
--- a/src/client/Buttons.hx
+++ b/src/client/Buttons.hx
@@ -255,9 +255,27 @@ class Buttons {
final removeBtn = ge("#removeVideoBtn");
removeBtn.onclick = e -> {
- final has = main.toggleVideoElement();
- if (has || main.isListEmpty()) removeBtn.innerText = Lang.get("removeVideo");
- else removeBtn.innerText = Lang.get("addVideo");
+ final hasVideo = main.toggleVideoElement();
+ if (hasVideo || main.isListEmpty()) {
+ removeBtn.innerText = Lang.get("removeVideo");
+ } else {
+ removeBtn.innerText = Lang.get("addVideo");
+ }
+ }
+ final setVideoUrlBtn = ge("#setVideoUrlBtn");
+ setVideoUrlBtn.onclick = e -> {
+ final src = window.prompt(Lang.get("setVideoUrlPrompt"));
+ if (src.trim() == "") { // reset to default url
+ main.refreshPlayer();
+ return;
+ }
+ JsApi.setVideoSrc(src);
+ }
+ final selectLocalVideoBtn = ge("#selectLocalVideoBtn");
+ selectLocalVideoBtn.onclick = e -> {
+ Utils.browseFileUrl((url:String, name:String) -> {
+ JsApi.setVideoSrc(url);
+ });
}
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage