Here is my code:
if (jQuery.browser.msie && !jQuery.browser.version == 9) {
}else{
var myVideoFrame = document.getElementById("myVideoFrame");
myVideoFrame.textTracks[0].mode = "hidden";
}
I am using JW Player but as I need my videos and video contents make indexable by search engines I created html5 video tag with source and track tags in it and implemented JW player setup javascript code on existing video id. In this case I needed to hide existing tracks cause I see double subtitles. Via code above it is hidden everywhere except IE 9 and gives me this error. Please see attached image. How can I hide tracks for IE9 ?
I found this article and added code written below:
<script type="text/javascript">
var ie9 = false;
</script>
<!--[if IE 9]>
<script>
ie9 = true;
</script>
<![endif]-->
<script type="text/javascript">
if (ie9 == false) {
var myVideoFrame = document.getElementById("myVideoFrame");
myVideoFrame.textTracks[0].mode = "hidden";
}
</script>
Now this code works in every browser except IE9. So no error in console.