resize iframe if view width is smaller than frame
This commit is contained in:
parent
1124bd9fb2
commit
aaaf02ba1d
10
index.html
10
index.html
@ -148,6 +148,14 @@
|
||||
document.getElementById('live').remove();
|
||||
}
|
||||
|
||||
const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
|
||||
const vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0);
|
||||
|
||||
if (document.getElementById('live').width > vw) {
|
||||
document.getElementById('live').width = vw;
|
||||
document.getElementById('live').height = vw * (9 / 16);
|
||||
}
|
||||
|
||||
// check if stream active every 5 seconds
|
||||
setInterval(function checkLive() {
|
||||
fetch(new URL('index.m3u8', socials.live.link))
|
||||
@ -157,8 +165,6 @@
|
||||
return checkLive;
|
||||
}(), 5000);
|
||||
|
||||
const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
|
||||
const vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0);
|
||||
const min_speed = 10;
|
||||
const max_speed = 20;
|
||||
let entities = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user