0
votes

I'm playing 3 videos from Dailymotion by JavaScript SDK. This is my code:

    var tag = document.createElement('script');

    tag.src = "https://api.dmcdn.net/all.js";
    var firstScriptTag = document.getElementsByTagName('script')[0];
    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

    window.dmAsyncInit = function () {
        var player = DM.player("divplayer",
            { video: VideoId, width: "100%", height: "100%", params: { "endscreen-enable": 0,"ui-logo":0 } });            
    };        
}

The first video is played with no problem but after that I get this Error:

Uncaught Error: Invalid first argument sent to DM.player(), this element is already a player: divplayer

divplayer is a div element.

I tried to empty the div content before calling my function but that did not work.

Thanks in advance

1

1 Answers

1
votes

We apology for the error you've encountered. This error is due to a regression we introduced in our SDK and fixed right after. You shouldn't have this error displayed again. Can you confirm this?