OembedVideo
GET /v10.0/oembed_video HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/oembed_video',
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
"/oembed_video",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/oembed_video",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/oembed_video"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
Parameter | Description |
---|---|
maxwidth int64 | Maximum width of returned video. |
omitscript boolean | Default value: false If set to true, the returned embed HTML code will not include any javascript. |
sdklocale string | sdklocale |
url URI | The video's URL. Required |
Field | Description |
---|---|
author_name string | The name of the Facebook user that owns the video. |
author_url string | A URL for the author/owner of the video. |
height int32 | The height in pixels required to display the HTML. |
html string | The HTML used to display the video. |
provider_name string | Name of the provider (Facebook) |
provider_url string | URL of the provider (Facebook) |
type string | The oEmbed resource type. See https://oembed.com/. |
version string | Always 1.0. See https://oembed.com/ |
width int32 | The width in pixels required to display the HTML. |
Error | Description |
---|---|
100 | Invalid parameter |
901 | This app is in development mode. Edit the app configuration at http://developers.facebook.com/apps to make the app publicly visible. |
200 | Permissions error |