StarPlayerViewDelegate
Objective-C
@protocol StarPlayerViewDelegate<NSObject>
@optional
/**
* 플레이어 준비 상태 변경
* @param openState 플레이어 준비 상태 (idle, ready)
* @see StarPlayerOpenState*/
- (void)starPlayerView:(StarPlayerView *_Nonnull)view openStateChanged:(StarPlayerOpenState)openState;
/**
* 플레이어 재생 상태 변경
* @param playState 플레이어 재생 상태
* @see StarPlayerPlayState*/
- (void)starPlayerView:(StarPlayerView *_Nonnull)view playStateChanged:(StarPlayerPlayState)playState;
/**
* 플레이어 프로그레스 변경
* @param currentPlayTime 현재 재생시간 (millisec 까지 표시)
* @param progressValue 프로그레스 값 (min:0 ~ max:1) */
- (void)starPlayerView:(StarPlayerView *_Nonnull)view playerPlayTime:(CGFloat)currentPlayTime progressValueChanged:(CGFloat)progressValue;
/**
* 플레이어 로드된 재생 시간 범위 (스트리밍용)
* @note
* 기본플레이어만 지원
* @param progressValue 프로그레스 값 (min:0 ~ max:1) */
- (void)starPlayerView:(StarPlayerView *_Nonnull)view playerPlayTimeRangeOfLoaded:(CGFloat)progressValue;
/**
* 플레이어 볼륨 변경 (min:0 ~ max:1)
* @note
* playState >= PlayerStateReadyToPlay 일 때 동작
* @param volumeValue 볼륨 값 */
- (void)starPlayerView:(StarPlayerView *_Nonnull)view playerVolumeChanged:(CGFloat)volumeValue;
/**
* 플레이어 배속 변경
* @param rate 비디오 배속 */
- (void)starPlayerView:(StarPlayerView *_Nonnull)view playerRateChanged:(CGFloat)rate;
/**
* 오디오 지연 시간 변경
* @note
* 오디오 싱크를 맞출때 사용
* 기본 플레이어는 지원하지 않음
* @param delay 오디오 지연 시간 (millisec) */
- (void)starPlayerView:(StarPlayerView *_Nonnull)view playerAudioDelayChanged:(NSInteger)delay;
/**
* 플레이어 버퍼링 상태 변경
* @param isBuffering 버퍼링 여부 */
- (void)starPlayerView:(StarPlayerView *_Nonnull)view playerBufferingStateChanged:(BOOL)isBuffering;
/**
* 플레이어 화면 드래그
* @param state 드래그 상태
* @param delta 이동값 */
- (void)starPlayerView:(StarPlayerView *_Nonnull)view screenDragState:(StarPlayerViewScreenDragState)state draggingValueChanged:(CGFloat)delta;
/**
* 플레이어 비디오 영역 변경
* 화면 회전 등의 비디오 사이즈가 변경되는 이벤트가 있을 때 발생
* ex) 화면 생성, 화면회전
* @param videoRect video rect */
- (void)starPlayerView:(StarPlayerView *_Nonnull)view videoRectChanged:(CGRect) videoRect;
/**
* 플레이어 비디오 영역 변경
* 화면 회전 등의 비디오 사이즈가 변경되는 이벤트가 있을 때 발생
* ex) 화면 생성, 화면회전
* @param videoRect video rect
* @param frame video frame */
- (void)starPlayerView:(StarPlayerView *_Nonnull)view videoRectChanged:(CGRect) videoRect frame:(CGRect)frame;
/**
* 플레이어 비디오 Zoom scale 변경
* 화면 확대/축소 이벤트가 발생했을 때
* @note
* videoZoomEnabled, starPlayerHandlePinch 등의 zoom 기능을 사용했을 때만 호출됨
* @param currentScale 현재 video scale
* @param zoomed zoom 여부
* @see videoZoomEnabled
* @see starPlayerHandlePinch */
//- (void)starPlayerView:(StarPlayerView *_Nonnull)view videoScaleChanged:(double) currentScale zoomed:(BOOL)zoomed;
/**
* 플레이어 썸네일 이미지 가져오기 완료
* @param image 썸네일 이미지 */
- (void)starPlayerView:(StarPlayerView *_Nonnull)view completedFetchingThumbnail:(CGImageRef _Nullable) image;
/**
* 플레이어 Event 발생
* @param response 결과
* @param method 이벤트 (bengin_content, playing_content, end_content)
* @param parameters request parameters (학습이력 데이터)
* @param error 이벤트 전송 실패 error
* @see eventEnabled */
- (void)starPlayerView:(StarPlayerView *_Nonnull)view playerEventOccurred:(NSDictionary*_Nullable)response withEventMethod:(NSString*_Nonnull)method requestParameters:(NSDictionary*_Nullable)parameters error:(NSError*_Nullable)error;
/**
* 플레이어 SCMS Block 발생
* @param info block정보 */
- (void)starPlayerView:(StarPlayerView *_Nonnull)view playerScmsBlockOccurred:(StarPlayerScmsBlock*_Nullable)info;
/**
* 플레이어 에러 발생
* @param error 에러 내용 */
- (void)starPlayerView:(StarPlayerView *_Nonnull)view errorOccurred:(StarPlayerError *_Nonnull)error;
/**
* 로드된 HLS Stream List
* @note
* HLS MasterPlaylist에서 #EXT-X-STREAM-INF 태그 정보를 담은 배열
* @param streamList stream list */
- (void)starPlayerView:(StarPlayerView *_Nonnull)view loadedHlsStreamList:(NSArray<StarPlayerHLSStream*>*_Nonnull)streamList;
/**
* 로드된 HLS Alternative Media List
* @note
* Media의 종류는 Audio, Video 두가지가 존재
* HLS MasterPlaylist에서 #EXT-X-MEDIA 태그 정보를 담은 배열
* @param mediaList alternative media list
*/
- (void)starPlayerView:(StarPlayerView *_Nonnull)view loadedHlsAlternativeMediaList:(NSArray<StarPlayerHLSAlternativeMedia*>*_Nonnull)mediaList;
/**
* 로드된 stream 정보
* @note
* 'auto' 모드 일 경우 네트워크 환경에 따라 stream이 변경됨
* @param stream 로드된 stream */
- (void)starPlayerView:(StarPlayerView *_Nonnull)view loadedHlsStream:(StarPlayerHLSStream*_Nonnull)stream;
#pragma mark - StarPlayer PIP Delegate (기본 플레이어만 지원)
/**
* PictureInPicture will start
* @note playing_content 이벤트 전송*/
- (void)starPlayerViewWillStartPictureInPicture:(StarPlayerView *_Nonnull)view;
/**
* PictureInPicture will stop
* @note playing_content 이벤트 전송*/
- (void)starPlayerViewWillStopPictureInPicture:(StarPlayerView *_Nonnull)view;
/**
* PictureInPicture did start */
- (void)starPlayerViewDidStartPictureInPicture:(StarPlayerView *_Nonnull)view;
/**
* PictureInPicture did stop */
- (void)starPlayerViewDidStopPictureInPicture:(StarPlayerView *_Nonnull)view;
/**
* PictureInPicture 중지, 사용자 인터페이스 복귀
* @note playing_content 이벤트 전송*/
- (void)starPlayerViewRestoreUserInterfaceForPictureInPictureStop:(StarPlayerView *_Nonnull)view;
/**
* PictureInPicture start failed */
- (void)starPlayerViewFailedToStartPictureInPictureWithError:(NSString *_Nullable)description;
@end
Swift
protocol StarPlayerViewDelegate : NSObjectProtocol
Undocumented
-
플레이어 준비 상태 변경
See
StarPlayerOpenStateDeclaration
Objective-C
- (void)starPlayerView:(StarPlayerView *_Nonnull)view openStateChanged:(StarPlayerOpenState)openState;Swift
optional func starPlayerView(_ view: StarPlayerView, openStateChanged openState: StarPlayerOpenState)Parameters
openState플레이어 준비 상태 (idle, ready)
-
플레이어 재생 상태 변경
See
StarPlayerPlayStateDeclaration
Objective-C
- (void)starPlayerView:(StarPlayerView *_Nonnull)view playStateChanged:(StarPlayerPlayState)playState;Swift
optional func starPlayerView(_ view: StarPlayerView, playStateChanged playState: StarPlayerPlayState)Parameters
playState플레이어 재생 상태
-
플레이어 프로그레스 변경
Declaration
Objective-C
- (void)starPlayerView:(StarPlayerView *_Nonnull)view playerPlayTime:(CGFloat)currentPlayTime progressValueChanged:(CGFloat)progressValue;Swift
optional func starPlayerView(_ view: StarPlayerView, playerPlayTime currentPlayTime: Double, progressValueChanged progressValue: Double)Parameters
currentPlayTime현재 재생시간 (millisec 까지 표시)
progressValue프로그레스 값 (min:0 ~ max:1)
-
플레이어 로드된 재생 시간 범위 (스트리밍용) @note 기본플레이어만 지원
Declaration
Objective-C
- (void)starPlayerView:(StarPlayerView *_Nonnull)view playerPlayTimeRangeOfLoaded:(CGFloat)progressValue;Swift
optional func starPlayerView(_ view: StarPlayerView, playerPlayTimeRangeOfLoaded progressValue: Double)Parameters
progressValue프로그레스 값 (min:0 ~ max:1)
-
플레이어 볼륨 변경 (min:0 ~ max:1) @note playState >= PlayerStateReadyToPlay 일 때 동작
Declaration
Objective-C
- (void)starPlayerView:(StarPlayerView *_Nonnull)view playerVolumeChanged:(CGFloat)volumeValue;Swift
optional func starPlayerView(_ view: StarPlayerView, playerVolumeChanged volumeValue: Double)Parameters
volumeValue볼륨 값
-
플레이어 배속 변경
Declaration
Objective-C
- (void)starPlayerView:(StarPlayerView *_Nonnull)view playerRateChanged:(CGFloat)rate;Swift
optional func starPlayerView(_ view: StarPlayerView, playerRateChanged rate: Double)Parameters
rate비디오 배속
-
오디오 지연 시간 변경 @note 오디오 싱크를 맞출때 사용 기본 플레이어는 지원하지 않음
Declaration
Objective-C
- (void)starPlayerView:(StarPlayerView *_Nonnull)view playerAudioDelayChanged:(NSInteger)delay;Swift
optional func starPlayerView(_ view: StarPlayerView, playerAudioDelayChanged delay: Int)Parameters
delay오디오 지연 시간 (millisec)
-
플레이어 버퍼링 상태 변경
Declaration
Objective-C
- (void)starPlayerView:(StarPlayerView *_Nonnull)view playerBufferingStateChanged:(BOOL)isBuffering;Swift
optional func starPlayerView(_ view: StarPlayerView, playerBufferingStateChanged isBuffering: Bool)Parameters
isBuffering버퍼링 여부
-
플레이어 화면 드래그
Declaration
Objective-C
- (void)starPlayerView:(StarPlayerView *_Nonnull)view screenDragState:(StarPlayerViewScreenDragState)state draggingValueChanged:(CGFloat)delta;Swift
optional func starPlayerView(_ view: StarPlayerView, screenDragState state: StarPlayerViewScreenDragState, draggingValueChanged delta: Double)Parameters
state드래그 상태
delta이동값
-
플레이어 비디오 영역 변경 화면 회전 등의 비디오 사이즈가 변경되는 이벤트가 있을 때 발생 ex) 화면 생성, 화면회전
Declaration
Objective-C
- (void)starPlayerView:(StarPlayerView *_Nonnull)view videoRectChanged:(CGRect)videoRect;Swift
optional func starPlayerView(_ view: StarPlayerView, videoRectChanged videoRect: CGRect)Parameters
videoRectvideo rect
-
플레이어 비디오 영역 변경 화면 회전 등의 비디오 사이즈가 변경되는 이벤트가 있을 때 발생 ex) 화면 생성, 화면회전
Declaration
Objective-C
- (void)starPlayerView:(StarPlayerView *_Nonnull)view videoRectChanged:(CGRect)videoRect frame:(CGRect)frame;Swift
optional func starPlayerView(_ view: StarPlayerView, videoRectChanged videoRect: CGRect, frame: CGRect)Parameters
videoRectvideo rect
framevideo frame
-
플레이어 썸네일 이미지 가져오기 완료
Declaration
Objective-C
- (void)starPlayerView:(StarPlayerView *_Nonnull)view completedFetchingThumbnail:(id)image;Swift
optional func starPlayerView(_ view: StarPlayerView, completedFetchingThumbnail image: Any!)Parameters
image썸네일 이미지
-
플레이어 Event 발생
See
eventEnabledDeclaration
Objective-C
- (void)starPlayerView:(StarPlayerView *_Nonnull)view playerEventOccurred:(NSDictionary *_Nullable)response withEventMethod:(NSString *_Nonnull)method requestParameters:(NSDictionary *_Nullable)parameters error:(NSError *_Nullable)error;Swift
optional func starPlayerView(_ view: StarPlayerView, playerEventOccurred response: [AnyHashable : Any]?, withEventMethod method: String, requestParameters parameters: [AnyHashable : Any]?, error: Error?)Parameters
response결과
method이벤트 (bengin_content, playing_content, end_content)
parametersrequest parameters (학습이력 데이터)
error이벤트 전송 실패 error
-
플레이어 SCMS Block 발생
Declaration
Objective-C
- (void)starPlayerView:(StarPlayerView *_Nonnull)view playerScmsBlockOccurred:(StarPlayerScmsBlock *_Nullable)info;Swift
optional func starPlayerView(_ view: StarPlayerView, playerScmsBlockOccurred info: StarPlayerScmsBlock?)Parameters
infoblock정보
-
플레이어 에러 발생
Declaration
Objective-C
- (void)starPlayerView:(StarPlayerView *_Nonnull)view errorOccurred:(StarPlayerError *_Nonnull)error;Swift
optional func starPlayerView(_ view: StarPlayerView, errorOccurred error: StarPlayerError)Parameters
error에러 내용
-
로드된 HLS Stream List @note HLS MasterPlaylist에서 #EXT-X-STREAM-INF 태그 정보를 담은 배열
Declaration
Objective-C
- (void)starPlayerView:(StarPlayerView *_Nonnull)view loadedHlsStreamList:(NSArray<StarPlayerHLSStream *> *_Nonnull)streamList;Swift
optional func starPlayerView(_ view: StarPlayerView, loadedHlsStreamList streamList: [StarPlayerHLSStream])Parameters
streamListstream list
-
로드된 HLS Alternative Media List @note Media의 종류는 Audio, Video 두가지가 존재 HLS MasterPlaylist에서 #EXT-X-MEDIA 태그 정보를 담은 배열
Declaration
Objective-C
- (void)starPlayerView:(StarPlayerView *_Nonnull)view loadedHlsAlternativeMediaList: (NSArray<StarPlayerHLSAlternativeMedia *> *_Nonnull)mediaList;Swift
optional func starPlayerView(_ view: StarPlayerView, loadedHlsAlternativeMediaList mediaList: [StarPlayerHLSAlternativeMedia])Parameters
mediaListalternative media list
-
로드된 stream 정보 @note ‘auto’ 모드 일 경우 네트워크 환경에 따라 stream이 변경됨
Declaration
Objective-C
- (void)starPlayerView:(StarPlayerView *_Nonnull)view loadedHlsStream:(StarPlayerHLSStream *_Nonnull)stream;Swift
optional func starPlayerView(_ view: StarPlayerView, loadedHlsStream stream: StarPlayerHLSStream)Parameters
stream로드된 stream
-
PictureInPicture will start
Note
playing_content 이벤트 전송Declaration
Objective-C
- (void)starPlayerViewWillStartPictureInPicture:(StarPlayerView *_Nonnull)view;Swift
optional func starPlayerViewWillStartPicture(inPicture view: StarPlayerView) -
PictureInPicture will stop
Note
playing_content 이벤트 전송Declaration
Objective-C
- (void)starPlayerViewWillStopPictureInPicture:(StarPlayerView *_Nonnull)view;Swift
optional func starPlayerViewWillStopPicture(inPicture view: StarPlayerView) -
PictureInPicture did start
Declaration
Objective-C
- (void)starPlayerViewDidStartPictureInPicture:(StarPlayerView *_Nonnull)view;Swift
optional func starPlayerViewDidStartPicture(inPicture view: StarPlayerView) -
PictureInPicture did stop
Declaration
Objective-C
- (void)starPlayerViewDidStopPictureInPicture:(StarPlayerView *_Nonnull)view;Swift
optional func starPlayerViewDidStopPicture(inPicture view: StarPlayerView) -
PictureInPicture 중지, 사용자 인터페이스 복귀
Note
playing_content 이벤트 전송Declaration
Objective-C
- (void)starPlayerViewRestoreUserInterfaceForPictureInPictureStop: (StarPlayerView *_Nonnull)view;Swift
optional func starPlayerViewRestoreUserInterfaceForPicture(inPictureStop view: StarPlayerView) -
PictureInPicture start failed
Declaration
Objective-C
- (void)starPlayerViewFailedToStartPictureInPictureWithError: (NSString *_Nullable)description;Swift
optional func starPlayerViewFailedToStartPictureInPictureWithError(_ description: String?)
StarPlayerViewDelegate Protocol Reference