Only New Recordings/Specify the Preferred Camera

Underneath the hood, the Mobile Native Recording Client uses the HTML Media Capture API to capture audio and video from mobile browsers & devices.

This API contains a capture attribute which, over time, it was defined in 2 ways in the spec:

  1. older specs defined it as a boolean HTML attribute
  2. newer versions defined it as a string: capture="user" and capture="environment"

The Mobile Native Recording Client allows you to use both versions.

Capture New Recordings

capture as a boolean was defined in the older versions of the spec (9 september 2014 was the latest one to include it).

If specified, it “indicates that the capture of media directly from the device’s environment… is preferred”.

To include the boolean version of capture in the HTML Media Capture code generated by the Pipe Mobile Native Recording Client use the pipe-dpv="1" attribute in the 2.0 HTML embed code and the dpv:1 property in the config object with the 2.0 JS and 1.0 embed codes.

Embed Code v2.0 via HTML:

<piperecorder id="custom-id" pipe-width="640" pipe-height="390" pipe-qualityurl="avq/360p.xml" pipe-accounthash="ACCOUNT_HASH" pipe-eid="ENVIRONMENT_ID" pipe-mrt="600" pipe-avrec="1" dpv="1"></piperecorder>

Embed Code v2.0 via JavaScript:

var pipeParams = {size:{width:640,height:390}, qualityurl:"avq/360p.xml", accountHash:"ACCOUNT_HASH", eid:"ENVIRONMENT_ID", mrt:600, avrec:1, dpv:1};

Embed Code v1.0:

var flashvars = {qualityurl:"avq/360p.xml", accountHash:"ACCOUNT_HASH", eid:"ENVIRONMENT_ID", mrt:600, avrec:1, dpv:1};

We found Safari on iOS to consistently support the capture attribute as boolean. Android support might vary.

Specify the Preferred Camera

Through the embed code, you can specify the preferred camera (user facing or environment facing).

To specify the camera, use pipe-capture attribute in the 2.0 HTML embed code and the capture property in the config object with the 2.0 JS embed code. It takes two possible values: user and environment.

Setting this value translates into adding the capture="user" and capture="environment" flag/attribute respectively to the HTML Media Capture <input> element.

We found Safari on iOS to consistently support using capture="user" and capture="environment" to specify the preferred camera AND force the device to record on the spot. Android support might vary.

Setting pipe-capture to any of the two values overwrites the boolean capture attributed introduced by dpv:1.

This option is not available with the 1.0 embed code.

Embed Code v2.0 via HTML:

<piperecorder id="custom-id" pipe-width="640" pipe-height="390" pipe-qualityurl="avq/360p.xml" pipe-accounthash="ACCOUNT_HASH" pipe-eid="ENVIRONMENT_ID" pipe-mrt="600" pipe-avrec="1" pipe-capture="user"></piperecorder>

Embed Code v2.0 via JavaScript:

var pipeParams = {size:{width:640,height:390}, qualityurl:"avq/360p.xml", accountHash:"ACCOUNT_HASH", eid:"ENVIRONMENT_ID", mrt:600, avrec:1, capture:"environment"};

TL;DR

2.0 HTML Embed Code OptionEffect
pipe-dpv="1"Capture directly from camera, do not allow user to select existing file.
pipe-capture="user"Capture directly from camera, use the user facing camera.
pipe-capture="environment"Capture directly from camera, use the environment facing camera.