Skip to content

Commit 20bf01d

Browse files
thoronwenThulinma
authored andcommitted
Embed: hide settings menu when gear icon is tapped (for mobile)
1 parent 4d94bf7 commit 20bf01d

File tree

7 files changed

+26
-7
lines changed

7 files changed

+26
-7
lines changed

embed/min/player.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

embed/min/skins/default.css

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ svg.icon.loading{z-index:-1;position:absolute;top:0;left:0;right:0;bottom:0;marg
88
[data-loading] svg.icon.loading{z-index:2;opacity:1}
99
[data-loading-css] .mistvideo-controls{display:none}
1010
[data-hidecursor],[data-hidecursor] *,[data-hidecursor] .mistvideo-pointer{cursor:none}
11-
.mistvideo-error{display:none;position:absolute;top:0;left:0;right:0;bottom:0;background-color:$background;align-items:center;justify-content:center;text-align:center;z-index:2;cursor:default;min-height:fit-content;min-width:fit-content}
11+
.mistvideo-error{display:none;position:absolute;top:0;left:0;right:0;bottom:0;background-color:$background;align-items:center;justify-content:center;text-align:center;z-index:2;cursor:default;min-height:fit-content;min-width:fit-content;height:100%}
1212
.mistvideo-error.show{display:flex}
1313
.mistvideo-error .message{max-width:80%}
1414
.mistvideo-error .message .details table{text-align:left}
@@ -84,8 +84,9 @@ svg.icon.timeout{display:inline-block;height:1em;width:1em;margin:0;margin-right
8484
.mistvideo-polling{display:inline-block;position:relative;width:25px;height:25px}
8585
.mistvideo-polling svg.icon.loading{z-index:0;opacity:1}
8686
.mistvideo[data-show-submenu] .mistvideo-submenu{right:5px}
87+
.mistvideo[data-hide-submenu] .mistvideo-submenu{right:-1000px!important}
8788
.mistvideo[data-show-submenu] .mistvideo-controls{bottom:0}
88-
.mistvideo-error[data-passive]{bottom:auto;left:auto;margin:.5em;padding:.5em}
89+
.mistvideo-error[data-passive]{bottom:auto;left:auto;height:auto;margin:.5em;padding:.5em}
8990
.mistvideo-error[data-passive] .message{max-width:none}
9091
.mistvideo-error .mistvideo-buttoncontainer{display:flex;flex-flow:row nowrap;justify-content:center}
9192
.mistvideo-error .mistvideo-buttoncontainer .mistvideo-button{white-space:nowrap}

embed/min/skins/dev.css

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ svg.icon.loading{z-index:-1;position:absolute;top:0;left:0;right:0;bottom:0;marg
88
[data-loading] svg.icon.loading{z-index:2;opacity:1}
99
[data-loading-css] .mistvideo-controls{display:none}
1010
[data-hidecursor],[data-hidecursor] *,[data-hidecursor] .mistvideo-pointer{cursor:none}
11-
.mistvideo-error{display:none;position:absolute;top:0;left:0;right:0;bottom:0;background-color:$background;align-items:center;justify-content:center;text-align:center;z-index:2;cursor:default;min-height:fit-content;min-width:fit-content}
11+
.mistvideo-error{display:none;position:absolute;top:0;left:0;right:0;bottom:0;background-color:$background;align-items:center;justify-content:center;text-align:center;z-index:2;cursor:default;min-height:fit-content;min-width:fit-content;height:100%}
1212
.mistvideo-error.show{display:flex}
1313
.mistvideo-error .message{max-width:80%}
1414
.mistvideo-error .message .details table{text-align:left}
@@ -84,8 +84,9 @@ svg.icon.timeout{display:inline-block;height:1em;width:1em;margin:0;margin-right
8484
.mistvideo-polling{display:inline-block;position:relative;width:25px;height:25px}
8585
.mistvideo-polling svg.icon.loading{z-index:0;opacity:1}
8686
.mistvideo[data-show-submenu] .mistvideo-submenu{right:5px}
87+
.mistvideo[data-hide-submenu] .mistvideo-submenu{right:-1000px!important}
8788
.mistvideo[data-show-submenu] .mistvideo-controls{bottom:0}
88-
.mistvideo-error[data-passive]{bottom:auto;left:auto;margin:.5em;padding:.5em}
89+
.mistvideo-error[data-passive]{bottom:auto;left:auto;height:auto;margin:.5em;padding:.5em}
8990
.mistvideo-error[data-passive] .message{max-width:none}
9091
.mistvideo-error .mistvideo-buttoncontainer{display:flex;flex-flow:row nowrap;justify-content:center}
9192
.mistvideo-error .mistvideo-buttoncontainer .mistvideo-button{white-space:nowrap}

embed/player.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ function MistVideo(streamName,options) {
402402
averagingSteps: 20, //the amount of measurements that are saved.
403403
threshold: function(){ //returns the score threshold below which the "action" should be taken
404404
if (this.MistVideo.source.type == "webrtc") {
405-
return 0.97;
405+
return 0.95;
406406
}
407407
return 0.75;
408408
},

embed/skins.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ MistSkins["default"] = {
306306
//also do something useful
307307
//show submenu
308308
MistVideo.container.setAttribute("data-show-submenu","");
309+
MistVideo.container.removeAttribute("data-hide-submenu");
309310
MistVideo.container.removeAttribute("data-hidecursor");
310311
//onmouseout, hide submenu
311312
var f = function(){
@@ -1200,8 +1201,19 @@ MistSkins["default"] = {
12001201
}
12011202
},
12021203
settings: function(){
1204+
var MistVideo = this;
1205+
12031206
var button = this.skin.icons.build("settings");
1204-
button.setAttribute("onclick","");
1207+
MistUtil.event.addListener(button,"click",function(){
1208+
if (MistVideo.container.hasAttribute("data-show-submenu")) {
1209+
MistVideo.container.setAttribute("data-hide-submenu",""); //don't show even when hovering
1210+
MistVideo.container.removeAttribute("data-show-submenu");
1211+
}
1212+
else {
1213+
MistVideo.container.setAttribute("data-show-submenu","");
1214+
MistVideo.container.removeAttribute("data-hide-submenu");
1215+
}
1216+
});
12051217
return button;
12061218
},
12071219
loop: function(){

embed/skins/default.css

+4
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,16 @@ svg.icon.timeout {
109109
.mistvideo[data-show-submenu] .mistvideo-submenu {
110110
right: 5px;
111111
}
112+
.mistvideo[data-hide-submenu] .mistvideo-submenu {
113+
right: -1000px !important;
114+
}
112115
.mistvideo[data-show-submenu] .mistvideo-controls {
113116
bottom: 0;
114117
}
115118
.mistvideo-error[data-passive] {
116119
bottom: auto;
117120
left: auto;
121+
height: auto;
118122
margin: 0.5em;
119123
padding: 0.5em;
120124
}

embed/skins/general.css

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ svg.icon.loading {
6464
cursor: default; /*cursor won't show up if it was hidden because the mousemove event can no longer reach the video element*/
6565
min-height: fit-content; /*overflow if needed*/
6666
min-width: fit-content;
67+
height: 100%;
6768
}
6869
.mistvideo-error.show { display: flex; }
6970
.mistvideo-error .message { max-width: 80%; }

0 commit comments

Comments
 (0)