Skip to content
  • home
  • portfolio
  • web design journal
  • blog
    • adventure
    • san diego
    • projects
    • website design
    • code notes
Blog Web Dev Javascript Capture Camera on Phone Doesn’t Work on iPhone

Javascript Capture Camera on Phone Doesn’t Work on iPhone

By Forrest Smith - Drempd.com

On an iphone you need to add a 'playsinline' parameter. I think it works by placing it either in the javascript, or as part of the HTML tag -- I just added it to both to be safe, and it resolved the issue so I called it good.

In javascript as part of the getUserMedia function:
let stream = await navigator.mediaDevices.getUserMedia({ 
  video: {
    facingMode: 'environment',
    playsinline: true
  }, 
  audio: false 
});


Just in the HTML
<video id="video" style="width: 100%; height: 100%;" autoplay playsinline></video>

Posted on June 9, 2022August 28, 2025 in Web Dev

drempd | san diego, ca


home contact

adventures san diego projects stream website design

portfolio resume san diego web design freelance web designer

custom web design responsive web design website maintenance