Question: Is it possible to autoplay a video inside a Rich Media / In-App message?
Answer: Yes. The steps differ per platform.
iOS
Use an up-to-date Pushwoosh iOS SDK (the properties below have been available since 5.13.1 and are present in the current 7.x releases). On the application side, configure the richMediaStyle object:
[PWRichMediaManager sharedManager].richMediaStyle.allowsInlineMediaPlayback = @(YES);
[PWRichMediaManager sharedManager].richMediaStyle.mediaPlaybackRequiresUserAction = @(NO);
Swift:
PWRichMediaManager.shared().richMediaStyle.allowsInlineMediaPlayback = true
PWRichMediaManager.shared().richMediaStyle.mediaPlaybackRequiresUserAction = false
Android
No additional actions on the application side are required — only the HTML attributes below.
HTML side (both platforms)
The <video> tag must carry autoplay, muted and playsinline. Browsers and WKWebView block autoplay of videos with sound, so muted is mandatory. Reference a directly playable file (for example an MP4 over HTTPS) and use a matching MIME type — a YouTube page URL will not play inline.
<video width="192" height="308" controls autoplay muted playsinline>
<source src="https://example.com/media/promo.mp4" type="video/mp4" />
</video>
See the Pushwoosh iOS SDK repository for the current SDK version.
Comments
0 comments
Please sign in to leave a comment.