Stay organized with collections
Save and categorize content based on your preferences.
meet::MediaApiClientObserverInterface
This is an abstract class.
#include <media_api_client_interface.h>
Interface for observing client events.
Summary
Methods are invoked on internal threads, and therefore observer implementations must offload non-trivial work to other threads. Otherwise, they risk blocking the client.
[null,null,["Last updated 2025-04-09 UTC."],[],[],null,["# meet::MediaApiClientObserverInterface Class Reference\n\nmeet::MediaApiClientObserverInterface\n=====================================\n\n| **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features. \n|\n| **To use the Meet Media API to access real-time media from a conference, the Google Cloud project, OAuth principal, and all participants in the conference must be enrolled in the Developer Preview Program.**\n\n\n**This is an abstract class.**\n\n\n`#include \u003cmedia_api_client_interface.h\u003e`\n\nInterface for observing client events.\n\nSummary\n-------\n\nMethods are invoked on internal threads, and therefore observer implementations must offload non-trivial work to other threads. Otherwise, they risk blocking the client.\n\n### Inheritance\n\nInherits from: RefCountInterface\n\n| ### Constructors and Destructors ||\n|---|---|\n| [~MediaApiClientObserverInterface](#classmeet_1_1_media_api_client_observer_interface_1af3f119c427fe08580fa2c72f26e1e593)`()` ||\n\n| ### Public functions ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [OnAudioFrame](#classmeet_1_1_media_api_client_observer_interface_1a3fba48b9e19ece82af163da62943e198)`(`[AudioFrame](/workspace/meet/media-api/reference/cpp/struct/meet/audio-frame#structmeet_1_1_audio_frame)` frame)=0` | `virtual void` Callback for receiving audio frames. |\n| [OnDisconnected](#classmeet_1_1_media_api_client_observer_interface_1a5b1b56fa47b4874b8457f6a42fa004bb)`(absl::Status status)=0` | `virtual void` Invoked when the client disconnects for whatever reason. |\n| [OnJoined](#classmeet_1_1_media_api_client_observer_interface_1ade371cd077cf46e66bec529ffa131c03)`()=0` | `virtual void` Invoked when the client has entered the [meet::SessionStatus::ConferenceConnectionState::kJoined](/workspace/meet/media-api/reference/cpp/struct/meet/session-status#structmeet_1_1_session_status_1a8bf13597b265baa6f9349c0e6b5ea754a148fbaeaccc3ce0b316198d4fc2f0bbd) state. |\n| [OnResourceUpdate](#classmeet_1_1_media_api_client_observer_interface_1a688cb805cef9c279159a4a1cf58b4dab)`(`[ResourceUpdate](/workspace/meet/media-api/reference/cpp/namespace/meet#namespacemeet_1a01d47477f878cf83a497eae6a4550664)` update)=0` | `virtual void` Invoked when a resource update is received from Meet servers. |\n| [OnVideoFrame](#classmeet_1_1_media_api_client_observer_interface_1affcf80d17568bfc4a51183a02c26be26)`(`[VideoFrame](/workspace/meet/media-api/reference/cpp/struct/meet/video-frame#structmeet_1_1_video_frame)` frame)=0` | `virtual void` Callbacks for receiving video frames. |\n\nPublic functions\n----------------\n\n### OnAudioFrame\n\n```c++\nvirtual void OnAudioFrame(\n AudioFrame frame\n)=0\n``` \nCallback for receiving audio frames.\n\nAudio frames will not be received for muted participants.\n\nThis will only be invoked while in the [meet::SessionStatus::ConferenceConnectionState::kJoined](/workspace/meet/media-api/reference/cpp/struct/meet/session-status#structmeet_1_1_session_status_1a8bf13597b265baa6f9349c0e6b5ea754a148fbaeaccc3ce0b316198d4fc2f0bbd) state. \n\n### OnDisconnected\n\n```c++\nvirtual void OnDisconnected(\n absl::Status status\n)=0\n``` \nInvoked when the client disconnects for whatever reason.\n\n\n- This will only be called after [MediaApiClientInterface::ConnectActiveConference](/workspace/meet/media-api/reference/cpp/class/meet/media-api-client-interface#classmeet_1_1_media_api_client_interface_1add02b89ea4650ab76a330a968c929170) is called.\n- This will be called once and only once, either before or after [MediaApiClientObserverInterface::OnJoined](/workspace/meet/media-api/reference/cpp/class/meet/media-api-client-observer-interface#classmeet_1_1_media_api_client_observer_interface_1ade371cd077cf46e66bec529ffa131c03) is called.\n- Once this is invoked, no other callbacks will be invoked.\n\n\u003cbr /\u003e\n\nDisconnections are either graceful or ungraceful. Disconnections are considered graceful if the client receives a [SessionControlChannelToClient](/workspace/meet/media-api/reference/cpp/struct/meet/session-control-channel-to-client#structmeet_1_1_session_control_channel_to_client) resource update with a session status of [meet::SessionStatus::ConferenceConnectionState::kDisconnected](/workspace/meet/media-api/reference/cpp/struct/meet/session-status#structmeet_1_1_session_status_1a8bf13597b265baa6f9349c0e6b5ea754af469e2a5b05d423dd49764004270f117), or if [MediaApiClientInterface::LeaveConference](/workspace/meet/media-api/reference/cpp/class/meet/media-api-client-interface#classmeet_1_1_media_api_client_interface_1a72c076b23a5bd8a1605081f5d6c554db) is called while the client is joining the conference. All other disconnections are considered ungraceful (`PeerConnection` closed, Meet servers unreachable, etc).\n\nThis client implementation passes an OK status for graceful disconnections and an error status for ungraceful disconnections. Graceful disconnections can be analyzed by checking the [SessionControlChannelToClient](/workspace/meet/media-api/reference/cpp/struct/meet/session-control-channel-to-client#structmeet_1_1_session_control_channel_to_client) resource update received via [MediaApiClientObserverInterface::OnResourceUpdate](/workspace/meet/media-api/reference/cpp/class/meet/media-api-client-observer-interface#classmeet_1_1_media_api_client_observer_interface_1a688cb805cef9c279159a4a1cf58b4dab). \n\n### OnJoined\n\n```c++\nvirtual void OnJoined()=0\n``` \nInvoked when the client has entered the [meet::SessionStatus::ConferenceConnectionState::kJoined](/workspace/meet/media-api/reference/cpp/struct/meet/session-status#structmeet_1_1_session_status_1a8bf13597b265baa6f9349c0e6b5ea754a148fbaeaccc3ce0b316198d4fc2f0bbd) state.\n\nOnce this is invoked, the client is fully operational and will remain in this state until [MediaApiClientObserverInterface::OnDisconnected](/workspace/meet/media-api/reference/cpp/class/meet/media-api-client-observer-interface#classmeet_1_1_media_api_client_observer_interface_1a5b1b56fa47b4874b8457f6a42fa004bb) is invoked. \n\n### OnResourceUpdate\n\n```c++\nvirtual void OnResourceUpdate(\n ResourceUpdate update\n)=0\n``` \nInvoked when a resource update is received from Meet servers.\n\nThis can be in response to a request sent via [MediaApiClientInterface::SendRequest](/workspace/meet/media-api/reference/cpp/class/meet/media-api-client-interface#classmeet_1_1_media_api_client_interface_1a26b3b86fba02bc7d46a13e8dfdeb5672) or a push from Meet servers.\n\nThis will only be invoked while in the [meet::SessionStatus::ConferenceConnectionState::kJoined](/workspace/meet/media-api/reference/cpp/struct/meet/session-status#structmeet_1_1_session_status_1a8bf13597b265baa6f9349c0e6b5ea754a148fbaeaccc3ce0b316198d4fc2f0bbd) state. \n\n### OnVideoFrame\n\n```c++\nvirtual void OnVideoFrame(\n VideoFrame frame\n)=0\n``` \nCallbacks for receiving video frames.\n\nVideo frames will not be received for participants with their video disabled (i.e. their video is muted).\n\nThis will only be invoked while in the [meet::SessionStatus::ConferenceConnectionState::kJoined](/workspace/meet/media-api/reference/cpp/struct/meet/session-status#structmeet_1_1_session_status_1a8bf13597b265baa6f9349c0e6b5ea754a148fbaeaccc3ce0b316198d4fc2f0bbd) state. \n\n### \\~MediaApiClientObserverInterface\n\n```c++\n ~MediaApiClientObserverInterface() override=default\n```"]]