Mobile Web

HTML Media Capture: Activating Media Capture Capabilities

This tutorial demonstrates how you can use the HTML media capture feature.

This feature is supported in mobile applications only.

Warm-up

Become familiar with the HTML Media Capture API basics by learning about:

Activating the Media Capture

To provide users with the HTML media capture feature, you must learn to activate the media capture feature by selecting the file type during file upload:

  1. Activate the media capture feature by adding the capture attribute to the <input> element:

    <input type="file" capture="filesystem">
    

    File types

  2. Assign format, such as filesystem, camera, or camcorder:

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

    If the capture attribute does not exist or the value has not been entered, the filesystem format is activated. If the camera or camcorder format is selected, the device camera is activated.

    Note
    In the current version of the Tizen SDK, the microphone format for the capture attribute is not available as the voice recorder application is not included.

    The accept attribute indicates which file types are appropriate. If used with a device that has a camera, it activates the device camera. With a device without a camera, it activates the My photo folder.

    Activating media features

Source Code

For the complete source code related to this use case, see the following file:

Go to top