Tài liệu tham khảo Roku API PAL SDK

    1. ima
    2. ima.NonceLoader
    3. ima.NonceManager
    4. ima.NonceRequest

Lớp ima

Các hàm chung kiểm soát Roku IMA cho PAL.

Trở lại đầu trang

Lớp ima.NonceLoader

Phương thức

Thư viện truy cập có lập trình cho phép nhà xuất bản thu thập các tín hiệu có thể dùng để khai thác nhu cầu AdX. Đối với mỗi yêu cầu quảng cáo, hãy gọi các phương thức setter phù hợp khi cần, sau đó gọi đến loadNonceManager. Sau đó, nhà xuất bản có thể gọi NonceManager.getNonce() để nhận chuỗi cần được thêm vào yêu cầu quảng cáo dưới dạng giá trị cho

createNonceLoader()


Trả về ima.NonceLoader:

loadNonceManager(request)


Trả về ima.NonceManager: Một trình quản lý số chỉ dùng một lần dùng để tạo số chỉ dùng một lần cho yêu cầu quảng cáo.

Thông số Loại Nội dung mô tả
request ima.NonceRequest

Yêu cầu chứa thông tin về số chỉ dùng một lần đang được yêu cầu.

Trở lại đầu trang

Lớp ima.NonceManager

Phương thức

Quản lý một số chỉ dùng một lần và báo cáo sự kiện của số chỉ dùng một lần cho một phiên phát nội dung duy nhất. Các phương thức trong vòng đời của phiên phát nội dung, bao gồm ima.NonceManager.sendAdClick, ima.NonceManager.sendAdTouch, ima.NonceManager.sendPlaybackStartsendPlaybackEnd phải được gọi khi các sự kiện tương ứng này xảy ra để bật tính năng kiếm tiền có lập trình.

getNonce()


Trả về String: Số chỉ dùng một lần được tạo cho trình quản lý này khi được tải. Giá trị này sẽ không bao giờ thay đổi đối với một thực thể NonceManager nhất định. Giá trị số chỉ dùng một lần này chỉ hợp lệ cho một phiên phát nội dung duy nhất trong thời lượng tối đa là 6 giờ.

poll()

Cập nhật trạng thái của trình quản lý để có thể theo dõi tiến trình phát.

sendAdClick()

Thông báo cho các máy chủ quảng cáo của Google rằng một lượt nhấp vào quảng cáo đã xảy ra trong phiên phát nội dung nhất định.

sendAdImpression()

Không dùng nữa. Sử dụng ima.NonceManager.sendPlaybackStartima.NonceManager.sendPlaybackEnd/code>.

sendAdTouch(touch)

Notifies Google ad servers that a user touch or click on the ad other than a clickthrough (for example, skip, mute, tap, etc.) has occurred during the given content playback session.

Parameter Type Description
touch roInputEvent|String

The key received from onKeyEvent (if using SceneGraph), or the roInputEvent otherwise.

sendPlaybackEnd()

Notifies Google ad servers that playback for the given content playback session has ended. This should be called when playback ends (for example, when the player reaches end of stream, or when the user exits playback mid-way, or when the user quits the channel, or when advancing to the next content item in a playlist setting). This method ends the asynchronous calls to Google servers started in sendPlaybackStart.

sendPlaybackStart()

Notifies Google ad servers that playback for the given content playback session has started. This should be called on "video player start". This may be in response to a user-initiated action (click-to-play) or a channel initiated action (autoplay). This method will start asynchronous calls to Google servers to collect signal needed for IVT monitoring and detection.

Back to top

Class ima.NonceRequest

Fields

Methods

Information a publisher can provide when requesting a PAL nonce.

Properties

Name Type Description
adWillAutoPlay

Set to true if the ad will be auto played without waiting for user interaction. Set to false if the ad will wait for user interaction before being played.

adWillPlayMuted

Set to true if the ad will be played while muted. Set to false if the ad will play unmuted.

continuousPlayback

Set to true if the player intends to continuously play the content videos one after another similar to TV broadcast or video playlist. Set to false otherwise.

descriptionUrl

The description URL of the content during which the ad will be played. Any description URL string longer than 500 characters will be ignored and excluded from the nonce.

directedForChildOrUnknownAge

Whether the ad request is directed to a child or user of an unknown age (TFCD or TFUA). Default value is false.

iconsSupported

Whether VAST icons are supported by the video player. On Roku this value should always be false.

ppid

The publisher provided ID. Any PPID longer than 200 characters will be ignored. Note: The PPID will not be used in personalisation. If it is appropriate to use a ppid for personalization, include it separately in clear text in your ad request.

sessionId

Session ID is a temporary random ID. It is used exclusively for frequency capping. A session ID must be a UUID.

storageAllowed

Whether storage consent (purpose 1 consent) from the IAB TCF V2 spec has been granted by the user. Defaults to true.

supportedApiFrameworks

Accepts an array of strings representing API framweworks supported by the player as defined in AdCOM 1.0 "API Frameworks" list https://github.com/InteractiveAdvertisingBureau/AdCOM/blob/master/AdCOM%20v1.0%20FINAL.md#list--api-frameworks-. Example: ["2","7","9"] indicates this player supports VPAID 2.0, OMID 1.0, and SIMID 1.1.

videoHeight

The height of the ad video element.

videoWidth

The width of the ad video element.

createNonceRequest()


Returns ima.NonceRequest:

Back to top