无法找到变量:Safari中的MediaRecorder

时间:2017-12-29 07:10:18

标签: javascript browser safari video-streaming video-player

我正在制作视频聊天应用程序并尝试录制视频。但是我遇到了在safari浏览器中记录本地Stream或Remote Stream的问题。它显示错误“无法找到变量:MediaRecorder”。

这是我的代码:

function startRecording() {

    recordedBlobs = [];

    var options = { mimeType: 'video/webm;codecs=vp9' };
    if (!MediaRecorder.isTypeSupported(options.mimeType)) {
        console.log(options.mimeType + ' is not Supported');
        options = { mimeType: 'video/webm;codecs=vp8' };
        if (!MediaRecorder.isTypeSupported(options.mimeType)) {
            console.log(options.mimeType + ' is not Supported');
            options = { mimeType: 'video/webm' };
            if (!MediaRecorder.isTypeSupported(options.mimeType)) {
                console.log(options.mimeType + ' is not Supported');
                options = { mimeType: '' };
            }
        }
    }
}

1 个答案:

答案 0 :(得分:-1)

MediaRecorder is not supported jet by Safari 11, iOS 11

https://caniuse.com/#search=MediaRecorder