Reputation: 553
At my job we were recently audited by Youtube and they told us that some of our pages do not respect the required minimum functionality. The reason is because the user can manually start multiples videos and watch them play at the same time. Those videos are NOT on autoplay but apparently we are still in violation of the RMF even if the issue is caused by manual interaction. My question is, is it possible to prevent multiple youtube videos from playing at the same time using the embedded iframes?
If not, what would be the easiest way of fixing this issue?
The following HTML can reproduce the issue:
<!DOCTYPE html>
<html>
<head>
<title>Test Youtube</title>
</head>
<body>
<iframe frameborder="0" allowfullscreen="1" src="https://www.youtube.com/embed/imsF84ICNj0"></iframe>
<iframe frameborder="0" allowfullscreen="1" src="https://www.youtube.com/embed/r-8Tqm81MZY"></iframe>
</body>
</html>
Upvotes: 2
Views: 637
Reputation: 1523
If you use the HTML5 video tag instead of an iframe, you should be able to track the play event using an event listener and disable other videos with pause function in that event listeners callback.
Upvotes: 1