Embed videos with oEmbed
What is oEmbed
oEmbed is a format for allowing an embedded representation of a URL on third-party sites. The protocol allows a website to turn a Dailymotion video page URL into a structured data set, making it easy to embed and share content across the web.
When to use it
This protocol is the preferred method when you need to transform the URL provided into an embed code. For more information, see the oEmbed specification.
How to use it
Use the following endpoint to request the corresponding video information using only a Dailymotion video URL. Add in URL params from the table below to configure the response.
https://www.dailymotion.com/services/oembed?url=VIDEO_URL?PARAM1&PARAM2
Available URL parameters
Parameter | Parameter description |
---|---|
url | The Dailymotion URL for a video (required) |
maxwidth | The maximum width the embedded video can take on the destination page |
maxheight | The maximum height the embedded video can take on the destination page |
format | Response format, either json or xml . Defaults to json |
callback | When returning JSON, wrap in this function |
player | The player ID that the loaded player will be created with. This ID can be accessed via the Players tab on Dailymotion Studio. |
Example
Call using URL parameters:
// Replace x7tgad0 with your Video ID and xfh28 with your own Player ID
https://www.dailymotion.com/services/oembed?url=https://www.dailymotion.com/video/x7tgad0?maxwidth=480&maxheight=269&player=xfh28
JSON response:
{
"type": "video",
"version": "1.0",
"provider_name": "Dailymotion",
"provider_url": "https://www.dailymotion.com",
"title": "Midnight Sun | Iceland",
"description": "",
"author_name": "Dailymotion player demo",
"author_url": "https://www.dailymotion.com/dailymotionplayerdemo2",
"width": 478,
"height": 268,
"html": "<iframe frameborder=\"0\" width=\"478\" height=\"268\" src=\"https://geo.dailymotion.com/player/xfh28.html?video=x7tgad0&\" allowfullscreen allow=\"autoplay; fullscreen; picture-in-picture\"></iframe>",
"thumbnail_url": "https://s2.dmcdn.net/v/SBL5q1Zl12Cbw0Bb_/x240",
"thumbnail_width": 427,
"thumbnail_height": 240
}