Page MenuHomePhabricator

Export file thumbnail, video preview via Open Graph meta elements as Facebook posting helper
Open, MediumPublic

Description

Similar to T27854 (oEmbed export/discovery), it should be useful to expose images and video files via Open Graph meta tags, which tools like Facebook can pick up when someone posts a link.

For images and video, exposing a thumbnail at some defaultish default width/height should help:

<meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>

We'll have to pick a default size, I suppose; per docs should be bigger than 50x50, with maximum aspect ratio of 3:1 (???)

For video, there are some examples of multi-format info:

<html xmlns:og="http://ogp.me/ns#"> 
    <head>
        ...
        [REQUIRED TAGS]
        <meta property="og:video" content="http://example.com/awesome.swf" />
        <meta property="og:video:height" content="640" />
        <meta property="og:video:width" content="385" />
        <meta property="og:video:type" content="application/x-shockwave-flash" />
        <meta property="og:video" content="http://example.com/html5.mp4" />
        <meta property="og:video:type" content="video/mp4" />
        <meta property="og:video" content="http://example.com/fallback.vid" />
        <meta property="og:video:type" content="text/html" />
        ...
    </head>

however if we're not generating H.264 .mp4 output for videos, we might be stuck with just a link if it doesn't happen to accept WebM/ogg; it kinda looks like that fallback is for linking not iframe embedding.

Audio files seem to be handled similar to videos; depending on what clients claim to support they may or may not actually take an ogg vorbis file, but mp3 is specifically called out as supported.

Some additional file metadata such as location could probably also be extracted and exposed, if necessary/desired.

See Also:
T32113

Details

Reference
bz31338

Related Objects

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:54 PM
bzimport set Reference to bz31338.
bzimport added a subscriber: Unknown Object (MLST).

+Cc per https://lists.wikimedia.org/pipermail/wikitech-l/2015-April/081459.html and replies.

MaxSem, would metadata for images be in scope for the PageImages extension?

I have added this comment on T27854: Expose image thumbs, embedded video players via oEmbed (API + discovery <link rel>) and I am copying it here just in case it is relevant too (sorry, I lack the technical knowledge to discern).

@Theklan has reported this problem on the Movement Strategy Forum: Embedding Commons pages on the Forum. There is also T309101: Allow video embedding from Wikimedia Commons at Diff.

These two use cases are relatively anecdotal compared to the many other people that might be trying to embed or feature Commons content on their social media or websites easily, just by pasting a URL to a Commons page.