aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-02-24 13:57:09 +0300
committerRblSb <msrblsb@gmail.com>2020-02-24 13:57:09 +0300
commit2849df4f2c5e7f289a7cf4c2db9daf68f5653545 (patch)
tree4e5a94d576d2ab2624d3005cadbc8dc9861cdd7e /res
parent9c6cd2c2310d2e3ce3d1a6e3350a97e7ba0ca657 (diff)
Save state and error logs
Diffstat (limited to 'res')
-rw-r--r--res/client.js16
-rw-r--r--res/langs/en.json1
-rw-r--r--res/langs/ru.json1
3 files changed, 15 insertions, 3 deletions
diff --git a/res/client.js b/res/client.js
index d9cc67b..4c3a8a5 100644
--- a/res/client.js
+++ b/res/client.js
@@ -591,6 +591,11 @@ client_Main.prototype = {
name = Lang.get("rawVideo");
}
this.getRemoteVideoDuration(url,function(duration) {
+ if(duration == 0) {
+ var tmp = Lang.get("addVideoError");
+ _gthis.serverMessage(4,tmp);
+ return;
+ }
_gthis.send({ type : "AddVideo", addVideo : { item : { url : url, title : name, author : _gthis.personal.name, duration : duration}, atEnd : atEnd}});
callback();
return;
@@ -606,7 +611,7 @@ client_Main.prototype = {
while(_g1 < items.length) _g.push(items[_g1++].url);
return _g;
}
- ,replaceLocalIp: function(url) {
+ ,tryLocalIp: function(url) {
if(this.host == this.globalIp) {
return url;
}
@@ -617,6 +622,9 @@ client_Main.prototype = {
var video = window.document.createElement("video");
video.src = src;
video.onerror = function(e) {
+ if(player.contains(video)) {
+ player.removeChild(video);
+ }
callback(0);
return;
};
@@ -633,7 +641,7 @@ client_Main.prototype = {
var data = JSON.parse(e.data);
var t = data.type;
var t1 = t.charAt(0).toLowerCase() + HxOverrides.substr(t,1,null);
- haxe_Log.trace("Event: " + data.type,{ fileName : "src/client/Main.hx", lineNumber : 188, className : "client.Main", methodName : "onMessage", customParams : [data[t1]]});
+ haxe_Log.trace("Event: " + data.type,{ fileName : "src/client/Main.hx", lineNumber : 193, className : "client.Main", methodName : "onMessage", customParams : [data[t1]]});
switch(data.type) {
case "AddVideo":
if(this.player.isListEmpty()) {
@@ -758,6 +766,8 @@ client_Main.prototype = {
if(guestName.value.length > 0) {
this.send({ type : "Login", login : { clientName : guestName.value}});
}
+ window.document.querySelector("#messagebuffer").innerHTML = "";
+ this.serverMessage(1);
var _g = 0;
var _g1 = connected.history;
while(_g < _g1.length) {
@@ -997,7 +1007,7 @@ client_Player.prototype = {
this.isLoaded = false;
this.video = window.document.createElement("video");
this.video.id = "videoplayer";
- item.url = this.main.replaceLocalIp(item.url);
+ item.url = this.main.tryLocalIp(item.url);
this.video.src = item.url;
this.video.controls = true;
this.video.oncanplaythrough = function(e) {
diff --git a/res/langs/en.json b/res/langs/en.json
index 5fa5d53..ea1ca74 100644
--- a/res/langs/en.json
+++ b/res/langs/en.json
@@ -6,6 +6,7 @@
"online": "online",
"nothingPlaying": "Nothing Playing",
"usernameError": "Username must be from 1 to $MAX characters and don't repeat another's.",
+ "addVideoError": "Failed to add video.",
"rawVideo": "Raw video",
"videos": "videos",
"addedBy": "Added by",
diff --git a/res/langs/ru.json b/res/langs/ru.json
index f9944d1..eb2c1b3 100644
--- a/res/langs/ru.json
+++ b/res/langs/ru.json
@@ -6,6 +6,7 @@
"online": "онлайн",
"nothingPlaying": "Ничего не играет",
"usernameError": "Ник должен быть от 1 до $MAX символов и не повторять чужие.",
+ "addVideoError": "Не удалось добавить видео.",
"rawVideo": "Исходное видео",
"videos": "видео",
"addedBy": "Добавлено",
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage