bug on the controls bar

Apr 27, 2011 at 8:23 AM

Hello,
first of all thank you for sharing this player. It allowed me to learn a lot of stuff about silverlight.

I found a small bug with controls bar.

Steps to reproduce: set autohide=true, move mouse on video then move mouse out of video before control bar reach its final position. Now control bar won't autohide anymore.
To make it autohide again you have to use some of the controls (i.e. change the volume).

Workaround: hide control bar with javascript if it's visible for more than x seconds.

var visicount=0;

 function hidecontrols() {
    player=document.getElementById('VideoPlayer');
    player.content.findName("PlayIcon").Visibility = "Collapsed"; 
    player.content.findName("controlsContainer").Visibility = "Collapsed"; 
  }

  function updatetime() {
    player=document.getElementById('VideoPlayer');
    if (player && player.content) {
      if (player.content.findName('mediaPlayer')) {
        document.getElementById('Position').innerHTML=Math.round(player.content.findName('mediaPlayer').Position.Seconds);
        if (player.content.findName("controlsContainer").Visibility!="Collapsed") {
          visicount++;
          if (visicount>6) {
            hidecontrols();
            visicount=0;
          }
        } else {
          visicount=0;
        }
      }
    }
    setTimeout('updatetime()',1000);
  }

 

updatetime();