Skip to main content

Is it possible to set default camera for mobile (front or rear camera)?

Comments

3 comments

  • Bane

    Hey Felipe,

    Can you tell us what SDK you are using? It would be different if you are using one of our native (mobile) SDKs and if you are using one of our web SDKs instead (in which case few additional things could impact it).

    0
  • Felipe Costa

    Thanks for the reply,

     

    I am using Javascript SDK.

    0
  • Bane

    Thank you for the question and the info Felipe :)

    The JS SDK will actually show you the little option (usually in the bottom left corner) that will allow you to switch the camera.

    Now with the JS SDK there is something important to mention, many things are up to the operating system to decide, our system can only ask for something specific like the camera.

    In this case you would use the parameter named camerafacefront. It is about to be published to our docs, so you will not be able to find it on the parameters page as of right now.

    Example:

    <ziggeorecorder ziggeo-theme="modern"
    ziggeo-themecolor="green"
    ziggeo-camerafacefront>
    </ziggeorecorder>

    What it will try / use if possible is to have the face camera in use by default.

    By default this boolean attribute is set as false.

    You could also switch through a following function:

    recorder.select_camera(camera_id);

    * The same might not be allowed by all mobile operating systems and or mobile browsers.

    I would of course recommend the following setup of your application header:

    <link rel="stylesheet" href="https://assets.ziggeo.com/v2-r34/ziggeo.css" />
    <script src="https://assets.ziggeo.com/v2-r34/ziggeo.js"></script>
    <script>
    var ziggeoApp = new ZiggeoApi.V2.Application({
    token:"APPLICATION_TOKEN",
    webrtc_streaming_if_necessary: true,
    webrtc_on_mobile: true,
    auth: true
    });
    </script>

    * Also the above parameter and method is only available on the latest r34 revision and the dev preview of r35 however not on any older revisions (including the "stable" tag)

    Now, the reason why I included the webrtc_streaming_if_necessary and webrtc_on_mobile is because this turns on the WebRTC on the mobile devices (if supported) allowing greater control of the camera than if mobile camera app gets activated.

    Hope this helps :)

    0

Please sign in to leave a comment.