Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

htracker.stop() does not work from an eventlistener #16

Open
auduno opened this issue Nov 5, 2013 · 12 comments
Open

htracker.stop() does not work from an eventlistener #16

auduno opened this issue Nov 5, 2013 · 12 comments
Assignees
Labels

Comments

@auduno
Copy link
Owner

auduno commented Nov 5, 2013

when calling stop() on a headtracker instance from an eventlistener, an InvalidStateError is raised in Chrome:

Uncaught InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable.

@ghost ghost assigned auduno Nov 5, 2013
@DanielMSchmidt
Copy link
Contributor

May you provide a jsFiddle? I couldn't reproduce that error.

@ricricucit
Copy link

This is happening to me as well (trying to use headtrackr in the main Controller of an AngularJS App), but i can't find the cause of the problem...if it helps they were talking about the same error here as well: http://auduno.tumblr.com/post/25125149521/head-tracking-with-webrtc

UPDATE: i just realized that the tumbler it's from @auduno :)
Any updates on this? (i'm not using htracker.stop())

@auduno
Copy link
Owner Author

auduno commented Feb 27, 2014

I haven't really had time to look at it, unfortunately. Do you have the possibility to create an example of the bug in a dropbox or jsfiddle page?

@ricricucit
Copy link

Well i actually solved MY problem (which was something quite stupid).

To explain it, to those who might get the same problem:

Inside
document.addEventListener("facetrackingEvent", function( event ) {
i was doing:
overlayContext.drawImage(stickImage,some,other,stuf,etc);
Where stickImage didn't actually contain an image.

I'm sure that is not a bug of headtrackr tho.

@auduno
Copy link
Owner Author

auduno commented Feb 27, 2014

Haha, great to hear it's not my fault :)

@havenchyk
Copy link

Sorry, if it's not a good place to ask, but is there way to stop getUserMedia at all from headtrackr?

@auduno
Copy link
Owner Author

auduno commented Apr 11, 2014

If you mean stopping webcam stream, no. headtrackr.stop() merely stops the tracking, not the video. The correct way to stop a getusermedia stream is to call stop() on the mediastream, but I guess you also can call stop() or pause() on the video element.

@havenchyk
Copy link

@auduno, thanks for quick response. As I see, mediastream is placed deep into headtrackr.js, can I get mediastream outside headtrackr.js src to stop it? Sorry for this type of questions, headtrackr.js is too complicated for me, haven't success with it for several days.

@auduno
Copy link
Owner Author

auduno commented Apr 11, 2014

Hmm, it seems I should have added functionality for this. As far as I can tell, it's not possible to stop the mediastream without the mediastream object, which I discard after I set it up. I'll try to add functionality for that within the next couple of days.

@havenchyk
Copy link

@auduno oh, thanks, it would be great! Should I create new issue for this?
If you give me a tips, what need to do, I can try to male a pr

@auduno
Copy link
Owner Author

auduno commented Apr 11, 2014

I created a new issue for it now here : #24

@havenchyk
Copy link

cool, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants