farhadnowzari / easy-vue-camera

11 stars 11 forks source link

Easy Vue Camera

This vue component is powered by easy-js-camera library.

How it works

This component has two sub-components. One is called FullscreenViewCamera and the other is StandardViewCamera.

Fullscreen view android phone screenshot

Note: If you enable the auto-detect-mobile property the mother component will automatically will decide which of the sub-components should be rendered. If this property is off you can toggle between the two, by toggling fullscreen property.

Installation

The package is available via npm. For using this package you also need to install easy-js-camera.

npm install easy-js-camera easy-vue-camera

After the installation is complete you can add the component with the following code.

import EasyCamera from 'easy-vue-camera';

Vue.use(EasyCamera);

or

import EasyCamera from 'easy-vue-camera';

//inside your vue options api
export default {
    components: {
        ...
        'v-easy-camera': EasyCamera
        ...
    }
}

Usage

After adding the EasyCamera component to your vue components you can use it like below.

<v-easy-camera
    v-model="picture"></v-easy-camera>

Properties

Events

Slots

Desktop version

Please note that on desktop just the video is adjusted and no actions are shown. On desktop it is better that the actions are placed manually than using the component actions. The actions are available in fullscreen mode