Skip to content

Commit

Permalink
Corrigindo distorção no video
Browse files Browse the repository at this point in the history
  • Loading branch information
SonanFarr committed Nov 15, 2023
1 parent a766f42 commit 28a1e35
Showing 1 changed file with 17 additions and 22 deletions.
39 changes: 17 additions & 22 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -326,31 +326,26 @@ <h1>Sons</h1>
}
</script>
<script>
var video = document.getElementById('video');
var output = document.getElementById('output');

var width = video.width;
var height = video.height;

//screen.orientation.addEventListener("change", function(e) {
// video.width = height;
// video.height = width;
// $( "#video" ).load(window.location.href + " #video" );
// $( "#output" ).load(window.location.href + " #output" );
// $( "#cvn" ).load(window.location.href + " #cvn" );
// output.width = height;
// output.height = width;
//});
counter_left = document.getElementById('reps-left').innerText;
counter_right = document.getElementById('reps-right').innerText;
counter_series = document.getElementById('sets').innerText;
counter_descanso = document.getElementById('rest').innerText;

max_left = document.getElementById('reps-left-max').innerText;
max_right = document.getElementById('reps-right-max').innerText;
max_series = document.getElementById('sets-max').innerText;

window.addEventListener("orientationchange", function(event) {
var video = document.getElementById('video');
var canvas = document.getElementById('output');
$( "#main" ).load(window.location.href + " #main" );

video.load();
video.play();
document.getElementById('reps-left').innerText = counter_left;
document.getElementById('reps-right').innerText = counter_right;
document.getElementById('sets').innerText = counter_series;
document.getElementById('rest').innerText = counter_descanso;

const ctx = canvas.getContext("2d");
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;
document.getElementById('reps-left-max').innerText = max_left;
document.getElementById('reps-right-max').innerText = max_right;
document.getElementById('sets-max').innerText = max_series;
});
</script>
</body>
Expand Down

0 comments on commit 28a1e35

Please sign in to comment.