AgoraIO-Community / VideoUIKit-Web-React

A Web library to simply integrate Agora Video Calling or Live Video Streaming to your website with just a few lines of code.
MIT License
53 stars 42 forks source link

Screensharing #6

Closed Alastair1234 closed 1 year ago

Alastair1234 commented 2 years ago

Great UI kit, is there an easy way to implement screensharing?

EkaanshArora commented 2 years ago

Screensharing is on the roadmap, if you want to add screensharing before it's officially added to the UIKit, you can use the individual components of the UIKit to put together your app, you can access the Agora SDK and the client object to create a screen track and publish it yourself. You can look at this example where I used the UIKit to add RTMP streaming.

Vahidalizadeh7070 commented 2 years ago

I use Agora UIKIT and then add the below code to join the screen as a client to AGORA Uikit. but I have another problem. I have 2 versions of the application that have been used by Agora. (React Native, React js). When the screen is shared, In the android version, Screen is not fitted for the android screen. `async function shareScreen() { const screenClient = AgoraRTC.createClient({ mode: 'rtc', codec: 'vp8', role: 'host' });

    const appId = '***;
    const screenTrack = await AgoraRTC.createScreenVideoTrack(
        {
            encoderConfig: '1080p',
            optimizationMode: 'detail',
            screenSourceType: 'screen'
        });

    await screenClient.join(appId, params.courseTitle, null)

    await screenClient.publish(screenTrack);

    screenTrack.on('track-ended', async () => {
        await screenClient.leave();
    });
}`
buddhiv commented 1 year ago

AgoraRTC.createClient({ mode: 'rtc', codec: 'vp8', role: 'host' });

Hi, just a quick question. I am new to Agora. Now <AgoraUI></AgoraUI> is a react component which initiates a conference with given prop values.

Where do you call the await AgoraRTC.createScreenVideoTrack() function? It is a different approach from the other one. Can both patterns be used in the same application? How do you implement your Agora solution?

Is is possible for you to share your experience?

EkaanshArora commented 1 year ago

This is added in v1.2.0 #22