ZegoMediaPlayer
ZegoMediaPlayer
Declared in ZegoExpressDefines.h
Methods
setEventHandler:
- (void)setEventHandler:(nullable id<ZegoMediaPlayerEventHandler>) handler;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| handler | nullable id<ZegoMediaPlayerEventHandler> | Event callback handler for media player |
Details
Listen to the event notification callback of the media player. Use Cases: You can change the media player UI widget according to the related event callback.
- When to call: After the [ZegoMediaPlayer] instance created.
- Caution: Calling this function will overwrite the callback set by the last call to this function.
- Available since: 2.1.0
- Restrictions: None.
setVideoHandler:format:type:
- (void)setVideoHandler:(nullable id<ZegoMediaPlayerVideoHandler>) handler format:(ZegoVideoFrameFormat) format type:(ZegoVideoBufferType) type;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| handler | nullable id<ZegoMediaPlayerVideoHandler> | Video data callback handler for media player |
| format | ZegoVideoFrameFormat | Video frame format for video data |
| type | ZegoVideoBufferType | Buffer type for video data |
Details
By setting this callback, the video data of the media resource file played by the media player can be called back.
- When to call: After the [ZegoMediaPlayer] instance created.
- Caution: When you no longer need to get the video frame data, please call this function again to clear the handler to stop the video frame data callback.
- Available since: 2.1.0
- Restrictions: None.
setAudioHandler:
- (void)setAudioHandler:(nullable id<ZegoMediaPlayerAudioHandler>) handler;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| handler | nullable id<ZegoMediaPlayerAudioHandler> | Audio data callback handler for media player |
Details
By setting this callback, the audio data of the media resource file played by the media player can be called back.
- When to call: After the [ZegoMediaPlayer] instance created.
- Caution: When you no longer need to get the audio data, please call this function again to clear the handler to stop the audio data callback.
- Available since: 2.1.0
- Restrictions: None.
setBlockDataHandler:blockSize:
- (void)setBlockDataHandler:(nullable id<ZegoMediaPlayerBlockDataHandler>) handler blockSize:(unsigned int) blockSize;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| handler | nullable id<ZegoMediaPlayerBlockDataHandler> | The media resource block data callback handler of the media player. |
| blockSize | unsigned int | The size of the encrypted data block. The bufferSize in the OnBlockData callback is an integer multiple of blockSize. |
Details
This callback can be set to listen to and decrypt the media resource block data for playing the user's own ciphertext media resources.
- When to call: After the [ZegoMediaPlayer] instance created, before playing media resources.
- Caution: When it is no longer necessary to listen to the callback for data decryption, please call this function again to clear the handler.
- Available since: 3.4.0
- Restrictions: None.
loadResource:callback:
- (void)loadResource:(NSString *) path callback:(nullable ZegoMediaPlayerLoadResourceCallback) callback;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| path | NSString * | The absolute resource path or the URL of the network resource and cannot be null or "". Android can set this path string with Uri. |
| callback | nullable ZegoMediaPlayerLoadResourceCallback | Notification of resource loading results |
Details
Load media resources. Use case: Developers can load the absolute path to the local resource or the URL of the network resource incoming.
- When to call: It can be called after the engine by [createEngine] has been initialized and the media player has been created by [createMediaPlayer].
- Related APIs: Resources can be loaded through the [loadResourceWithPosition] or [loadResourceFromMediaData] function.
- Caution: If the mediaplayer has already loaded resources or is in the process of playing, please first call the [stop] interface to halt the playback, and then proceed to call the interface to load the media resources; failure to do so will result in an unsuccessful load.
Return
Callback result of loading media resource.
loadResourceWithPosition:startPosition:callback:
- (void)loadResourceWithPosition:(NSString *) path startPosition:(long) startPosition callback:(nullable ZegoMediaPlayerLoadResourceCallback) callback;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| path | NSString * | The absolute resource path or the URL of the network resource and cannot be null or "". Android can set this path string with Uri. |
| startPosition | long | The progress at which the playback started. |
| callback | nullable ZegoMediaPlayerLoadResourceCallback | Notification of resource loading results |
Details
Load media resources, and specify the progress, in milliseconds, at which playback begins. Use case: Developers can load the absolute path to the local resource or the URL of the network resource incoming.
- When to call: It can be called after the engine by [createEngine] has been initialized and the media player has been created by [createMediaPlayer].
- Related APIs: Resources can be loaded through the [loadResource] or [loadResourceFromMediaData] function.
- Caution: 1.When [startPosition] exceeds the total playing time, it will start playing from the beginning. 2.If the mediaplayer has already loaded resources or is in the process of playing, please first call the [stop] interface to halt the playback, and then proceed to call the interface to load the media resources; failure to do so will result in an unsuccessful load.
Return
Callback result of loading media resource.
loadResourceFromMediaData:startPosition:callback:
- (void)loadResourceFromMediaData:(NSData *) mediaData startPosition:(long) startPosition callback:(nullable ZegoMediaPlayerLoadResourceCallback) callback;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| mediaData | NSData * | Binary audio data. |
| startPosition | long | Position of starting playback, in milliseconds. |
| callback | nullable ZegoMediaPlayerLoadResourceCallback | Notification of resource loading results. |
Details
Load binary audio data. Use case: Developers do not want to cache the audio data locally, and directly transfer the audio binary data to the media player, directly load and play the audio.
- When to call: It can be called after the engine by [createEngine] has been initialized and the media player has been created by [createMediaPlayer].
- Related APIs: Resources can be loaded through the [loadResource] or [loadResourceWithPosition] function.
- Caution: 1.When [startPosition] exceeds the total playing time, it will start playing from the beginning. 2.If the mediaplayer has already loaded resources or is in the process of playing, please first call the [stop] interface to halt the playback, and then proceed to call the interface to load the media resources; failure to do so will result in an unsuccessful load.
Return
Callback result of loading media resource.
loadCopyrightedMusicResourceWithPosition:startPosition:callback:
- (void)loadCopyrightedMusicResourceWithPosition:(NSString *) resourceID startPosition:(long) startPosition callback:(nullable ZegoMediaPlayerLoadResourceCallback) callback;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| resourceID | NSString * | The resource ID obtained from the copyrighted music module. |
| startPosition | long | The progress at which the playback started. |
| callback | nullable ZegoMediaPlayerLoadResourceCallback | Notification of resource loading results |
Details
Load media resources, and specify the progress, in milliseconds, at which playback begins. Use case: Developers can load the resource ID of copyrighted music.
- When to call: It can be called after the engine by [createEngine] has been initialized and the media player has been created by [createMediaPlayer].
- Caution: 1.When [startPosition] exceeds the total playing time, it will start playing from the beginning. 2.If the mediaplayer has already loaded resources or is in the process of playing, please first call the [stop] interface to halt the playback, and then proceed to call the interface to load the media resources; failure to do so will result in an unsuccessful load.
Return
Callback result of loading media resource.
loadResourceWithConfig:callback:
- (void)loadResourceWithConfig:(ZegoMediaPlayerResource *) resource callback:(nullable ZegoMediaPlayerLoadResourceCallback) callback;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| resource | ZegoMediaPlayerResource * | Multimedia resources that need to be loaded. |
| callback | nullable ZegoMediaPlayerLoadResourceCallback | Notification of resource loading results |
Details
Load media resources. Use case: Developers can load the absolute path to the local resource or the URL of the network resource incoming.
- When to call: Called after the engine [createEngine] has been initialized and the media player [createMediaPlayer] has been created.
- Related APIs: Support for loading resources through the [loadResourceWithPosition] or [loadResourceFromMediaData] interface.
- Caution: If the mediaplayer has already loaded resources or is in the process of playing, please first call the [stop] interface to halt the playback, and then proceed to call the interface to load the media resources; failure to do so will result in an unsuccessful load.
Return
Callback result of loading media resource.
start
- (void)start;ZegoExpressDefines.hYou need to load resources before playing
stop
- (void)stop;ZegoExpressDefines.hpause
- (void)pause;ZegoExpressDefines.hresume
- (void)resume;ZegoExpressDefines.hseekTo:callback:
- (void)seekTo:(unsigned long long) millisecond callback:(nullable ZegoMediaPlayerSeekToCallback) callback;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| millisecond | unsigned long long | Point in time of specified playback progress |
| callback | nullable ZegoMediaPlayerSeekToCallback | The result notification of set the specified playback progress |
Details
Unit is millisecond
Return
The result notification of set the specified playback progress
enableRepeat:
- (void)enableRepeat:(BOOL) enable;ZegoExpressDefines.h| Name | Type | Description |
|---|---|---|
| enable | BOOL | repeat playback flag. The default is false. |
setPlaySpeed:
- (void)setPlaySpeed:(float) speed;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| speed | float | The speed of play. The default is 1.0. Versions 2.12.0 to 3.15.1: The range is 0.5 ~ 4.0. Versions 3.16.0 and above: The range is 0.3 ~ 4.0. |
Details
Set the playback speed of the player.
- When to call: You should load resource before invoking this function.
- Related APIs: Resources can be loaded through the [loadResource] function.
- Available since: 2.12.0
- Restrictions: None.
enableAux:
- (void)enableAux:(BOOL) enable;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| enable | BOOL | Aux audio flag. The default is false. |
Details
This interface will only mix the media player sound into the main channel
muteLocal:
- (void)muteLocal:(BOOL) mute;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| mute | BOOL | Mute local audio flag, The default is false. |
Details
If [enableAux] switch is turned on, there is still sound in the publishing stream. The default is false.
setPlayerCanvas:
- (void)setPlayerCanvas:(nullable ZegoCanvas *) canvas;ZegoExpressDefines.h| Name | Type | Description |
|---|---|---|
| canvas | nullable ZegoCanvas * | Video rendered canvas object |
setVolume:
- (void)setVolume:(int) volume;ZegoExpressDefines.h| Name | Type | Description |
|---|---|---|
| volume | int | The range is 0 ~ 200. The default is 60. |
setPlayVolume:
- (void)setPlayVolume:(int) volume;ZegoExpressDefines.h| Name | Type | Description |
|---|---|---|
| volume | int | The range is 0 ~ 200. The default is 60. |
setPublishVolume:
- (void)setPublishVolume:(int) volume;ZegoExpressDefines.h| Name | Type | Description |
|---|---|---|
| volume | int | The range is 0 ~ 200. The default is 60. |
setProgressInterval:
- (void)setProgressInterval:(unsigned long long) millisecond;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| millisecond | unsigned long long | Interval of playback progress callback in milliseconds |
Details
This function can control the callback frequency of [onMediaPlayerPlayingProgress]. When the callback interval is set to 0, the callback is stopped. The default callback interval is 1s This callback are not returned exactly at the set callback interval, but rather at the frequency at which the audio or video frames are processed to determine whether the callback is needed to call
playVolume
- (int)playVolume;ZegoExpressDefines.hcurrent volume
publishVolume
- (int)publishVolume;ZegoExpressDefines.hcurrent volume
totalDuration
- (unsigned long long)totalDuration;ZegoExpressDefines.hYou should load resource before invoking this function, otherwise the return value is 0
Unit is millisecond
currentProgress
- (unsigned long long)currentProgress;ZegoExpressDefines.hYou should load resource before invoking this function, otherwise the return value is 0
current progress
currentRenderingProgress
- (unsigned long long)currentRenderingProgress;ZegoExpressDefines.hYou should load resource before invoking this function, otherwise the return value is 0
current rendering progress
audioTrackCount
- (unsigned int)audioTrackCount;ZegoExpressDefines.hNumber of audio tracks
setAudioTrackIndex:
- (void)setAudioTrackIndex:(unsigned int) index;ZegoExpressDefines.h| Name | Type | Description |
|---|---|---|
| index | unsigned int | Audio track index, the number of audio tracks can be obtained through the [getAudioTrackCount] function. |
setAudioTrackMode:
- (void)setAudioTrackMode:(ZegoMediaPlayerAudioTrackMode) mode;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| mode | ZegoMediaPlayerAudioTrackMode | Audio track mode. |
Details
Set the audio track mode of the player. Use case: Under the real-time chorus (KTV), call the interface enable multi-track mode, call the interface [setAudioTrackIndex] to specify the original track to play, call interface [setAudioTrackPublishIndex] specified need publish of accompaniment tracks.
- When to call: The call takes effect before [start] starts playing
- Related APIs: Call [setAudioTrackIndex] to specified the play track of media file and call [setAudioTrackPublishIndex] to specified the publish track of media file.
- Caution: When multi-track mode is enabled, the resource consumption of the hardware device is increased.
- Available since: 3.1.0
setAudioTrackPublishIndex:
- (void)setAudioTrackPublishIndex:(unsigned int) index;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| index | unsigned int | Audio track index, the number of audio tracks can be obtained through the [getAudioTrackCount] function. |
Details
Set the audio track for the media file to be publish.
- When to call: It can be called after the engine by [createEngine] has been initialized and the media player has been created by [createMediaPlayer].
- Related APIs: The number of audio tracks can be obtained through the [getAudioTrackCount] function.
- Caution: This call takes effect only after multitrack mode is enabled by calling the interface [setAudioTrackMode].
- Available since: 3.1.0
enableVoiceChanger:param:audioChannel:
- (void)enableVoiceChanger:(BOOL) enable param:(ZegoVoiceChangerParam *) param audioChannel:(ZegoMediaPlayerAudioChannel) audioChannel;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| enable | BOOL | Whether enable voice changer or not. True - enabled, false - disabled, default value is false. |
| param | ZegoVoiceChangerParam * | Voice changer parameters |
| audioChannel | ZegoMediaPlayerAudioChannel | The audio channel to be voice changed |
Details
Enable voice changer, set up the specific voice changer parameters.
- When to call: It can be called after the engine by [createEngine] has been initialized and the media player has been created by [createMediaPlayer].
- Available since: 3.15.0
currentState
- (ZegoMediaPlayerState) currentState;ZegoExpressDefines.hcurrent state
index
- (NSNumber *)index;ZegoExpressDefines.hGet media player index.
- When to call: It can be called after [createMediaPlayer].
- Restrictions: None.
Media player index.
takeSnapshot:
- (void)takeSnapshot:(ZegoMediaPlayerTakeSnapshotCallback) callback;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| callback | ZegoMediaPlayerTakeSnapshotCallback | The callback of the screenshot of the media player playing screen |
Details
Only in the case of calling [setPlayerCanvas] to set the display controls and the playback state, can the screenshot be taken normally
enableAccurateSeek:config:
- (void)enableAccurateSeek:(BOOL) enable config:(ZegoAccurateSeekConfig *) config;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| enable | BOOL | Whether to enable accurate seek |
| config | ZegoAccurateSeekConfig * | The property setting of accurate seek, only valid when enable is true. |
Details
The timestamp specified by normal seek may not an I frame, and then returns the I frame near the specified timestamp, which is not so accurate. But the accurate seek, when the specified timestamp is not an I frame, it will use the I frame near the specified timestamp to decode the frame of the specified timestamp.
- Use cases: When user needs to seek to the specified timestamp accurately.
- When to call: The setting must be called before [loadResource], and it will take effect during the entire life cycle of the media player.
- Available since: 2.4.0
setNetWorkResourceMaxCache:size:
- (void)setNetWorkResourceMaxCache:(unsigned int) time size:(unsigned int) size;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| time | unsigned int | The maximum length of the cache time, in ms, the SDK internal default is 5000; the effective value is greater than or equal to 2000; if you fill in 0, it means no limit. |
| size | unsigned int | The maximum size of the cache, the unit is byte, the internal default size of the SDK is 1510241024 byte; the effective value is greater than or equal to 5000000, if you fill in 0, it means no limit. |
Details
The setting must be called before loading the resource, and it will take effect during the entire life cycle of the media player. Time and size are not allowed to be 0 at the same time. The SDK internal default time is 5000, and the size is 1510241024 byte.When one of time and size reaches the set value first, the cache will stop. When loading resources with a non-empty onlineResourceCachePath, the cache is controlled by maxCachePendingLength. This configuration is invalid.
getNetWorkResourceCache
- (ZegoNetWorkResourceCache *)getNetWorkResourceCache;ZegoExpressDefines.hReturns the current cached information, including the length of time the data can be played and the size of the cached data.
setNetWorkBufferThreshold:
- (void)setNetWorkBufferThreshold:(unsigned int) threshold;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| threshold | unsigned int | Threshold that needs to be reached to resume playback, unit ms. |
Details
The setting must be called before loading the resource, and it will take effect during the entire life cycle of the media player.
When the network status is poor and the media player has finished playing the cached network resources, it will stop playing, and notify the user through the ZegoMediaPlayerNetworkEvent.BUFFER_BEGIN state of the callback interface onMediaPlayerNetworkEvent that the network resources are being recached.
Only when the cached network resources are greater than the set threshold, the media player will automatically resume playback at the original paused position, and notify the user through the ZegoMediaPlayerNetworkEvent.BUFFER_ENDED of the callback interface onMediaPlayerNetworkEvent that the user has cached the network resources The threshold was reached and playback resumed.
enableSoundLevelMonitor:millisecond:
- (void)enableSoundLevelMonitor:(BOOL) enable millisecond:(unsigned int) millisecond;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| enable | BOOL | Whether to enable monitoring, true is enabled, false is disabled. |
| millisecond | unsigned int | Monitoring time period of the sound level, in milliseconds, has a value range of [100, 3000]. |
Details
Whether to enable sound level monitoring.
- When to call: It can be called after the engine by [createEngine] has been initialized and the media player has been created by [createMediaPlayer].
- Related callbacks: After it is turned on, user can use the [onMediaPlayerSoundLevelUpdate] callback to monitor sound level updates.
- Available since: 2.15.0
- Restrictions: None.
enableFrequencySpectrumMonitor:millisecond:
- (void)enableFrequencySpectrumMonitor:(BOOL) enable millisecond:(unsigned int) millisecond;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| enable | BOOL | Whether to enable monitoring, true is enabled, false is disabled. |
| millisecond | unsigned int | Monitoring time period of the frequency spectrum, in milliseconds, has a value range of [10, 3000]. Note that on v3.19.0 and older version, the value range is [100, 3000]. |
Details
Whether to enable frequency spectrum monitoring.
- When to call: It can be called after the engine by [createEngine] has been initialized and the media player has been created by [createMediaPlayer].
- Related APIs: After it is turned on, user can use the [onMediaPlayerFrequencySpectrumUpdate] callback to monitor frequency spectrum updates.
- Available since: 2.15.0
- Restrictions: None.
setActiveAudioChannel:
- (void)setActiveAudioChannel:(ZegoMediaPlayerAudioChannel) audioChannel;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| audioChannel | ZegoMediaPlayerAudioChannel | Playback channel, the default is ZegoMediaPlayerAudioChannelAll. |
Details
Set the playback channel.
- When to call: It can be called after the engine by [createEngine] has been initialized and the media player has been created by [createMediaPlayer].
- Available since: 2.20.0
- Restrictions: None.
clearView
- (void)clearView;ZegoExpressDefines.hClears the last frame of the playback control that remains on the control after playback ends.
- When to call: It can be called after the engine by [createEngine] has been initialized and the media player has been created by [createMediaPlayer].
- Available since: 2.20.0
- Restrictions: The interface call takes effect only when the media player ends playing.
getMediaInfo
- (ZegoMediaPlayerMediaInfo *)getMediaInfo;ZegoExpressDefines.hGet meida information such as video resolution from media file.
- When to call: It can be called after the engine by [createEngine] has been initialized and the media player has been created by [createMediaPlayer].
- Available since: 3.6.0
- Restrictions: None.
updatePosition:
- (void)updatePosition:(const float[_Nonnull 3]) position;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| position | const float[_Nonnull 3] | The unit vector of the front axis of its own coordinate system. The parameter is a float array with a length of 3. |
Details
Update the position of the media player (audio source).
- Use cases: The media player also needs to have 3D spatial sound.
- When to call: It can be called after the engine by [createEngine] has been initialized and the media player has been created by [createMediaPlayer].
- Available since: 3.6.0
- Restrictions: This interface needs to be used in conjunction with the RangeAudio/RangeScene module. This interface can only be called successfully after the RangeAudio/RangeScene module enables 3D sound effects.
setHttpHeader:
- (void)setHttpHeader:(NSDictionary<NSString *, NSString *> *) headers;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| headers | NSDictionary<NSString *, NSString *> * | Headers info. |
Details
Call this function to set the http headers of the http network resource.
- Use cases: When the network resource needs to set special header information.
- When to call: It can be called after the engine by [createEngine] has been initialized and the media player has been created by [createMediaPlayer].
- Available since: 3.8.0
- Restrictions: Called before the corresponding network resource is loaded.
setPlayMediaStreamType:
- (void)setPlayMediaStreamType:(ZegoMediaStreamType) streamType;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| streamType | ZegoMediaStreamType | Stream type. |
Details
Configure the media stream type to be played. You can only play video streams or audio streams. This will take effect during the life cycle of the media player.
- Use cases: When only the video stream or audio stream needs to be played.
- When to call: It can be called after the engine by [createEngine] has been initialized and the media player has been created by [createMediaPlayer].
- Caution: Changing the media stream type during playing will take effect in the next playing.
- Available since: 3.10.0
enableLiveAudioEffect:mode:
- (void)enableLiveAudioEffect:(BOOL) enable mode:(ZegoLiveAudioEffectMode) mode;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| enable | BOOL | Whether to enable live audio effect. |
| mode | ZegoLiveAudioEffectMode | Live audio effect mode. |
Details
When the live audio effect is turned on, the spatial sense is enhanced and the instrument sounds become more prominent, without any increase in delay.
- Use cases: It is commonly used in voice chat rooms and karaoke scenarios to enhance the live audio effects of the accompaniment.
- When to call: It can be called after the engine by [createEngine] has been initialized and the media player has been created by [createMediaPlayer].
- Caution: To enhance the live audio effect experience, it is recommended to configure dual-channel stereo encoding. Developers can achieve this configuration by using the [setAudioCaptureStereoMode] method. Failure to configure dual-channel stereo encoding may significantly diminish the effects of certain songs, as the left and right channel effects may cancel each other out when synthesizing mono audio, resulting in less noticeable effects.
- Available since: 3.10.0
enableLocalCache:cacheDir:
- (void)enableLocalCache:(BOOL) enable cacheDir:(NSString *) cacheDir;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| enable | BOOL | Whether to enable local caching. |
| cacheDir | NSString * | Cache dir. If left blank, the directory specified internally by SDK will be used. |
Details
When playing http/https network resources, when the local cache is enabled, the network resources will be saved locally and the cache information will be called back through [onMediaPlayerLocalCache].
- When to call: It can be called after the engine by [createEngine] has been initialized and the media player has been created by [createMediaPlayer]. Called after [loadResource] or during playback, it will take effect next playback.
- Caution: Only http/https single file type network resources are supported. If there is a [seek] operation during playback, the cache will fail.
- Available since: 3.12.0
enableViewMirror:
- (void)enableViewMirror:(BOOL) enable;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| enable | BOOL | Whether to enable view mirror. |
Details
Enable view mirror.
- When to call: It can be called after the engine by [createEngine] has been initialized and the media player has been created by [createMediaPlayer].
- Available since: 3.14.0
getPlaybackStatistics
- (ZegoMediaPlayerStatisticsInfo *)getPlaybackStatistics;ZegoExpressDefines.hGet current playback statistics to monitor whether decoding and rendering anomalies occur in the player.
- Use cases: Typically used in cloud-based media player scenarios.
- When to call: Invoke after the [loadResource] callback succeeds.
- Available since: 3.12.0
setVoiceChangerParam:audioChannel:
- (void)setVoiceChangerParam:(ZegoVoiceChangerParam *) param audioChannel:(ZegoMediaPlayerAudioChannel) audioChannel;ZegoExpressDefines.h| Name | Type | Description |
|---|---|---|
| param | ZegoVoiceChangerParam * | Voice changer parameters |
| audioChannel | ZegoMediaPlayerAudioChannel | The audio channel to be voice changed |
