Dailymotion Video Tiles is composed of different types of tiles
/ cards
. It creates a carousel slideshow for a list of videos, playlists, and channels. All the lists are added vertically throughout the page creating a video-hub alike experience.
Based on UI and functionalities, There are mainly three types of lists.
List of video-cards : A list of videos mainly derived from playlistId
/ videoIds
or through DATA-API.
List of playlist-cards: A list of playlists mainly derived from playlistIds
or through DATA-API.
List of channel-cards: list of channels mainly derived from channelIds
or through DATA-API.
You need to do 2 things to embed the Dailymotion Video Tiles.
body
end in your website
<script src="https://srvr.dmvs-apac.com/dm-video-tiles/dm-video-tiles.min.js"></script>
<div class="dm-video-tiles"
{PARAMS}></div>
in your target location within the body content.<div class="dm-video-tiles"
playerId="{PLAYER_ID}"
owners="{YOUR_CHANNEL_NAME}"
logoImg="{YOUR_LOGO_IMAGE_URL}"
data-list-1 = "=video_playlist({PLAYLIST_ID})"
data-list-2 = "{Customized Title}=video_ids({VIDEO_ID},{VIDEO_ID},{VIDEO_ID},{VIDEO_ID},{VIDEO_ID})"
data-list-3 = "{Customized Title}=video_api(sort=trending)"
data-list-4 = "{Customized Title}=playlist_ids({PLAYLIST_ID},{PLAYLIST_ID},{PLAYLIST_ID},{PLAYLIST_ID})"
data-list-5 = "{Customized Title}=playlist_api(sort=recent)"
data-list-6 = "{Customized Title}=channel_ids({YOUR_CHANNEL_NAME},{YOUR_CHANNEL_NAME},{YOUR_CHANNEL_NAME},{YOUR_CHANNEL_NAME})"
data-list-7 = "{Customized Title}=channel_api(sort=recent)"
>
</div>
Name | Type | Description |
---|---|---|
owners Mandatory |
string | You need to put the username of the channels from which the script will search content. If your channel name URL is www.dailymotion.com/channelABC then your username is channelABC. This is case sensitive, meaning channelABC is not the same as Channelabc. To put more than 1 you can separate by “,” |
playerId Mandatory |
string | You can get PLAYER_ID from Dailymotion partner HQ in the player tab, inside the embed menu. |
logoImg Mandatory |
string | Add your logo image url for header |
data-list-{sequence_number} |
string | To add different type list. Ex : data-list-1 . Check Embeding different type of list |
customHeader |
boolean | Set it true to customize the header. Check Customize Your Header |
videoTilesPreview |
boolean | If you are adding preview of you Video Tiles page, set it true . Learn More |
videoTilesLink |
string | If you are adding preview of you Video Tiles page, add its URL . Learn More |
Dailymotion Video Tiles provide data-list-{sequence_number}
parameter to embed different types of lists and their sequence order. Also, you can add custom Title
/Header
to those lists.
List of video-cards
, you can use three ways based on requirements.
PLAYLIST_ID
. Example :
data-list-1 = "=video_playlist(x661nk)"
Learn more on how to create, sort, feed and embed playlist
VIDEO_ID
. Example :
data-list-2 = "My Selected videos=video_ids(x85xvf0,x85xurb,x85xtvb)"
You must use
","
separator to add more{VIDEO_ID}
data-list-3 = "My Trending Videos=video_api(sort=trending)"
You can customized title as here
My Trending Videos
.
List of playlist-cards
, you can use two ways based on requirements.
PLAYLIST_ID
. Example :
data-list-4 = "My playlists=playlist_ids(x661nk,x661nh,x51ill,x51ild)"
data-list-5 = "Recent Playlist=playlist_api(sort=recent)"
List of channel-cards
, you can use two ways based on requirements.
CHANNEL_ID
. Example :
data-list-6 = "Test Channels=channel_ids(filmibeat,oneindiahindi,boldsky,oneindiatamil)"
data-list-7 = "Recent Channels=channel_api(sort=recent)"
Dailymotion Video Tiles also provide an option to add categories and cities through application/json
script
tag. You must add this script
tag before main script
i.e., dm-video-tiles.min.js. Example :
<script type="application/json" id="dm_video_tiles">
{
"category": [
{
"name": "News",
"playlist": "`PLAYLIST_ID`,`PLAYLIST_ID`"
},
{
"name": "Entertainment",
"playlist": "`PLAYLIST_ID`,`PLAYLIST_ID`"
}
],
"city": [
{
"name": "Hello Pune",
"playlist": "`PLAYLIST_ID`"
},
{
"name": "Hello Mumbai",
"playlist": "`PLAYLIST_ID}`"
},
]
}
</script>
For each category, you can map multiple playlists with PLAYLIST_ID
. For each city, you can map a single playlist with PLAYLIST_ID
. Like the Example ⇧ .
Assuming that you have already a video-hub
page created by Dailymotion video tiles, You can add a preview of the video-hub
on a different page of your website. The preview will show a snapshot of the video-hub
which can be clicked to open the video-hub
in a different tab. Example Embed code:
<div class="dm-video-tiles"
playerId="{PLAYER_ID}"
owners="{YOUR_CHANNEL_NAME}"
videoTilesPreview="true"
videoTilesLink="video-hub.html"
data-list-1 = "=video_playlist(x5nune)"
>
</div>
Just add one
data-list-1
which will be used to show the preview.
Dailymotion video tiles create its header with the given logoImg
, Category
and City
. But it can be customized if you set customHeader
true
. Adding this param, Dailymotion video tiles will trigger a CustomEvent(tiles-header-render
) on the document
after creating a container(div
) of the header.
The tiles-header-render
event conveys information and method which can be used to customize the header.
Example code:
// On header create get info
document.addEventListener("tiles-header-render",(e)=>{
let dmTilesObj = e.detail
/**
* dmTilesObj = {
* headerDom : {Header Dom object}
* singleLive : { //If there is one live video
* thumbnail_240_url: string;
title: string;
id: string;
created_time: number;
duration: number;
url: string;
"owner.screenname": string;
"owner.username": string;
channel: string;
onair: boolean;
* } or null
isMobile: {true if its mobile},
updateUrl : { funtion to route category or city page}
(
name:string,value:{pageName&playlistId}
)
* }
*/
})
As seen above the code, dmTilesObj
is an object of information and method. These are
HTMLElement
div
object.onair
, it will be an object of that video’s information.true
for mobile.string
,value:{pageName&playlistId}
) : This is the funtion to route the different page.
string
: you can set to category
or city
to route the category/city page accordingly.{pageName&playlistId}
) : This is a combination of category
’s/city
’s name and its playlist.
Ex:
// for category
dmTilesObj.updateUrl({
name: "category",
value: "News"+"&"+"`PLAYLIST_ID`,`PLAYLIST_ID`,`PLAYLIST_ID`"
});
// for city
dmTilesObj.updateUrl({
name: "city",
value: "Hello Pune"+"&"+"`PLAYLIST_ID`"
});
Check the example links for more details.
Hero playlist
that shows previews of videos from the playlist at the top of the page.live
videos found on a given channel, Dailymotion video tiles will add that list of live
videos as the first playlist.Video Card
will land you video page. The selected video will play and the related playlist will show below the player.Playlist Card
will land you Playlist page. The first video of the playlist will show as a preview and the rest videos will show below.Channel Card
will land your channel page. All the playlists from that channel will show like video tiles and the first playlist will have a Hero playlist
UI.