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

StarPlayer PIP Delegate (기본 플레이어만 지원)