jsfeat icon indicating copy to clipboard operation
jsfeat copied to clipboard

Demos stopped working

Open piotrjaw opened this issue 6 years ago • 3 comments

Hi, it seems that the demos stopped working at all, there seems to be a problem with the MediaStream:

screenshot 2019-01-10 at 20 42 33 screenshot 2019-01-10 at 20 50 23

piotrjaw avatar Jan 10 '19 19:01 piotrjaw

OK so it seems that calling URL.createObjectURL with a MediaStream is deprecated, but all you need to do is to replace:

video.src = compatibility.URL.createObjectURL(stream);

with:

video.srcObject = stream;

and it should work just fine. Would do it myself, but I don't see the demos sourcecode here :(

piotrjaw avatar Jan 16 '19 20:01 piotrjaw

Hard to know if I should use this library without seeing a demo. And yes, I realize I can download it and run it locally, but it would be so much easier if this simple change was made.

donaldr avatar May 10 '20 23:05 donaldr

OK so it seems that calling URL.createObjectURL with a MediaStream is deprecated, but all you need to do is to replace:

video.src = compatibility.URL.createObjectURL(stream);

with:

video.srcObject = stream;

and it should work just fine. Would do it myself, but I don't see the demos sourcecode here :(

Exactly. https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL#Usage_notes

Important: If you still have code that relies on createObjectURL() to attach streams to media elements, you need to update your code to simply set srcObject to the MediaStream directly.

lubosmato avatar May 23 '20 09:05 lubosmato