javascriptmobilenative

How m.facebook.com is able to run native mobile actions like camera and gallery?


When I visit https://m.facebook.com/ I can upload a picture from gallery, or take picture from camera.

How is it possible that a web site is able to run native actions?


Solution

  • You can use the

    <input type="file" accept="image/*;capture=camera">
    <input type="file" accept="video/*;capture=camcorder">
    <input type="file" accept="audio/*;capture=microphone">
    

    Compatability:

    source