aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-04-27 11:12:17 +0300
committerRblSb <msrblsb@gmail.com>2020-04-27 11:12:17 +0300
commitdcba207583b70426a4cf0e566241894a13911758 (patch)
tree4281a9c5ac41ef775f0c11cec01376f126937df4 /res
parent9f93fb9783c4647a0e25b67078dded196d035ca9 (diff)
Improve video emotes
Diffstat (limited to 'res')
-rw-r--r--res/client.js17
-rw-r--r--res/css/cytube.css6
2 files changed, 11 insertions, 12 deletions
diff --git a/res/client.js b/res/client.js
index 715fe24..f19bebc 100644
--- a/res/client.js
+++ b/res/client.js
@@ -1154,7 +1154,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 : 303, className : "client.Main", methodName : "onMessage", customParams : [data[t1]]});
+ haxe_Log.trace("Event: " + data.type,{ fileName : "src/client/Main.hx", lineNumber : 305, className : "client.Main", methodName : "onMessage", customParams : [data[t1]]});
switch(data.type) {
case "AddVideo":
this.player.addVideoItem(data.addVideo.item,data.addVideo.atEnd);
@@ -1588,11 +1588,16 @@ client_Main.prototype = {
e.target.onload = null;
}
,onChatVideoLoaded: function(e) {
- var _gthis = this;
- haxe_Timer.delay(function() {
- _gthis.scrollChatToEnd();
- return e.target.onloadedmetadata = null;
- },100);
+ var el = e.target;
+ if(this.emoteMaxSize == null) {
+ this.emoteMaxSize = Std.parseInt(window.getComputedStyle(el).getPropertyValue("max-width"));
+ }
+ var max = this.emoteMaxSize;
+ var ratio = Math.min(max / el.videoWidth,max / el.videoHeight);
+ el.style.width = "" + el.videoWidth * ratio + "px";
+ el.style.height = "" + el.videoHeight * ratio + "px";
+ this.scrollChatToEnd();
+ el.onloadedmetadata = null;
}
,scrollChatToEnd: function() {
var msgBuf = window.document.querySelector("#messagebuffer");
diff --git a/res/css/cytube.css b/res/css/cytube.css
index 55e832c..a550826 100644
--- a/res/css/cytube.css
+++ b/res/css/cytube.css
@@ -109,12 +109,6 @@
max-width: 200px;
max-height: 200px;
}
-video.channel-emote, video.chat-img {
- background-color: transparent;
- /* Fixes default video tag size in chat when tab unloads videos in background */
- /* (some browsers optimization i guess) */
- height: 150px;
-}
/*
#userpl_list li {
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage