HTML5:捕获从Web浏览器组合的音频和视频

Ka.*_*Ka. 5 html5 html5-video html5-audio asp.net-web-api

我看过很多tutos和演示,展示了如何使用简单的网页捕获和录制音频和视频.

到目前为止的演示:

音频:http
://webaudiodemos.appspot.com/AudioRecorder/index.html视频:http://html5-demos.appspot.com/static/getusermedia/record-user-webm.html

我正在寻找同时捕获和记录两个流.即使它仅适用于特定平台上的特定浏览器,我也感兴趣.

我认为这是不可能的,但不确定.有人找到了同时用网页捕获音频和视频的技巧吗?

Pas*_*cal 0

你好,尝试做同样的事情,你可能应该看看

[http://jsfiddle.net/james2doyle/URyLt/]

如果您愿意,请告诉我,谢谢

$("button").click(do_it);

function do_it() {
    var obj = {}, txt="";
    if (this.id == "video") {
        obj = {
            video: true,
            audio: true
        };
        txt = "<video>";
    } else {
        obj = {
            video: false,
            audio: true
        };
        txt = "<audio>";
    }
    navigator.webkitGetUserMedia(obj, function(stream) {
        $("#result").empty();
        var output = $(txt).appendTo("#result")[0],
            source = window.webkitURL.createObjectURL(stream);
        output.autoplay = true;
        output.src = source;
        console.log(stream);
        window.a = stream; //debug
        $("span#name").html("Camera name: <b>" + stream.videoTracks[0].label + "</b><br>" + "Mic name: <b>" + stream.audioTracks[0].label + "</b>");
    }, function(err) {
        console.log(err);
        err.code == 1 && (alert("You can click the button again anytime to enable."))
    });
}
Run Code Online (Sandbox Code Playgroud)