Software Archive
Read-only legacy content
17060 Discussions

SDK Sample Browser - Hands Viewer Javascript

germ13
Beginner
851 Views

I was testing  the "Hands Viewer (Javascript)"  code from  the SDK Sample Browser and the example would not work, until I went into the code and changed the file:

hands_viewer.html (line 104)

from 

if (data.hands == 'undefined') return;

to  

if (data.hands === 'undefined') return;

Just thought I'd share, might help someone.

And if any Intel personnel is reading this, is there a code repository where we can maybe share code bugs/suggestions?  If no, why not? :) Thanks :)

 

0 Kudos
4 Replies
Xusheng_L_Intel
Employee
851 Views

It works under Chrome. Are you using IE?

0 Kudos
germ13
Beginner
851 Views

Yes, I am using the most recent chrome as my dev browser.

I stepped through the code, and thats where the issue was at.

I am going to set up a clean user environment for chrome, without any of my extensions.

0 Kudos
Martin_W__K_
Beginner
851 Views

Hi, 

the problem still exists in the latest versions of the SDK.

hands_viewer.html (line 104)

if (data.hands == 'undefined') return;

This doesn't work in Chrome nor Firefox.

Reason: your need to check the type via 'typeof'.

See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof

Correct code:

if (typeof data.hands === 'undefined') return;

 

@IntelDevelopers: please update the SDK :-)

Thanks in advance
Martin

0 Kudos
Martin_W__K_
Beginner
851 Views

There is a second issue in this example file.

From time to time, this error occurs:  Uncaught TypeError: Cannot read property 'positionImage' of undefined

I've found the root cause and fixed it.
Please, see this github ghist revisions for the two fixes: 
https://gist.github.com/nitram509/7d8869f30d76db97c683/revisions

 

0 Kudos
Reply