1
I have this function in js that takes the name of the video that the user has chosen
function getUrlVars() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) {
vars[key] = value;
});
return vars;
}
var video = getUrlVars()["v"];
alert(video);
I would like to know how I use the value obtained in the video variable in src below:
<video width="502" height="360" id="Video1">
<source src="COMO COLOCAR O VALOR DA VARIAVEL AQUI" type=video/webm>
</video>
well put the code at the end after Alert with the video variable so that is giving typeError, you know what can be wrong?
– Lawrence
Can you tell me which line of code he’s quoting is wrong?
– Daniel Bruno
well I decided to just use window.load in the function
– Lawrence