setConfig()

Set one or more of the following video attributes after the player has already been set up

Set one or more of the following video attributes after the player has already setup.

setConfig({
  "repeat": true,
  "autostart": "viewable",
  "mute": false,
  "volume": 25
});
PropertyDescription
aspectratio 8.10.0+ string
Maintains proportions when width is a percentage

This property will not be used if the player has been configured with fixed dimensions. The value for this property must be entered in ratio x:y format.
autostart stringWhen true, playback will start automatically on desktop devices or when the player is 50% visible on mobile devices.

When set to viewable, playback will start automatically on desktop devices when the player is more than 50% visible in the active tab.

Default: false
floating object

Updates the floating player behavior after player setup

Supports mode to control floating behavior and devices to configure device-specific settings.

See Floating for all supported properties and values.

Player 8.49.10+:

  • During initial setup, device-level enabled settings determine whether floating is permitted. Setting mode to always forces floating when the device is enabled.
  • Setting floating.mode to always or never without specifying devices overrides the existing device-level enabled settings while preserving other device properties.
  • Setting floating.mode to notVisible does not change device-level enabled settings.
Player 8.41.0-8.49.9:
When floating.devices is configured, setting floating.mode to always or never does not override existing device-level enabled settings. To change floating behavior, explicitly configure enabled for each device.

Player 8.49.0–8.49.9 Examples
player.setConfig({
  floating: {
    mode: "never",
    devices: {
      desktop: { enabled: false },
      tablet: { enabled: false },
      mobile: { enabled: false }
    }
  }
});
player.setConfig({
  floating: {
    mode: "always",
    devices: {
      desktop: { enabled: true },
      tablet: { enabled: true },
      mobile: { enabled: true }
    }
  }
});


āš ļø IMPORTANT: Specifying floating.devices replaces the entire existing device configuration. Include all devices and properties you want to retain, such as enabled, position, and closeButtonMode.

height 8.10.0+ numberDesired height of your video player (in pixels)

Should not be used with aspectratio.

Default: 360
mute booleanToggles the player's mute attribute

Default: false
repeat booleanWhen true, starts playing the first playlist item after the playlist completes

Default: false
stretching 8.10.0+ stringResize images and video to fit player dimensions

  • uniform: (Default) Fits the JWX player dimensions while maintaining aspect ratio
  • exactfit: Fits JWX player dimensions without maintaining aspect ratio
  • fill: Zooms and crops video to fill dimensions, maintaining aspect ratio
  • none: Displays the actual size of the video file (Black borders)
volume numberSets the volume of the player between 1-100
width 8.10.0+ number | stringDesired width of your video player (in pixels or percentage)

Default: 640
© 2007- Longtail Ad Solutions, Inc.