0

我刚刚申请了 Dailymotion 发布者网络。我有一个网站,我使用这个 javascript 播放所有 Dailymotion 视频。

<script>
// This code loads the Dailymotion Javascript SDK asynchronously.
(function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol + '//api.dmcdn.net/all.js';
    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';

    $("#videorol").fadeIn("fast");

});
};

根据 Dailymotion Publisher,我必须将联合参数插入 iframe src。我怎样才能通过使用 javascript sdk 来实现这一点?谢谢

4

1 回答 1

1

您必须将您的联合密钥作为播放器的参数(查询字符串参数syndication=<YOUR_KEY>)传递。这已添加到文档https://developer.dailymotion.com/player/#player-parameters-iframe

如果你想使用sdk,你也可以传递这个参数,这在https://developer.dailymotion.com/player/#player-parameters-sdk-js都有描述

例如:

 var player = DM.player(document.getElementById("player"),{ 
    video: "x7tgad0",
    width: "100%",
    height: "100%",
  referrerPolicy: "no-referrer-when-downgrade",
    params: {
        'syndication': YOUR_SYNDICATION_KEY,
        'ads_params' : 'YOUR_ADS_PARAMS',
        'ui-logo': 'false'
    } 
});
于 2014-10-15T10:09:19.750 回答