mirror of
https://github.com/eliasstepanik/vdo.ninja.git
synced 2026-01-16 08:08:28 +00:00
Delete textmixer.html
This commit is contained in:
parent
4c7ffeac34
commit
93b1d8f0c7
@ -1,64 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
<div id="playwindow"></div>
|
||||
<script>
|
||||
|
||||
var mediaPool = [];
|
||||
|
||||
function updateMixer(){
|
||||
|
||||
var w = window.innerWidth;
|
||||
var h = window.innerHeight;
|
||||
var ww = w/16;
|
||||
var hh = h/9;
|
||||
|
||||
if (mediaPool.length>1){
|
||||
var mod = Math.pow((ww*hh)/(mediaPool.length-1),0.5)
|
||||
var rw = Math.ceil(ww/mod);
|
||||
var rh = Math.ceil(hh/mod);
|
||||
} else { rw=1; rh=1;}
|
||||
|
||||
var playarea = document.getElementById("playwindow");
|
||||
playarea.innerHTML = "";
|
||||
var i=0;
|
||||
var offset = 0;
|
||||
mediaPool.forEach(vid=>{
|
||||
|
||||
var vw = vid.videoWidth;
|
||||
var vh = vid.videoHeight;
|
||||
var ar = vw/vh;
|
||||
vid.style.position = "absolute";
|
||||
|
||||
if (Math.ceil((i+1)/rw)==rh){
|
||||
offset = (rw*rh -mediaPool.length )*(w/rw)/2;
|
||||
console.log(offset);
|
||||
}
|
||||
|
||||
vid.style.left = Math.floor(offset+((i%rw)+0)*w/rw)+"px";
|
||||
|
||||
vid.style.top = Math.floor((Math.floor(i/rw)+0)*h/rh)+"px";
|
||||
|
||||
vid.style.width = Math.ceil(w/rw)+"px";
|
||||
vid.style.height = Math.ceil(h/rh)+"px";
|
||||
playarea.appendChild(vid);
|
||||
i+=1;
|
||||
});
|
||||
}
|
||||
|
||||
function addVideo(filename){
|
||||
var x = document.createElement("VIDEO");
|
||||
x.src = filename;
|
||||
mediaPool.push(x);
|
||||
updateMixer();
|
||||
}
|
||||
|
||||
window.addEventListener("resize", updateMixer);
|
||||
</script>
|
||||
<div style="top:800px;position:absolute">
|
||||
<button onclick="addVideo('480.mp4');">480</button>
|
||||
<button onclick="addVideo('1280.mp4');">1280</button>
|
||||
<button onclick="addVideo('640.mp4');">640</button>
|
||||
<button onclick="addVideo('1920.mp4');">1920</button>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user