GCKSession 類別
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
沿用 NSObject。
沿用自 GCKCastSession。
- (instancetype) initWithDevice: |
|
(GCKDevice *) |
device |
traits: |
|
(nullable GCKSessionTraits *) |
traits |
sessionID: |
|
(nullable NSString *) |
sessionID |
|
|
| |
為預設裝置初始化新的工作階段物件 (含預設選項)。
- Parameters
-
device | The device. |
traits | The session traits. |
sessionID | The session ID of an existing session, if this object will be used to resume a session; otherwise nil if it will be used to start a new session. |
- (instancetype) initWithDevice: |
|
(GCKDevice *) |
device |
traits: |
|
(nullable GCKSessionTraits *) |
traits |
sessionID: |
|
(nullable NSString *) |
sessionID |
sessionOptions: |
|
(nullable GCKSessionOptions *) |
sessionOptions |
|
|
| |
針對特定裝置初始化新的工作階段物件。
- Parameters
-
device | The device. |
traits | The session traits. |
sessionID | The session ID of an existing session, if this object will be used to resume a session; otherwise nil if it will be used to start a new session. |
sessionOptions | The session options, if any; otherwise nil . |
- 辛策
- 4.0
設定裝置的音量。
這是非同步作業。預設的實作方式是失敗,導致發生 GCKErrorCodeSupportedFeature 錯誤;
- Parameters
-
- 傳回
- 用於追蹤要求的 GCKRequest 物件。
- 辛策
- 3.4;在先前的架構版本中,此方法會傳回
void
。
設定裝置的靜音狀態。
這是非同步作業。預設的實作方式是失敗,導致發生 GCKErrorCodeSupportedFeature 錯誤;
- Parameters
-
- 傳回
- 用於追蹤要求的 GCKRequest 物件。
- 辛策
- 3.4;在先前的架構版本中,此方法會傳回
void
。
結束具有指定動作的工作階段。
這是非同步作業。必須使用子類別覆寫。
- Parameters
-
action | The action to take when ending the session; see GCKSessionEndAction for more details. |
由「GCKSession(Protected)」類別提供。
- (void) notifyDidStartWithSessionID: |
|
(NSString *) |
sessionID |
|
- (void) notifyDidFailToStartWithError: |
|
(NSError *) |
error |
|
- (void) notifyDidEndWithError: |
|
(nullable NSError *) |
error |
willTryToResume: |
|
(BOOL) |
willTryToResume |
|
|
| |
由子類別呼叫,以通知架構已經結束工作階段。
- Parameters
-
error | The error that caused the session to end, if any. Should be nil if the session was ended intentionally. |
willTryToResume | Whether the session will try to resume itself automatically. |
由「GCKSession(Protected)」類別提供。
- (void) notifyDidReceiveDeviceVolume: |
|
(float) |
volume |
muted: |
|
(BOOL) |
muted |
|
|
| |
子類別呼叫時,系統會通知架構從裝置接收到更新的裝置音量和靜音狀態。
- Parameters
-
volume | The device's current volume. Must be in the range [0, 1.0]; |
muted | The device's current mute state. |
由「GCKSession(Protected)」類別提供。
- (void) notifyDidReceiveDeviceStatus: |
|
(nullable NSString *) |
statusText |
|
- (GCKSessionOptions*) sessionOptions |
|
readnonatomicstrong |
- (NSString*) deviceStatusText |
|
readnonatomiccopy |
- (float) currentDeviceVolume |
|
readnonatomicassign |
- (BOOL) currentDeviceMuted |
|
readnonatomicassign |
目前的媒體中繼資料 (如果有的話)。
如果工作階段不支援媒體命名空間,或是接收器目前未載入媒體,則值為 nil
。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2022-12-06 (世界標準時間)。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"缺少我需要的資訊"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"過於複雜/步驟過多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"過時"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻譯問題"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/程式碼問題"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"容易理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"確實解決了我的問題"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]