title: Detect if ios11 device is in low power mode to prevent bad UX on normally correctly autoplaying video
body: <p>I am running into a huge issue with autoplaying videos on iOS11 devices (at least tested on iphone 7 ios 11.2.5 safari ).</p>
  
  <p>When the change in policy about autoplaying videos arrived, our autoplaying videos stopped working. Our app heavily depend on videos.</p>
  
  <p>We deeply changed all the steps for users to interact with videos to make sure they're not blocked and they're now muted by default and autoplay is triggered after user gesture. so videos DO autoplay muted and we thought we were doing after already days of work.</p>
  
  <p>But there's an issue: Last week, I was testing on my girklfriend 11.2 iphone the website and boum...videos were blocked. I did not understand why...
  <strong>Found out the reason was... I was using her phone while it was charging the battery!</strong></p>
  
  <p>Indeed on ios11, when you put to charge the phone, it automatically gets in "low power mode" hehe...thus blocking autoplay videos. If you go into Settings > itune &amp; apple store and go to the "autoplay video" setting you'll see (while it's charging in low power mode) :</p>
  
  <blockquote>
    <p>"autoplay video are not available while low power mode is on"....</p>
  </blockquote>
  
  <p>So basically thousands of users across the world who will connect to our website while charging will have a broken experience and no video loading ! (we rely heavily on autoplaying videos even if muted before user activates the sound)</p>
  
  <p>How can we detect this and at least give an explainer message to user in that case such as "our videos can't be played while low power mode (or charging your phone).</p>
  
  <p>I understand apple thrives to protect users form autoplay bad experience but here we made all the efforts to change our codebase to comply with their new policies but we see nowhere in their documentation how our web app (javascript) can detect the low power mode 'or the phone charging status). It's not fair: if they change the behavior in certain cases such as low power mode, they should play by their own rule and let us create a compliant but quality experience by letting us detect this device status. So that we could have a sort of plan B or fallback for users.</p>
  
  <p>Any idea how to detect that an iphone is charging or in low power mode in javascript for a web app ? or how to deal with this ?</p>