title: How does apple define "user action"?
body: <p>I am currently working on a web project and I need to start playing a video after a swipe event and I can not make this work. I am using the HTML5 video player and JS to detect the swipe event. I first tried with hammer.js which makes it easier to detect swipe events, but after struggling to get this working I started using plain js.</p>
  
  <p>After some debugging, I noticed that the play method of the video HTMLElement returns a promise. When I call <code>video.play()</code> from my swipe handler this promise is always rejected with the following message:</p>
  
  <blockquote>
    <p>NotAllowedError (DOM Exception 35): The request is not allowed by the
    user agent or the platform in the current context, possibly because
    the user denied permission.</p>
  </blockquote>
  
  <p>As this problem only exists in iOS I started reading the apple developer docs and noticed that many features are only available after an "explicit user action". For example:</p>
  
  <blockquote>
    <p>Important: The webkitEnterFullscreen() method can be invoked only in
    response to a user action, such as clicking a button. You cannot
    invoke webkitEnterFullscreen() in response to a load event, for
    example.</p>
  </blockquote>
  
  <p>Source: <a href="https://developer.apple.com/library/content/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/ControllingMediaWithJavaScript/ControllingMediaWithJavaScript.html" rel="nofollow noreferrer">https://developer.apple.com/library/content/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/ControllingMediaWithJavaScript/ControllingMediaWithJavaScript.html</a></p>
  
  <p>The same applies for calling the play method from js. It will only work if it was invoked in response to a user action.</p>
  
  <p>My question here is, how does apple define "user action"? Because apparently, swipe events are not user actions.</p>