--- title: "Media Events" slug: "media-events" updated: 2024-05-03T06:54:29Z published: 2024-05-03T06:54:29Z canonical: "docs.mapp.com/media-events" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.mapp.com/llms.txt > Use this file to discover all available pages before exploring further. # Media Events The key figures for the media streams are calculated by the media actions and the transferred positions. You must, therefore, ensure that the requests are sent in the correct order. For example, no actions will be measured until a **mediaPlay** request is made for the video. > [!NOTE] > If you are using custom parameters or categories, please note that with AMP, you need to include the parameters in every action call via the **extraUrlParams** parameter (see also [Media Categories](/v1/docs/media-categories)). ## Start a Multimedia File The request "mediaPlay" is used for the playback of a video and start of the media session. **Example** ```xml     ``` | Parameter or Attribute | Description | | --- | --- | | "request": "mediaPlay" | You must set the value of the **request** parameter to **mediaPlay** to send the correct parameter to Mapp Intelligence. The request **mediaPlay** is used to record the playback of the multimedia file. This action is also sent when a file is autostarted or when the [Play] button of the media player is clicked. > [!NOTE] > Please note that the total playing time and media categories will only be evaluated for the first **mediaPlay** request. | ## Current Position of a Multimedia File The request **mediaPosition** should be sent regularly every 30 seconds. It is used for tracking the viewed chapters of a video and the last position of the video, in case the user ends the video by closing the browser tab/window. This action should be sent when the media player is in **play** mode. Once the video is paused or stopped, the timer for sending these actions must be stopped. **Example** ```xml     ``` | Parameter or Attribute | Description | | --- | --- | | "request": "mediaPosition" | Specifies the request value to be sent. You need to set it to "mediaPosition" to send the corre[ct event to Map](http://Intelligence.In)p Intelligence. In the above example, the request "mediaPosition" is sent regularly at intervals of 30 seconds and is used to capture the sections viewed and the last position in case the user terminates the video by closing the browser window. When the video is paused or stopped, the timer is also paused to send this action. | | "videoSpec": {"interval": 30} | Specifies the interval the requests are sent to Mapp Intelligence. > [!NOTE] > Please note that the transmission of the current position in multimedia files without a total playing time (for example, live streams) is only permitted in the interval of 60 seconds. | ## Pause a Multimedia File The request **mediaPause** must be sent with a click on the Pause button in the media player. Do not send any other position action while in **pause** mode. **Example** ```xml     ``` | Parameter or Attribute | Description | | --- | --- | | "request": "mediaPause", | The request **mediaPause** is sent when clicking the [Pause] button. In pause mode, no further position requests will be sent. | ## Ending a Multimedia File The request **mediaPause** must be sent with a click on the Pause button in the media player. Do not send any other position action while in **pause** mode. **Example** ```xml     ``` | Parameter or Attribute | Description | | --- | --- | | "request": "mediaPause", | The request **mediaPause** is sent when clicking the [Pause] button. In pause mode, no further position requests will be sent. | ## Custom Media Events You can define custom media events, for example, to track ad playback. ```xml     ``` | Parameter | Description | | --- | --- | | mediaEventName | You can define your custom media event here |