One-Way Video Broadcast + Audio Feedback: Viewer

HTML

<script src="https://api.bistri.com/bistri.conference.min.js"></script>

JavaScript

/*
    One-Way Video Broadcast + Audio Feedback Demo: Viewer.
    the broadcaster demo is located at the following url:
    http://jsfiddle.net/bistri/e9y40fxh
    JS library reference:
    http://developers.bistri.com/webrtc-sdk/js-library-reference
*/
onBistriConferenceReady = function () {
    
    var localStream;
  
    // initialize API client with application keys
    // if you don't have your own, you can get them at:
    // https://api.developers.bistri.com/login
    bc.init( {
        appId: "38077edb",
        appKey: "4f304359baa6d0fd1f9106aaeb116f33"
    } );
    
    // when a new remote stream is received
    bc.streams.bind( "onStreamAdded", function ( stream ) {
        // insert the stream into the page body
        bc.attachStream( stream, document.body );
    } );
    
    // when a stream has been stopped
    bc.streams.bind( "onStreamClosed", function ( stream ) {
        // remove the stream from the page
        bc.detachStream( stream );
    } );
  
    // when user is connected to the server
    bc.signaling.bind( "onConnected", function () {
        // ask the user to access to his microphone
        bc.startStream( "pure-audio", function( stream ){
            // join a room called "myRoom-b" and limit conference to 4 participants
            bc.joinRoom( "myRoom-b", 400 );
        } );
    } );
    
    // open a new session on the server
    bc.connect();
}