Jump to content
  • 0

Broadcasting 'canvas' instead of camera directly (for overlays etc)


Alex A
 Share

Question

So looking into the examples and explanations in this Antmedia article: https://antmedia.io/how-to-merge-live-stream-and-canvas-in-webrtc-easily/

We want to broadcast a 'canvas' which has a manipulated version of the video stream drawn onto it - however the above article does not seem relevant to the current antmedia versions and demo files.

ie: there is no "initWebRTCAdaptor(localStream);" in all the demo's, they intialize differently - so how do you attach a canvas instead of a video stream now in the current versions ?

anyone have the basic demo code working to do this ?

thanks

Alex.
Link to comment
Share on other sites

  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

1 answer to this question

Recommended Posts

  • 0

Incase anyone finds this post - Enes answered it in another post;

 

"you need to add localStream variabla to webRTCAdaptor here: https://github.com/ant-media/StreamApp/blob/master/src/main/webapp/index.html#L446

You need to use localStream = {variable you are going to use} instead of localVideoId.

Like:

function initWebRTCAdaptor(publishImmediately, autoRepublishEnabled)

 

{

 

webRTCAdaptor = new WebRTCAdaptor({

 

websocket_url : websocketURL,

 

mediaConstraints : mediaConstraints,

 

peerconnection_config : pc_config,

 

sdp_constraints : sdpConstraints,

 

localStream : somestream,

 

debug:debug,

 

bandwidth:maxVideoBitrateKbps,

"

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share


×
×
  • Create New...