When I open the page in a browser, on occasions the video does not load and also if I refresh the page the video never loads, how can I fix these 2 issues?
This is the html for my video player
<video width="320" height="240" controls>
<source id="audioFile" src="" type="video/mp4">
Your brow
This is the javascript code which gets the name of the video file from the URL
function getUrlParameters(parameter, staticURL, decode){
var currLocation = (staticURL.length)? staticURL : window.location.search,
parArr = currLocation.split("?")[1].split("&"),
returnBool = true;
for(var i = 0; i < parArr.length; i++){
parr = parArr[i].split("=");
if(parr[0] == parameter){
return (decode) ? decodeURIComponent(parr[1]) : parr[1];
returnBool = true;
}else{
returnBool = false;
}
}
if(!returnBool) return false;
}
var parameter = getUrlParameters("audioFile", "", true);
document.getElementById('audioFile').src = parameter;
document.getElementById('url').content = parameter;
src, try runningdocument.getElementById('video').load()