How to split local camera preview and streaming in webRTC streaming?

marcw

Member
Hello!

Related to the demo "client2/examples/demo/streaming/streamer/streamer.html" I would like to only display the local camera view and starting streaming with a second action. I still was not able to adjust the code to realize this. I tried to double a lot of function but this is a stupid solution (and hard to maintain later) and also the preview screen is doubled when I start the streaming process in a second step. Seems it has to do with

MediaProvider[mediaProvider].getMediaAccess(constraints, display, disableConstraintsNormalization, useCanvasMediaStream).then(function () {

what I cannot separate senseful.

The perfekt soluton would be that there is only one camera preview screen. Clicking on button 1 starts the local preview. Clicking on button two the streaming to the server starts. The preview screen still displays the camera view. Just the PUBLISHING evant is fired.

Can you help me?

Best regards
Marc
 

Max

Administrator
Staff member
Good day.
The perfekt soluton would be that there is only one camera preview screen. Clicking on button 1 starts the local preview. Clicking on button two the streaming to the server starts. The preview screen still displays the camera view. Just the PUBLISHING evant is fired.
If you wat to just test the camera, then publish a stream, please look at this camera test example: Testing microphones and cameras. The example shows how to stop test by clicking Stop test button, you can stop camera test then start streaming in this case.
 
Top