我们正在更新 Data API,以便与 YouTube 统计 Shorts 短视频观看次数的方式保持一致。
了解详情
Watermarks
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
watermark
资源用于标识在指定频道的视频播放期间显示的图片。您还可以指定图片要关联的目标频道以及时间详情,以确定水印何时在视频播放期间出现以及显示的时间长度。
方法
对于 watermarks
资源,该 API 支持以下方法:
- 设置
- 将水印图片上传到 YouTube 并为频道设置水印。
- unset
- 删除频道的水印图片。
立即试用。
属性
下表定义了此资源中显示的属性:
属性 |
timing |
object
timing 对象会封装在视频播放期间显示频道水印图片的时间信息。 |
timing.type |
string
用于确定水印图片在视频播放过程中何时显示的时间方法。如果值为 offsetFromStart ,则 offsetMs 字段表示相对于视频开头的偏移量。如果值为 offsetFromEnd ,则 offsetMs 字段表示相对于视频末尾的偏移量。 |
timing.offsetMs |
unsigned long
时差(以毫秒为单位),用于确定推广内容在视频播放期间的显示时间。type 属性的值可确定偏移值是从视频开始位置还是结束位置处开始计算的。 |
timing.durationMs |
unsigned long
水印图片应显示的时长(以毫秒为单位)。 |
position |
object
position 对象封装了视频中将显示水印图片的空间位置信息。 |
position.type |
string
推广商品在视频播放器中的排名方式。
此属性的有效值包括: |
position.cornerPosition |
string
推荐商品显示在播放器的一角。该商品始终显示在播放器的右上角。
此属性的有效值包括: |
imageUrl |
string
频道水印图片的网址。YouTube 将生成此网址,并在对 watermark.set 请求的 API 响应中返回此网址。 |
imageBytes |
bytes
水印图片的大小(以字节为单位)。 |
targetChannelId |
string
水印图片关联的频道的 YouTube 频道 ID。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-04-26。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-04-26。"],[[["A watermark resource displays an image during a channel's video playbacks, with the option to link to a target channel."],["The API provides `set` and `unset` methods to upload and delete watermark images respectively."],["The `timing` object controls when a watermark appears, using `type` to determine if it's measured from the start or end of a video and `offsetMs` for the time offset, with `durationMs` defining its display length."],["The `position` object defines the watermark's location within the video, with `cornerPosition` specifically determining the corner."],["The `targetChannelId` property is used to indicate the YouTube channel ID that the image links to when interacted with."]]],["A watermark resource is an image displayed during a channel's video playbacks. Key actions include setting a watermark by uploading an image and specifying its `targetChannelId` for linking. The `timing` object defines when the image appears using `type`, `offsetMs`, and `durationMs`. The `position` object, set to 'corner', determines the spatial location, specifically `topRight`. Watermarks can be removed using the `unset` method. The API response provides an `imageUrl` and `imageBytes`.\n"]]