I have the following code in client side JS:
$(function() {
$("#player1").html(
'<video width=' + width + ' height=' + height + ' autoplay>' +
'<source src=' + curPlayListHrefs[0] + ' type="video/youtube"></source>' +
'</video>'
);
});
I tried:
var video = document.getElementsByTagName("video")[0];
video.videoHeight = 300;
video.videoWidth = 700;
Is it possible for me to change the width/height of the video tag?
Try setting its width and height attributes
var video = document.getElementsByTagName("video")[0];
video.setAttribute('height', '300');
video.setAttribute('width', '700');
or setting its width and height properties
var video = document.getElementsByTagName("video")[0];
video.height = 300;
video.width = 700;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With