Twitter (and Dailymotion) video onebox autoplays without user interaction

When a video from twitter is oneboxed, it seems to auto-play without any user interaction. This is quite obnoxious. For example


I am having a similar issue with videos, but can’t say whether it’s restricted to Twitter or not.

The below thread has an embedded video in the 15th post, but it plays whether you like it or not.

1 Like

Your example looks like a Dailymotion video, so this isn’t just restricted to Twitter.

I’m not really sure what the solution is here, as Discourse doesn’t have any control of what is inside an iframe… :frowning:

It’s annoying as hell.

It is not autoplaying on my iPad right now, so this isn’t a valid statement.

1 Like

@ron_jeremy, @david, what browser/device are you using? I’m on Windows 10, Chrome, and am seeing the video autoplay. However, opening this topic on my phone (Android 7.1.1m Chrome) is didn’t…

Lubuntu 16.10

MacOS Sierra

The thread I linked to will have DailyMotion videos embedded every week throughout the Supercross season, meaning in a month or two there will be 20 auto-playing videos to greet vieweres of the thread.

I just tested this on my Nexus 6P running Chrome on Android 7.1.1 and the issue does not happen. It seems to be a desktop issue across multiple browsers and operating systems.

1 Like

Remember flash is about to become click to play by default on all browsers. Which it should have been, for years…

1 Like

Running Chrome on Windows 10, the video above does autoplay, and does not appear to be a flash player.


Sure @zogstrip can have a look.


Any update on this? I am also getting end-user complaints. Twitter videos to be more specific.

I have not yet investigated thoroughly, but it might be that Chrome’s behaviour has changed recently:!topic/chrome/2c2JsQFohoo

The reason this isn’t an issue on iPad/Android is because those browsers will not allow a video element with sound to play without user interaction. Desktop browsers do not have this restriction.

These articles have information on when videos can autoplay on iOS/Android:

Muted Autoplay on Mobile: Say Goodbye to Canvas Hacks and Animated GIFs!

I think this is a change from Twitter/Dailymotion rather than a browser thing (i.e. they’ve set the autoplay attribute on the video elements inside the iframes)

Using the example in my first post, the link I pasted has this tag in the <head>

<link rel="alternate" type="application/json+oembed" href="" title="Uni of Nottingham on Twitter: &quot;Highlights from @LakesideArts digital show celebrating #ChineseNewYear 🐓;">

which links to:

O-embed JSON
   "author_name":"Uni of Nottingham",
   "html":"\u003Cblockquote class=\"twitter-tweet\"\u003E\u003Cp lang=\"en\" dir=\"ltr\"\u003EHighlights from \u003Ca href=\"https:\/\/\/LakesideArts\"\u003E@LakesideArts\u003C\/a\u003E digital show celebrating \u003Ca href=\"https:\/\/\/hashtag\/ChineseNewYear?src=hash\"\u003E#ChineseNewYear\u003C\/a\u003E \uD83D\uDC13 \u003Ca href=\"https:\/\/\/yWujAUIFNw\"\\/yWujAUIFNw\u003C\/a\u003E\u003C\/p\u003E&mdash; Uni of Nottingham (@UniofNottingham) \u003Ca href=\"https:\/\/\/UniofNottingham\/status\/827966230568988672\"\u003EFebruary 4, 2017\u003C\/a\u003E\u003C\/blockquote\u003E\n\u003Cscript async src=\"\/\/\/widgets.js\" charset=\"utf-8\"\u003E\u003C\/script\u003E",

This is a javascript based embed, which I believe Discourse ignores because it is variable height and so risks breaking scrolling :frowning:

Instead, it seems like Discourse is using the og:video property, which is a link to a page with the video autoplaying. If you visit that URL, and remove the embed_source=facebook parameter then it doesn’t autoplay any more. I suspect twitter have done this so that their videos autoplay when people share them on Facebook.

<meta property="og:video:secure_url" content="">

Note that currently a link to a twitter video does not match the custom “Twitter Status Onebox”, since the URL is not to a status, but to a video:

So I think the only way this can be solved on the Discourse end is by implementing a “Twitter video” onebox which takes the og:video URL and removes the embed_source=facebook parameter…

Does anyone have any tidier ideas?


Came here to report the same issue with Dailymotion videos. Is there a way to disable video embedding of a specific platform until this issue get fixed?

The “onebox domains blacklist” setting in the admin panel could be used to disable oneboxing for dailymotion. You’ll need to add “”.

Note that any existing posts with oneboxes will need to be “rebaked” for this to take effect - easiest way to do this is to click the wrench below a post and click “rebuild HTML”

Also, onebox does a lot of caching, so it may take a bit of time for the blacklist to take effect :slight_smile:


I’ve just submitted 2 PRs, one to discourse/onebox and one to discourse/discourse. These together should hopefully fix all the twitter-related issues in this thread.


And while I’m at it, here’s a PR to stop autoplay on dailymotion


This is still a problem?

Yes it is, still waiting on the Pull requests to be merged in


It’s also an issue when a direct URL to a video is turned into an HTML video, it autoplays.

Hmm… I’m not sure why that would be the case - the basic video onebox doesn’t add the autoplay attribute as far as I can see

Please can you post an example here on meta?