Skip to content

Share Screen Solution  #239

Description

@daroOkpeku

i have found the solution

`let audioTrack, videoTrack, streamsx;
LocalStream.getDisplayMedia({
resolution: 'vga',
video: true,
audio: true,
codec: "vp8"
}).then( async(media) => {

        [videoTrack] = media.getVideoTracks();
        const audioStream = await  LocalStream.getUserMedia({audio: true}).catch(e =>console.log(e));
        [audioTrack] = audioStream.getAudioTracks();
        streamsx = new MediaStream([videoTrack, audioTrack]); 

        media.getAudioTracks()[0].enabled = true;
     
        isPub.current.srcObject = streamsx;
        isPub.current.autoplay = true;
        isPub.current.controls = true; 
        isPub.current.muted = false;
      clientx.current.publish(media);

})`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions