Create Player

Introduction

The Dailymotion Player is customizable, consistent across all devices, 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.

👍

Alternative

If you prefer a user-friendly interface, you can create Players from the Dailymotion Studio rather than the API.



Implementation steps

1. Create your Player

To create a Player via the API, you need to have the manage_players scope. You can refer to the authentication guide to see how to authenticate with specific scopes.

Then, 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. Refer to the list of Player fields for customization.

curl -X POST -H 'Authorization: Bearer ${ACCESS_TOKEN}' \
       -d 'label=My new player' \
       'https://partner.api.dailymotion.com/rest/user/<YOUR_PROFILE_ID>/players'

2. Embed your Player

Players can be embedded on web and native environments.


Embed on web

Our Web SDK provides you with different integration methods to embed content on web with your custom Player. You only need to add your Player to your page using a generated script embed or iFrame.

The script URL of your Player can be retrieved with the Platform API using the below fields, depending on which embed method you want to use.

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


Embed type

API

Description

Embed script URL

embed_script_url

Retrieve 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 URL

lib_script_url

Retrieve 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 URL

embed_html_url

Retrieve 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.


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.