aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/Main.hx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/Main.hx')
-rw-r--r--src/client/Main.hx40
1 files changed, 24 insertions, 16 deletions
diff --git a/src/client/Main.hx b/src/client/Main.hx
index 3400595..900f841 100644
--- a/src/client/Main.hx
+++ b/src/client/Main.hx
@@ -250,7 +250,7 @@ class Main {
author: personal.name,
duration: data.duration,
isTemp: isTemp,
- isIframe: false
+ isIframe: data.isIframe == true
},
atEnd: atEnd
}});
@@ -263,23 +263,31 @@ class Main {
final iframe = iframeCode.value;
if (iframe.length == 0) return;
iframeCode.value = "";
- final mediaName:InputElement = cast ge("#customembed-title");
- final name = mediaName.value.length == 0 ? "Custom Media" : mediaName.value;
- mediaName.value = "";
+ final mediaTitle:InputElement = cast ge("#customembed-title");
+ final title = mediaTitle.value;
+ mediaTitle.value = "";
final checkbox:InputElement = cast ge("#customembed").querySelector(".add-temp");
final isTemp = checkbox.checked;
- send({
- type: AddVideo, addVideo: {
- item: {
- url: iframe,
- title: name,
- author: personal.name,
- duration: 99 * 60 * 60,
- isTemp: isTemp,
- isIframe: true
- },
- atEnd: atEnd
- }});
+ player.getIframeData(iframe, (data:VideoData) -> {
+ if (data.duration == 0) {
+ serverMessage(4, Lang.get("addVideoError"));
+ return;
+ }
+ if (title.length > 0) data.title = title;
+ if (data.url == null) data.url = iframe;
+ send({
+ type: AddVideo, addVideo: {
+ item: {
+ url: data.url,
+ title: data.title,
+ author: personal.name,
+ duration: data.duration,
+ isTemp: isTemp,
+ isIframe: true
+ },
+ atEnd: atEnd
+ }});
+ });
}
public function toggleVideoElement():Bool {
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage