I’m close to doing what I want, but not quite there.
I have an ad banner that when clicked, reveals a YouTube video by sliding it down below the banner and pushing everything else down the page (OnClick Show Video slide down 500ms push widgets below).
I added “?autoplay=1” to the inlineFrame Frame Target URL code and the video actually does start to autoplay when the page is loaded. However, when the page is loaded the video is hidden (as it is supposed to be) — but the audio starts before the ad banner is clicked!
How (where) can I set autoplay for a YouTube (or any) video, but only when the Inline Frame is revealed and not before?
You’re very close! Rather than having the Open Link interaction on the iframe itself, you can create this interaction to add to the OnClick of the banner instead:
Could you post your .rp file here for me to test? That’ll be the fastest way to troubleshoot the issue. If you’d rather keep the file private, you can send that over to support@axure.com.
Gotcha - thanks for clarifying. I’ve been playing around with the YouTube controls and your file, and it doesn’t look like ?autoplay=1 works when shown with an animation. I tried a variety of combinations using resize, move, enable/disable, but it looks like the autoplay code does not work for certain conditions. As such, I’m afraid the only solution is to remove the slide up/down animations to get the autoplay code to work, but hopefully this helps a bit.
Since April 2018, Google made some changes to the Autoplay Policy. You not only need to add the autoplay=1 as a query param, but also add allow=‘autoplay’ as an iframe’s attribute
So while embed youtube video, you will have to do something like this: