Add runtime Player parameters (Android)

In addition to Player configuration settings, you can add extra parameters that can change at runtime.

While the main Player experience is controlled using the settings defined in your Player configuration from the Dailymotion Studio  (Players tab) or the Platform API , additional runtime customization is achievable using client-side parameters. They allow you to specify additional Player behavior or pass in required values to a specific Player embed.

In the example below, we're adding the following runtime parameters to the existing Player config defined in the {Player ID} placeholder:

  • startTime=15: video will start playing from second 15.
  • mute=true: video will start muted.

Find all available runtime parameters in the Android SDK Reference .

val playerParameters = PlayerParameters(
       startTime = 15,
       mute = true,
       defaultFullscreenOrientation = Orientation.Portrait // Set the default fullscreen orientation to portrait
)

Dailymotion.createPlayer(
    context = context,
    playerId = "MY_PLAYER_ID", // replace by desired player id
    videoId = "A_VIDEO_ID", // replace by desired video id
    playlistId = "A_PLAYLIST_ID", // replace by desired playlist id
    playerParameters = playerParameter,
    playerSetupListener = object : Dailymotion.PlayerSetupListener {
        override fun onPlayerSetupSuccess(player: PlayerView) {
            // Add PlayerView to view hierarchy
        }

        override fun onPlayerSetupFailed(error: PlayerError) {
            // PlayerView setup failed
        }
    }
)