【问题标题】:share video with react-native-fbsk与 react-native-fbsk 分享视频
【发布时间】:2017-10-17 14:28:34
【问题描述】:

我正在尝试使用 react-native-fbsdk 将视频发布到 Facebook

到目前为止,我设法使用此代码将图像发布到 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, })
    })

有人已经这样做了吗?

会很棒!

【问题讨论】:

    标签: react-native fbsdk react-native-fbsdk


    【解决方案1】:

    如果您检查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,
    };
    

    【讨论】:

    • 不是直接的。如果您有任何问题,我可以尝试提供帮助。只需使用当前版本更新您的代码,以便我更好地检查它。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-03-25
    • 2022-10-04
    • 2017-03-20
    • 2018-01-18
    • 1970-01-01
    • 2017-11-14
    • 2016-01-16
    相关资源
    最近更新 更多