API | Description |
Play an HTTP URL address. Starting from version 10.7, startPlay is changed to startVodPlay. You need to set the licence through +[TXLiveBase setLicenceURL:key:] before successful playback; otherwise, playback will fail (black screen). The licence only needs to be set once globally.Live License, Short Video License, and Player License are all acceptable for this use case. If you haven't obtained any of these licenses yet, you may click Player License to apply. Please note that formal version licenses require purchase. | |
Play in fileId mode by passing in TXPlayInfoParams parameters. Starting from version 10.7, startPlay is changed to startVodPlay. You need to set the licence through +[TXLiveBase setLicenceURL:key:] before successful playback; otherwise, playback will fail (black screen). The licence only needs to be set once globally.Live License, Short Video License, and Player License are all acceptable for this use case. If you haven't obtained any of these licenses yet, you may click Player License to apply. Please note that formal version licenses require purchase. | |
Play DRM encrypted video. | |
Stop playback. | |
Whether it is playing. | |
Pauses playback. The player will stop pulling data and freeze on the last frame. | |
Resumes playback. The player will resume pulling data. | |
Seeks to the specified time point of the video stream (in seconds). | |
Seeks to the specified time point in the video stream, in seconds, with an accuracy of 3 decimal places. Supports precise seek. | |
Gets the current playback time point in seconds. | |
Gets the total video duration in seconds. | |
Gets the playable video duration in seconds. | |
Get video width. | |
Retrieve video height. | |
Sets whether to start playback automatically after startVodPlay is called. Auto-play is on by default. | |
Sets whether to enable hardware acceleration. | |
Sets the playback start time. | |
Create a Video rendering View, which hosts the display of video content. | |
Remove Video rendering View . | |
Sets the token for HLS encryption. | |
Retrieve the encrypted playback key for reinforcement. | |
Whether to loop playback. | |
Add external subtitles (supported by the premium version of the player). | |
Returns the list of subtitle track information (only supported by the premium version of the player). | |
Returns the list of audio track information (supported only by the premium version of the player). | |
Select a track (supported only in the premium version of the player). | |
Deselects a track (only supported in premium versions of the player). | |
Seek to the specified Program Date Time (PDT) point in the video stream, which enables functions such as fast-forward, rewind, and progress bar jumping. Currently, only HLS video format is supported. This function is supported starting from version 11.6 of the player's premium edition. The parameter unit is milliseconds (ms). Parameter unit: milliseconds (ms). | |
Automatically refresh upon URL authentication expiration (supported starting from player premium version 13.6). |
API | Description |
Sets the player business parameters in the format of <NSString *, id>. | |
Set the subtitle style information, and the subtitle style can be updated after playback (only supported by the premium version of the player). | |
Setting volume normalization, loudness range: -70 to 0 (LUFS). Supported from player version 11.7 of the premium version. Off: AUDIO_NORMALIZATION_OFF On: AUDIO_NORMALIZATION_STANDARD AUDIO_NORMALIZATION_LOW AUDIO_NORMALIZATION_HIGH Custom value can be entered: ranging from low to high, range -70 to 0 LUFS. |
API | Description |
Sets whether to enable hardware acceleration. | |
Retrieve the current video frame image. Note: Because this operation is time-consuming, the screenshot will be called back asynchronously. | |
Sets whether to flip the video image. | |
Set the playback speed of on-demand video. Default is 1.0. | |
Return the bitrate index of current playback. | |
Return the list of supported bitrates (resolution) when the playback address is HLS. | |
Sets the current playback bitrate index for seamless definition switch. | |
Set switchable adaptive playback with maximum bit rate. |
API | Description |
Whether Picture-in-Picture (PiP) function is supported. | |
Whether to support seamless switching of picture-in-picture function.(Only available in the Premium version of the player). | |
Set whether to automatically start picture-in-picture.(Only available in the Premium version of the player). | |
Enter picture-in-picture. | |
Exit picture-in-picture. |
API | Description |
Sets whether to mute the player. | |
Set volume level, range: 0 - 150. |
API | Description |
Set player event callback object. | |
Set video rendering callback object. |
API | Description |
Start pushing video stream. | |
Cancel pushing video stream. | |
Start pushing audio stream. | |
Cancel pushing audio stream. |
+[TXLiveBase setLicenceURL:key:] to play successfully, otherwise the playback will fail (black screen). You only need to set it once globally.- (int)startVodPlay:(NSString *)url;
Parameter Name | Type | Description |
url | NSString | Playback address. |
+[TXLiveBase setLicenceURL:key:] for successful playback - otherwise playback will fail (black screen). The license only needs to be set once globally.- (int)startVodPlayWithParams:(TXPlayerAuthParams *)params;
Parameter Name | Type | Description |
params | Video fieldID and information. |
+[TXLiveBase setLicenceURL:key:] for successful playback - otherwise playback will fail (black screen). The license only needs to be set once globally.- (int)startPlayDrm:(TXPlayerDrmBuilder *)drmBuilder;
Parameter Name | Type | Description |
drmBuilder | DRM playback information. |
- (int)stopPlay;
- (bool)isPlaying;
- (void)pause;
- (void)resume;
- (int)seek:(float)time;
Parameter Name | Type | Description |
time | float | Video stream time point, in seconds. |
- (void)seek:(float)time accurateSeek:(BOOL)isAccurateSeek;
Parameter Name | Type | Description |
time | float | Video stream time point, in seconds, accurate to 3 decimal places. |
isAccurateSeek | BOOL | Whether the Seek is accurate. YES: Indicates an accurate Seek. Must find the current time point. This will take longer. NO: Indicates an imprecise Seek, that is, searching for the previous I-frame. |
- (void)seekToPdtTime:(long long)pdtTimeMs;
Parameter Name | Type | Description |
pdtTimeMs | long long | Video stream PDT time point, unit milliseconds. |
- (float)currentPlaybackTime;
- (float)duration;
- (float)playableDuration;
- (int)width;
- (int)height;
- (void)setupVideoWidget:(NSView *)view insertIndex:(unsigned int)idx;
- (void)removeVideoWidget;
@property BOOL isAutoPlay;
- (void)setStartTime:(CGFloat)startTime;
Parameter Name | Type | Description |
startTime | CGFloat | Video stream time point, in seconds, accurate to 3 decimal places. |
@property(nonatomic, strong) NSString *token;
+ (NSString *)getEncryptedPlayKey:(NSString *)key;
@property(nonatomic, assign) BOOL loop;
- (void)addSubtitleSource:(NSString *)url name:(NSString *)name mimeType:(TX_VOD_PLAYER_SUBTITLE_MIME_TYPE)mimeType;
Parameter Name | Type | Description |
url | NSString | Subtitle address, supports Http link and local storage absolute path. |
name | NSString | Subtitle name. If adding multiple subtitles, set the subtitle names to different names for distinguishing from other added subtitles; otherwise, it may lead to subtitle selection error. |
mimeType | TX_VOD_PLAYER_SUBTITLE_MIME_TYPE | Subtitle type, only supports VVT and SRT formats. For details, see TX_VOD_PLAYER_SUBTITLE_MIME_TYPE. |
- (NSArray<TXTrackInfo *> *)getSubtitleTrackInfo;
- (NSArray<TXTrackInfo *> *)getAudioTrackInfo;
- (void)selectTrack:(NSInteger)trackIndex;
Parameter Name | Type | Description |
trackIndex | NSInteger | The track index, which can be obtained via -[TXTrackInfo getTrackIndex]. |
- (void)deselectTrack:(NSInteger)trackIndex;
Parameter Name | Type | Description |
trackIndex | NSInteger | The track index, which can be obtained via -[TXTrackInfo getTrackIndex]. |
- (int)refreshUrlQuery:(NSString *)newUrl;
Parameter Name | Type | Description |
newUrl | NSString | New complete URL (usually only the querystring changes, while the schema/host/path remain the same). |
@property(nonatomic, copy) TXVodPlayConfig *config;
<NSString, id>.- (void)setExtentOptionInfo:(NSDictionary<NSString *, id> *)extInfo;
- (void)setSubtitleStyle:(TXPlayerSubtitleRenderModel *)renderModel;
Parameter Name | Type | Description |
renderModel | Subtitle style configuration parameters. |
- (void)setAudioNormalization:(float)value;
Parameter Name | Type | Description |
value | float | Preset value can be filled in (related class or file: Android: TXVodConstants; iOS: TXVodPlayConfig.h) Off: AUDIO_NORMALIZATION_OFF On: AUDIO_NORMALIZATION_STANDARD AUDIO_NORMALIZATION_LOW AUDIO_NORMALIZATION_HIGH Custom value can be entered: ranging from low to high, range -70 to 0 LUFS. |
- (void)setAutoMaxBitrate:(NSInteger)autoMaxBitrate;
@property(nonatomic, assign) BOOL enableHWAcceleration;
- (void)snapshot:(void (^)(UIImage *))snapshotCompletionBlock;
Parameter Name | Type | Description |
snapshotCompletionBlock | void (^)(UIImage *) | Callback interface class for screenshots. |
- (void)setMirror:(BOOL)isMirror;
- (void)setRate:(float)rate;
Parameter Name | Type | Description |
rate | float | Playback speed [0.5, 3.0]. |
- (NSInteger)bitrateIndex;
- (NSArray<TXBitrateItem *> *)supportedBitrates;
- (void)setBitrateIndex:(NSInteger)index;
Parameter Name | Type | Description |
index | NSInteger | Bitrate index. The index value can be obtained through the -[TXVodPlayer supportedBitrates] API.index == -1 indicates enabling HLS adaptive bitrate streaming. index > 0 indicates manually switching to the corresponding resolution bitrate. |
- (void)setRenderMode:(TX_Enum_Type_RenderMode)renderMode;
Parameter Name | Type | Description |
renderMode | Image Tiling Mode, valid values: RENDER_MODE_FILL_SCREEN: The video fills the entire screen with the image proportionally scaled to cover the whole screen, cropping any excess parts. In this mode, there is no black border around the image. RENDER_MODE_FILL_EDGE: The video image self-adaptively scales proportionally to fit the screen, with the scaled width and height not exceeding the display area. It is displayed in the center and may leave black borders. |
- (void)setRenderRotation:(TX_Enum_Type_HomeOrientation)rotation;
Parameter Name | Type | Description |
rotation | TX_Enum_Type_HomeOrientation | Image rendering angle, valid values: HOME_ORIENTATION_RIGHT: The Home button is on the right. HOME_ORIENTATION_DOWN: The Home button is at the bottom. HOME_ORIENTATION_LEFT: The Home button is on the left. HOME_ORIENTATION_UP: The Home button is at the top. |
- (void)setMute:(BOOL)bEnable;
- (void)setAudioPlayoutVolume:(int)volume;
@property(nonatomic, weak) id<TXVodPlayListener> vodDelegate;
@property(nonatomic, weak) id<TXVideoCustomProcessDelegate> videoProcessDelegate;
- (void)attachTRTC:(NSObject *)trtcCloud;
- (void)detachTRTC;
- (void)publishVideo;
- (void)unpublishVideo;
- (void)publishAudio;
- (void)unpublishAudio;
+ (BOOL)isSupportPictureInPicture;
+ (BOOL)isSupportSeamlessPictureInPicture;
- (void)setAutoPictureInPictureEnabled:(BOOL)enabled;
Parameter Name | Type | Description |
enabled | BOOL | YES: Automatically enters Picture-in-Picture when going into the background. NO: Automatic entry into Picture-in-Picture is not allowed. |
- (void)enterPictureInPicture;
- (void)exitPictureInPicture;
피드백