0

I am using AVPlayer to play videos in a SCNNode. I want to prevent more than one video/audio from playing at a time. So if a video is playing and then another video starts, it will pause the previous video. Only allowing one video to ever be played at a time. The problem I'm having is if 2 nodes are in view it is overlapping the audio of 2 videos. Please help!

I've tried pausing the video when the node is out of view but I am running into problems if 2 nodes are in view at the same time.

  • did you try using multiple instances of AVPlayer ? – ZahraAsgharzade Jul 26 '19 at 16:28
  • 1) Could we see some code with your described errors? It would allow us to better understand this case. 2) You can have 2 `AVPlayer`s at one time; I think it actually allows up to 16. (https://stackoverflow.com/questions/27071045/multiple-avplayers-in-a-uiscrollview-only-16-of-them-are-shown) So, have 1 `SCNNode` and show/hide the `AVPlayer`s as you switch, as well as pausing them as necessary – impression7vx Jul 26 '19 at 17:12

0 Answers0