Is there a way to enable autoplay on video in iPhone? Currently, videos on iPhone only autoplay when initiated by a user click. Is there a method to achieve autoplay without requiring user interaction?
I’ve noticed that when I play a video and then pause it by swapping, and then swap back, the video resumes playing as expected. This behavior works well in most cases. However, the only issue is that on iPhones, For the first time, the videos require a user interaction to start playing. Is there a solution to enable autoplay on iPhones?
I’m using the AdvancedJS player, along with a Repeating Group Slider to create a swappable set of videos. To pause the previous video when swapping, I’m using the following custom code:
var parentElement = document.getElementById("JSP69RG - job carousel Swaper 's current_index");
if (parentElement) {
var videoElement = parentElement.querySelector("video");
if (videoElement) {
videoElement.pause();
}
}
**
To play the current video, I’m using the following code:
var parentElement = document.getElementById("JSP69This RepeatingGroupCarousel's Active Number + 1");
if (parentElement) {
var videoElement = parentElement.querySelector("video");
if (videoElement) {
videoElement.play();
}
}
**
This setup functions well on desktop and Android devices, but on iPhones, the videos don’t autoplay. If I manually start a video playback once and then swap, the video pauses and resumes as expected. However, I’m seeking a way to achieve autoplay without requiring this initial manual interaction on iPhones.
I am using the custom code, because when I attach the Repeating Group Slider on RG which contains the advanceJs Player, the autoplay on viewport is not working within the AdvanceJS player.