GCKDevice 类
继承 NSObject、<NSCopy> 和 <NSSecureCoding>。
- (BOOL) isSameDeviceAs: |
|
(const GCKDevice *) |
other |
|
用于测试此设备是否指代另一台设备。
如果两个 GCKDevice 对象具有相同的类别、设备 ID、IP 地址、服务端口和协议版本,则返回 YES
。
- (BOOL) hasCapabilities: |
|
(GCKDeviceCapabilities) |
deviceCapabilities |
|
如果设备支持所有给定功能,则返回 YES
。
- Parameters
-
deviceCapabilities | A bitwise-OR of one or more of the GCKDeviceCapabilities constants. |
- (void) setAttribute: |
|
(NSObject< NSSecureCoding > *) |
attribute |
forKey: |
|
(NSString *) |
key |
|
|
| |
设置对象中的任意属性。
自定义设备提供商可以使用它来存储非 Cast 设备的设备特定信息。
- Parameters
-
attribute | The attribute value, which must be key-value coding compliant, and cannot be nil . |
key | The key that identifies the attribute. The key is an arbitrary string. It cannot be nil . |
- (nullable NSObject<NSSecureCoding> *) attributeForKey: |
|
(NSString *) |
key |
|
在对象中查找属性。
- Parameters
-
key | The key that identifies the attribute. The key is an arbitrary string. It cannot be nil . |
- 返回
- 属性的值,如果此类属性不存在,则为
nil
。
- (void) removeAttributeForKey: |
|
(NSString *) |
key |
|
从对象中移除属性。
- Parameters
-
key | The key that identifies the attribute. The key is an arbitrary string. It cannot be nil . |
- (void) removeAllAttributes |
|
|
|
+ (NSString *) deviceCategoryForDeviceUniqueID: |
|
(NSString *) |
deviceUniqueID |
|
设备的 IP 地址。
在发出网络请求时使用。
- 开始时间
- 4.2
- (NSString*) friendlyName |
|
readwritenonatomiccopy |
设备的易记名称。
这是可由用户指定的名称,例如“Living Room”。
- (GCKDeviceStatus) status |
|
readwritenonatomicassign |
当前正在运行的接收器应用报告的状态文本(如果有)。
- (NSString*) deviceVersion |
|
readwritenonatomiccopy |
- (BOOL) isOnLocalNetwork |
|
readnonatomicassign |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-02。
[null,null,["最后更新时间 (UTC):2023-12-02。"],[[["The `GCKDevice` class represents a Cast receiver device on the network, providing information such as its name, IP address, capabilities, and status."],["It offers methods to check device capabilities, compare devices, and manage device-specific attributes."],["Developers can access properties like `friendlyName`, `modelName`, `deviceID`, and `icons` to identify and interact with the device."],["The `GCKDevice` class helps in discovering and managing Cast-enabled devices for seamless integration with Cast applications."],["It includes properties like `networkAddress`, `servicePort` and `deviceVersion` for handling network communication and device identification."]]],[]]