How does Twilio's "Programmable Video" work? - ios

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.

Related

Twilio Video start recording manually

I'm working on a video call web application using Twilio Video REST API and JavaScript SDK 2.8.0.
My requirement is that Users should be able to record video calls only if they want to record, and there is no need to record all calls automatically.
According to twilio documentation, group video rooms created via the REST API can specify whether to record or not in the initial room creation HTTP POST request only. (using RecordParticipantsOnConnect=True)
Is there any possibility to start recording after room was created ?
Currently no. You would have to move participants to another room to record them.

Twilio Video JS: Muting RemoteParticipant's audio

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!

Twilio video: recording rooms server-side

Context: we're building a HIPAA-compliant video chat, and evaluating Twilio as a potential supplier for video streams. Part of the requirement is that we need to make a recording on each video -and this needs to be stored encrypted in a HIPAA-compliant storage.
Having set up Twilio's excelent quickstart example, I've started a server, and were able to connect with two clients to it, with videos. However, looking around Twilio's room configuration, the server-side recording appears to refer to Twilio-based storage, which is not HIPAA-compliant.
Question: In what ways can we configure the started Node server to save a local copy of all streams participating in a room?
Thank you!
Twilio developer evangelist here.
When you set up a group room based video chat using Twilio Video all participants in the chat make WebRTC connections to a Twilio server in order to transmit and receive data via the room. When you turn on recording, the video that passes through the server is then written to disk. As far as I'm aware, this is not HIPAA compliant.
We do have a page on building HIPAA compliant video applications with Twilio Video but the advice is to use peer to peer rooms so that the only media that potentially goes through Twilio (via the TURN relay) is encrypted and can't be read or saved by Twilio.
You can't record the video on the Node server from the quickstart, because that's not used to stream the media at all. It only exists to generate an access token.
You could build a server that also joined the peer to peer room of the chat and saved the video that way. I have no experience in building WebRTC server applications though, so I can't help guide you with that. It's certainly not a case of just configuring the server differently.
Your other option would be to record the video in the client and somehow transfer that to your server. That might be unwieldy though for long chats that would cause extra work on the client and result in a potentially large video file to send to the server.

Video recording with Twilio

Is it possible to record only one person in video call with Twilio?
I don't see any examples in their documentation about video recording for one person.
Yes you absolutely can, just make the 2 people join the same room.
You can give it a try with Twilio's sample app here: Twilio Video Sample App
Just make sure the 2 devices running this app connects to the same room.

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.

Resources