Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is SoundCloud embedding an HTML5/JS widget on Facebook?

Tags:

Here's the scenario I'm seeing -

  • You click to post a sound from SoundCloud to Facebook
  • It embeds a player in the post that can either be clicked on to take you to the original item on SoundCloud OR you can click a Play icon to play the sound right in your feed.
  • The player is a Javascript/HTML5 player (which you can see by viewing source) HOWEVER if you take the embedded URL and put it in the Facebook open graph debugger you'll see that it appears to be directing to embed a Flash SWF

How is SoundCloud doing, what appears to be, some kind of redirect trick to get a "og:video" SWF to turn into a JS/HTML5 player?

I notice that there is an "og:type" of "soundcloud:sound" so is it some kind of whitelist/Facebook application scenario?

Try it yourself with this:

  • OG debug: https://developers.facebook.com/tools/debug/og/object?q=https%3A%2F%2Fsoundcloud.com%2Fsystek_music%2Fcyberoptics-sub-antix-the%3Futm_source%3Dsoundcloud%26utm_campaign%3Dshare%26utm_medium%3Dfacebook

I did find this bit of info from the SoundCloud site about how they've switched to JS players (that fall back to Flash on older browsers): http://help.soundcloud.com/customer/portal/articles/1219149-where-has-the-flash-widget-gone-

like image 863
user2041058 Avatar asked Mar 30 '14 23:03

user2041058


People also ask

How do I embed a SoundCloud post on Facebook?

The trick is to logout of Soundcloud - and then visit your Playlist URL. You will then see the Share button... Click on the Share button - then click on Embed tab (top) to see your Embed code. This code can then be used on your website, blog, or Facebook Tab.

How do I embed SoundCloud in HTML?

To get an embed code for your track or playlist, click the 'Share' button below the waveform and an overlay will appear. Click on the embed tab to view what options you have to embed your player. Copy-paste the embed code from 'Code & preview'.

Can SoundCloud be a widget?

But sometimes you want to take people straight to your own website and do your own private promo there. Well you can do this with SoundCloud too by using our secret widget feature. This allows you to keep your tracks totally private on SoundCloud but still grab a player widget that you can embed on your own promo page.

Can you embed an audio player in Facebook?

Facebook lets you embed players from several video-sharing services, including YouTube and Vimeo, or you can use their built-in player by uploading video directly to Facebook. But the platform doesn't allow audio uploads or provide an audio player.


1 Answers

This may only be a partial answer. But there exists a special Facebook Open Graph Music program which "is only available to whitelisted partners at this time". This includes a bridge which has the goal to "enable play buttons on feed stories on Facebook.com that can play and pause tracks and indicate which is playing."

However, apparently you can include both Flash (application/x-shockwave-flash) and HTML5 video (video/mp4) formats in the og:video:type property.

like image 168
mb21 Avatar answered Sep 18 '22 06:09

mb21