개요
수신기 기기와의 세션을 나타내는 추상 기본 클래스입니다.
서브클래스는 start (GCKSession(Protected)), endAndStopCasting: (GCKSession(Protected)), suspendWithReason: (GCKSession(Protected)), resume (GCKSession(Protected)) 메서드를 구현해야 하며, 세션 상태의 해당 변경사항을 나타내기 위해 적절한 알림 메서드 (예: notifyDidStartWithSessionID: (GCKSession(Protected)))를 호출해야 합니다. 기기에서 이러한 작업을 지원하는 경우 서브클래스에서 setDeviceVolume: (GCKSession), setDeviceMuted: (GCKSession), remoteMediaClient를 구현할 수도 있습니다.
세션은 GCKSessionManager의 세션 메서드를 사용하여 생성되고 제어됩니다. 이 메서드는 적절한 GCKDeviceProvider를 사용하여 세션을 생성한 다음 세션 요청을 해당 GCKSession 객체에 위임합니다.
- 이후
- 3.0
NSObject를 상속합니다.
GCKCastSession에서 상속됩니다.
인스턴스 메서드 요약 | |
(instancetype) | - initWithDevice:traits:sessionID: |
지정된 기기의 새 세션 객체를 초기화합니다. 더보기 | |
(GCKRequest *) | - setDeviceVolume: |
기기의 볼륨을 설정합니다. 더보기 | |
(GCKRequest *) | - setDeviceMuted: |
기기의 음소거 상태를 설정합니다. 더보기 | |
(void) | - start |
세션을 시작합니다. 더보기 | |
(void) | - endAndStopCasting: |
세션을 종료합니다. 더보기 | |
(void) | - suspendWithReason: |
지정된 이유로 세션을 일시중지합니다. 더보기 | |
(void) | - resume |
세션을 재개합니다. 더보기 | |
(void) | - notifyDidStartWithSessionID: |
세션이 시작되었음을 프레임워크에 알리기 위해 하위 클래스에서 호출합니다. 더보기 | |
(void) | - notifyDidFailToStartWithError: |
세션 시작에 실패했음을 프레임워크에 알리기 위해 하위 클래스에서 호출합니다. 더보기 | |
(void) | - notifyDidResume |
세션이 재개되었음을 프레임워크에 알리기 위해 하위 클래스에서 호출합니다. 더보기 | |
(void) | - notifyDidSuspendWithReason: |
세션이 일시중지되었음을 프레임워크에 알리기 위해 하위 클래스에서 호출합니다. 더보기 | |
(void) | - notifyDidEndWithError: |
세션이 종료되었음을 프레임워크에 알리기 위해 하위 클래스에서 호출합니다. 더보기 | |
(void) | - notifyDidReceiveDeviceVolume:muted: |
업데이트된 기기 볼륨 및 음소거 상태가 기기에서 수신되었음을 프레임워크에 알리기 위해 하위 클래스에서 호출합니다. 더보기 | |
(void) | - notifyDidReceiveDeviceStatus: |
업데이트된 상태가 기기에서 수신되었음을 프레임워크에 알리기 위해 하위 클래스에서 호출됩니다. 더보기 | |
숙박 시설 요약 | |
GCKDevice * | device |
이 세션과 연결된 기기입니다. 더보기 | |
NSString * | sessionID |
현재 세션 ID입니다(있는 경우). 더보기 | |
GCKConnectionState | connectionState |
현재 세션 연결 상태입니다. 더보기 | |
BOOL | suspended |
세션이 현재 일시중지되었는지 여부를 나타내는 플래그입니다. 더보기 | |
NSString * | deviceStatusText |
현재 기기 상태 텍스트입니다. 더보기 | |
GCKSessionTraits * | traits |
세션 특성입니다. 더보기 | |
float | currentDeviceVolume |
현재 기기 볼륨입니다. 범위는 [0.0, 1.0]입니다. 더보기 | |
BOOL | currentDeviceMuted |
현재 기기 음소거 상태입니다. 더보기 | |
GCKRemoteMediaClient * | remoteMediaClient |
이 세션에서 미디어 재생을 제어하는 데 사용할 수 있는 GCKRemoteMediaClient 객체입니다. 더보기 | |
GCKMediaMetadata * | mediaMetadata |
현재 미디어 메타데이터입니다(있는 경우). 더보기 | |
메소드 세부정보
- (instancetype) initWithDevice: | (GCKDevice *) | device | |
traits: | (GCKSessionTraits *) | traits | |
sessionID: | (NSString *__nullable) | 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.
- (GCKRequest *) setDeviceVolume: | (float) | volume |
기기의 볼륨을 설정합니다.
이 작업은 비동기 작업입니다. 기본 구현은 GCKErrorCodeUnsupportedFeature 오류와 함께 요청이 실패하는 no-op입니다.
- Parameters
-
volume The new volume.
- 반환 값
- 요청을 추적하는 GCKRequest 객체입니다.
- 이후
- 3.4. 이전 프레임워크 버전에서는 이 메서드가
void
를 반환했습니다.
- (GCKRequest *) setDeviceMuted: | (BOOL) | muted |
기기의 음소거 상태를 설정합니다.
이 작업은 비동기 작업입니다. 기본 구현은 GCKErrorCodeUnsupportedFeature 오류와 함께 요청이 실패하는 no-op입니다.
- Parameters
-
muted The new mute state.
- 반환 값
- 요청을 추적하는 GCKRequest 객체입니다.
- 이후
- 3.4. 이전 프레임워크 버전에서는 이 메서드가
void
를 반환했습니다.
- (void) start |
- (void) endAndStopCasting: | (BOOL) | stopCasting |
세션을 종료합니다.
이 작업은 비동기 작업입니다. 서브클래스에서 재정의해야 합니다.
- Parameters
-
stopCasting Whether to stop casting content to the receiver.
GCKSession(Protected) 카테고리에서 제공합니다.
- (void) suspendWithReason: | (GCKConnectionSuspendReason) | reason |
- (void) resume |
- (void) notifyDidStartWithSessionID: | (NSString *) | sessionID |
세션이 시작되었음을 프레임워크에 알리기 위해 하위 클래스에서 호출합니다.
- Parameters
-
sessionID The session's unique ID.
GCKSession(Protected) 카테고리에서 제공합니다.
- (void) notifyDidFailToStartWithError: | (NSError *) | error |
세션 시작에 실패했음을 프레임워크에 알리기 위해 하위 클래스에서 호출합니다.
- Parameters
-
error The error that occurred.
GCKSession(Protected) 카테고리에서 제공합니다.
- (void) notifyDidResume |
세션이 재개되었음을 프레임워크에 알리기 위해 하위 클래스에서 호출합니다.
GCKSession(Protected) 카테고리에서 제공합니다.
- (void) notifyDidSuspendWithReason: | (GCKConnectionSuspendReason) | reason |
세션이 일시중지되었음을 프레임워크에 알리기 위해 하위 클래스에서 호출합니다.
- Parameters
-
reason The reason for the suspension.
GCKSession(Protected) 카테고리에서 제공합니다.
- (void) notifyDidEndWithError: | (NSError *__nullable) | error |
세션이 종료되었음을 프레임워크에 알리기 위해 하위 클래스에서 호출합니다.
- Parameters
-
error The error that caused the session to end, if any. Should be nil
if the session was ended intentionally.
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: | (NSString *__nullable) | statusText |
업데이트된 상태가 기기에서 수신되었음을 프레임워크에 알리기 위해 하위 클래스에서 호출됩니다.
- Parameters
-
statusText The new status.
GCKSession(Protected) 카테고리에서 제공합니다.
숙박 시설 세부정보
|
readnonatomicstrong |
이 세션과 연결된 기기입니다.
|
readnonatomiccopy |
현재 세션 ID입니다(있는 경우).
|
readnonatomicassign |
현재 세션 연결 상태입니다.
|
readnonatomicassign |
세션이 현재 일시중지되었는지 여부를 나타내는 플래그입니다.
|
readnonatomiccopy |
현재 기기 상태 텍스트입니다.
|
readnonatomiccopy |
세션 특성입니다.
|
readnonatomicassign |
현재 기기 볼륨입니다. 범위는 [0.0, 1.0]입니다.
|
readnonatomicassign |
현재 기기 음소거 상태입니다.
|
readnonatomicstrong |
이 세션에서 미디어 재생을 제어하는 데 사용할 수 있는 GCKRemoteMediaClient 객체입니다.
세션이 시작되기 전이거나 세션에서 GCKRemoteMediaClient API를 지원하지 않는 경우 nil
입니다. GCKRemoteMediaClient 인터페이스를 제공하는 서브클래스는 getter 메서드를 재정의해야 합니다.
|
readnonatomicstrong |
현재 미디어 메타데이터입니다(있는 경우).
세션에서 미디어 네임스페이스를 지원하지 않거나 현재 리시버에 로드된 미디어가 없는 경우 nil
입니다.