Twilio Video JS: Muting RemoteParticipant's audio - twilio

I have a scenario wherein I would need to mute some of the remote participants in the video call in my local machine. Example of this use case is when I want to be able to just hear a remote participant that is presenting and no else.
Solution I found online is to muted as stated here: https://github.com/twilio/twilio-video.js/issues/363.
Muting the html element appears to work but I'm just curious if there is a Twilio method that can achieve the same result?

At this time, the SDK does not provide a native ability to mute remote tracks. Only the local participant can disable their own tracks.
A solution to this problem is the track subscription API. This API allows you to make a request to update a certain participant's subscribe rules so you can programmatically unsubscribe users from tracks. For your use case, you can could hit this API to unsubscribe participants from specific users in the room, or unsubscribe all participants from all tracks except the presenter.
More info on this can be found here: https://www.twilio.com/docs/video/api/track-subscriptions
Let me know what you think!

Related

Youtube subscriber detection

I can't find any documentation with yt api to fire an event whenever a new user subscribes, but I wonder how people on live streams add new subscriber info on their videos whenever someone subscribes.
I'm trying to get the same youtube subscriber notification like people do when they are in livestreams.
But I can't find any way to do it.
I thought of setting interval of checking channel, like if the sub count increases, check the latest subscriber from subscription list.
But this is kinda complicated and can't handle multiple users when they subscribe.
So my question is how does the youtuber's subscriber notification works and how can I replicate it in a nodejs project for example:
async function newSub(sub){ myWeb.send(user.name+ " Thank you for subscribing"); }

How does Twilio's "Programmable Video" work?

I'm building a streaming iOS app in Swift. Looking at the docs https://www.twilio.com/docs/api/video I understand that you can create live video chat rooms on the fly.
My use case is a bit different:
User A access a room, hit 'record' and start streaming a video of himself to Twilio storage. Creates a thumbnail in the UI. User B enters the same room and click the video thumbnail - that video should be streamed down to User B.
If user A is talking (Streaming up) and user B is in the room at the same time, it should be possible to 'Go live', which would start a live video chat room that other users can join too.
Main question: Does Twilio Programmable Video allow streaming up and down using their storage?
Secondary question: Would you say Twilio Programmable Video is the right choice for this use case or would you recommend another service?
Twilio developer evangelist here.
I'll answer this the other way around that you asked if that's ok.
If User A is currently streaming to a room and recording it (having created the room in group mode with RecordParticipantsOnConnect set to true) and another user wants to join the room, then they can. They just need an access token that gives them access to the room. They will then be able to join the room and chat and be recorded too.
Once a recording is complete, you will receive a webhook to the statusCallback URL that was set for the room. The callback for the recording will have the recording-complete and will include a MediaURL for the recording as well as the Uri and Sid for the recording resource.
You can use the media URL or the recording resource to get the binary data, which for videos will be in .mkv format. If you want to stream this video to your users, you may want to download the video and convert to a playable format. Or upload it to a streaming service.
Let me know if that helps at all.

Video Twilio - Setting up a Ringtone for videocalls

We're using Twilio Programmable Video and we'd like to set up:
- A ringtone while a participant is waiting in the room.
- A "ringing" to notify the other side that a participant is waiting in the room.
All in all, a performance like a voice call.
We have checked API Reference, AudioTrack and Media section, without success. (https://media.twiliocdn.com/sdk/js/video/releases/1.0.0-beta4/docs/)
Any idea to configure this performance?
Regards,
Carlos
Twilio developer evangelist here.
There is no functionality in the Twilio API for providing a ring tone, however you could implement it yourself.
You would need to send an invite to the participant that hasn't entered the room yet. You could do that with a server sent event or websocket. Then you would play the ringtone (using an <audio> element or the web audio API) until the user entered the room themself, at which point you would stop playback of the ringtone.
Let me know if that helps at all.

Twilio: how to detect which participant is speaking in a conference

I'm working on to implement an audio-only conference app which is something like Google Hangout, but without video.
In Google Hangout, all participants can see which participants is currently speaking, via visual feedback. In other words, when someone starts speaking, their avatar comes foreground of all of participants immediately.
So, here's my questions for Twilio and its client SDKs:
Is there any way to detect current speaker (and give some feedback to users) ?
Is there any way to get input level of a microphone via the SDKs?
Interesting use cases .
I think both these can be achieved with Twilio and here's my views on how to achieve these
Detecting current speaker
What you essentially require is a flag that is globally shared across all participants. This flag should have the facility to be dynamically updated in real time by the speaker who is speaking and at the same time push this information , again in real time , to other participants. So , simply put , you want a shared resource where each Twilio Client can 'publish' and 'subscribe' their 'speaking' state. You could achieve it via Twilio Sync .
To do that , you could create a list object on Sync and add each participants whose audio level goes above a certain level that you consider them speaking . All Client instances in the conference should be subscribed to this list and so on 'itemAdded' or 'itemRemoved' each instance of client can get a list of participants who are speaking . Based on it , UI changes could be done.
You can get audio level (output and input) at each client instance by querying Twilio Voice Insights .For Audio input level , you will have the value passed in parameter named AudioLevelIn .
Note : Both these products require requesting access .

Youtube API - How to send direct messages to followers?

According to google support:
Use Messages to send private messages to other members of the YouTube
community. [...] The messages system utilizes Google+
messaging so your channel must be connected with a Google+ in order to
use this feature.
https://support.google.com/youtube/answer/57955?hl=en
Is it possible to send direct messages to followers via youtube or google plus API?
I think the closest thing that's currently implemented is the Subscriptions resource, which
"contains information about a YouTube user subscription. A
subscription notifies a user when new videos are added to a channel or
when another user takes one of several actions on YouTube, such as
uploading a video, rating a video, or commenting on a video." [source]
So your subscribers should be getting a notification when you upload a video or do something similar anyways. If you wanted to message each of them directly, I suppose you could use Subscriptions.list() with mySubscribers to get your list of subscribers, but I don't think there's a way to mass message them programmatically (seems like it could be easily abused).

Resources