Iframe: how to stop autoplay?

Things I have tried

  • I tried to put ’ do-not-allow = “autoplay” ’ into iframe.

Things I want it to be

  • I want to stop some iframe embedded videos from being autoplayed.

Can you give us your code for the iframe?
Also are you using any plugins that create iframes in Obsidian?

When I take an iframe from YouTube for example, the player does not start without clicking it.
Code:

<iframe width="560" height="315" src="https://www.youtube.com/embed/-Y1HIo8Mqq4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

I’d like to recreate your issue so I can find a fix for you.

For example, I found this funny video on Imgur

<iframe width="600" height="400" src="https://shrtm.nu/oDGS" do-not-allow="autoplay" allowfullscreen></iframe>

I don’t want the embedded video to autoplay. So I tried to add ‘do-not-allow=“autoplay”’. But I guess it wouldn’t be the right code. Or there is no such code ?

Try this:

<video width="600" height="400" src="https://shrtm.nu/oDGS" controls></video>

2 Likes

This is the solution.
I’ve tried to get the autoplay to be disabled out of the iframe, perhaps this isn’t possible with certain links like to imgur.

With YouTube this seems to work, perhaps this needs to be implemented from the site itself?

Just use the video tag :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.