how to publish host and participant stream from different page and playback on home page?

prateek_sharma

New Member
i have one host file and one participant file(.php and .js) ,
1)first webpage - create room (only for host/admin)
2)second webpage -then select camera or audio
3)third webpage - final page where we have host stream(using camera id and audio id) and MCU.
4) copy invitation link

PARTICIPANT END
1)paste invitationlink - which will redirect to me on choose camera and audio

i done these things

now stuck at
2)page where we have MCU and participant stream

output- i want host stream and MCU and participant stream(which is connected after joining) this is from hostview
from partipant view only want to see is participant stream and MCU.

help me out,
 

Max

Administrator
Staff member
Good day.
output- i want host stream and MCU and participant stream(which is connected after joining) this is from hostview
from partipant view only want to see is participant stream and MCU.
In MCU video stream, you will always see all the pictures (the host and all the participants), so playing host stream and participants streams separately seems excessive if you're playing MCU stream.
Anyway, you can play a number of video streams simultaneosly, each in its own div, see 2Players example code.
If you're using server side PHP script to form a webpage, you can add or remove some div elements depending on parameters passed from client, fro example https://webserver/chat.php?view=participant&token=12345678910. In JS file, you should check if there is a host div on page, and play host stream depending on this.
 

prateek_sharma

New Member
Good day.

In MCU video stream, you will always see all the pictures (the host and all the participants), so playing host stream and participants streams separately seems excessive if you're playing MCU stream.
Anyway, you can play a number of video streams simultaneosly, each in its own div, see 2Players example code.
If you're using server side PHP script to form a webpage, you can add or remove some div elements depending on parameters passed from client, fro example https://webserver/chat.php?view=participant&token=12345678910. In JS file, you should check if there is a host div on page, and play host stream depending on this.
hello max
can i publish stream on one page and playback that published stream on another page ,is there any way to do that.
 

prateek_sharma

New Member
You can play a number of video streams simultaneosly on the same page, see 2Players example code. You should just set stream name to play.
hey max ,
i have multiple stream along with add button each and i am using roomAPI(conference part)
1) how i add one stream or both stream on MCU client
2) and also how i manipulate their audio basis on actively speaking
 

Max

Administrator
Staff member
i have multiple stream along with add button each and i am using roomAPI(conference part)
1) how i add one stream or both stream on MCU client
You should use either RoomApi or MCU mixer, but not both. If you prefer RoomApi, you can use mixer for conference recording. In this case:
1. Enable mixer streams recording in WCS settings
Code:
record_mixer_streams=true
2. Create a mixer using REST API
Code:
POST /rest-api/mixer/startup HTTP/1.1
HOST: wcs:8081
content-type: application/json
 
{
    "uri": "mixer://conference1",
    "localStreamName": "conference1",
    "hasVideo": true,
    "hasAudio": true
}
3. Add participant stream to the mixer using REST API
Code:
POST /rest-api/mixer/add HTTP/1.1
Host: wcs:8081
Content-Type: application/json
 
{
    "uri": "mixer://conference1",
    "remoteStreamName": "room-11111-participant-1"
}
2) and also how i manipulate their audio basis on actively speaking
Mixer has a built-in speech indicator enabled by default. If you are using RoomApi, please see this code sample to detect speech in plaing stream.
 
Top