Mute

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

The mute player state tracks when the viewer mutes and unmutes audio. Fire a state-start event when the viewer mutes and a state-end event when the viewer unmutes. 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.mute.set, a.media.states.mute.count, a.media.states.mute.time
XDM collection field
xdm.mediaCollection.statesStart[] and xdm.mediaCollection.statesEnd[] (entries with name: "mute")
Audience Manager traits
c_contextdata.a.media.states.mute.set, c_contextdata.a.media.states.mute.count, c_contextdata.a.media.states.mute.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:

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

When the viewer unmutes, send another event with the state in statesEnd:

code language-javascript
alloy("sendEvent", {
  xdm: {
    eventType: "media.statesUpdate",
    mediaCollection: {
      statesEnd: [{ name: "mute" }],
      sessionID: "{sid}",
      playhead: 90
    }
  }
});
iOS

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

code language-swift
let stateObject = Media.createStateObjectWith(stateName: MediaConstants.PlayerState.MUTE)

tracker.trackPlayerStateStart(info: stateObject)
tracker.trackPlayerStateEnd(info: stateObject)
Android

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

code language-kotlin
val stateObject = Media.createStateObject(MediaConstants.PlayerState.MUTE)

tracker.trackPlayerStateStart(stateObject)
tracker.trackPlayerStateEnd(stateObject)
Roku Edge

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

code language-brightscript
m.aepSdk.sendMediaEvent({
    "xdm": {
        "eventType": "media.statesUpdate",
        "mediaCollection": {
            "statesStart": [{ "name": "mute" }],
            "playhead": 60
        }
    }
})

When the viewer unmutes, send another event with the state in statesEnd:

code language-brightscript
m.aepSdk.sendMediaEvent({
    "xdm": {
        "eventType": "media.statesUpdate",
        "mediaCollection": {
            "statesEnd": [{ "name": "mute" }],
            "playhead": 90
        }
    }
})
Media Edge API

Call the statesUpdate endpoint with mute in statesStart (or statesEnd when the viewer unmutes):

code language-json
{
  "events": [{
    "xdm": {
      "eventType": "media.statesUpdate",
      "mediaCollection": {
        "statesStart": [{ "name": "mute" }],
        "sessionID": "{sid}",
        "playhead": 60
      }
    }
  }]
}

Legacy implementation types (Analytics-only)

Media SDK JS 3.x

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

code language-javascript
var stateObject = ADB.Media.createStateObject(ADB.Media.PlayerState.Mute);

tracker.trackPlayerStateStart(stateObject);
tracker.trackPlayerStateEnd(stateObject);
Chromecast

Use ADBMobile.media.createStateObject with the "mute" string directly, as Chromecast does not have named PlayerState constants:

code language-javascript
var stateObject = ADBMobile.media.createStateObject("mute");
ADBMobile.media.trackEvent(ADBMobile.media.Event.StateStart, stateObject);
// When the viewer unmutes:
ADBMobile.media.trackEvent(ADBMobile.media.Event.StateEnd, stateObject);
Roku 2.x
Player state tracking is not available in the Roku 2.x SDK. To track player states, use the Roku Edge SDK.
Media Collection API

Send a stateStart POST request when the viewer mutes, and a stateEnd POST when they unmute:

code language-json
{
  "playerTime": { "playhead": 60, "ts": 1699523820000 },
  "eventType": "stateStart",
  "params": {
    "media.state.name": "mute"
  }
}

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

recommendation-more-help
media-analytics-help