# Better way to handle iOS Safari autoplay issues?

**URL:** <https://openvidu.discourse.group/t/better-way-to-handle-ios-safari-autoplay-issues/3957>\
**Category:** How to implement?\
**Tags:** v2\
**Created:** [May 11, 2022, 7:50am UTC](https://openvidu.discourse.group/t/better-way-to-handle-ios-safari-autoplay-issues/3957 "2022-05-11T07:50:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![phil917](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/phil917/32/58_2.png) [@phil917](https://openvidu.discourse.group/u/phil917)\
**Post date:** [May 11, 2022, 7:50am UTC](https://openvidu.discourse.group/t/better-way-to-handle-ios-safari-autoplay-issues/3957/1 "2022-05-11T07:50:42Z")

</div>

Hi there, I recently put in a fix for an issue my app was having where subscribers on iOS (Safari/Chrome) would not see the publisher’s video play when the publisher switched between webcam/screen share/etc… (using OpenVidu.initPublisher).

I “fixed” this issue by essentially calling video.play() on all videoElementCreated events and then catching the error on iOS and then retrying play() with the audio muted and showing a prompt.

This works, but calling play() on the video element feels kind of messy/hacky, since in most cases the video is already playing.

I was wondering if there was a better solution known to OpenVidu devs (besides using a native app for iOS)? I couldn’t find much from searching Google and the forums.

Thanks!

---

<div class="post-metadata">

**Author:** ![CSantosM](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/csantosm/32/16_2.png) [@CSantosM](https://openvidu.discourse.group/u/CSantosM)\
**Post date:** [May 11, 2022, 3:05pm UTC](https://openvidu.discourse.group/t/better-way-to-handle-ios-safari-autoplay-issues/3957/2 "2022-05-11T15:05:39Z")

</div>

iOS doesn’t allow playing a video with audio without a user gesture. By default, if a video has audio, it will appear stopped ([Troubleshooting / FAQ - OpenVidu Docs](https://docs.openvidu.io/en/2.21.0/troubleshooting/#11-my-safari-users-with-role-subscriber-are-not-able-to-receive-any-remote-video))

You will need to emulate a user gesture if you want to autoplay the video without interaction
