Thenutz Thenutz - 1 year ago 119
Javascript Question

How can i insert my syndication key in dailymotion video using javascript sdk?

I just applied for Dailymotion publisher network. I have an website and i play all the Dailymotion videos using this javascript.

// This code loads the Dailymotion Javascript SDK asynchronously.
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol + '//';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s);

// This function init the player once the SDK is loaded
window.dmAsyncInit = function()
// PARAMS is a javascript object containing parameters to pass to the player if any (eg: {autoplay: 1})
var player = DM.player("player", {video: "x27rzcj_", width: "728", height: "410", autoplay: 1});

// 4. We can attach some events on the player (using standard DOM events)
player.addEventListener("ended", function(e)
document.getElementById('player').style.display = 'none';



According to Dailymotion Publisher i have to insert the syndication parameter to the iframe src. How can i achieve this by using the javascript sdk ?

Answer Source

You have to pass your syndication key as a parameter of the player (query string parameter syndication=<YOUR_KEY>). This was added to the documentation

If you want to use the sdk, you can pass this parameter as well, this is all described at

for example:

var player = DM.player("player", {video: "x27rzcj_", width: "728", height: "410", params: { syndication: <SYNDICATION_KEY> }});
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download