簡體   English   中英

帶有音樂附件的Facebook feed

[英]Facebook feed with music attachment

嘿,我試圖使用帶有.mp3文件附件的Javascript SDK發布Facebook食物,我的代碼如下:

用於初始化facebook api:

<script type="text/javascript">
  window.fbAsyncInit = function() {
    FB.init({
      appId  : _cfg.fbAppId,
      status : false,
      cookie : false,
      xfbml  : true
    });

    FB.Canvas.setAutoResize();
  };

  (function() {
    var e = document.createElement('script');
        e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
        e.async = true;
    document.getElementById('fb-root').appendChild(e);
  }());
</script>

然后我有以下代碼發送提要:

FB.ui({
  method: 'feed',
  attachment: {
    media:[{
      'type' : 'music',
      'src' : 'http://media.*****.com/files/test.mp3',
      'title' : 'this is a test mp3 file',
      'artist' : 'test artist',
      'album' : 'Test Album'
    }]
  },
  display: 'page'
});

對話框打開時,它只顯示我

不允許輸入“音樂”

任何想法如何解決這個問題? 我所希望的就是能夠將提要與mp3文件一起發布,以便朋友可以在新聞提要中查看提要並收聽該文件。

謝謝。

music是不允許的類型。 我認為mp3是:

FB.ui({
  method: 'feed',
  attachment: {
    media:[{
      'type' : 'mp3',
      'src' : 'http://media.*****.com/files/test.mp3',
      'title' : 'this is a test mp3 file',
      'artist' : 'test artist',
      'album' : 'Test Album'
    }]
  },
  display: 'page'
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM