A Google Ads media object.
Methods:
Member Type Description
getDimensions
void
getEntityType
String
Returns the type of this entity as a String
, in this case,
"Media"
.
getFileSize
long
Returns the size of the media file in bytes.
getId
String
Returns the ID of the media.
getMimeType
String
Returns a MIME type identifier for the media object.
getName
String
Returns the name of the media object, or null
if the media was
created without a name.
getReferenceId
void
getResourceName
String
Returns the resource name of the media.
getSourceUrl
String
Returns the URL where the original media was downloaded from, or
null
if the media was not obtained via download.
getType
String
Returns the media object's type.
getUrls
AdsApp.MediaUrls
Returns a MediaUrls instance for the
media object if it is an image.
getYouTubeVideoId
String
Returns the YouTube video ID if this media is a YouTube video, or
null
otherwise.
getDimensions()
Deprecated. This method will throw an error.
Returns nothing.
getEntityType()
Returns the type of this entity as a
String
, in this case,
"Media"
.
Return values:
Type Description
String
Type of this entity: "Media"
.
getFileSize()
Returns the size of the media file in bytes.
Return values:
Type Description
long
The file size.
getId()
Returns the ID of the media.
Return values:
Type Description
String
The ID of the media.
getMimeType()
Returns a MIME type identifier for the media object.
For example, this returns IMAGE_PNG
for the
image/png
MIME type. See the API
documentation for all possible values.
Return values:
Type Description
String
The MIME type.
getName()
Returns the name of the media object, or
null
if the media was
created without a name.
Return values:
Type Description
String
The media object's name.
getReferenceId()
Deprecated. This method will throw an error.
Returns nothing.
getResourceName()
Returns the resource name of the media.
Return values:
Type Description
String
The resource name of the media.
getSourceUrl()
Returns the URL where the original media was downloaded from, or
null
if the media was not obtained via download.
Return values:
Type Description
String
The source URL.
getType()
Returns the media object's type. This is one of
AUDIO
,
DYNAMIC_IMAGE
,
ICON
,
IMAGE
,
STANDARD_ICON
,
VIDEO
, or
MEDIA_BUNDLE
.
Return values:
Type Description
String
The media type.
getUrls()
Returns a
MediaUrls instance for the
media object if it is an image.
Return values:
getYouTubeVideoId()
Returns the YouTube video ID if this media is a YouTube video, or
null
otherwise.
Return values: