Bug 193312

Summary: Multiple videos (with audios) with autoplay & playinline not working. Only one video play at a time.
Product: WebKit Reporter: Vasanth <vasanthv>
Component: WebRTCAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: ben.browitt, commit-queue, eric.carlson, jer.noble, tsavell, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari 11   
Hardware: Unspecified   
OS: iOS 12   
Attachments:
Description Flags
Screenshot from iOS
none
Patch
none
Patch
none
Patch none

Description Vasanth 2019-01-10 02:08:51 PST
I implemented a group video chat app that is supported by all browsers. The problem I face in iOS is when more than 2 videos are added to the page, the older video gets paused one by one.

To test it hit http://itshello.co/ios-bug-test

Any help is appreciated.

Thanks in advance.
Comment 1 Vasanth 2019-01-10 02:16:03 PST
Created attachment 358783 [details]
Screenshot from iOS
Comment 2 Radar WebKit Bug Importer 2019-01-10 14:07:30 PST
<rdar://problem/47189864>
Comment 3 youenn fablet 2019-01-10 15:31:29 PST
Hi Vasanth,

There is a limitation in the number of video elements that can play audio at the same time. Instead, you might be able to use multiple audio elements and have video elements just play video tracks without audio.

Can you tell me whether that will fix your issue?
Comment 4 Vasanth 2019-01-10 22:34:28 PST
(In reply to youenn fablet from comment #3)
> Hi Vasanth,
> 
> There is a limitation in the number of video elements that can play audio at
> the same time. Instead, you might be able to use multiple audio elements and
> have video elements just play video tracks without audio.
> 
> Can you tell me whether that will fix your issue?

Thank you for the response.

But it wont solve my problem, the reason is that it is a group video chat app and we need to have the audio for all video elements.

Just to understand the problem, is this limitation imposed by iOS? because its working fine in Mac Safari.

Vasanth
Comment 5 youenn fablet 2019-01-11 08:15:22 PST
(In reply to Vasanth from comment #4)
> (In reply to youenn fablet from comment #3)
> > Hi Vasanth,
> > 
> > There is a limitation in the number of video elements that can play audio at
> > the same time. Instead, you might be able to use multiple audio elements and
> > have video elements just play video tracks without audio.
> > 
> > Can you tell me whether that will fix your issue?
> 
> Thank you for the response.
> 
> But it wont solve my problem, the reason is that it is a group video chat
> app and we need to have the audio for all video elements.

I guess you are sending each audio of each user independently.
In that case, you can have one audio element per user.
They will all play jointly.
You can then have one video element per user but not playing audio.
They will also play independently.

> Just to understand the problem, is this limitation imposed by iOS? because
> its working fine in Mac Safari.

Yes, this is current iOS limitation.
Comment 6 Ben 2019-01-12 17:29:44 PST
Using multiple audio elements won't work If you are only receiving and not capturing local mic or webcam. Each audio element will need to be played from a user gesture.
Comment 7 youenn fablet 2019-05-22 08:19:20 PDT
Created attachment 370397 [details]
Patch
Comment 8 youenn fablet 2019-05-22 09:49:47 PDT
Created attachment 370409 [details]
Patch
Comment 9 youenn fablet 2019-05-22 09:50:25 PDT
Created attachment 370410 [details]
Patch
Comment 10 WebKit Commit Bot 2019-05-23 13:57:03 PDT
Comment on attachment 370410 [details]
Patch

Clearing flags on attachment: 370410

Committed r245712: <https://trac.webkit.org/changeset/245712>
Comment 11 WebKit Commit Bot 2019-05-23 13:57:04 PDT
All reviewed patches have been landed.  Closing bug.
Comment 12 Truitt Savell 2019-05-24 11:34:40 PDT
It looks like the changes in https://trac.webkit.org/changeset/245712/webkit

has caused media/video-remote-control-playpause.html

to become a constant timeout.

I reproduced this locally and had the test timeout on 245712 but not 245711

History:
http://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=media%2Fvideo-remote-control-playpause.html
Comment 13 Ben 2019-05-24 13:20:42 PDT
The commit message says:
"Any non MediaStream backed video will stop all MediaStream backed video elements."

In our app the meeting organizer share mp4 or youtube video. The video will stop WebRTC streams and make the app broken. Why is it important to prevent webrtc streams to play with non MediaStream videos?
Comment 14 youenn fablet 2019-05-24 16:22:02 PDT
(In reply to Truitt Savell from comment #12)
> It looks like the changes in https://trac.webkit.org/changeset/245712/webkit
> 
> has caused media/video-remote-control-playpause.html
> 
> to become a constant timeout.
> 
> I reproduced this locally and had the test timeout on 245712 but not 245711
> 
> History:
> http://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.
> html#showAllRuns=true&tests=media%2Fvideo-remote-control-playpause.html

Filed https://bugs.webkit.org/show_bug.cgi?id=198238 for fixing it.
Comment 15 youenn fablet 2019-07-08 11:53:03 PDT
(In reply to Ben from comment #13)
> The commit message says:
> "Any non MediaStream backed video will stop all MediaStream backed video
> elements."
> 
> In our app the meeting organizer share mp4 or youtube video. The video will
> stop WebRTC streams and make the app broken. Why is it important to prevent
> webrtc streams to play with non MediaStream videos?

Hi Ben, could you file another bug for this one?
Comment 16 Ben 2019-07-09 23:44:05 PDT
Filed a bug:
https://bugs.webkit.org/show_bug.cgi?id=199661