collab-project / videojs-record

video.js plugin for recording audio/video/image files
https://collab-project.github.io/videojs-record
MIT License
1.4k stars 315 forks source link

Error Recording as Mirror Mode #687

Open smilemittal opened 1 year ago

smilemittal commented 1 year ago

Description

it is showing mirror mode for the front camera on the phone and also on the laptop cam.

Steps to reproduce

Options object 
            options: {
                controls: true,
                autoplay: true,
                fluid: false,
                loop: false,
                width: 540,
                height: 360,
                DeviceButton: true,
                bigPlayButton: true,
                controlBar: {
                    deviceButton: false,
                    recordToggle: false,
                    pipToggle: false,
                    fullscreenToggle: true,
                },
                plugins: {
                    record: {
                        image: {
                            facingMode: 'user'
                        },
                        pip: false,
                        audio: true,
                        video: true,
                        maxLength: 90,
                        debug: true
                    }
                }
            },

 this.player = videojs('#myVideo', this.options, () => {
            // print version information at startup
            let msg = 'Using video.js ' + videojs.VERSION +
                ' with videojs-record ' + videojs.getPluginVersion('record') +
                ' and recordrtc ' + RecordRTC.version;
            videojs.log(msg);
        });

        this.player.one('deviceReady', () => {
            this.player.record().enumerateDevices();
        });

        // this.player.on('startRecord', function () {
        //     console.log('started recording!');
        // });

        this.player.on('finishRecord', () => {
            console.log('finishRecord');
            this.submitVideo();
        });

        this.player.on('error', (element, error) => {
            console.log(element, error);
        });

        this.player.on('enumerateReady', () => {
            this.devices = this.player.record().devices;
            let deviceInfo, i;
            this.videoDevices = [];
            for (i = 0; i < this.devices.length; ++i) {
                deviceInfo = this.devices[i];
                if (deviceInfo.kind === 'videoinput') {
                    this.videoDevices.push(this.devices[i]);
                }
            }
            if (this.videoDevices.length > 1) {
                this.deviceId = this.videoDevices[0].deviceId;
                this.player.record().setVideoInput(this.deviceId);
                this.isSwitchCamera = false;
            }
        });
        this.player.record().getDevice();

Using vue 3 + laravel

smilemittal commented 1 year ago

Recording using videojs example (https://collab-project.github.io/videojs-record/demo/change-video-input.html)

Recording using google meet

I think above images explain my issue better.