When a video from twitter is oneboxed, it seems to auto-play without any user interaction. This is quite obnoxious. For example
https://twitter.com/UniofNottingham/status/827966230568988672/video/1
When a video from twitter is oneboxed, it seems to auto-play without any user interaction. This is quite obnoxious. For example
https://twitter.com/UniofNottingham/status/827966230568988672/video/1
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.
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âŚ
Itâs annoying as hell.
It is not autoplaying on my iPad right now, so this isnât a valid statement.
@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
Firefox
Chrome
MacOS Sierra
Chrome
Safari
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.
Update
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.
Remember flash is about to become click to play by default on all browsers. Which it should have been, for yearsâŚ
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:
https://productforums.google.com/forum/m/#!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:
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="https://publish.twitter.com/oembed?url=https://twitter.com/UniofNottingham/status/827966230568988672" title="Uni of Nottingham on Twitter: "Highlights from @LakesideArts digital show celebrating #ChineseNewYear đ https://t.co/yWujAUIFNw"">
which links to:
{
"url":"https:\/\/twitter.com\/UniofNottingham\/status\/827966230568988672",
"author_name":"Uni of Nottingham",
"author_url":"https:\/\/twitter.com\/UniofNottingham",
"html":"\u003Cblockquote class=\"twitter-tweet\"\u003E\u003Cp lang=\"en\" dir=\"ltr\"\u003EHighlights from \u003Ca href=\"https:\/\/twitter.com\/LakesideArts\"\u003E@LakesideArts\u003C\/a\u003E digital show celebrating \u003Ca href=\"https:\/\/twitter.com\/hashtag\/ChineseNewYear?src=hash\"\u003E#ChineseNewYear\u003C\/a\u003E \uD83D\uDC13 \u003Ca href=\"https:\/\/t.co\/yWujAUIFNw\"\u003Epic.twitter.com\/yWujAUIFNw\u003C\/a\u003E\u003C\/p\u003E— Uni of Nottingham (@UniofNottingham) \u003Ca href=\"https:\/\/twitter.com\/UniofNottingham\/status\/827966230568988672\"\u003EFebruary 4, 2017\u003C\/a\u003E\u003C\/blockquote\u003E\n\u003Cscript async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"\u003E\u003C\/script\u003E",
"width":550,
"height":null,
"type":"rich",
"cache_age":"3153600000",
"provider_name":"Twitter",
"provider_url":"https:\/\/twitter.com",
"version":"1.0"
}
This is a javascript based embed, which I believe Discourse ignores because it is variable height and so risks breaking scrolling
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="https://twitter.com/i/videos/827966230568988672?embed_source=facebook">
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 âwww.dailymotion.comâ.
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
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
https://github.com/discourse/onebox/blob/master/lib/onebox/engine/video_onebox.rb#L15
Please can you post an example here on meta?