<GCKUIImagePicker> 协议
用于从 GCKMediaMetadata 对象中选择特定用途的图片的对象。
该框架在内部使用默认实现,始终从元数据中选择第一张图片用于所有用途。应用可以通过设置 GCKCastContext::imagePicker 属性来提供自定义实现。
- 开始时间
- 3.0
此类继承 <NSObject>。
从媒体元数据返回指定类型的图片。
- Parameters
-
imageHints | The hints about how to pick the image. |
metadata | The media metadata to pick from. |
- 返回
- 所选图片,或者如果请求类型没有合适的图片,则为
nil
。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-01。
[null,null,["最后更新时间 (UTC):2023-12-01。"],[[["`GCKUIImagePicker` protocol helps select images from `GCKMediaMetadata` objects for display within the Google Cast framework."],["By default, the first image in the metadata is used, but apps can customize image selection via `GCKCastContext::imagePicker`."],["`getImageWithHints:fromMetadata:` method fetches a specific image type from the metadata based on provided hints."],["If no suitable image is found matching the desired type, this method will return `nil`."]]],["The `GCKUIImagePicker` protocol selects an image from `GCKMediaMetadata`. It has a default implementation that selects the first image. Custom implementations can be provided via `GCKCastContext::imagePicker`. The key method, `getImageWithHints:fromMetadata:`, retrieves an image based on `GCKUIImageHints` from provided metadata. It returns the selected `GCKImage` or `nil` if no suitable image is found. This enables picking specific image types for different purposes.\n"]]