private static Bundle create( ShareVideoContent videoContent, String videoUrl, boolean dataErrorsFatal) { Bundle params = createBaseParameters(videoContent, dataErrorsFatal); Utility.putNonEmptyString(params, ShareConstants.TITLE, videoContent.getContentTitle()); Utility.putNonEmptyString( params, ShareConstants.DESCRIPTION, videoContent.getContentDescription()); Utility.putNonEmptyString(params, ShareConstants.VIDEO_URL, videoUrl); return params; }
private UploadContext( ShareVideoContent videoContent, String graphNode, FacebookCallback<Sharer.Result> callback) { // Store off the access token right away so that under no circumstances will we // end up with different tokens between phases. We will rely on the access token tracker // to cancel pending uploads. this.accessToken = AccessToken.getCurrentAccessToken(); this.videoUri = videoContent.getVideo().getLocalUrl(); this.title = videoContent.getContentTitle(); this.description = videoContent.getContentDescription(); this.ref = videoContent.getRef(); this.graphNode = graphNode; this.callback = callback; this.params = videoContent.getVideo().getParameters(); if (!Utility.isNullOrEmpty(videoContent.getPeopleIds())) { this.params.putString("tags", TextUtils.join(", ", videoContent.getPeopleIds())); } if (!Utility.isNullOrEmpty(videoContent.getPlaceId())) { this.params.putString("place", videoContent.getPlaceId()); } if (!Utility.isNullOrEmpty(videoContent.getRef())) { this.params.putString("ref", videoContent.getRef()); } }
@Override public Builder readFrom(final ShareVideoContent model) { if (model == null) { return this; } return super .readFrom(model) .setContentDescription(model.getContentDescription()) .setContentTitle(model.getContentTitle()) .setPreviewPhoto(model.getPreviewPhoto()) .setVideo(model.getVideo()) ; } }