Skip to content

Commit

Permalink
Dynamic Media Format Support
Browse files Browse the repository at this point in the history
  • Loading branch information
fl2on authored Apr 13, 2024
1 parent 3e2fcce commit 18f343a
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ <h1>PixelCorder</h1>
<div class="form-group">
<label for="format">Select Format:</label>
<select id="format">
<option value="video/webm;codecs=vp8,opus">WebM</option>
<option value="video/mp4;codecs=h264,aac">MP4</option>
<option value="video/ogg;codecs=theora,vorbis">Ogg</option>
<option value="video/mkv;codecs=h264,aac">MKV</option>
<option value="video/avi;codecs=msmpeg4v2">AVI</option>
<option value="video/flv;codecs=h264,aac">FLV</option>
<option value="video/mov;codecs=h264,aac">MOV</option>
</select>
</div>
<div class="form-group">
Expand Down Expand Up @@ -94,5 +87,22 @@ <h1>PixelCorder</h1>
window.location.href = "404.html";
}
</script>
<script>
window.onload = function() {
let formatosSoportados = ['video/webm;codecs=vp8,opus', 'video/mp4;codecs=h264,aac', 'video/ogg;codecs=theora,vorbis', 'video/mkv;codecs=h264,aac', 'video/avi;codecs=msmpeg4v2', 'video/flv;codecs=h264,aac', 'video/mov;codecs=h264,aac'];
let formatSelect = document.getElementById('format');

formatSelect.innerHTML = '';

formatosSoportados.forEach(function(formato) {
if (MediaRecorder.isTypeSupported(formato)) {
let option = document.createElement('option');
option.value = formato;
option.text = formato.split(';')[0].toUpperCase();
formatSelect.appendChild(option);
}
});
};
</script>
</body>
</html>
</html>

0 comments on commit 18f343a

Please sign in to comment.