Để thảo luận và đưa ra ý kiến phản hồi về các sản phẩm của chúng tôi, hãy tham gia kênh Discord chính thức của Ad Manager trong máy chủ Cộng đồng quảng cáo và đo lường của Google.
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.
StreamRequest
classpublic
Một lớp để chỉ định các thuộc tính của yêu cầu truyền trực tuyến.
Hàm dựng
StreamRequest
new
StreamRequest()
Thuộc tính
adTagParameters
(Đối tượng rỗng hoặc không rỗng có thuộc tính chuỗi)
Bạn có thể ghi đè một số thông số thẻ quảng cáo nhất định trên yêu cầu luồng. Giá trị được thêm phải là chuỗi.
Bài viết
Cung cấp thông số nhắm mục tiêu cho luồng của bạn cung cấp thêm thông tin.
Bạn có thể sử dụng các tham số dai-ot và dai-ov cho tuỳ chọn ưu tiên biến thể luồng.
Hãy xem phần
Ghi đè thông số biến thể trong luồng để biết thêm thông tin.
apiKey
chuỗi
Khoá API yêu cầu luồng. Mã này được định cấu hình thông qua
Giao diện người dùng quản trị DFP và được cung cấp cho nhà xuất bản để mở khoá nội dung của họ.
API này xác minh các ứng dụng đang cố gắng truy cập vào nội dung.
authToken
chuỗi
Mã uỷ quyền yêu cầu truyền phát. Được dùng thay cho khoá API để cho phép nội dung nghiêm ngặt hơn. Nhà xuất bản có thể kiểm soát các quyền truy cập vào luồng nội dung riêng lẻ dựa trên mã thông báo này.
Các chế độ cài đặt liên quan đến quy định và sự đồng ý.
định dạng
chuỗi
Định dạng luồng cần yêu cầu. Chấp nhận các giá trị chuỗi sau:
hls (mặc định)
dash
.
Nếu bạn cung cấp một chuỗi không hợp lệ, thì giá trị mặc định sẽ được sử dụng.
networkCode
chuỗi
Mã mạng của nhà xuất bản thực hiện yêu cầu truyền trực tuyến này. Bạn bắt buộc phải có mã mạng cho các yêu cầu phát trực tuyến phân phát nhóm (PodStreamRequest hoặc PodVodStreamRequest) và các yêu cầu phát trực tuyến nối ghép trên đám mây (VideoStitcherLiveStreamRequest hoặc VideoStitcherVodStreamRequest). Bạn không bắt buộc phải có mã mạng nhưng nên có mã này cho các yêu cầu phát trực tuyến dịch vụ đầy đủ (LiveStreamRequest hoặc VODStreamRequest). Mã này được dùng để áp dụng các chế độ cài đặt đã chọn trong giao diện người dùng Ad Manager, chẳng hạn như bật quảng cáo bị hạn chế có lập trình. Đối với tính năng phân phát nhóm và ghép nối trên đám mây, mã này cũng được dùng để xác định vị trí và phát luồng. Để tìm mã mạng, hãy xem bài viết này.
senderCanSkip
boolean
(Các) người gửi có hiển thị giao diện người dùng bỏ qua CAF cho người dùng cuối hay không.
Dùng để bật quảng cáo có thể bỏ qua.
streamActivityMonitorId
chuỗi
Mã nhận dạng dùng để gỡ lỗi luồng bằng trình giám sát hoạt động của luồng.
Mã này được dùng để cung cấp một cách thuận tiện cho phép nhà xuất bản tìm thấy
nhật ký luồng trong công cụ theo dõi hoạt động luồng.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-21 UTC."],[[["\u003cp\u003e\u003ccode\u003eStreamRequest\u003c/code\u003e class defines properties for requesting ad-integrated streams.\u003c/p\u003e\n"],["\u003cp\u003eIt utilizes \u003ccode\u003eapiKey\u003c/code\u003e or \u003ccode\u003eauthToken\u003c/code\u003e for content authorization and access control.\u003c/p\u003e\n"],["\u003cp\u003ePublishers can customize ad parameters, stream format (\u003ccode\u003ehls\u003c/code\u003e or \u003ccode\u003edash\u003c/code\u003e), and consent settings.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003enetworkCode\u003c/code\u003e is crucial for Pod/Cloud stitching requests & applying Ad Manager settings.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003esenderCanSkip\u003c/code\u003e enables skippable ads and \u003ccode\u003estreamActivityMonitorId\u003c/code\u003e aids in stream debugging.\u003c/p\u003e\n"]]],["The `StreamRequest` class defines stream properties, including: `adTagParameters` for overriding ad tag settings, `apiKey` and `authToken` for content access authorization, and `consentSettings` for regulatory compliance. The `format` property specifies the stream type (`hls` or `dash`). `networkCode` is for publisher network identification, with requirements depending on the stream type. `senderCanSkip` enables skippable ads, and `streamActivityMonitorId` is used for debugging through stream activity monitoring.\n"],null,["# Class: StreamRequest\n\nStreamRequest\n=============\n\nclass public\n\nA class for specifying properties of the stream request.\n\nConstructor\n-----------\n\n### StreamRequest\n\nnew\nStreamRequest()\n\nProperties\n----------\n\n### adTagParameters\n\n(null or non-null Object with string properties)\n\nYou can override a limited set of ad tag parameters on your stream\nrequest. Values added must be strings.\n[Supply targeting parameters to your stream](//support.google.com/dfp_premium/answer/7320899) provides more information.\nYou can use the dai-ot and dai-ov parameters for stream variant\npreference.\nSee [Override Stream Variant Parameters](//support.google.com/dfp_premium/answer/7320898) for more information.\n\n### apiKey\n\nstring\n\nThe stream request API key. It's configured through the\n[DFP Admin UI](//support.google.com/dfp_premium/answer/6381445) and provided to the publisher to unlock their content.\nIt verifies the applications that are attempting to access the content.\n\n### authToken\n\nstring\n\nThe stream request authorization token. Used in place of the API key\nfor stricter content authorization. The publisher can control individual\ncontent streams authorizations based on this token.\n\n### consentSettings\n\n(null or non-null [ConsentSettings](/ad-manager/dynamic-ad-insertion/sdk/cast/reference/js/ConsentSettings))\n\nSettings related to regulations and consent.\n\n### format\n\nstring\n\nThe stream format to request. Accepts the following string values:\n\n- `hls` (default)\n- `dash`\n\n. If an invalid string is provided, the default value will be used. Note: Values must be lowercase.\n\n### networkCode\n\nstring\n\nThe network code for the publisher making this stream request. Network\ncodes are required for Pod serving stream requests (PodStreamRequest or\nPodVodStreamRequest) and Cloud stitching stream requests\n(VideoStitcherLiveStreamRequest or VideoStitcherVodStreamRequest) and\nare optional but recommended for Full service stream requests\n(LiveStreamRequest or VODStreamRequest). The code is used to apply\nsettings selected in the Ad Manager UI such as programmatic limited\nads enablement. For Pod serving and Cloud stitching it is also used to\nlocate and play the stream. To find the network code, see [this article](//support.google.com/admanager/answer/7674889).\n\n### senderCanSkip\n\nboolean\n\nWhether or not the sender(s) display a CAF skip UI to the end user.\nUsed to enable skippable ads.\n\n### streamActivityMonitorId\n\nstring\n\nThe ID to be used to debug the stream with the stream activity monitor.\nThis is used to provide a convenient way to allow publishers to find a\nstream log in the stream activity monitor tool."]]