我正在使用 Facebook 的旧版 REST API 将 MP3 媒体附件发布到用户的流中(因为新的 Graph API 尚不支持音频)。这会按预期在 Facebook 自己的媒体播放器中呈现音频。但是,由于播放器是一个 Flash 组件,因此它不会在 iOS 设备上呈现并提示进行 Flash 升级。我想改为提供后备 URL,以便用户可以点击进入带有 HTML5 音频播放器的外部站点。
有没有办法做到这一点?在 attachment
对象中提供 href
参数:
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'
}]
}
或者在 post 对象本身:
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'
}]
}
好像没有什么作用...
因此我是否只能使用 flash
媒体类型来提供我自己的 SWF 播放器和图像?
最佳答案
您可以尝试在帖子对象上使用 action_links 数组属性为用户添加自定义链接。
action_links = [("text":"alternate site link text here","href":"alternate url here"}]
关于href - Facebook 媒体附件 - 'music' 类型的回退 URL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6329890/