Giter Site home page Giter Site logo

Comments (9)

stephenlb avatar stephenlb commented on May 30, 2024

Yes it is 😸 Sorry for late replay. Let me know if you'd like to see the code to make that happen.

from webrtc-sdk.

jonohayon avatar jonohayon commented on May 30, 2024

Hi!
It would be awesome :)

--Jonathan

from webrtc-sdk.

stephenlb avatar stephenlb commented on May 30, 2024

Jonathan I'll post a sample here: https://github.com/stephenlb/webrtc-sdk#webrtc-video-and-audio-broadcasting-mode - I'll post it in this thread too. 1 sec.

from webrtc-sdk.

jonohayon avatar jonohayon commented on May 30, 2024

That's great! Thanks!

--Jonathan

from webrtc-sdk.

jonohayon avatar jonohayon commented on May 30, 2024

And btw, where can I find the ObjC library for WebRTC and the settings for using it with this library?

--Jonathan

from webrtc-sdk.

stephenlb avatar stephenlb commented on May 30, 2024

Obj-c you'll want http://xirsys.com

from webrtc-sdk.

stephenlb avatar stephenlb commented on May 30, 2024

Broadcaster with Audience Members

https://github.com/stephenlb/webrtc-sdk#webrtc-video-and-audio-broadcasting-mode

You'll start by opening the stream for the broadcaster so audience members can join in.
Start broadcasting as the broadcaster:

Broadcaster

// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Initialize the Broadcaster's Device
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
var broadcaster = PHONE({
    number        : "BROADCASTER",  // If you want more than one broadcaster, use unique ids
    publish_key   : 'pub-c-561a7378-fa06-4c50-a331-5c0056d0163c',
    subscribe_key : 'sub-c-17b7db8a-3915-11e4-9868-02ee2ddab7fe',
    ssl           : true
});

// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Wait for New Viewers to Join
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
broadcaster.receive(function(new_viewer){
    new_viewer.connected(function(viewer){ /* ... */ }); // new viewer joined
    new_viewer.ended(function(viewer){ /* ... */ });  // viewer left
    //new_viewer.hangup();  // if you want to block the viewer
});

Viewer

// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Initialize the Viewer's Device
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
var viewer = PHONE({
    number        : "VIEWER-"+new Date,
    publish_key   : 'pub-c-561a7378-fa06-4c50-a331-5c0056d0163c',
    subscribe_key : 'sub-c-17b7db8a-3915-11e4-9868-02ee2ddab7fe',
    ssl           : true
});

// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Join a Broadcast as a Viewer
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
viewer.ready(function(){
    var broadcaster = phone.dial("BROADCASTER");
});

// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Show Broadcast's Video Stream
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
viewer.receive(function(broadcaster){
    broadcaster.connected(function(broadcaster){
        document.body.appendChild(broadcaster.video);
    });
    broadcaster.ended(function(broadcaster){ /* broadcast ended */ });
});

from webrtc-sdk.

jonohayon avatar jonohayon commented on May 30, 2024

Thanks!!

-- Jonathan

from webrtc-sdk.

stephenlb avatar stephenlb commented on May 30, 2024

I've made a few tweaks, there may be a few bugs because I typed this up freeform.

from webrtc-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.