Retrieve Player state (Web)
Retrieve data about your Player state.
To access data state, use the getState() method: on resolve, it will return an object representation of the Player state.
From the state, it is possible to access required player, video or advertising data for your video application or analytics purposes. For example, you can determine if PiP is currently displayed, access the duration of the video or know if the Player is in or out of the user’s viewport.
Find all available states in the Web SDK Reference.
Example Player state:
{
"adAdvertiserName": "Dailymotion advertiser",
"adCompanion": null,
"adCreativeAdId": null,
"adCreativeId": "video",
"adDescription": "Dailymotion ad",
"adDuration": 15.07,
"adEndedReason": null,
"adError": null,
"adId": "32251",
"adIsPlaying": true,
"adIsSkippable": true,
"adPosition": "midroll",
"adSkipOffset": 0,
"adTime": 6.42,
"adTitle": "Dailymotion_ad",
"playerAspectRatio": "16:9",
"playerError": null,
"playerInstanceId": "e10b4d45-438f-065a-31f8-d1d6482cb34a",
"playerIsAlertDialogDisplayed": false,
"playerIsBuffering": false,
"playerIsCriticalPathReady": true,
"playerIsMuted": null,
"playerIsNavigationEnabled": true,
"playerIsPipNativeSupported": true,
"playerIsPlaybackAllowed": true,
"playerIsPlaying": true,
"playerIsReplayScreen": false,
"playerIsStartScreen": false,
"playerIsViewable": true,
"playerNextVideo": "x81ixxp",
"playerPipDisplay": "largeViewport",
"playerPipIsExpanded": false,
"playerPipStatus": "enabled",
"playerPlaybackPermissionReason": "allowed",
"playerPresentationMode": "inline",
"playerPrevVideo": null,
"playerScaleMode": "fit",
"playerVolume": 1,
"videoCreatedTime": 1551103337,
"videoDuration": 214.06,
"videoId": "x730nnd",
"videoIsCreatedForKids": false,
"videoIsPasswordRequired": false,
"videoOwnerAvatars": {"60": "https://s1.dmcdn.net/u/4gS6x1bAn1J4XkTtz/60x60"},
"videoOwnerId": "x23rwb7",
"videoOwnerScreenname": "Player team",
"videoOwnerUsername": "player-team",
"videoPosters" : {
"60": "https://s2.dmcdn.net/v/DZRrE1a-UY_P8Q4HG/x60",
"120": "https://s2.dmcdn.net/v/DZRrE1a-UY_Llrtde/x120",
"180": "https://s1.dmcdn.net/v/DZRrE1a-UY_YZWP_m/x180",
"240": "https://s1.dmcdn.net/v/DZRrE1a-UY_lKqwAs/x240",
"360": "https://s2.dmcdn.net/v/DZRrE1a-UY_vfzXEe/x360",
"480": "https://s1.dmcdn.net/v/DZRrE1a-UY_MePtiX/x480",
"720": "https://s2.dmcdn.net/v/DZRrE1a-UY_19B5cB/x720",
"1080": "https://s1.dmcdn.net/v/DZRrE1a-UY_vvxuk3/x1080"
},
"videoQualitiesList": ["1080", "720", "480", "380", "240", "144"],
"videoQuality": "Auto",
"videoSubtitles": "en",
"videoSubtitlesList": ["fr", "en"],
"videoTime": 60.12,
"videoTitle": "Dailymotion video",
"videoViewId": "1h2fo92qc4qahuhdekq",
}Updated 25 days ago
