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

Uncaught TypeError: this.stream.stop is not a function #35

Closed
TrySpace opened this issue Jan 7, 2016 · 3 comments
Closed

Uncaught TypeError: this.stream.stop is not a function #35

TrySpace opened this issue Jan 7, 2016 · 3 comments

Comments

@TrySpace
Copy link

TrySpace commented Jan 7, 2016

When I try to call qr.stop() like the example it throws this error:

Uncaught TypeError: this.stream.stop is not a function

Also, it will continuously keep calling the resultHandler after scanning, I'm assuming this would stop, if the qr.stop() would work.

The qr Object does contain this though:

canvasElem: canvas
stream: MediaStream
    active: true
    id: "U1UY73wPzsxXdV1pQXZIXuYOF0VVtmaqFqoc"
    onactive: null
    onaddtrack: null
    onended: null
    oninactive: null
    onremovetrack: null
timerCapture: 21
videoConstraints: Object
videoDimensions: false
videoElem: video

No .stop method

@TrySpace
Copy link
Author

TrySpace commented Jan 8, 2016

Fixed it after seeing this: https://github.com/andyet/SimpleWebRTC/issues/363

By doing:

tracks = @qr.stream.getTracks()   

Which returns an Array of MediaStreamTracks
And then:

tracks[0].stop()

Apparently something changed in the API.

At least now the stream stops, but the lib needs top be updated, will see if I can make a pull request, or otherwise I'll post a fork with the fix.

@TrySpace
Copy link
Author

TrySpace commented Jan 8, 2016

Actually, I see that a pull request exists for this already: #34

@TrySpace
Copy link
Author

TrySpace commented Jan 8, 2016

Forked: https://github.com/TrySpace/qcode-decoder

I will respond to pull requests when needed over there

@TrySpace TrySpace closed this as completed Jan 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant