2013-06-19 98 views
2

當你意圖它會自動嵌入YouTube播放器到您的牆壁上FB分享的YouTube鏈接,它看起來像這樣發佈使用Facebook SDK嵌入的YouTube鏈接

enter image description here

但是......當我嘗試使用FB sdk發佈相同的視頻,HelloFacebookSampleActivity =>postStatusUpdate() mathood。

public void postStatusUpdate() { 
     if (user != null && hasPublishPermission()) { 
      final String message ; 

       message = (user.getFirstName()+" "+ getString(R.string.status_update_link)+ " " +video_id + " " + getString(R.string.google_play_link)); 


      Request request = Request 
        .newStatusUpdateRequest(Session.getActiveSession(), message, new Request.Callback() { 
         @Override 
         public void onCompleted(Response response) { 
          showPublishResult(message, response.getGraphObject(), response.getError()); 
         } 
        }); 
      request.executeAsync(); 
     } else { 
      pendingAction = PendingAction.POST_STATUS_UPDATE; 
     } 
    } 

它看起來像這樣

enter image description here

所以我覺得this link是爲了從http://www.youtube.com/watch?v=<code>鏈接格式更改爲http://www.youtube.com/e/<code><code>

後添加&autoplay=1但它不工作...我google搜索「臉譜android嵌入式鏈接youtube」,但沒有發現這個問題,需要幫助

如何我張貼使用Facebook SDK嵌入的YouTube鏈接(比如圖一)?

UPDATE:

將我的代碼,我現在正在使用Publish to Feed代碼。但問題沒有解決

我嘗試post通過像Facebook豪宅源,但它不工作...

postParams.putString("name", "Facebook SDK for Android"); 
      postParams.putString("caption", "Build great social apps and get more installs."); 
      postParams.putString("description", "The Facebook SDK for Android makes it easier and faster to develop Facebook integrated Android apps."); 
      postParams.putString("source","http://www.youtube.com/e/2raioEC7Hms"); 

回答

1

解決:使用教程Publish to Feed,使用post

postParams.putString("message", "Link to YouTube"); 
     postParams.putString("link", "http://www.youtube.com/watch?v=3aICB2mUu2k"); 
     postParams.putString("source", "http://www.youtube.com/v/3aICB2mUu2k"); 
     postParams.putString("picture","http://img.youtube.com/vi/3aICB2mUu2k/0.jpg"); 
+0

u能交詳細的程序。 –

相關問題