GraphRequest graphRequest =GraphRequest.newGraphPathRequest(accessToken,"/me/videos",newGraphRequest.OnProgressCallback() {
@Override
public void onProgress(long current, long max) {
}
@Override
public void onCompleted(GraphResponse response) {
Log.i(TAG, "onCompleted: " + response.toString());
}
});
Bundle params = graphRequest.getParameters();
try {
byte[] data = readBytes(videoPath);
Log.i(TAG, "shareVideoFB: " + data.length);
params.putByteArray("video.mp4", data);
String albumName = "testFBUpload";
params.putString("title", albumName);
params.putString("description", " SomeTag");
params.putBoolean("spherical", true);
graphRequest.setParameters(params);
graphRequest.setHttpMethod(HttpMethod.POST);
graphRequest.executeAsync();
} catch (Exception e) {
e.printStackTrace();
}
}