Last Updated: February 25, 2016
·
1.625K
· pierrel

iOS + VideoJS events + DOM Manipulation

So Mobile Safari doesn't like it when you do something like this:

<video controls class="video-js vjs-default-skin">
  <source type="video/mp4" src="something.mp4">
  </source>
</video>
<script type="text/javascript">
  var v = document.getElementsByTagName('video')[0];
  var player = _V_(v);
  player.addEvent('play', function(evt) {
  $('.video-js').css('display', 'block') // !!!
  });
</script>

Works just fine in other Webkit browsers.

(full gist: https://gist.github.com/3837123 )