AliyunIPlayer
@protocol AliyunIPlayer <NSObject>
* The protocol of players.
-
* Starts playback.
@return ALIVC_COMMON_RETURN_SUCCESS if the invocation is successful. ALIVC_COMMON_INVALID_STATE if the player’s state is incorrect. ALIVC_COMMON_INVALID_PARAM if the parameter setting is incorrect. ALIVC_FRAMEWORK_AUDIO_RENDER_INIT_SPEAKER_FAILED if an exception occurred during initialization. ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID ALIVC_FRAMEWORK_RENDER_ERROR_EDITORLAYOUT_INVALID_SIZE ALIVC_FRAMEWORK_VIDEO_ENCODER_ERROR_STATE
Declaration
Objective-C
- (int)play;
-
* Seeks to a point in time.
Declaration
Objective-C
- (int)seek:(float)time;
Parameters
time
The point in time. Unit: seconds. @return ALIVC_COMMON_RETURN_SUCCESS if the invocation is successful. ALIVC_COMMON_INVALID_STATE if the player’s state is incorrect. ALIVC_FRAMEWORK_AUDIO_PROCESS_SEEK_FAILED
-
* Draws a frame at a point in time.
Declaration
Objective-C
- (int)draw:(float)time;
Parameters
time
The point in time. Unit: seconds. @return ALIVC_COMMON_RETURN_SUCCESS if the invocation is successful. ALIVC_COMMON_INVALID_STATE if the player’s state is incorrect.
-
* Pauses playback.
@return ALIVC_COMMON_RETURN_SUCCESS if the invocation is successful. ALIVC_COMMON_INVALID_STATE if the player’s state is incorrect.
Declaration
Objective-C
- (int)pause;
-
* Resumes playback.
@return ALIVC_COMMON_RETURN_SUCCESS if the invocation is successful. ALIVC_COMMON_INVALID_STATE if the player’s state is incorrect.
Declaration
Objective-C
- (int)resume;
-
* Gets whether playback is in progress.
Declaration
Objective-C
- (BOOL)isPlaying;
Return Value
Whether playback is in progress.
-
* Restarts playback.
@return ALIVC_COMMON_RETURN_SUCCESS if the invocation is successful. ALIVC_COMMON_INVALID_STATE if the player’s state is incorrect. ALIVC_COMMON_INVALID_PARAM if the parameter setting is incorrect. ALIVC_FRAMEWORK_AUDIO_RENDER_INIT_SPEAKER_FAILED if an exception occurred during initialization. ALIVC_FRAMEWORK_VIDEO_ENCODER_ERROR_STATE if the encoder’s state is incorrect. ALIVC_FRAMEWORK_RENDER_ERROR_SCENE_INVALID ALIVC_FRAMEWORK_RENDER_ERROR_EDITORLAYOUT_INVALID_SIZE
Declaration
Objective-C
- (int)replay;
-
* Stops playback.
@return ALIVC_COMMON_RETURN_SUCCESS if the invocation is successful. ALIVC_COMMON_INVALID_STATE if the player’s state is incorrect.
Declaration
Objective-C
- (int)stop;
-
* Gets the duration of the playback timeline.
Unit: seconds.
Declaration
Objective-C
- (double)getDuration;
Return Value
The duration of the playback timeline.
-
* Gets the current position on the playback timeline.
Unit: seconds.
Declaration
Objective-C
- (double)getCurrentTime;
-
* Gets the duration of the video stream.
Unit: seconds.
Declaration
Objective-C
- (double)getStreamDuration;
Return Value
The duration of the video stream.
-
* Gets the current position on the video stream.
Unit: seconds.
Declaration
Objective-C
- (double)getCurrentStreamTime;
-
* Gets the start time of a video clip on the playback timeline.
Declaration
Objective-C
- (double)getClipStartTimeAtIndex:(int)idx;
Parameters
idx
The index of a video clip.
Return Value
The start time in seconds.
-
* Sets the frame rate of the player.
Default value: 30 fps. Maximum value: 60 fps. It is recommended to set a value greater than 20.
Declaration
Objective-C
- (void)setRefreshFps:(double)fps;
Parameters
fps
The frame rate.
-
Deprecated
deprecated
* Sets whether the player is active or not.
Declaration
Objective-C
- (void)setActive:(BOOL)active;
Parameters
active
Whether the player is active.