Android SDK Version
  • java.lang.Object
    • com.facebook.gamingservices.GamingVideoUploader

public class GamingVideoUploader
extends java.lang.Object
Constructor Summary
Constructor and Description
GamingVideoUploader(Context context)
Utility class to upload Videos to a Player's Gaming Media Library.
Method Summary
Modifier and TypeMethod and Description
voiduploadToMediaLibrary(java.lang.String caption, Uri videoUri)
Uploads a video to a player's Gaming Media Library.
voiduploadToMediaLibrary(java.lang.String caption, Uri videoUri, boolean shouldLaunchMediaDialog, GraphRequest.OnProgressCallback callback)
Uploads an image to a player's Gaming Media Library.
voiduploadToMediaLibrary(java.lang.String caption, Uri videoUri, GraphRequest.OnProgressCallback callback)
Uploads a video to a player's Gaming Media Library.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail

GamingVideoUploader

public GamingVideoUploader(Context context)
Utility class to upload Videos to a Player's Gaming Media Library.
Parameters:
context - Android Context for the activity launching initiating an upload.
Method Detail

uploadToMediaLibrary

public void uploadToMediaLibrary(java.lang.String caption,
                                 Uri videoUri)
                          throws java.io.FileNotFoundException
Uploads a video to a player's Gaming Media Library.
After uploading the player will receive a notification that a new item on their media library is ready to share.
Note: After the upload is complete the video still needs to be encoded by Facebook and won't be immediately available to be shared.
Parameters:
caption - the user generated caption for the video, can be null
videoUri - the file:// or content:// Uri to the video on device
Throws:
java.io.FileNotFoundException - if the videoUri doesn't exist.

uploadToMediaLibrary

public void uploadToMediaLibrary(java.lang.String caption,
                                 Uri videoUri,
                                 GraphRequest.OnProgressCallback callback)
                          throws java.io.FileNotFoundException
Uploads a video to a player's Gaming Media Library.
After uploading the player will receive a notification that a new item on their media library is ready to share.
Note: After the upload is complete the video still needs to be encoded by Facebook and won't be immediately available to be shared.
Parameters:
caption - the user generated caption for the video, can be null
videoUri - the file:// or content:// Uri to the video on device
callback - an optional OnProgressCallback to track the upload process.
Throws:
java.io.FileNotFoundException - if the videoUri doesn't exist.

uploadToMediaLibrary

public void uploadToMediaLibrary(java.lang.String caption,
                                 Uri videoUri,
                                 boolean shouldLaunchMediaDialog,
                                 GraphRequest.OnProgressCallback callback)
                          throws java.io.FileNotFoundException
Uploads an image to a player's Gaming Media Library.
After uploading the player will receive a notification that a new item on their media library is ready to share. If shouldLaunchMediaDialog is set to true this will also trigger the Media Dialog to open and allow immediate sharing.
Parameters:
caption - the user generated caption for the video, can be null
videoUri - the file:// or content:// Uri to the video on device
shouldLaunchMediaDialog - if set to True will open the Media Dialog in the FB App to allow the user to share the uploaded video.
callback - an optional OnProgressCallback to track the upload process.
Throws:
java.io.FileNotFoundException - if the videoUri doesn't exist.