简体   繁体   中英

Media Recorder in iOS

someone can help me with this line of code?
recorder = new MediaRecorder(stream, {mimeType: 'video/webm'}); when i use this variable in iOS, cath(err) answer me "RefenceError, cant find variable: mediaRecorder" pleases can you helpe? if you need it this is the complete function

startBtn.addEventListener('click',function() {
    navigator.mediaDevices.getUserMedia(constraint).then(function(stream) {
        recorder = new MediaRecorder(stream, {
        mimeType: 'video/webm'
        });
        recorder.start();
    }).catch(function(err) {
        alert('impossible '+err);
    });
})

Unfortunately the getUserMedia is only supported in safari browser

Any other browsers the getUserMedia is not supported in iOS devices

First check the availability of getUserMedia before you assign it to recorder

Good Luck

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM