Frequently asked questions

Why autoplay on mobile devices does not work?

The thing is that most mobile devices, including iOS devices, prevent videos from being played automatically (see Apple documentation : Safari HTML5 Audio and Video Guide). On those devices, the first play must be triggered by a user interaction, such as touching the play button, otherwise it's ignored by the browser.


Why calling the JavaScript SDK player.play() method upon receiving the apiready event does not work on mobile devices?

Consider the following sample code:

var player = DM.player(document.getElementById('player'), {
  video: 'xwr14q'
});

player.addEventListener('apiready', function (e)
{
  player.play();
});

On desktop this will work.

However, on mobile devices this will not work since the playing event is triggered programmatically and is not a user event. That's why the player.play() method has no effect on the video in that case.

In all cases, passing the params: { autoplay: true } option to the DM.player() method is always a better option than calling the player.play() method.

The following sample code is recommended when you want to autoplay a video:

var player = DM.player(document.getElementById('player'), {
  video: 'xwr14q',
  params: {
    autoplay: true
  }
});

Why calling the JavaScript SDK player.seek() method upon receiving the apiready event does not work?

Consider the following sample code:

var player = DM.player(document.getElementById('player'), {
  video: 'xwr14q'
});

player.addEventListener('apiready', function (e)
{
  player.seek(30);
});

This code is not robust enough and will not seek to 30 seconds in several cases:

More generally, the player.seek() method should not be called before the video playback started (e.g. before the playing event).

In all cases, passing the params: { autoplay: true, start: 30 } option to the DM.player() method is always a better option than calling the player.seek() method.

The following sample code is recommended when you want to autoplay the video beginning at 30 seconds:

var player = DM.player(document.getElementById('player'), {
  video: 'xwr14q',
  params: {
    autoplay: true,
    start: 30
  }
});

Can I embed Dailymotion videos on my WordPress?

Sure thing! The way to do it will be different whether you are using wordpress.com (the online hosting platform by Automattic) or wordpress.org (an install of WordPress on your own hosting, using the open-source solution).

 Dailymotion videos on wordpress.com

You can refer to this detailed wordpress tutorial: https://en.support.wordpress.com/videos/dailymotion/

Basically, you can directly copy the video page url in your text editor (on its own line). The video will automatically embed!

Otherwise, you can also use the following shortcode: [dailymotion id=VIDEO_ID]

 Dailymotion videos on wordpress.org

You can directly copy the video page url in your text editor (on its own line). The video will automatically embed!

If you need more controls (like autoplay, setting player size, etc), you'll prefer to use our embed code. You'll find the iframe code with many customization options on the video page, under the "share" tab.