bcabanes / ng-camera

AngularJS directive for capturing images form your computer's camera.
55 stars 33 forks source link

Request camera access after page load #3

Open shealan opened 9 years ago

shealan commented 9 years ago

Is there any way of requesting browser camera access on a button press, rather than when the page is loaded?

flick36 commented 8 years ago

@shealan you could wrap the directive in a div with a ng-if like

<div ng-if="!vm.picture">
    <md-camera
        capture-message="Cheeeese!"
        output-height="320"
        output-width="426"
        crop-height="320"
        crop-width="320"
        viewer-height="160"
        viewer-width="213"
        image-format="jpeg"
        jpeg-quality="100"
        action-message="Take picture"
        snapshot="vm.picture"
        shutter-url="sounds/shutter.ogg">
    </md-camera>
</div>