AdBreakInfo
Stay organized with collections
Save and categorize content based on your preferences.
A class that aggregates information about an ad that is playing or will be played on the
receiver. The sender app may use instances of this class to draw ad breaks on a SeekBar
.
Inherited Constant Summary
From interface android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
Public Method Summary
boolean |
|
String[]
|
getBreakClipIds
() Returns an unmodifiable list of ad break clip IDs in this break.
|
long |
|
String
|
getId
() Returns this break's ID.
|
long |
getPlaybackPositionInMs
() Returns this break content’s playback position in milliseconds at which the ad
will begin playing relative to the start of the video.
|
int |
|
boolean |
isEmbedded
() Returns true
if this break doesn't have a URL and is part of the
content.
|
boolean |
isWatched
() Returns true
if this break has been watched.
|
void |
|
Inherited Method Summary
From class java.lang.Object
From interface android.os.Parcelable
abstract int |
describeContents
()
|
abstract void |
writeToParcel
( Parcel
arg0,
int arg1)
|
Public Methods
public boolean
equals
( Object
other)
public long
getDurationInMs
()
Returns this break content’s duration in milliseconds.
public long
getPlaybackPositionInMs
()
Returns this break content’s playback position in milliseconds at which the ad will
begin playing relative to the start of the video. If position is 0, the pre-roll break
will play before the video starts. If position is -1, the post-roll break will play at
the end of the video (only if isEmbedded is false).
public boolean
isEmbedded
()
Returns true
if this break doesn't have a URL and is part of the
content.
public boolean
isWatched
()
Returns true
if this break has been watched.
public void
writeToParcel
( Parcel
out, int
flags)
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eAdBreakInfo\u003c/code\u003e provides information about ad breaks in media content, like duration and playback position, allowing apps to display them on a SeekBar.\u003c/p\u003e\n"],["\u003cp\u003eYou can access information such as break ID, duration, playback position, whether it's embedded in content, and if it's been watched.\u003c/p\u003e\n"],["\u003cp\u003eIt includes methods like \u003ccode\u003egetBreakClipIds\u003c/code\u003e to retrieve ad clip IDs within the break, and \u003ccode\u003eisEmbedded\u003c/code\u003e to check if the break is part of the content itself.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize the \u003ccode\u003eAdBreakInfo.Builder\u003c/code\u003e class to easily construct instances of \u003ccode\u003eAdBreakInfo\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# AdBreakInfo\n\npublic class **AdBreakInfo** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Parcelable](//developer.android.com/reference/android/os/Parcelable.html) \nA class that aggregates information about an ad that is playing or will be played on the\nreceiver. The sender app may use instances of this class to draw ad breaks on a\n[SeekBar](//developer.android.com/reference/android/widget/SeekBar.html). \n\n### Nested Class Summary\n\n|-------|---|---|------------------------------------------------------------------------------------------|\n| class | [AdBreakInfo.Builder](/android/reference/com/google/android/gms/cast/AdBreakInfo.Builder) || A builder for [AdBreakInfo](/android/reference/com/google/android/gms/cast/AdBreakInfo). |\n\n### Inherited Constant Summary\n\nFrom interface android.os.Parcelable \n\n|-----|-------------------------------|---|\n| int | CONTENTS_FILE_DESCRIPTOR | |\n| int | PARCELABLE_WRITE_RETURN_VALUE | |\n\n### Public Method Summary\n\n|-----------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/android/reference/com/google/android/gms/cast/AdBreakInfo#equals(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) other) |\n| [String\\[\\]](//developer.android.com/reference/java/lang/String.html) | [getBreakClipIds](/android/reference/com/google/android/gms/cast/AdBreakInfo#getBreakClipIds())() Returns an unmodifiable list of ad break clip IDs in this break. |\n| long | [getDurationInMs](/android/reference/com/google/android/gms/cast/AdBreakInfo#getDurationInMs())() Returns this break content's duration in milliseconds. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getId](/android/reference/com/google/android/gms/cast/AdBreakInfo#getId())() Returns this break's ID. |\n| long | [getPlaybackPositionInMs](/android/reference/com/google/android/gms/cast/AdBreakInfo#getPlaybackPositionInMs())() Returns this break content's playback position in milliseconds at which the ad will begin playing relative to the start of the video. |\n| int | [hashCode](/android/reference/com/google/android/gms/cast/AdBreakInfo#hashCode())() |\n| boolean | [isEmbedded](/android/reference/com/google/android/gms/cast/AdBreakInfo#isEmbedded())() Returns `true` if this break doesn't have a URL and is part of the content. |\n| boolean | [isWatched](/android/reference/com/google/android/gms/cast/AdBreakInfo#isWatched())() Returns `true` if this break has been watched. |\n| void | [writeToParcel](/android/reference/com/google/android/gms/cast/AdBreakInfo#writeToParcel(android.os.Parcel,%20int))([Parcel](//developer.android.com/reference/android/os/Parcel.html) out, int flags) |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nFrom interface android.os.Parcelable \n\n|---------------|--------------------------------------------------------------------------------------------------|\n| abstract int | describeContents() |\n| abstract void | writeToParcel([Parcel](//developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |\n\nPublic Methods\n--------------\n\n#### public boolean **equals** ([Object](//developer.android.com/reference/java/lang/Object.html) other)\n\n#### public [String\\[\\]](//developer.android.com/reference/java/lang/String.html) **getBreakClipIds** ()\n\nReturns an unmodifiable list of ad break clip IDs in this break. The list of\nmatching [AdBreakClipInfo](/android/reference/com/google/android/gms/cast/AdBreakClipInfo)\nobjects can be obtained by calling [MediaInfo.getAdBreakClips()](/android/reference/com/google/android/gms/cast/MediaInfo#getAdBreakClips()). \n\n#### public long **getDurationInMs** ()\n\nReturns this break content's duration in milliseconds. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getId** ()\n\nReturns this break's ID. \n\n#### public long **getPlaybackPositionInMs** ()\n\nReturns this break content's playback position in milliseconds at which the ad will\nbegin playing relative to the start of the video. If position is 0, the pre-roll break\nwill play before the video starts. If position is -1, the post-roll break will play at\nthe end of the video (only if isEmbedded is false). \n\n#### public int **hashCode** ()\n\n#### public boolean **isEmbedded** ()\n\nReturns `true` if this break doesn't have a URL and is part of the\ncontent. \n\n#### public boolean **isWatched** ()\n\nReturns `true` if this break has been watched. \n\n#### public void **writeToParcel** ([Parcel](//developer.android.com/reference/android/os/Parcel.html) out, int flags)"]]