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.hx17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/client/Main.hx b/src/client/Main.hx
index d3271e9..c74a600 100644
--- a/src/client/Main.hx
+++ b/src/client/Main.hx
@@ -12,7 +12,9 @@ import js.Browser;
import js.Browser.document;
import js.lib.Date;
import Client.ClientData;
-import Types;
+import Types.VideoData;
+import Types.Config;
+import Types.WsEvent;
using StringTools;
using ClientTools;
@@ -156,23 +158,20 @@ class Main {
url = '$protocol//$host:$port$url';
}
if (!url.startsWith("http")) url = '$protocol//$url';
- var name = url.substr(url.lastIndexOf('/') + 1);
- final matchName = ~/^(.+)\./;
- if (matchName.match(name)) name = matchName.matched(1);
- else name = Lang.get("rawVideo");
- player.getRemoteDuration(url, (duration:Float) -> {
- if (duration == 0) {
+ player.getVideoData(url, (data:VideoData) -> {
+ if (data.duration == 0) {
serverMessage(4, Lang.get("addVideoError"));
return;
}
+ if (data.title == null) data.title = Lang.get("rawVideo");
send({
type: AddVideo, addVideo: {
item: {
url: url,
- title: name,
+ title: data.title,
author: personal.name,
- duration: duration,
+ duration: data.duration,
isTemp: isTemp
},
atEnd: atEnd
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage