Remove svg tag from a shape object.

I have created my own progress bar for media in my courses using a shape object that is resized using custom javascript.

function myProgress() {
var media = document.getElementById(Var_playingAV.getValue());
var pBar = document.getElementById(“shape390712”);
var svgTag = pBar.getElementsByTagName(“svg”);
svgTag.remove();

media.ontimeupdate = function(){
var media = document.getElementById(Var_playingAV.getValue());
var pBar = document.getElementById(“shape390712”);
var value = 0;
var currentPos = media.currentTime;
var maxduration = media.duration;
if (currentPos > 0) {value = Math.floor((100 / maxduration) * currentPos );}
pBar.style.width = value + “%”;
pBar.style.background = “#00ff00”;
}
};

So this works in all browsers but IE. I found the svg tag that is create within the shape object is causing the problem and if it is removed the progress bar works fine. With this knowledge I decided to just delete it. Unfortunately, I have not been able to accomplish this. Does anyone have a suggestion. Maybe there is a better fix than to delete the svg tag.

Preview image

Tags: , , ,