react-native-webrtc / react-native-webrtc/react-native-incall-manager

[Android] Media does not play with 'unable to play during call' notification after call ends

Open
#184 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
597
Forks
201
Avg merge
2h 42m
Merged PRs (30d)
1

Description

I am implementing a video call with WebRTC, and I am using CallKeep and IncallManager together.

RN: 0.66.3
WebRTC: 1.94.1
RNCallkeep: 4.3.1
IncallManager: 3.2.2

Initially, there was no problem when the call function was implemented using webrtc and incallmanager.
After adding Callkeep to receive calls, I'm having a problem with Android.

When media is played with android default app after the call is ended, the message “unable to play during call” appears and the media cannot be played. In other media apps (such as YouTube), the video plays but no sound. My app is running in the background. I ended the callkeep or incallmanager well after the call ended, but I don't understand why this happens.

GettingCall

//1. Answer incoming Call
RNCallKeep.answerIncomingCall(this.currentCallId);

...
WebRTC Signaling
...

//2. When a media stream is received, start IncallManager
handleStreamEvent(event: EventOnAddStream) {
    this.setRemoteStream(event.stream);
    
    // start IncallManager video, auto mode
    InCallManager.start({ media: 'video' });
   
    this.callStateChangeCallback('connected');
 }

EndCall

 closeVideoCall(): void {
    
    //stop IncallManager
     InCallManager.stop();
     
    if (this.conn) {
      this.conn.close();
      this.conn = null;
    }
    
    //end call
    RNCallKeep.endCall(this.currentCallId);
  }

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Android call flow around RNCallKeep.answerIncomingCall, InCallManager.start({ media: 'video' }), InCallManager.stop(), and RNCallKeep.endCall(). Reproduce the issue by ending the call and then playing media while the app is in the background. Done means the Android default media app plays audio and video normally after the call ends, without the unable-to-play-during-call notification.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript
Domain
audio-video-rtc, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.