Search code examples
javascriptwebsocketleap-motion

Running a Leap Motion on two browsers at the same time


So, I'm trying to have two computers that pick up data from the leap motion at the same time. (using the javascript api)

Ideally, the first one would mimick the second one, showing a rigged hand on both screens

       Leap.loop({host:address})
    .use('riggedHand',{
        element:document.getElementById('leapcanvas'),
        offset: new THREE.Vector3(0,0,0)
    })
    riggedHandPlugin = Leap.loopController.plugins.riggedHand;

However, the leap motion seems only to work on one screen at a time.

Is this a problem with WebSockets or Leap Motion?


Solution

  • Have you already set the config options that allow remote computers to connect to the Leap web socket? On the Leap service command line:

    --websockets_allow_remote=1
    

    (or the json equivalent in Leap's config.json file)

    If so, try setting background to true in Leap.loop for both applications:

    Leap.loop({'host':'address', 'background':true})... etc