The floating object defines how the player behaves when its embedded position scrolls out of view.
When floating is enabled, the player transitions into a persistent, on-screen state that allows playback to continue while viewers navigate the page. Floating behavior can be configured to control when it activates, whether it can be dismissed, and how it appears across devices.
The
floatingobject cannot be used with a player that is embedded in an iframe.
Models
The player supports two floating configuration models.
| Model | Description |
|---|---|
| Enhanced | Provides granular, device-specific control over floating behavior across desktop, tablet, and phone (mobile) This model supports:
|
| Legacy | Applies a single, global floating configuration across all devices This model supports:
This model is maintained for backward compatibility. |
Both models maintain the same core behavior: the player begins floating when it leaves the viewport and returns to its embedded position when it re-enters view (unless otherwise configured).
Enhanced model
jwplayer("myElement").setup({
"playlist": "https://cdn.jwplayer.com/v2/playlists/{playlist_id}",
"floating": {
"devices": {
"desktop": {
"enabled": true,
"position": "bottom-right",
"closeButtonMode": "always"
},
"tablet": {
"enabled": false
},
"mobile": {
"enabled": true,
"position": "pinned-to-top",
"closeButtonMode": "on-hover"
}
},
"enableNewDesign": true
}
});
| Property | Description |
|---|---|
| devices * object | (Required) Device-specific floating player customizations Supported device objects:
See: devices.{device} |
| enableNewDesign * boolean | (Required) Enables the enhanced floating configuration model Possible values:
|
devices.{device}
| Property | Description |
|---|---|
| enabled * boolean | (Required) Enables floating behavior for the specified device Possible values:
|
| closeButtonMode string | Permits or prohibits closing the floating player Possible values:
|
| position string | Sets the location of the floating player when the main player scrolls out of the visible screen area Possible values:
|
Legacy model
jwplayer("myElement").setup({
"playlist": "https://cdn.jwplayer.com/v2/playlists/{playlist_id}",
"floating": {
"mode": "notVisible",
"dismissible": true,
"showTitle": false
}
});
| Property | Description |
|---|---|
| dismissible boolean | Permits or prohibits closing the floating player Possible values:
|
| mode < 8.17.0+ string | Tells the player how the floating behavior should operate Possible values:
|
| showTitle boolean | Determines if the video title is displayed with the floating player close (X) button Possible values:
|
By default, adding an empty
floatingobject enables the floating player functionality and also sets"dismissible": true.
Additional customizations
In addition to object-level configuration, floating behavior can be further customized through CSS and API methods. These options provide additional control over styling and activation timing.
| Feature | Description |
|---|---|
| CSS customization | Use the following CSS classes to customize the floating player: |
| Custom timing | Use the floating API method to create custom floating timing. |
