Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

18
LINES

< > BotCompany Repo | #1009011 // Listen for webcam connection / disconnection [WORKS]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 2596K of libraries. Click here for Pure Java version (956L/7K).

!7

p {
  for (Webcam webcam : listWebCams())
    print("Webcam detected: " + webcam.getName());

  Webcam.addDiscoveryListener(new WebcamDiscoveryListener {
    public void webcamFound(WebcamDiscoveryEvent event) {
      System.out.format("Webcam connected: %s \n", event.getWebcam().getName());
    }
    
    public void webcamGone(WebcamDiscoveryEvent event) {
      System.out.format("Webcam disconnected: %s \n", event.getWebcam().getName());
    }
  });

  print("\nPlease connect additional webcams, or disconnect already connected ones. Listening for events...");
}

Author comment

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: 543 / 1218
Version history: 6 change(s)
Referenced in: #1009013 - Put troll faces in webcam image [WORKS]