Java 类com.facebook.share.model.ShareVideo 实例源码

项目:kognitivo    文件:VideoUploader.java   
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);
}
项目:SocioBlood    文件:VideoUploader.java   
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);
}
项目:kognitivo    文件:ShareContentValidation.java   
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");
    }
}
项目:journal    文件:FbInfoFragment.java   
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);
}
项目:Move-Alarm_ORCA    文件:NativeDialogParameters.java   
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;
}
项目:Move-Alarm_ORCA    文件:ShareContentValidation.java   
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");
    }
}
项目:SocioBlood    文件:NativeDialogParameters.java   
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;
}
项目:SocioBlood    文件:ShareContentValidation.java   
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");
    }
}
项目:journal    文件:FbInfoFragment.java   
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);
}
项目:kognitivo    文件:ShareContentValidation.java   
public void validate(final ShareVideo video) {
    validateVideo(video, this);
}
项目:Move-Alarm_ORCA    文件:ShareContentValidation.java   
public void validate(final ShareVideo video) {
    validateVideo(video, this);
}
项目:SocioBlood    文件:ShareContentValidation.java   
public void validate(final ShareVideo video) {
    validateVideo(video, this);
}