2017-08-16 52 views
1

使用Facebook的SDK面對的問題,我想分享使用Facebook SDK在Android應用圖像 - 作品般的魅力,但是當我試圖分享視頻沒有任何反應。同時共享視頻在Android的

下面是我使用的共享視頻內容的代碼:

@Override 
public void onClick(View v) { 
    switch(v.getId()){ 
     case R.id.fb_share_button: 
      ShareVideo shareVideo1= new ShareVideo.Builder() 
        .setLocalUrl(Uri.parse("https://imdstar.com/clubapp/wp-content/uploads/2017/07/Chennaionline-AirtelParallelMusicFestival106-online-video-cutter.com_.mp4")) 
        .build(); 


      ShareVideoContent shareContent = new ShareVideoContent.Builder() 
        .setVideo(shareVideo1) 
        .build(); 
      shareButton.setShareContent(shareContent); 
      shareDialog.show(shareContent, ShareDialog.Mode.AUTOMATIC); 
      break; 

     default: 
      break; 
    } 


} 

的方法獲取調用上點擊分享按鈕,但出現sharing.Please沒有對話框給我您的寶貴建議,其中我犯錯了。

回答

1

你想分享一個鏈接,但您使用的是代碼共享的視頻這是您的設備上。

請看看

https://developers.facebook.com/docs/sharing/android

,並嘗試使用代碼共享的鏈接

ShareLinkContent content = new ShareLinkContent.Builder() 
     .setContentUrl(Uri.parse("https://developers.facebook.com")) 
     .build(); 

請考慮,你必須使用Facebook分享按鈕帳戶。請在https://developers.facebook.com/docs/sharing/android

ShareButton shareButton = (ShareButton)findViewById(R.id.fb_share_button); 
shareButton.setShareContent(content); 

底部看到您無法使用標準的Android按鍵