webrtc-stream

Stream video and audio

npm install webrtc-stream
8 downloads in the last week
35 downloads in the last month

webrtc-stream

Stream video and audio

Example

See example folder for more details

var WebRTC = require("../../browser")
    , MediaStream = WebRTC.MediaStream
    , WebRTCStreams = WebRTC.WebRTCStreams
    , DiscoveryNetwork = require("discovery-network")
    , Connection = DiscoveryNetwork.Connection

var localVideo = document.getElementById("local-webrtc")
    , remoteVideos = document.getElementById("remote-videos")

MediaStream.local(localVideo, function (myMediaStream) {
    var conn = Connection("http://discoverynetwork.co/service")

    WebRTCStreams(conn, "mediaStreams-demo", myMediaStream, renderStream)

    function renderStream(remotePeerId, stream) {
        var remoteVideo = document.createElement("video")
        remoteVideo.autoplay = true
        remoteVideos.appendChild(remoteVideo)
        MediaStream.remote(remoteVideo, stream)
    }
})

Contributors

  • Raynos

MIT Licenced

npm loves you