Skip to content
  • home
  • portfolio
  • web design journal
  • blog
    • adventure
    • san diego
    • projects
    • website design
Blog Quickbits 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, 2022July 6, 2022 in Quickbits
  • Adventure

    • adventure
    • gravelgrinding
    • hiking
    • running
  • The Built Environment

    • architecture
    • urbanity
  • Locations

    • san diego
    • portland
  • Freelance Life

    • freelancing
    • productivity
  • Web Dev

    • css
    • entrepreneurship
    • git
    • handlebars
    • html
    • inkscape
    • photoshop
    • php
    • sass
    • web design
    • web development
    • saphire

drempd | san diego, ca


home contact

adventures san diego urbanity and architecture projects stream website design

portfolio resume san diego web design freelance web designer

custom web design responsive web design website maintenance