Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Media Attachment - fallback URL for 'music' type?

I'm using Facebook's Legacy REST API to publish MP3 media attachments to users' streams (as the new Graph API does not yet support audio). This renders the audio in Facebook's own media player as expected. However, because the player is a Flash component, it doesn't render on iOS devices and prompts for a Flash upgrade. I'd like to provide a fallback URL instead so the user can click through to an external site with an HTML5 audio player instead.

Is there a way of doing this? Supplying the href parameter in either the attachment object:

access_token = 1234567890.....,
format = 'json',
privacy = {
    value: 'EVERYONE'
},
message = 'Message goes here...',
attachment = {
    href: 'http://www.google.com',
    media:[{
        type:'mp3',
        src:'http://www.looptvandfilm.com/blog/Radiohead - In Rainbows/01 - Radiohead - 15 Step.MP3',
        title:'15 Step',
        artist:'Radiohead',
        album:'In Rainbows'
    }]
}

or in the post object itself:

access_token = 1234567890.....,
format = 'json',
privacy = {
    value: 'EVERYONE'
},
message = 'Message goes here...',
href: 'http://www.google.com',
attachment = {
    media:[{
        type:'mp3',
        src:'http://www.looptvandfilm.com/blog/Radiohead - In Rainbows/01 - Radiohead - 15 Step.MP3',
        title:'15 Step',
        artist:'Radiohead',
        album:'In Rainbows'
    }]
}

does not seem to have any effect...

Am I therefore restricted to using the flash media type, supplying my own SWF player and image?

like image 442
chrisfrancis27 Avatar asked Dec 20 '25 22:12

chrisfrancis27


1 Answers

You can try the action_links array property on the post object to add a custom link for the user.

action_links = [("text":"alternate site link text here","href":"alternate url here"}]
like image 56
brheal Avatar answered Dec 24 '25 11:12

brheal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!