All Projects → bolav → fuse-camerapanel

bolav / fuse-camerapanel

Licence: other
CameraPanel for FuseTools

Programming Languages

Uno
12 projects
Objective-C++
1391 projects
java
68154 projects - #9 most used programming language
shell
77523 projects
objective c
16641 projects - #2 most used programming language

Fuse CameraPanel Build Status Fuse Version

Library to use the camera as a panel in Fuse.

Currently supports iOS

Issues, feature request and pull request are welcomed.

Installation

Using fusepm

$ fusepm install https://github.com/bolav/fuse-camerapanel

Usage:

JS/UX Approach

<CameraExtended ux:Global="CameraAPI" />

<JavaScript>
    var Observable = require("FuseJS/Observable");
    var FileSystem = require("FuseJS/FileSystem");
    var CameraAPI = require("CameraAPI");

    function take_picture() {
        CameraAPI.takePicture("my_camera")
            .then(function (result) {
                console.log("Got a pic!");
                console.log("Name: " + result.name);
                console.log("Path: " + result.path);

                return FileSystem.readBufferFromFile(result.path);
            })
            .then(function(contents) {
                console.log("Got contents: " + JSON.stringify(contents));
            })
            .catch(function(err) {
                console.log("Error: " + JSON.stringify(err));
            });
    }

    function refresh_camera() {
        CameraAPI.refreshCamera("my_camera");
    }

    var camera_available = Observable(false);

    CameraAPI.requestCameraPermission().then(function () { camera_available.value = true });

    module.exports = {
        take_picture:take_picture,
        camera_available:camera_available,
    }

</JavaScript>

<WhileTrue Value="{camera_available}">
    <CameraStream Dock="Fill" >
        <CameraVisual Facing="Back" ux:Name="my_camera" />
    </CameraStream>
</WhileTrue>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].