Giter Club home page Giter Club logo

Comments (6)

disoul avatar disoul commented on August 23, 2024 1

@MobeenAshraf I recommend that you modify the CSS of the receiver's DOM element when you receive the user-unpublished event to get a black screen instead of calling setMute.

from agorawebsdk-ng.

disoul avatar disoul commented on August 23, 2024

Have you read this migration guide about NG? The user-published event will be fired when a remote user publishes an audio or video track (not local user). In NG, all the async operations are using Promise, so there are no callbacks.

If you want to close your camera light, just close and unpublish your video track, then create a new video track and publish it:

let videoTrack = await AgoraRTC.createCameraVideoTrack();
await client.publish(videoTrack);
console.log("publish success");

// close camera light here
videoTrack.close();
await client.unpublish(videoTrack);

// re-create and publish your video track
videoTrack = await AgoraRTC.createCameraVideoTrack();
await client.publish(videoTrack);

from agorawebsdk-ng.

MobeenAshraf avatar MobeenAshraf commented on August 23, 2024

The user-unpublished event is not getting called on remote after I do this:

videoTrack.close();
await client.unpublish(videoTrack);

from agorawebsdk-ng.

disoul avatar disoul commented on August 23, 2024

Have you called setMute before unpublish? There is a known issue about call setMute with unpublish(#8), it may cause user-unpublished event missing if you call LocalAudio.setMute(true). This issue has been fixed in develop branch and will be released next month.

If you did not call setMute and your SDK version is 0.1.9, this case is unexpected, please give me your sample codes to reproduce this issue.

from agorawebsdk-ng.

MobeenAshraf avatar MobeenAshraf commented on August 23, 2024

Hi, Yes, it Seems that is the case.

I was calling unpublish after couple of seconds of setMute to make sure that the receivers get a black screen and don't have video frame stopped.

from agorawebsdk-ng.

MobeenAshraf avatar MobeenAshraf commented on August 23, 2024

Thanks @disoul, That helps

from agorawebsdk-ng.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.