Youtube Iframe API events don't work on IOS devices
<p>Hi i want to do event when my youtube video ends. Event <code>onStateChange</code> works on desktop and android perfect but on IOS devices doesn't do change when youtube video ends because IOS is opening youtube in build in player. Here is my javascript:</p>

<pre><code>// create youtube player
    var player;
    function onYouTubePlayerAPIReady() {
      player = new YT.Player('player', {
        height: '340',
        width: '850',
        videoId: 'xnh7zOFes-4',
        playerVars: {
          controls: 0,
          showinfo: 0,
          rel: 0
        },
        events: {
          'onStateChange': onPlayerStateChange
        }
      });
    }

    function onPlayerStateChange(event) {
      if(event.data === 0) {
        $('.mobile').fadeOut();
        $('.newsletter').css('display','flex');
      }
    }
</code></pre>