Tumblelog by Soup.io
Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

Partial video embedding fix

This is a bookmarklet and userscript that fixes video embedding in soup. Sadly, it has a limitation: It works only if either:

  • You are in your own soup or your own friend soup
  • or the post contains a link to video in the description

So please, when using this script, start linking the video in the description of your videos, so people who don't follow you can enjoy them!

Currently, these platforms are supported:

  • Youtube
  • Dailymotion
  • Vimeo

Where to get it?

The link of this post is a bookmarklet. (How to install bookmarklets?)

For something more permanent, here is a userscript version: https://greasyfork.org/de/scripts/34474-soup-io-embedfix (How to install userscripts?)

How does it work?

Interestingly, while you cannot edit posts inside your friend soup, soup still sends the code for the edit window. (credits go to @sofias for discovering this) With it comes whatever the user entered in the embedding code text field.

This code gets parsed using my MediaEmbedder library. This allows us to generate a player even if only a url was entered, protect the user from malicious code in the embed field, and generate a valid modern player from old flash-player embeds.

NOTE: The bookmarklet loads an external script, since the code is bigger then 8kb, which, as a bookmarklet is really unwieldy. But I hosted the post on soup itself, so I cannot modify it. And the code is uncompressed, so you can read and verify it.

The source can be found here.

If the media hosting service you want isn't included, or you find embed codes that don't work correctly, feel free to contribute to the MediaEmbedder project.

Reposted bynordernnaichsofiaswonkorokoFlau

Don't be the product, buy the product!