public static synchronized void uploadAsync( ShareVideoContent videoContent, String graphNode, FacebookCallback<Sharer.Result> callback) throws FileNotFoundException { if (!initialized) { registerAccessTokenTracker(); initialized = true; } Validate.notNull(videoContent, "videoContent"); Validate.notNull(graphNode, "graphNode"); ShareVideo video = videoContent.getVideo(); Validate.notNull(video, "videoContent.video"); Uri videoUri = video.getLocalUrl(); Validate.notNull(videoUri, "videoContent.video.localUrl"); UploadContext uploadContext = new UploadContext(videoContent, graphNode, callback); uploadContext.initialize(); pendingUploads.add(uploadContext); enqueueUploadStart( uploadContext, 0); }
public static synchronized void uploadAsync( ShareVideoContent videoContent, String targetId, FacebookCallback<Sharer.Result> callback) throws FileNotFoundException { if (!initialized) { registerAccessTokenTracker(); initialized = true; } Validate.notNull(videoContent, "videoContent"); Validate.notNull(targetId, "targetId"); ShareVideo video = videoContent.getVideo(); Validate.notNull(video, "videoContent.video"); Uri videoUri = video.getLocalUrl(); Validate.notNull(videoUri, "videoContent.video.localUrl"); UploadContext uploadContext = new UploadContext(videoContent, targetId, callback); uploadContext.initialize(); pendingUploads.add(uploadContext); enqueueUploadStart( uploadContext, 0); }
private static void validateVideo(ShareVideo video, Validator validator) { if (video == null) { throw new FacebookException("Cannot share a null ShareVideo"); } Uri localUri = video.getLocalUrl(); if (localUri == null) { throw new FacebookException("ShareVideo does not have a LocalUrl specified"); } if (!Utility.isContentUri(localUri) && !Utility.isFileUri(localUri)) { throw new FacebookException("ShareVideo must reference a video that is on the device"); } }
private void publishVideo(String videoUrl) { Uri videoFileUri = Uri.parse("file://" + videoUrl); ShareVideo video = new ShareVideo.Builder() .setLocalUrl(videoFileUri) .build(); ShareVideoContent content = new ShareVideoContent.Builder() .setVideo(video) .build(); shareDialog.show(content); }
private static Bundle create(ShareVideoContent videoContent, boolean dataErrorsFatal) { ShareVideo video = videoContent.getVideo(); Bundle params = createBaseParameters(videoContent, dataErrorsFatal); Utility.putNonEmptyString(params, ShareConstants.TITLE, videoContent.getContentTitle()); Utility.putNonEmptyString( params, ShareConstants.DESCRIPTION, videoContent.getContentDescription()); Utility.putUri(params, ShareConstants.VIDEO_URL, video.getLocalUrl()); return params; }
private static void validateVideo(ShareVideo video, Validator validator) { if (video == null) { throw new FacebookException("Cannot share a null ShareVideo"); } if (video.getLocalUrl() == null) { throw new FacebookException("ShareVideo does not have a LocalUrl specified"); } }
public void validate(final ShareVideo video) { validateVideo(video, this); }