API | Description |
To play HTTP URL-formatted addresses: Starting from version 10.7, startPlay has been renamed to startVodPlay. You must set the Licence via +[TXLiveBase setLicenceURL:key:] before playback will succeed; 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. | |
To play using fileId, pass the TXPlayInfoParams parameter. Starting from version 10.7, 'startPlay' has been renamed to 'startVodPlay'. You must configure the license using +[TXLiveBase setLicenceURL:key:] for successful playback - otherwise playback will fail (black screen). The license 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. | |
Start a standard FairPlay DRM playback. | |
Stops the audio/video stream. | |
Gets whether playback is ongoing. | |
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. | |
Gets the video width. | |
Gets the 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. | |
Get the encrypted playback key for content protection. | |
Set 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). |
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. You can set the volume normalization to preset values or custom values. The preset values are defined in the related classes or files, such asTXVodConstants for Android and TXVodPlayConfig.hfor iOS: Off: AUDIO_NORMALIZATION_OFF On: AUDIO_NORMALIZATION_STANDARD (standard) AUDIO_NORMALIZATION_LOW (low) AUDIO_NORMALIZATION_HIGH (high) Custom values can be set in the range of -70 to 0 LUFS, from low to high. |
API | Description |
Sets whether to enable hardware acceleration. | |
Gets 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. | |
Sets the VOD playback speed. Default value: 1.0. | |
Returns the current playback bitrate index. | |
When the playback address is a master playlist, return the supported bitrates (resolutions). | |
Sets the current playback bitrate index for seamless definition switch. You may need to wait momentarily to switch the definition. | |
Set the highest bitrate that can be switched for adaptive playback. |
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. | |
Sets the volume level. Value range: 0–100. |
API | Description |
Set the player event callback object. | |
Set the video rendering callback object. |
API | Description |
Starts pushing the video stream. | |
Cancels pushing the video stream. | |
Starts pushing the audio stream. | |
Cancels pushing the 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 | Track index, obtained through -[TXTrackInfo getTrackIndex]. |
- (void)deselectTrack:(NSInteger)trackIndex;
Parameter Name | Type | Description |
trackIndex | NSInteger | Track index, obtained through -[TXTrackInfo getTrackIndex]. |
@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_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 *) | Screenshot callback interface class |
- (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. index == -1 indicates enabling HLS adaptive bitrate streaming. index > 0 indicates manually switching to the corresponding clarity bitrate. The index value can be set through the API. -Retrieve [TXVodPlayer supportedBitrates]. |
- (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;
Feedback