Full screen

This page covers data collection for the Full screen player state. See Streams impacted by full screen, Full screen counts, and Full screen total duration for the corresponding reporting metrics.

The full-screen player state tracks when the viewer enters and exits full-screen playback. Fire a state-start event whenever the viewer enters full-screen and a state-end event when the viewer exits. The backend computes three metrics from these events: streams impacted, count of state entries, and total time in state.

Property
Value
Context data variables
a.media.states.fullscreen.set, a.media.states.fullscreen.count, a.media.states.fullscreen.time
XDM collection field
mediaCollection.statesStart[] and mediaCollection.statesEnd[] (entries with name: "fullscreen")
Audience Manager traits
c_contextdata.a.media.states.fullscreen.set, c_contextdata.a.media.states.fullscreen.count, c_contextdata.a.media.states.fullscreen.time
Required
No
Sent with
State start, state end

Web SDK

Use sendEvent to send a media.statesUpdate event with the state added to statesStart:

alloy("sendEvent", {
  xdm: {
    eventType: "media.statesUpdate",
    mediaCollection: {
      statesStart: [{ name: "fullscreen" }],
      sessionID: "{sid}",
      playhead: 60
    }
  }
});

When the viewer exits full-screen, send another event with the state in statesEnd:

alloy("sendEvent", {
  xdm: {
    eventType: "media.statesUpdate",
    mediaCollection: {
      statesEnd: [{ name: "fullscreen" }],
      sessionID: "{sid}",
      playhead: 90
    }
  }
});

Mobile SDK

Use tracker.trackPlayerStateStart() and tracker.trackPlayerStateEnd() with the MediaConstants.PlayerState.FULLSCREEN constant.

iOS (Swift)

let stateObject = Media.createStateObjectWith(stateName: MediaConstants.PlayerState.FULLSCREEN)

tracker.trackPlayerStateStart(info: stateObject)
// ...later, when the user exits full-screen:
tracker.trackPlayerStateEnd(info: stateObject)

Android (Kotlin)

val stateObject = Media.createStateObject(MediaConstants.PlayerState.FULLSCREEN)

tracker.trackPlayerStateStart(stateObject)
// ...later, when the user exits full-screen:
tracker.trackPlayerStateEnd(stateObject)

Roku (BrightScript)

Use sendMediaEvent to send a media.statesUpdate event with the state added to statesStart:

m.aepSdk.sendMediaEvent({
    "xdm": {
        "eventType": "media.statesUpdate",
        "mediaCollection": {
            "statesStart": [{ "name": "fullscreen" }],
            "playhead": 60
        }
    }
})

When the viewer exits full-screen, send another event with the state in statesEnd:

m.aepSdk.sendMediaEvent({
    "xdm": {
        "eventType": "media.statesUpdate",
        "mediaCollection": {
            "statesEnd": [{ "name": "fullscreen" }],
            "playhead": 90
        }
    }
})

Media Edge API

Call the statesUpdate endpoint with fullscreen in statesStart (or statesEnd when the viewer exits):

{
  "events": [{
    "xdm": {
      "eventType": "media.statesUpdate",
      "mediaCollection": {
        "statesStart": [{ "name": "fullscreen" }],
        "sessionID": "{sid}",
        "playhead": 60
      }
    }
  }]
}

Media SDK

Use ADB.Media.createStateObject and the ADB.Media.PlayerState.FullScreen constant:

var stateObject = ADB.Media.createStateObject(ADB.Media.PlayerState.FullScreen);

tracker.trackPlayerStateStart(stateObject);
// ...later, when the user exits full-screen:
tracker.trackPlayerStateEnd(stateObject);

Media Collection API

Send a stateStart POST request when the viewer enters full-screen, and a stateEnd POST when they exit:

{
  "playerTime": { "playhead": 60, "ts": 1699523820000 },
  "eventType": "stateStart",
  "params": {
    "media.state.name": "fullscreen"
  }
}
{
  "playerTime": { "playhead": 90, "ts": 1699523850000 },
  "eventType": "stateEnd",
  "params": {
    "media.state.name": "fullscreen"
  }
}

See the Media Collection API events reference for the full request structure.

recommendation-more-help
media-analytics-help