question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Successive Image captures on Safari IOS results in same image after first few are taken.

See original GitHub issue

Description

Successive Image captures on Safari IOS results in same image after first few are taken.

Steps to reproduce

Explain in detail the exact steps necessary to reproduce the issue.

var optionsImage = {
            controls: true,
            width: 640,
            height: 480,
            controlBar: {
                volumePanel: false,
                fullscreenToggle: false
            },
            plugins: {
                record: {
                    image: true,
                    audio: false,
                    debug: true,
                    imageOutputType: 'dataURL',
                    imageOutputFormat: 'image/png',
                    imageOutputQuality: 0.70
                }
            }
        };

var playerImage = videojs('myVideo', optionsImage, function () {
            // print version information at startup
            var msg = 'Using video.js ' + videojs.VERSION +
                ' with videojs-record ' + videojs.getPluginVersion('record') +
                ' and recordrtc ' + RecordRTC.version;
            videojs.log(msg);
            $('#buttonGroup2').hide();
            //playerImage.record().getDevice();
            playerImage.record().enumerateDevices();
        });

        var playerVideo = videojs('myVideoFinal', optionsVideo);


        $('#myAudio').hide();
        $('#myVideoFinal').hide();
            $('#unrappWrap').hide();


        playerImage.on('deviceError', function () {
            console.log('device Image error:', player.deviceErrorCode);
            alert('device Image error:' + error);
        });

        playerImage.on('error', function (element, error) {
            console.error(error);
            alert(error);
        });
        playerImage.on('enumerateReady', function () {
            console.log('Enumerate Ready (IMAGE)...');
            playerImage.record().getDevice();
            if (record) {
                playerImage.record().start();
            }
        });
        playerImage.on('startRecord', function () {
            console.log('started Image recording!');
        });
        playerImage.on('finishRecord', function () {
            // the blob object contains the recorded data that
            // can be downloaded by the user, stored on server etc.
            console.log('finished image: ', playerImage.recordedData);
            // Let handler know we are done...
            var formData = new FormData();
            formData.append('file', dataURLToBlob(playerImage.recordedData));
            formData.append('id', id);  //Replace with real ID later...
            formData.append('last', '0');
            formData.append('type', 'R');
            y++;
            formData.append('count', y);

            $.ajax({
                url: "/admin/ws/WebApp2019.ashx",
                type: "POST",
                data: formData,
                processData: false,
                contentType: false,
                success: function (result) {
                    console.log('posted: ', y);
                    console.log('result reaction image: ', result);
                },
                error: function (xhr, ajaxOptions, thrownError) {
                    console.log(xhr.status, ': ', thrownError);
                    console.log(xhr.responseText);
                }
            });

            setTimeout(shouldRecord, 10);
            

        });

        function shouldRecord() {
            if (record) {
                // Make another image snap...
                playerImage.record().retrySnapshot();
                //playerImage.record().enumerateDevices();
                playerImage.record().start();
            }
        }

Results

After first 5-6 images it starts to be the same screen shot over and over…same code works fine when on in safari ios.

Expected

To be a new screenshot everytime it is executred.

Actual

After first 5-6 images it starts to be the same screen shot over and over…same code works fine when on in safari ios.

Error output

If there are any errors at all, please include them here.

Additional Information

Please include any additional information necessary here. Including the following:

versions

videojs

what version of videojs does this occur with? Using video.js 7.6.6 with videojs-record 3.9.0 and recordrtc 5.5.8

browsers

what browser(s) are affected? Make sure to test with all third-party browser extensions disabled. IOS - Safari

OSes

what platforms (operating systems and devices) are affected? IOS - Safari

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rdurishcommented, Mar 6, 2020

@thijstriemstra just FYI your proposed solutions didn’t work for me. I needed to have retry snapshop and start in order for a picture to be taken (any device for my example of auto taking pictures). For this to work on the iphone I had to not HIDE the image grabber but move it off screen. Once I did that everything worked. I updated my example on dropbox if you care to see. Thanks for your help!

1reaction
rdurishcommented, Feb 3, 2020

Sorry that should say NON-IOS devices. I’m having trouble editing. I will put together an example here shortly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Saving Captured Photos | Apple Developer Documentation
When you complete a photo capture with AVCapturePhotoOutput , you receive an AVCapturePhoto object that contains not only the still image data, but...
Read more >
iPhone (Safari or Chrome) browser image capture (Take ...
1) In order to test open the link in iPhone and Android. · 2) Click on Select Multiple files and select Take Photo...
Read more >
21 Hidden Tricks Inside Apple's Safari Browser | PCMag
Open Settings > Safari > Downloads and send them to your iPhone, iPad, or another location. Here, you can also opt to remove...
Read more >
3 Free Ways to Combine Multiple Screenshots Side by Side ...
Here are quick and free ways to turn multiple iPhone screenshots into a single image, with all of them placed horizontally, one after...
Read more >
How to reverse image search on your iPhone or iPad
You can reverse image search a photo you find online or from your phone ... from image search results. 1. Open the Chrome...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found