Giter Site home page Giter Site logo

mpankajarun / selfiebooth-app-with-pwa- Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 54 KB

This will show you how to make a JavaScript SelfieBooth app that takes images using the camera on your phone, laptop or desktop.

CSS 27.80% JavaScript 47.87% HTML 24.33%
progressive-web-app javascript getusermedia selfieapp camera service-worker

selfiebooth-app-with-pwa-'s Introduction

SelfieBooth App with PWA

This app will show you how to make a JavaScript SelfieBooth app that takes images using the camera on your phone, laptop or desktop. We will showcase a number of awesome native APIs that allowed us to make our project without any external dependencies, third-party libraries or Flash - vanilla JavaScript only!

The App

To the end user our app is just an oversimplified version of the camera app you can find on any smartphone. It uses a hardware camera to take pictures - that's it. Under the hood, however, a whole lot of JavaScript magic is going on. Here is a high-level overview:

We access the camera input and get a video stream from it using the getUserMedia API. Project the camera stream onto a HTML video element. When the user wants to take a picture, we copy the current video frame and draw it on a canvas element. Transform the canvas into an image dataURL which then can be shown on the screen or downloaded as a PNG. In the article below we will only look at the more interesting parts of the code. For the full source go to the Download button near the top of this page or checkout the demo.

Keep in mind that the navigator.getUserMedia API is considered deprecated, but it still has pretty good browser support and is the only way to access the camera right now, until it's future replacement - navigator.mediaDevices.getUserMedia gains wider browser support.

selfiebooth-app-with-pwa-'s People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.