Class VideoAdRequest.Builder

com.yandex.mobile.ads.video

public class VideoAdRequest.Builder

Class for creating a VideoAdRequest object.

Methods

Builder(@NonNull final Context context, @NonNull final BlocksInfo blocksInfo, @Nullable final RequestListener< List< VideoAd >> requestListener, @NonNull final String targetRef, @NonNull final String pageRef, @NonNull final String blockId)

Creates a new object of the Builder class to construct VideoAdRequest.

VideoAdRequest build()

Creates a new object of the VideoAdRequest class.

Builder setCharset(@Nullable final Charset charset)

Sets the encoding.

Builder setContentId(final String contentId)

Sets the content ID.

Builder setContentName(final String contentName)

Sets the title of the content.

Builder setExtendedParams(final String extendedParams)

Sets additional parameters.

Builder setGenreIds(@Nullable final List< String > genreIds)

Sets a list of genre IDs.

Builder setGenreNames(@Nullable final List< String > genreNames)

Sets a list of genre names.

Builder setMaxBitrate(final int maxBitrate)

Sets the maximum bitrate of the video.

Builder setPlayerSize(final int width, final int height)

Sets the preferred video size in pixels.

Builder setPublisherId(@Nullable final String publisherId)

Sets the content copyright holder ID.

Builder setPublisherName(@Nullable final String publisherName)

Sets the name of the content copyright holder.

Builder setTagsList(@Nullable final List< String > tagsList)

Sets a list of tags.

Method Detail

Builder

public Builder (@NonNull final Context context, @NonNull final BlocksInfo blocksInfo, @Nullable final RequestListener< List< VideoAd >> requestListener, @NonNull final String targetRef, @NonNull final String pageRef, @NonNull final String blockId)

Creates a new object of the Builder class to construct VideoAdRequest.

Parameters:
context

An object of the Context system class.

blocksInfo

An object of the BlocksInfo class obtained using the loadBlocksInfo(BlocksInfoRequest) method.

requestListener

An object of the RequestListener class.

targetRef

The targetRef parameter received from Yandex.

pageRef

The pageRef parameter received from Yandex.

blockId

The block ID obtained by using the getId() method.

Throws:

IllegalArgumentException
Possible options:
  • An empty blocksInfo or the null value is set.

  • An empty blockId or the null value is set.

  • An empty targetRef or the null value is set.

  • An empty pageRef or the null value is set.

NullPointerException

An empty context or the null value is set.

build

public VideoAdRequest build ()

Creates a new object of the VideoAdRequest class.

Returns:

An object of the VideoAdRequest class.

setCharset

public Builder setCharset (@Nullable final Charset charset)

Sets the encoding.

Parameters:
charset

Encoding. The default value is UTF_8.

Returns:

An object of the Builder class.

setContentId

public Builder setContentId (final String contentId)

Sets the content ID.

Parameters:
contentId

Content ID.

Returns:

An object of the Builder class.

setContentName

public Builder setContentName (final String contentName)

Sets the title of the content.

Parameters:
contentName

Title of the content.

Returns:

An object of the Builder class.

setExtendedParams

public Builder setExtendedParams (final String extendedParams)

Sets additional parameters.

Parameters:
extendedParams

Additional parameters.

Returns:

An object of the Builder class.

setGenreIds

public Builder setGenreIds (@Nullable final List< String > genreIds)

Sets a list of genre IDs.

Parameters:
genreIds

List of genre IDs.

Returns:

An object of the Builder class.

setGenreNames

public Builder setGenreNames (@Nullable final List< String > genreNames)

Sets a list of genre names.

Parameters:
genreNames

List of genre names.

Returns:

An object of the Builder class.

setMaxBitrate

public Builder setMaxBitrate (final int maxBitrate)

Sets the maximum bitrate of the video.

Parameters:
maxBitrate

Maximum bitrate of the video.

Returns:

An object of the Builder class.

setPlayerSize

public Builder setPlayerSize (final int width, final int height)

Sets the preferred video size in pixels.

Parameters:
width

The width in pixels.

height

The height in pixels.

Returns:

An object of the Builder class.

setPublisherId

public Builder setPublisherId (@Nullable final String publisherId)

Sets the content copyright holder ID.

Parameters:
publisherId

ID of the content copyright holder.

Returns:

An object of the Builder class.

setPublisherName

public Builder setPublisherName (@Nullable final String publisherName)

Sets the name of the content copyright holder.

Parameters:
publisherName

Name of the content copyright holder.

Returns:

An object of the Builder class.

setTagsList

public Builder setTagsList (@Nullable final List< String > tagsList)

Sets a list of tags.

Parameters:
tagsList

List of tags.

Returns:

An object of the Builder class.