Create Player

📘

You are reading API v2 documentation

Still using the Legacy API? Access the Legacy API documentation.


The Dailymotion Player is customizable, consistent across all devices, and delivered with Picture-in-Picture, extensive analytics and the necessary advertising infrastructure out of the box.

Each Player is identified with a unique ID that carries every element you need to make embeds easy and efficient:

  • Configuration with a set of parameters you defined via the API or your Dailymotion Studio.
  • Analytics to monitor your embeds' performance.
  • Tracking to ensure accurate monetization, ad targeting and ad revenue attribution.

In this article, we'll guide you to create your own custom Player via the API so you can start your journey with Dailymotion in the best conditions.

👍

Prefer a UI?

You can create Players from the Dailymotion Studio rather than the API.



1. Create your Player

To create a Player via the API v2, you need an access token with the player.manage scope. Refer to the authentication guide.

Define and specify the required fields and perform a POST request. Once a Player has been created and associated with your account, it is possible to update or delete it.

// Replace <PROFILE_ID> with your own profile ID

curl -X POST -H 'Authorization: Bearer ${ACCESS_TOKEN}' \
     -H 'Content-Type: application/json' \
     -d '{"name": "My new Player"}' \
     'https://api.dailymotion.com/v2/profiles/PROFILE_ID>/players'

A successful request returns 201 Created with the Player's default fields: player_id, name, and created_at.

{
  "data": {
    "player_id": "x8k2m9p",
    "name": "My New Player",
    "created_at": "2025-12-05T16:00:00Z"
  }
}

To retrieve additional fields, such as embed URLs, append a fields query parameter to the request URL.


2. Embed your Player

Players can be embedded on web and native environments.

Embed on web

Our Web SDK provides different integration methods to embed content on web with your custom Player. The embed URLs for your Player can be retrieved from API v2 using the `embedding object.

To best know which embed methods best suits your needs, please refer to the description of each integration methods.


Embed typeAPIDescription
Embed script URLembedding.script_urlRetrieve the URL of the Player Embed Script.
Add this URL in a script HTML tag. This will load the Player exactly where it is added in the HTML page. This method also provides access to the Player API.
Library script URLembedding.library_urlRetrieve the URL of the Player Library Script.
Add this URL in a script HTML tag to load your library, and create a Player programatically using the Player API.
Embed HTML URLembedding.html_urlRetrieve the URL of the iFrame Player.
Add this URL in an iFrame HTML tag. This embed method isn't using JavaScript, advanced functionalities such as PiP or firstTimeViewable will not be available.
📘

Requesting embed URLs

The embedding object is not returned by default. Request it explicitly using the fields parameter:

curl --request GET \
     --url 'https://api.dailymotion.com/v2/players/<PLAYER_ID>?fields=player_id,embedding.html_url,embedding.script_url,embedding.library_url' \
     --header 'authorization: Bearer ${ACCESS_TOKEN}'

Embed on native

You can embed your custom Player on native environments using our dedicated SDKs.

Embed typeDescription
Android SDKPass in your Player ID when creating a PlayerView in your Android app. Check the Android SDK guide to learn how to embed with our SDK.
iOS SDKPass in your Player ID when creating a PlayerView in your iOS app. Check the iOS SDK guide to learn how to embed with our SDK.



Did this page help you?