根据RecordRTC作者的说法,在chrome >=版本49中已经支持媒体记录器api。
我下载了50版来测试这些特性。
任何小于5分钟的记录都会导致铬金丝雀崩溃。我该如何解决这个问题?
audioRecorder = RecordRTC(stream, {
recorderType: StereoAudioRecorder,
bufferSize: 16384, // mandatory: if 720p output is forced. otherwise: optional default buffersize 16384
//sampleRate: 22050, // default samplerate 48000
});
videoRecorder = RecordRTC(stream, {
type: 'video',
frameInterval: 90,
canvas: {
width: 1280,
height: 720
}
});
videoRecorder.initRecorder(function() {
audioRecorder.initRecorder(function() {
audioRecorder.startRecording();
videoRecorder.startRecording();
});
});
发布于 2016-02-15 04:06:20
请转到chrome://crashes,并从那里提供的链接提交崩溃的bug,以便在Chrome Canary变得稳定之前修复问题。似乎仍然有相当多的bug存在,请参阅here
发布于 2016-03-02 08:43:53
使用Chrome金丝雀或测试版>=50
。启用此标志:chrome://flags/#enable-experimental-web-platform-features
现在试试这个RecordRTC代码片段:
var audioVideoRecorder = RrecordRTC(yourStream, {
type: 'video'
});
audioVideoRecorder.startRecording();
现在,您不仅可以获得音频/视频曲目的单个WebM,而且还可以录制至少10到15分钟的录制,而不会出现任何崩溃。
如果你想用记录最长可能的流,那么你可能会尝试这样做:
更新于2016年3月03日
以下是如何使用MediaRecorder接口录制更长的流(因为RecordRTC目前似乎无法录制更长的流):
var recorder = new MediaRecorder(yourStream, {
mimeType: 'video/webm'
});
recorder.ondataavailable = function(e) {
if(!e || !e.data || !e.data.size) throw 'Failed.';
yourVideo.src = URL.createObjectURL(e.data);
// UploadToServer(e.data);
};
recorder.start(3600000); // record 60 minutes video
您甚至可以使用recorder.stop
随时停止录制;或者使用recorder.pause
暂停录制。
https://stackoverflow.com/questions/35401076
复制相似问题