VastAdsRequest
Stay organized with collections
Save and categorize content based on your preferences.
A class that represents configuration of a VAST ad request. Digital Video Ad Serving
Template (VAST)
is a common protocol that enables ad servers to use a single ad response
format across multiple publishers/video players.
Inherited Constant Summary
From interface android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
Public Method Summary
boolean |
|
static VastAdsRequest
|
|
String
|
getAdTagUrl
() Returns the URL for the VAST file, used to retrieve and identify the ad.
|
String
|
getAdsResponse
() Returns the VAST XML document that can be used as the ads response instead of
making a request via an ad tag url.
|
int |
|
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)
Parses a JSON Object sent by the receiver.
public String
getAdTagUrl
()
Returns the URL for the VAST file, used to retrieve and identify the ad.
public String
getAdsResponse
()
Returns the VAST XML document that can be used as the ads response instead of making
a request via an ad tag url. If this is set, adTagUrl is ignored. This can be useful
for debugging and other situations where a VAST response is already available.
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\u003eVastAdsRequest\u003c/code\u003e configures VAST video ad requests, enabling a standardized ad response format across various publishers and players.\u003c/p\u003e\n"],["\u003cp\u003eIt allows specifying either an ad tag URL to fetch the VAST file or directly providing a VAST XML response.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use the \u003ccode\u003eVastAdsRequest.Builder\u003c/code\u003e to create instances of this class.\u003c/p\u003e\n"],["\u003cp\u003eIt implements the \u003ccode\u003eParcelable\u003c/code\u003e interface for easy data transfer between components.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003efromJson\u003c/code\u003e method allows parsing \u003ccode\u003eVastAdsRequest\u003c/code\u003e objects from JSON data received from the receiver.\u003c/p\u003e\n"]]],["`VastAdsRequest` configures VAST ad requests, a protocol for ad servers to use a single format. Key actions include parsing a JSON object via `fromJson`, retrieving the ad tag URL with `getAdTagUrl`, and obtaining the VAST XML document using `getAdsResponse`. Other functionality includes writing to a parcel with `writeToParcel`, and comparing objects with `equals`. The builder `VastAdsRequest.Builder` is available to assist in constructing a VastAdRequest.\n"],null,["# VastAdsRequest\n\npublic class **VastAdsRequest** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Parcelable](//developer.android.com/reference/android/os/Parcelable.html) \nA class that represents configuration of a VAST ad request. [Digital Video Ad Serving\nTemplate (VAST)](/android/reference/com/google/android/gms/cast/www.iab.com/guidelines/digital-video-ad-serving-template-vast-4-0) is a common protocol that enables ad servers to use a single ad response\nformat across multiple publishers/video players. \n\n### Nested Class Summary\n\n|-------|---|---|-----------------------------------------------------------------------------------------------|\n| class | [VastAdsRequest.Builder](/android/reference/com/google/android/gms/cast/VastAdsRequest.Builder) || A builder for [VastAdsRequest](/android/reference/com/google/android/gms/cast/VastAdsRequest) |\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/VastAdsRequest#equals(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) other) |\n| static [VastAdsRequest](/android/reference/com/google/android/gms/cast/VastAdsRequest) | [fromJson](/android/reference/com/google/android/gms/cast/VastAdsRequest#fromJson(org.json.JSONObject))([JSONObject](//developer.android.com/reference/org/json/JSONObject.html) json) Parses a JSON Object sent by the receiver. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getAdTagUrl](/android/reference/com/google/android/gms/cast/VastAdsRequest#getAdTagUrl())() Returns the URL for the VAST file, used to retrieve and identify the ad. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getAdsResponse](/android/reference/com/google/android/gms/cast/VastAdsRequest#getAdsResponse())() Returns the VAST XML document that can be used as the ads response instead of making a request via an ad tag url. |\n| int | [hashCode](/android/reference/com/google/android/gms/cast/VastAdsRequest#hashCode())() |\n| void | [writeToParcel](/android/reference/com/google/android/gms/cast/VastAdsRequest#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 static [VastAdsRequest](/android/reference/com/google/android/gms/cast/VastAdsRequest)\n**fromJson** ([JSONObject](//developer.android.com/reference/org/json/JSONObject.html) json)\n\nParses a JSON Object sent by the receiver. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getAdTagUrl** ()\n\nReturns the URL for the VAST file, used to retrieve and identify the ad. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getAdsResponse** ()\n\nReturns the VAST XML document that can be used as the ads response instead of making\na request via an ad tag url. If this is set, adTagUrl is ignored. This can be useful\nfor debugging and other situations where a VAST response is already available. \n\n#### public int **hashCode** ()\n\n#### public void **writeToParcel** ([Parcel](//developer.android.com/reference/android/os/Parcel.html) out, int flags)"]]