https://github.com/devnawjesh/webcam
Accessing your webcam via your browser used to involve a...pardon the profanity, a plugin. That's right. In order to connect to a webcam and gain access to its video stream, you had to rely on something primarily created in Flash or Silverlight. While that approach certainly worked for browsers that supported plug-ins, it didn't help for the increasing number of browsers that aim to be plugin-free. This inability to natively access the webcam without relying on 3rd party components was certainly a gap in the HTML development story. At least, that was the case until pretty recently.
https://github.com/devnawjesh/webcam
getusermedia screen-capture screenshot video-streaming web-application webcam webcam-capture webcam-streaming webcamjs
Last synced: 3 months ago
JSON representation
Accessing your webcam via your browser used to involve a...pardon the profanity, a plugin. That's right. In order to connect to a webcam and gain access to its video stream, you had to rely on something primarily created in Flash or Silverlight. While that approach certainly worked for browsers that supported plug-ins, it didn't help for the increasing number of browsers that aim to be plugin-free. This inability to natively access the webcam without relying on 3rd party components was certainly a gap in the HTML development story. At least, that was the case until pretty recently.
- Host: GitHub
- URL: https://github.com/devnawjesh/webcam
- Owner: Devnawjesh
- Created: 2018-05-16T23:13:07.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-16T23:36:54.000Z (about 7 years ago)
- Last Synced: 2025-01-15T22:29:05.205Z (5 months ago)
- Topics: getusermedia, screen-capture, screenshot, video-streaming, web-application, webcam, webcam-capture, webcam-streaming, webcamjs
- Size: 216 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# webcam
Accessing your webcam via your browser used to involve a...pardon the profanity, a plugin. That's right. In order to connect to a webcam and gain access to its video stream, you had to rely on something primarily created in Flash or Silverlight. While that approach certainly worked for browsers that supported plug-ins, it didn't help for the increasing number of browsers that aim to be plugin-free. This inability to natively access the webcam without relying on 3rd party components was certainly a gap in the HTML development story. At least, that was the case until pretty recently.How to Use Webcam In PHP:
Here we will use the JPEG Camera script for the webcam functions to take the snap and save it.
index.phpBelow the form we will put our webcam window to show the webcam screen capture.
Take Snapshots
Now it's time to process the image snap. Add this code to index.php :
var options = {
shutter_ogg_url: "jpeg_camera/shutter.ogg",
shutter_mp3_url: "jpeg_camera/shutter.mp3",
swf_url: "jpeg_camera/jpeg_camera.swf",
};
var camera = new JpegCamera("#camera", options);
$('#take_snapshots').click(function(){
var snapshot = camera.capture();
snapshot.show();
console.log(snapshot);
snapshot.upload({api_url: "action.php"}).done(function(response) {
$('#imagelist').prepend("<tr><td><img src='"+response+"' width='100px' height='100px'></td><td>"+response+"</td></tr>");
}).fail(function(response) {
alert("Upload failed with status " + response);
});
})function done(){
$('#snapshots').html("uploaded");
}Now when we receive the success message, we will show it in a table.
ImageImage Name
You can also use getUserMedia in index2.php and index3.php