https://github.com/32teeth/selfiebg.js
https://github.com/32teeth/selfiebg.js
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/32teeth/selfiebg.js
- Owner: 32teeth
- Created: 2015-01-30T14:32:48.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-30T15:56:34.000Z (over 11 years ago)
- Last Synced: 2025-04-04T16:43:31.778Z (about 1 year ago)
- Language: JavaScript
- Size: 407 KB
- Stars: 7
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# selfiebg.js
-----------
##introduction
**selfiebg.js** is a small script that injects and allows you to use the users web cam and streaming media as a video background to your website, kinda letting you allow your users to make the site their own
### design pattern
**selfiebg.js** is built on a module reveal pattern exposing three (3) core methods.
* setup()
* start()
* stop()
### usage
**selfiebg.js** is an IIFE *(immediately-invoked function expression)* and executes the **setup()** method on load, simply include the file at the bottom of your html page before the closing ***body*** tag
/*
** @description include selfiebg.js or selfiebg.min.js
*/
<script src="selfiebg.min.js"></script>
</body>
### options
you can set the boolean value of **button_require**, by default it is set to ***false***
setting the boolean value to ***true*** creates a button that allows the user to terminate the user media stream by invoking the **stop()** method
##example
----------
Below is a quick screengrab of the script running once the user allows the sharing of their camera *(yep, it's a pitcure of me)*

view the [example](example.html) file for more information.
or check out the [live example](http://www.selfiebgjs.32teeth.org/) here