Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
NonceRequest
classpublic
NonceRequest được dùng để lưu trữ thông tin về yêu cầu đối với số chỉ dùng một lần.
Hàm dựng
NonceRequest
new
NonceRequest()
Triển khai
NonceRequestInterface
Thuộc tính
adWillAutoPlay
(giá trị rỗng hoặc boolean)
Đặt thành true nếu quảng cáo sẽ tự động phát mà không cần chờ người dùng tương tác. Đặt thành false nếu quảng cáo sẽ chờ người dùng tương tác trước khi phát.
adWillPlayMuted
(giá trị rỗng hoặc boolean)
Đặt thành true nếu quảng cáo sẽ phát ở chế độ tắt tiếng. Đặt thành false nếu quảng cáo sẽ phát mà không bị tắt tiếng.
continuousPlayback
(giá trị rỗng hoặc boolean)
Đặt thành true nếu trình phát có ý định liên tục phát lần lượt các video nội dung, tương tự như phát sóng trên truyền hình hoặc danh sách phát video. Nếu không, hãy đặt thành false.
descriptionUrl
Đặt URL mô tả của nội dung mà quảng cáo sẽ phát trong đó.
Mọi chuỗi URL nội dung mô tả dài hơn 500 ký tự sẽ bị bỏ qua và loại trừ khỏi số chỉ dùng một lần.
Thông số
descriptionUrl
chuỗi
Giá trị trả về
void
descriptionUrl
URL mô tả nội dung mà quảng cáo sẽ phát trong đó.
Giá trị trả về
string
iconsSupported
boolean
Trình phát video có hỗ trợ biểu tượng VAST hay không.
nonceLengthLimit
số
Giới hạn độ dài của số chỉ dùng một lần được tạo. Lời hứa loadNonceManager sẽ bị từ chối nếu số chỉ dùng một lần dài hơn giới hạn này. Giá trị mặc định là số nguyên lớn nhất có thể. Việc chọn giới hạn độ dài ngắn hơn có thể khiến nhiều thuộc tính nhắm mục tiêu bị loại trừ khỏi số chỉ dùng một lần.
playerType
Đặt loại trình phát do đối tác cung cấp. Bạn nên dùng thuộc tính này để chỉ định tên của trình phát đối tác. Mọi chuỗi loại người chơi dài hơn 200 ký tự sẽ bị bỏ qua và loại trừ khỏi số chỉ dùng một lần.
Thông số
playerType
chuỗi
Giá trị trả về
void
playerType
Loại trình phát do đối tác cung cấp.
Giá trị trả về
string
playerVersion
Đặt phiên bản trình phát do đối tác cung cấp. Bạn nên dùng tham số này để chỉ định phiên bản của trình phát đối tác. Mọi chuỗi phiên bản trình phát dài hơn 200 ký tự sẽ bị bỏ qua và loại trừ khỏi số chỉ dùng một lần.
Thông số
playerVersion
chuỗi
Giá trị trả về
void
playerVersion
Phiên bản trình phát do đối tác cung cấp.
Giá trị trả về
string
ppid
Đặt mã nhận dạng do nhà xuất bản cung cấp. Mọi PPID dài hơn 200 ký tự sẽ bị bỏ qua và loại trừ khỏi số chỉ dùng một lần.
Thông số
ppid
chuỗi
Giá trị trả về
void
ppid
Mã nhận dạng do nhà xuất bản cung cấp.
Giá trị trả về
string
sessionId
chuỗi
Mã phiên là một mã ngẫu nhiên tạm thời. Giá trị này chỉ được dùng cho tính năng giới hạn tần suất. Mã nhận dạng phiên phải là một UUID.
url
chuỗi
URL mà quảng cáo sẽ nhắm đến. Theo mặc định, đây là trang giống với trang sẽ hiển thị quảng cáo, nhưng bạn có thể đặt trang này theo cách thủ công.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-21 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eNonceRequest\u003c/code\u003e class stores information about a request for a nonce, which is used for ad targeting and verification.\u003c/p\u003e\n"],["\u003cp\u003eIt includes various properties like ad behavior, content description, player details, and user session information.\u003c/p\u003e\n"],["\u003cp\u003eThese properties influence the generation of the nonce and its use in ad serving.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can configure properties such as ad autoplay, mute state, and continuous playback behavior to tailor the nonce request.\u003c/p\u003e\n"],["\u003cp\u003eThe nonce length can be limited, although this might affect the inclusion of certain targeting properties.\u003c/p\u003e\n"]]],["The `NonceRequest` class stores information for a nonce request. Key properties include: `adWillAutoPlay` and `adWillPlayMuted` (booleans for ad behavior), `continuousPlayback` (boolean for video play), `descriptionUrl`, `playerType`, `playerVersion`, `ppid`, `sessionId`, and `url` (strings for content and player details, with length limits), `iconsSupported` (boolean for VAST support), `nonceLengthLimit`(number for nonce limit), and `videoHeight` and `videoWidth` (numbers for ad dimensions). It manages nonce generation and validation, using provided IDs, URLs and player specs.\n"],null,["# Class: NonceRequest\n\nNonceRequest\n============\n\nclass public\n\nThe NonceRequest is used to store information about the request for a nonce.\n\nConstructor\n-----------\n\n### NonceRequest\n\nnew\nNonceRequest()\n\nImplements\n: NonceRequestInterface\n\nProperties\n----------\n\n### adWillAutoPlay\n\n(null or boolean)\n\nSet to true if the ad will be auto played without waiting for user\ninteraction. Set to false if the ad will wait for user interaction before\nbeing played.\n\n### adWillPlayMuted\n\n(null or boolean)\n\nSet to true if the ad will be played while muted. Set to false if the ad\nwill play unmuted.\n\n### continuousPlayback\n\n(null or boolean)\n\nSet to true if the player intends to continuously play the content videos\none after another similar to TV broadcast or video playlist. Set to false\notherwise.\n\n### descriptionUrl\n\n\u003cbr /\u003e\n\nSets the description URL of the content during which the ad will be played.\nAny description URL string longer than 500 characters will be ignored and\nexcluded from the nonce.\n\n| #### Parameter ||\n|----------------|--------|\n| descriptionUrl | string |\n\nReturns\n\n: `void`\n\n### descriptionUrl\n\n\u003cbr /\u003e\n\nThe description URL of the content during which the ad will be played.\n\nReturns\n\n: `string`\n\n### iconsSupported\n\nboolean\n\nWhether VAST icons are supported by the video player.\n\n### nonceLengthLimit\n\nnumber\n\nThe length limit of the generated nonce. The loadNonceManager promise\nwill be rejected if the nonce is longer than this limit. Defaults to the\nlargest possible integer. Choosing a shorter length limit may cause\nvarious targeting properties to be excluded from the nonce.\n\n### playerType\n\n\u003cbr /\u003e\n\nSets the partner provided player type. This should be used to specify the\nname of the partner player. Any player type string longer than 200\ncharacters will be ignored and excluded from the nonce.\n\n| #### Parameter ||\n|------------|--------|\n| playerType | string |\n\nReturns\n\n: `void`\n\n### playerType\n\n\u003cbr /\u003e\n\nThe partner provided player type.\n\nReturns\n\n: `string`\n\n### playerVersion\n\n\u003cbr /\u003e\n\nSets the partner provided player version. This should be used to specify\nthe version of the partner player. Any player version string longer than\n200 characters will be ignored and excluded from the nonce.\n\n| #### Parameter ||\n|---------------|--------|\n| playerVersion | string |\n\nReturns\n\n: `void`\n\n### playerVersion\n\n\u003cbr /\u003e\n\nThe partner provided player version.\n\nReturns\n\n: `string`\n\n### ppid\n\n\u003cbr /\u003e\n\nSets the publisher provided ID. Any PPID longer than 200 characters will be\nignored and excluded from the nonce.\n\n| #### Parameter ||\n|------|--------|\n| ppid | string |\n\nReturns\n\n: `void`\n\n### ppid\n\n\u003cbr /\u003e\n\nThe publisher provided ID.\n\nReturns\n\n: `string`\n\n### sessionId\n\nstring\n\nThe session ID is a temporary random ID. It is used exclusively for\nfrequency capping. A session ID must be a UUID.\n\n### url\n\nstring\n\nThe URL to which the ads will be targeted. By default, this is the same\nas the page that will display the ads, but it may be manually set.\n\n### videoHeight\n\nnumber\n\nThe height of the ad video element.\n\n### videoWidth\n\nnumber\n\nThe width of the ad video element."]]