Download Jar. Uses 2596K of libraries. Click here for Pure Java version (956L/7K).
1 | !7 |
2 | |
3 | p { |
4 | for (Webcam webcam : listWebCams()) |
5 | print("Webcam detected: " + webcam.getName()); |
6 | |
7 | Webcam.addDiscoveryListener(new WebcamDiscoveryListener { |
8 | public void webcamFound(WebcamDiscoveryEvent event) { |
9 | System.out.format("Webcam connected: %s \n", event.getWebcam().getName()); |
10 | } |
11 | |
12 | public void webcamGone(WebcamDiscoveryEvent event) { |
13 | System.out.format("Webcam disconnected: %s \n", event.getWebcam().getName()); |
14 | } |
15 | }); |
16 | |
17 | print("\nPlease connect additional webcams, or disconnect already connected ones. Listening for events..."); |
18 | } |
Began life as a copy of #1008996
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1009011 |
Snippet name: | Listen for webcam connection / disconnection [WORKS] |
Eternal ID of this version: | #1009011/7 |
Text MD5: | 3046739c4aa26610bfe8a26e9c51577f |
Transpilation MD5: | 7cc859a2080381f7b8b4f6720ac60c59 |
Author: | stefan |
Category: | javax / desktop / camera |
Type: | JavaX source code (desktop) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-02-27 17:36:27 |
Source code size: | 591 bytes / 18 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 544 / 1220 |
Version history: | 6 change(s) |
Referenced in: | [show references] |