inspirit / jsfeat

JavaScript Computer Vision library.
MIT License
2.74k stars 372 forks source link

Support for iOS 11 #77

Open mheskol opened 6 years ago

mheskol commented 6 years ago

I tried running the demos on iOS 11 (iPhone 7 device) but they didn't work. I'm wondering if there are any changes that need to be Incorporated into the demo application code or to the library itself to support that. Can you please provide any guidance or information on this issue if possible? Thanks

liangmuren commented 6 years ago

The demo code is old so it doesn't work on iOS 11 devices, I'm studying the code and want to get a cross platform solution with the orb demo. But the code is a little complicated. I would be very appreciate if the author could give some guidance if possible.

davyk7 commented 6 years ago

i'd appreciate too

alexreflexive commented 5 years ago

Those messages are old. Just in case, if you have problems with webcam and iOS there are two places where you have to do something. First, you have to add playsinline to the video tag. And you have to replace HTMLElement.src = compatibility.URL.createObjectURL() with HTMLElement.srcObject = stream :

    <video autoplay playsinline></video>
    <script>
        var video = document.querySelector('video');
        navigator.mediaDevices.getUserMedia({ video: true }).then(function (stream) {
            video.srcObject = stream;
            // deprecated:
            // video.src = compatibility.URL.createObjectURL(stream);
        });
    </script>