Last active
April 1, 2016 08:15
-
-
Save spleenteo/1880364cead389679b7c5b77cbb1a7e1 to your computer and use it in GitHub Desktop.
cameraStill.coffee
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# live demo http://share.framerjs.com/raf9vavekxei/ | |
# suppose to have different initial layers | |
# * camera_player_frame <- where video plays | |
# * photo_shooter <- the button to shoot | |
# get the module from https://github.com/ktcy/CameraLayer | |
CameraLayer = require "cameraLayer" | |
camera = new CameraLayer | |
camera.parent = camera_player_frame | |
camera.size = camera_player_frame.size | |
camera.start() | |
photo_shooter.on Events.Click, -> | |
photo = new Layer | |
photo.parent = camera_player_frame | |
photo.size = camera_player_frame.size | |
photo._alwaysUseImageCache = true # this is the magic line | |
photo.image = camera.capture() | |
camera.destroy() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment