Kumar Swamy
Kumar Swamy

Reputation: 774

share video to facebook using content provider is not working

share video to facebook using content provider is not working private void sharevideoToFacebook() {

    Uri videoFileUri = Uri.fromFile(new File((Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/VID_20151014-WA0013.mp4")));
    ShareVideo video = new ShareVideo.Builder()
            .setLocalUrl(videoFileUri)
            .build();
    Log.d("videouri",videoFileUri.toString());
    ShareVideoContent content = new ShareVideoContent.Builder()
            .setVideo(video)
            .build();
    Log.d("videouri", content.toString());
    ShareApi.share(content, null);

Upvotes: 1

Views: 614

Answers (3)

James Chan
James Chan

Reputation: 97

I had same issue on my app and I solved it.

If you want to share the video in your app, you must install Facebook app.

Using Webview, you can not share video file.

If you want to still share the video in your app, you can use link share feature.

Best

Upvotes: 0

TharakaNirmana
TharakaNirmana

Reputation: 10353

Videos must be less than 12MB in size.

Read the "Videos" section of https://developers.facebook.com/docs/sharing/android

Upvotes: 0

Zubair Akber
Zubair Akber

Reputation: 2828

Have you read the official guide to upload video file on facebook, if not read Sharing Video on FaceBook

Uri videoFileUri = ...
ShareVideo = new ShareVideo.Builder()
        .setLocalUrl(videoUrl)
        .build();
ShareVideoContent content = new ShareVideoContent.Builder()
        .setVideo(video)
        .build();

Upvotes: 1

Related Questions