Skip to Content

How to use the camera

Printer-friendly versionSend to friendPDF version
Intermediate

As part of a social networking rich media application, it can be convenient to enable using the handset camera to capture either a photo or a video (that is then usually uploaded to a server in order to be shared).

As a consequence some features have been granted in Streamezzo solution in order to provide the ability to:

  • Display the camera view, integrated as a video in rich media content (when possible, for a unified end-user experience) + trigger capture of either photo or video
  • Launch the camera application, in either photo or video capture mode

Principle

There are 2 flavours of the features available:

  • Integrated camera
    • Camera display within rich media scene
    • Ability to trigger picture or video capture
  • Non-integrated camera
    • Camera application launch
    • In picture or video capture mode

Features

Integrated camera

The purpose of the features below is to display an integrated camera display as part of rich media content (i.e. as any video) and enable triggering either a photo or video capture.

Video declaration:

  • ("capture://video" is a specific URL value intended to display camera view / use camera view as video source).
  • or you can use cmd://setMediaSource?media=[my_media_DEF]&source=capture://video

Picture capture:

  • cmd://cameraCapture?target=[my_Video_DEF]&url=[my_Text_DEF]&onSuccess=[my_capture_success_startable_DEF]&onError=[my_capture_error_startable_DEF] (url stands for the storage reference path)

Video capture:

  • Start:cmd://cameraVideo?target=[my_Video_DEF]&url=[my_Text_DEF]&onRecord=[my_capture_start_startable_DEF]&onSuccess=[my_capture_success_startable_DEF]&onError=[my_capture_error_startable_DEF] (url stands for the storage reference path)
  • Stop: cmd://cameraStopVideo?target=[my_Video_DEF]

Video capture states

Non-integrated camera

The purpose of the feature below is to launch the camera application in a given capture mode. Photo or video capture will be triggered through this application, then it will be automatically closed and focus will go back to original rich media application.

  • Video declaration: no need for video declaration in such case
  • Launch camera application: cmd://launchCameraApplication?mode=[PICTURE|VIDEO]&url=[my_Text_DEF]&onSuccess=[my_camera_launch_success_startable_DEF]&onError=[my_camera_launch_error_startable_DEF] (url stands for the storage reference path)

Typical example

The coding example below stands for an integrated photo capture that is then upload to a server. Note: for this example to work we assume the handset in use stores camera picture capture as PNG files.

Photo capture sample

Known limitations

Few devices support the integrated version of this feature. Alternatively the non-integrated version of this feature, i.e. launching the native camera application in defined capture mode, may be available.
See support information in this article. On Java devices, feature availability depends on JSR-135 availability and implementation + certification may be required. On Java devices, if the device supports JSR-75, recorded video is saved in the file system, else it is saved in the RMS.

AttachmentSize
Camera_capture.swz5.1 KB
Share this