2017-10-17 15 views
0

私はこれまでのところ、私はこのコードでのFacebookに画像を投稿する管理共有とビデオ反応-fbskネイティブ

反応-ネイティブfbsdkでのFacebookにビデオを投稿しようとしています!

 const sharePhotoContent = { 
      contentType: 'photo', 
      photos: [ 
       { 
        imageUrl: uri, 
        userGenerated: false, 
       } 
      ] 
     }; 
     this.setState({ sharePhotoContent: sharePhotoContent, }) 
    }) 

私はさまざまな方法でビデオを投稿しようとしましたが、正しい方法を見つけることができませんでしたか?

//これは動作しません!

this.refs.viewShot.capture().then(uri => { 
     const shareVideoContent = { 
      contentType: 'video', 
      localUrl: image, 
     }; 
     this.setState({ shareVideoContent: shareVideoContent, }) 
    }) 

既にこれを行った人はいますか?

素晴らしいと思います!

答えて

0

this pageにチェックを付けると、ビデオ共有コンテンツの構造を見つけることができます。

export type ShareVideoContent = { 
    // The type of content to be shared is photo. 
    contentType: 'video', 

    // Common parameters for share content; 
    commonParameters?: ShareContentCommonParameters, 

    // URL for the content being shared. 
    contentUrl?: string, 

    // Video to be shared. 
    video: ShareVideo, 

    // Description of the video. 
    contentDescription?: string, 

    // Title of the video. 
    contentTitle?: string, 

    // The photo that represents the video. 
    previewPhoto?: SharePhoto, 
}; 

export type ShareVideo = { 
    // The URL to the video. Must point to the location of the video on disk. 
    localUrl: string, 
}; 
+0

ではありません! – rickkorsten

+0

これまで作業しましたか? – rickkorsten

+0

直接ではありません。あなたが何か問題を抱えているなら、私は助けようとすることができます。現在のバージョンでコードを更新するだけで、よりよくチェックすることができます。 – bennygenel

0

@bennygenel私はこれを行いました!

onImageLoad =() => { 
    const shareVideoContent = { 
     contentType: 'video', 
     video: 
      { 
       localUrl: './VID_207171017_113247.mp4', 
      } 
    }; 
    this.setState({ shareVideoContent: shareVideoContent, }) 

} 

が、私は、エラーのthatsが言い得る:

未定義のおかげで、あなたの迅速な反応に@bennygenel( 'this.state.shareVideoContent' を評価)オブジェクト

+0

あなたの質問に対するSOルールのため、回答を追加するのではなく、編集オプションで質問を更新してください。それは削除されることができます – bennygenel

関連する問題