# Google Cloud Discovery Engine V1 Client - Class MediaInfo (1.11.1)

1.11.1 (latest) 1.11.0 1.10.1 1.9.1 1.8.0 1.7.0 1.6.1 1.5.1 1.4.0 1.3.3 1.2.0 1.1.0 1.0.0 0.11.3 0.8.0 0.7.1 0.6.0 0.5.0 0.4.0 0.3.0 0.2.0 0.1.1 Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class MediaInfo.

Media-specific user event information.

Generated from protobuf message `google.cloud.discoveryengine.v1.MediaInfo`

## Namespace

Google \\ Cloud \\ DiscoveryEngine \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ media_progress_duration` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` The media progress time in seconds, if applicable. For example, if the end user has finished 90 seconds of a playback video, then [MediaInfo.media_progress_duration.seconds](https://protobuf.dev/reference/php/api-docs/MediaInfo.media_progress_duration.seconds) should be set to 90. |
| `↳ media_progress_percentage` | `float` Media progress should be computed using only the [media_progress_duration](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.MediaInfo#_Google_Cloud_DiscoveryEngine_V1_MediaInfo__getMediaProgressDuration__) relative to the media total length. This value must be between `[0, 1.0]` inclusive. If this is not a playback or the progress cannot be computed (e.g. ongoing livestream), this field should be unset. |

### getMediaProgressDuration

The media progress time in seconds, if applicable.

For example, if the end user has finished 90 seconds of a playback video,
then
[MediaInfo.media_progress_duration.seconds](https://protobuf.dev/reference/php/api-docs/MediaInfo.media_progress_duration.seconds)
should be set to 90.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasMediaProgressDuration

### clearMediaProgressDuration

### setMediaProgressDuration

The media progress time in seconds, if applicable.

For example, if the end user has finished 90 seconds of a playback video,
then
[MediaInfo.media_progress_duration.seconds](https://protobuf.dev/reference/php/api-docs/MediaInfo.media_progress_duration.seconds)
should be set to 90.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMediaProgressPercentage

Media progress should be computed using only the
[media_progress_duration](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.MediaInfo#_Google_Cloud_DiscoveryEngine_V1_MediaInfo__getMediaProgressDuration__)
relative to the media total length.

This value must be between `[0, 1.0]` inclusive.
If this is not a playback or the progress cannot be computed (e.g. ongoing
livestream), this field should be unset.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### hasMediaProgressPercentage

### clearMediaProgressPercentage

### setMediaProgressPercentage

Media progress should be computed using only the
[media_progress_duration](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.MediaInfo#_Google_Cloud_DiscoveryEngine_V1_MediaInfo__getMediaProgressDuration__)
relative to the media total length.

This value must be between `[0, 1.0]` inclusive.
If this is not a playback or the progress cannot be computed (e.g. ongoing
livestream), this field should be unset.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |