Corretto layout per la live. Ancora non riesco a caricare un video delle dimensioni corrette.

This commit is contained in:
Emiliano Vavassori 2020-11-23 01:13:32 +01:00
parent 71f4b86bde
commit ec5ae57cc6
20 changed files with 1509 additions and 110 deletions

2
content/js/jquery-3.5.1.min.js vendored Normal file

File diff suppressed because one or more lines are too long

40
content/js/onload.js Normal file
View file

@ -0,0 +1,40 @@
var globalResizerTimer = null;
var sedicinoni = 1.777784514;
function resizeLive() {
// Let's calculate the right needed height for the video based on the
// browser settings.
var livewidth = $(window).innerWidth() - 10;
var liveheight = $(window).innerHeight() - 136 - 10;
// Calculate the videowidth based on proportions
var videowidth = Math.ceil(livewidth * 0.75);
var videoheight = Math.ceil(videowidth / sedicinoni);
var chatwidth = livewidth - videowidth;
// Case 1: the height calculated with the aspect ratio is bigger than the
// available space. Let's reverse the calculation and understand which video
// size we need
if (videoheight > liveheight) {
var videowidth = Math.round(liveheight * sedicinoni);
var chatwidth = livewidth - videowidth;
$("#live").height(liveheight);
$("#embedded-video").width(videowidth).height(liveheight);
$("#embedded-chat").width(chatwidth);
} else {
// In any other case, I will apply all the dimensions
$("#live").height(liveheight);
$("#embedded-video").width(videowidth);
$("#embedded-video iframe").attr("width", videowidth).attr("height", liveheight);
$("#embedded-chat").width(chatwidth);
}
}
$(document).ready(resizeLive());
$(window).resize(function(){
if (globalResizerTimer != null)
window.clearTimeout(globalResizeTimer);
globalResizeTimer = window.setTimeout(function(){
resizeLive();
}, 200);
});

View file

@ -2,7 +2,11 @@ title: Live - Conferenza Italiana LibreItalia
slug: live
template: large
# Live - Settima Conferenza Italiana LibreItalia 2020 #
<iframe id="embedded-chat" src="https://chat.linux.it/channel/libreitaliaconf?layout=embedded" width="100%" height="90%" style="min-height:400px"></iframe>
<iframe src="" style="position:absolute;top:0;left:0;width:99%;height:99%;" frameborder="0" allow="autoplay; fullscreen;" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
<div id="live">
<div id="embedded-video">
<iframe src="https://garr.tv/s/5fb82e7a175ddc33aa1e62d1?t=0" scrolling="no" marginwidth="0" allow="autoplay; fullscreen;" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
</div>
<div id="embedded-chat">
<iframe src="https://chat.linux.it/channel/libreitaliaconf?layout=embedded"></iframe>
</div>
</div>