function isVideoPlaying(pixels, width, height) {
  // Sample somewhere near the middle of the image.
  var middle = width * height / 2;
  for (var i = 0; i < 20; i++) {
    if (pixels[middle + i] > 0) {
      return true;
    }
  }
  return false;
}
// assumption that a video element with null source just presents zeroes.
assumption that a video element with null source just presents zeroes.
assumption that a video element with null source just presents zeroes .
function isVideoPlaying(pixels, width, height) {
  var middle = width * height / 2;
  for (var i = 0; i < 20; i++) {
    if (pixels[middle + i] > 0) {
      return true;
    }
  }
  return false;
}
function isVideoPlaying ( pixels , width , height ) { var middle = width * height / 2 ; for ( var i = 0 ; i < 20 ; i ++ ) { if ( pixels [ middle + i ] > 0 ) { return true ; } } return false ; }
assumption that a video element with null source just presents zeroes.
assumption that a video element with null source just presents zeroes .
// Sample somewhere near the middle of the image.