Unable to get property 'stopVideo' of undefined or null reference

Hi guys i’ve got a scroller with a slider whenever the user click on next thumbnail on the scrolller it stops the preview video, it works on every browser except on internet explore as it gives me the follwoing error
Unable to get property ‘stopVideo’ of undefined or null reference

On the head script


var player;
var player1;
var player2;
var player3;
var player4;
var player5;
var player6;
var player7;
var player8;
var player9;
var player10;
var player11;

function onYouTubeIframeAPIReady() {
    player = new YT.Player('video');
    player1 = new YT.Player('video1');
    player2 = new YT.Player('video2');
    player3 = new YT.Player('video3');
    player4 = new YT.Player('video4');
    player5 = new YT.Player('video5');
    player6 = new YT.Player('video6');
    player7 = new YT.Player('video7');
    player8 = new YT.Player('video8');
    player9 = new YT.Player('video9');
    player10 = new YT.Player('video10');
    player11 = new YT.Player('video11');
    console.log(player);
}

and the js file


/*Video and scroller panel*/
    $(function(){
 //     SyntaxHighlighter.all();
    });
  $(document).ready(function(){
      $('#carousel').flexslider({
        animation: "slide",
        controlNav: true,
        animationLoop: false,
        slideshow: false,
        itemWidth: 320,
        itemMargin: 28,
        asNavFor: '#slider'
      });

      $('#slider').flexslider({
        animation: "slide",
        controlNav: false,
        animationLoop: false,
        slideshow: false,
        sync: "#carousel",
        start: function(slider){
          $('body').removeClass('loading');
        },
        before: function(){

            player1.stopVideo();
            player2.stopVideo();
            player3.stopVideo();
            player4.stopVideo();
            player5.stopVideo();   
            player6.stopVideo();
            player7.stopVideo();
            player8.stopVideo(); 
            player9.stopVideo();
            player10.stopVideo();
            player11.stopVideo();
        }           
      });
    });

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.