ios – How to use AVMutableAudioMix with AVPlayer audio that is streaming in from the net (NOT local files)?



This question is about AVPlayer (not AVAudioPlayer).

Say you have a couple of videos, which you are playing at the same time:

py1 = AVPlayer(url: URL(string: "https:// a.. .mp4")!)
py1 = AVPlayer(url: URL(string: "https:// b.. .mp4")!)

Say they’re both playing. (Imagine them both playing on differnt parts of the screen.)

In short: how can we hear both?

You can hear one of the other by setting the .volume to zero on one of them,

but how to get a mix of both audios?

It seems impossible / very challenging to get AVMutableAudioMix to work on AVPlayer which are playing a remote URL.

Has anyone cracked this?