onIdle()

wrtc.onIdle() is called when user inactivity has been detected, and when user becomes active again. User inactivity usually means she has not touched mouse or keyboard for several minutes.

You can use this event function to call wrtc.setSIPPresence() and tell other users you have become active or inactive. Even though it is called set SIP presence it will also affect the wrtc online list.

Occurs

wrtc.onIdle() occurs only if idle detection has been activated using wrtc.adv.idleDetect(true). Otherwise it never occurs.

Arguments

wrtc.onIdle(user, screen)

  • user:
    • "idle" - user has not touched mouse or keyboard for several minutes
    • "active" - user is active
  • screen:
    • "locked" - screen is turned off or shows screensaver
    • "unlocked" - screen is active

Example

wrtc.onIdle(user, screen) {
    if ((user == "idle") || (screen == "locked"))
      stus = "away";
    else {
      if (wrtc.getCalls("inCall").length > 0)
        stus = "on-the-phone";
      else
        stus = "unknown";
      }
      wrtc.setSIPPresence(true, stus);
}

See Also

ixnx/wrtc/js/api/wrtc/onidle.txt · Last modified: by tibor
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0