Reputation: 774
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
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
Reputation: 10353
Videos must be less than 12MB in size.
Read the "Videos" section of https://developers.facebook.com/docs/sharing/android
Upvotes: 0
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