RemoteMediaClient.ParseAdsInfoCallback
Stay organized with collections
Save and categorize content based on your preferences.
The callback interface for parsing ads information from the custom data inside the
MediaStatus
.
Public Method Summary
abstract List<AdBreakInfo>
|
|
abstract boolean |
|
Public Methods
Returns a list of AdBreakInfo
instances, which contains information about a list of ads that is or will be played on
the receiver. An AdBreakInfo
contains the position of the ad relative to the playback of the current media content.
The returned value will be used by the framework to draw ad breaks on the
SeekBar
inside the
ExpandedControllerActivity
.
Returns whether an ad is playing on the receiver. The return value will be used by
the framework to render various framework managed UIs to indicate that an ad is
playing.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eRemoteMediaClient.ParseAdsInfoCallback\u003c/code\u003e is an interface used to parse ad information from the \u003ccode\u003eMediaStatus\u003c/code\u003e of media playing on a Cast receiver.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to get a list of ad breaks and determine if an ad is currently playing.\u003c/p\u003e\n"],["\u003cp\u003eThe ad information is used to update the UI, like displaying ad breaks on the seek bar.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can implement this interface to customize how ad information is extracted from the \u003ccode\u003eMediaStatus\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `RemoteMediaClient.ParseAdsInfoCallback` interface allows parsing ad information from `MediaStatus`. It provides two key methods: `parseAdBreaksFromMediaStatus`, which returns a list of `AdBreakInfo` instances indicating ad positions relative to media playback, used to draw ad breaks on the seek bar. The other method `parseIsPlayingAdFromMediaStatus` determines if an ad is playing, informing framework UI rendering. Both methods use the current `MediaStatus` to extract ad-related data.\n"],null,["# RemoteMediaClient.ParseAdsInfoCallback\n\npublic static interface **RemoteMediaClient.ParseAdsInfoCallback** \nThe callback interface for parsing ads information from the custom data inside the\n[MediaStatus](/android/reference/com/google/android/gms/cast/MediaStatus). \n\n### Public Method Summary\n\n|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [List](//developer.android.com/reference/java/util/List.html)\\\u003cAdBreakInfo\\\u003e | [parseAdBreaksFromMediaStatus](/android/reference/com/google/android/gms/cast/framework/media/RemoteMediaClient.ParseAdsInfoCallback#parseAdBreaksFromMediaStatus(com.google.android.gms.cast.MediaStatus))(MediaStatus mediaStatus) Returns a list of [AdBreakInfo](/android/reference/com/google/android/gms/cast/AdBreakInfo) instances, which contains information about a list of ads that is or will be played on the receiver. |\n| abstract boolean | [parseIsPlayingAdFromMediaStatus](/android/reference/com/google/android/gms/cast/framework/media/RemoteMediaClient.ParseAdsInfoCallback#parseIsPlayingAdFromMediaStatus(com.google.android.gms.cast.MediaStatus))(MediaStatus mediaStatus) Returns whether an ad is playing on the receiver. |\n\nPublic Methods\n--------------\n\n#### public abstract [List](//developer.android.com/reference/java/util/List.html)\\\u003cAdBreakInfo\\\u003e\n**parseAdBreaksFromMediaStatus** (MediaStatus mediaStatus)\n\nReturns a list of [AdBreakInfo](/android/reference/com/google/android/gms/cast/AdBreakInfo)\ninstances, which contains information about a list of ads that is or will be played on\nthe receiver. An [AdBreakInfo](/android/reference/com/google/android/gms/cast/AdBreakInfo)\ncontains the position of the ad relative to the playback of the current media content.\nThe returned value will be used by the framework to draw ad breaks on the\n[SeekBar](//developer.android.com/reference/android/widget/SeekBar.html)\ninside the [ExpandedControllerActivity](/android/reference/com/google/android/gms/cast/framework/media/widget/ExpandedControllerActivity). \n\n##### Parameters\n\n| mediaStatus | The current [MediaStatus](/android/reference/com/google/android/gms/cast/MediaStatus). |\n|-------------|----------------------------------------------------------------------------------------|\n\n#### public abstract boolean\n**parseIsPlayingAdFromMediaStatus** (MediaStatus mediaStatus)\n\nReturns whether an ad is playing on the receiver. The return value will be used by\nthe framework to render various framework managed UIs to indicate that an ad is\nplaying. \n\n##### Parameters\n\n| mediaStatus | The current [MediaStatus](/android/reference/com/google/android/gms/cast/MediaStatus). |\n|-------------|----------------------------------------------------------------------------------------|"]]