-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Have you read the Tutorials?
Yes
Have you read the FAQ and checked for duplicate open issues?
Yes
If the question is related to FairPlay, have you read the tutorial?
N/A
What version of Shaka Player are you using?
4.16.9
What browser and OS are you using?
iOS 26.1 / Safari
Please ask your question
When using interstitial_ad_manager.js to insert midroll ads via VMAP, is it possible for ads to autoplay unmuted on iOS Safari when using HLS?
I am using the following VMAP:
<vmap:VMAP xmlns:vmap="http://www.iab.net/vmap-1.0" version="1.0">
<vmap:AdBreak timeOffset="00:00:30.000" breakType="linear" breakId="midroll-foo">
<vmap:AdSource allowMultipleAds="true" followRedirects="true">
<vmap:AdTagURI templateType="vast4">
<![CDATA[ https://ad_server_url.com/ad?foo=1 ]]>
</vmap:AdTagURI>
</vmap:AdSource>
</vmap:AdBreak>
</vmap:VMAP>The player is configured as follows (using a custom UI):
const adManager = shaka.getAdManager();
adManager.initInterstitial(adContainer, shaka, video);
await adManager.addAdUrlInterstitial(vmap);Autoplay is disabled on the viewing page.
Under these conditions, when playback starts and runs until 0:30, the ad-started event fires, but the ad remains paused. Based on the following tests, I believe this is due to iOS autoplay policies:
- If the user taps the screen shortly before the ad break, the ad will autoplay.
- If I set the ad video element’s
mutedproperty totruewhen thead-startedevent fires, the ad will autoplay. - Preroll ads (
AdBreak timeOffset="start") autoplay immediately after the user initiates playback.