mediacapture-main icon indicating copy to clipboard operation
mediacapture-main copied to clipboard

Video with audio element pause after play during phone call

Open trouba opened this issue 2 years ago • 3 comments

Following this stack overflow issue, webrtc google group discussion and per request of @fippo:

I've got an issue with my app and I could reproduce it on this sample: https://webrtc.github.io/samples/src/content/getusermedia/record/

During a phone call, if I open a tab with a <video> with audio element, the video automatically pause (and I can see a pause event firing on the element)

This does not happen:

  • if the video element was loaded and played before the phone call start
  • if the video has no audio.

My main questions are:

  • Is this a normal behaviour ?
  • can it be tracked (by an event other than the pause one) ?
  • Is there any way to know there is a phone call ongoing
  • is there any way to restart the video during the phone call (element.play() works, but a pause event immediately happens) ?

To reproduce:

On a mobile ( Android) Start a phone call Open https://webrtc.github.io/samples/src/content/getusermedia/record/ The video is paused If you manually launch element.play(), you can see the frame in the video updating, and then pause again The record works correctly

trouba avatar Mar 09 '22 14:03 trouba

@youennf you probably thought most about this topic, can you take a look?

fippo avatar Mar 09 '22 18:03 fippo

A bit of new information:

  • I can reproduce this bug with any video element, can be tested with a simple mp4 here: https://codepen.io/caraya/pen/nEgjKW
  • This is probably because of https://developer.android.com/guide/topics/media-apps/audio-focus
  • I haven't read anything about requesting the audio focus from the browser

trouba avatar Mar 10 '22 15:03 trouba

Is it Android specific? We are in UA territory here.

I would expect that if a video gets paused when a phone call starts, the video would be resumed when a phone call ends.

It would be good to evaluate what all platforms are doing (Android/Chrome, Android/Firefox, iOS/Chrome, iOS/Firefox, iOS/Safari) and see what we can do. Maybe we should provide guidelines, I am unsure whether media capture-main is the right place though.

youennf avatar Jun 20 '22 15:06 youennf

The chromium discussion is on https://crbug.com/1285805 - this appears to be hard to implement in current architectures.

Concerns about the video element belong in the video working group.

alvestrand avatar Oct 27 '22 14:10 alvestrand

This should probably go to media WG.

youennf avatar Oct 27 '22 14:10 youennf

Planning to close this issue in a week for now since media capture-main is not really the right spec place.

youennf avatar Oct 27 '22 14:10 youennf

Planning to close this issue in a week for now since media capture-main is not really the right spec place.

youennf avatar Oct 27 '22 14:10 youennf

While there's a request for track mute here as well, I think the spec already says this would be recommended, but it seems ultimately up to the user agent.

jan-ivar avatar Oct 27 '22 14:10 jan-ivar

Closing based on above comment.

jan-ivar avatar Apr 04 '23 17:04 jan-ivar