How to share a Youtube Video on Facebook using open graph share dialog.
This is what I been trying, it creates a post but it does not take me to youtube.
String actionName = "play";
String objectName = "song";
String nameSpace = "myNameSpace";
String videoUrl = "https://youtubeUrl";
String objectType = "music.song";
ShareOpenGraphObject object = new ShareOpenGraphObject.Builder()
.putString("og:type", objectType)
.putString("og:image", imageUrl)
.putString("og:video:url", videoUrl)
.putString("og:title", item.getSnippet().getTitle())
.build();
ShareOpenGraphAction action = new ShareOpenGraphAction.Builder()
.setActionType(nameSpace + ":" + actionName)
.putObject(objectName, object)
.build();
ShareOpenGraphContent content = new ShareOpenGraphContent.Builder()
.setPreviewPropertyName(objectName)
.setAction(action)
.setContentUrl(Uri.parse(videoUrl))
.build();
ShareDialog.show(context, content);
