twilio / video-quickstart-ios

Twilio Video Quickstart for iOS
https://www.twilio.com/docs/api/video
MIT License
465 stars 178 forks source link

Play callertone while connecting participant to the room. #505

Closed sojitrajayumedex closed 4 years ago

sojitrajayumedex commented 4 years ago

Description

We have successfully implemented TwilioVoice and TwilioVideo SDK in the iOS application.

TwilioVoice SDK is providing a caller tone while a caller makes a call. But for TwilioVideo SDK there is no way which is playing a caller tone.

I have a requirement to play-caller tone while connecting to the user.

I have played ringtone using the following method when we call a user but it's stopping immediately after one second or as soon as the user connects to room.

NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"callringapple" ofType:@"wav"];
NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath];

playerRing = [[AVAudioPlayer alloc] initWithContentsOfURL:soundFileURL error:nil];
playerRing.numberOfLoops = -1;

[playerRing play];

So I think there AudioPlayer stops playing as soon as video SDK initialize room.

Please help me to achieve this feature which can be implemented in our application.

piyushtank commented 4 years ago

@sojitrajayumedex Thanks for reaching out. I am not able to reproduce the problem. When do you stop playing the Ringback? Also it would be useful if you could share a branch on quickstart to demonstrate the problem.

piyushtank commented 4 years ago

@sojitrajayumedex were you able to solve the problem?