ZegoLiveRoom
zego-api-mediaplayer.h
Go to the documentation of this file.
1//
2// zego-api-mediaplayer.h
3// ZegoLiveRoom
4//
5// Copyright © 2018年 Zego. All rights reserved.
6//
7
8#ifndef zego_api_mediaplayer_h
9#define zego_api_mediaplayer_h
10
11#include <memory>
12#include "zego-api-defines.h"
13#include "media_player.h"
15#if defined(__APPLE__)
16#include "TargetConditionals.h"
17#endif
18
19
20namespace ZEGO
21{
22namespace MEDIAPLAYER
23{
24
34
43
51
59
67
75
83
91
100
109 ZEGOAVKIT_API void Start(const char *path, bool repeat, ZegoMediaPlayerIndex index = ZegoMediaPlayerIndexFirst);
110
122 ZEGOAVKIT_API void Start(const char *path, bool repeat, long startPosition, ZegoMediaPlayerIndex index = ZegoMediaPlayerIndexFirst);
123
134 ZEGOAVKIT_API void Start(const char *path, long startPosition, ZegoMediaPlayerIndex index = ZegoMediaPlayerIndexFirst);
135
147 ZEGOAVKIT_API void Start(unsigned char *mediaData, int mediaDataLen, long startPosition, ZegoMediaPlayerIndex index = ZegoMediaPlayerIndexFirst);
148
160 ZEGOAVKIT_API void StartCopyrightedMusic(const char * resourceID, long startPosition, ZegoMediaPlayerIndex index = ZegoMediaPlayerIndexFirst);
161
168
175
182
190
199
207
215
224
233
243 ZEGOAVKIT_API void Load(const char* path, long startPosition, ZegoMediaPlayerIndex index = ZegoMediaPlayerIndexFirst);
244
255 ZEGOAVKIT_API void Load(unsigned char *mediaData, int mediaDataLen, long startPosition, ZegoMediaPlayerIndex index = ZegoMediaPlayerIndexFirst);
256
269 ZEGOAVKIT_API void LoadCopyrightedMusic(const char * resourceID, long startPosition, ZegoMediaPlayerIndex index = ZegoMediaPlayerIndexFirst);
270
279
287
295
303
313
323
331
339
348
358
366
377
389
397
405
412
421
430
438
449
460
472
481
491
502
511
520
521
531
539
547
556
564
571 ZEGOAVKIT_API void EnableSoundLevelMonitor(bool enable, unsigned int timeInMS = 200, ZegoMediaPlayerIndex index = ZegoMediaPlayerIndexFirst);
572
580
590
598
607
615
626
637
648
657 ZEGOAVKIT_API void EnableLocalCache(bool enable, const char *cache_dir, ZegoMediaPlayerIndex index = ZegoMediaPlayerIndexFirst);
658
667
674
689}
690}
691
692
693
694#endif /* zego_api_mediaplayer_h */
Definition: zego-api-mediaplayer-defines.h:428
Definition: zego-api-mediaplayer-defines.h:535
Definition: zego-api-mediaplayer-defines.h:282
Definition: zego-api-mediaplayer-defines.h:449
Definition: zego-api-mediaplayer-defines.h:465
Definition: zego-api-mediaplayer-defines.h:399
Definition: zego-api-mediaplayer-defines.h:490
PublishChannelIndex
Definition: zego-api-defines.h:976
@ PUBLISH_CHN_AUX
Definition: zego-api-defines.h:978
ZegoVideoViewMode
Definition: zego-api-defines.h:80
ZEGOAVKIT_API void SetMediaPlayerFileReader(ZegoMediaPlayerFileReader *reader, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SetView(void *view, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void AttachToPublishChannel(AV::PublishChannelIndex channel=AV::PUBLISH_CHN_AUX, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
指定某个播放器绑定到推流通道,注意不能为主路,当前复制播放器音频到辅路只支持channel 1,推荐设置到channel 1。
ZEGOAVKIT_API void Load(const char *path, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void DestroyPlayer(ZegoMediaPlayerIndex index)
ZEGOAVKIT_API void SetAudioDataCallback(IZegoMediaPlayerAudioDataCallback *callback, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API ZegoMediaPlayerMediaInfo GetMediaInfo(ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void Start(const char *path, bool repeat, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SetBackgroundColor(int color, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void EnableRepeatMode(bool enable, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API long GetCurrentDuration(ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API const char * GetMetaDataValue(const char *key, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
通过键值获取保存在媒体文件中的元数据信息
ZEGOAVKIT_API long GetDuration(ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API long GetCurrentRenderingDuration(ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SetSoundInfoCallback(IZegoMediaPlayerSoundInfoCallback *callback, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
设置声音信息回调,包括声浪、频谱。
ZegoMediaPlayerIndex
Definition: zego-api-mediaplayer-defines.h:37
@ ZegoMediaPlayerIndexFirst
Definition: zego-api-mediaplayer-defines.h:38
ZEGOAVKIT_API long SetAudioStream(long streamIndex, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SetAudioTrackMode(ZegoMediaPlayerAudioTrackMode mode, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void EnableAccurateSeek(bool enable, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void EnableLiveAudioEffect(bool enable, ZegoLiveAudioEffectMode mode, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
开启现场音效
ZEGOAVKIT_API void SetPlayerType(ZegoMediaPlayerType type, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SetActiveAudioChannel(ZegoMediaPlayerAudioChannel channel, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void CreatePlayer(ZegoMediaPlayerType type, ZegoMediaPlayerIndex index)
ZegoMediaPlayerAudioTrackMode
Definition: zego-api-mediaplayer-defines.h:52
ZegoMediaPlayerVideoPixelFormat
Definition: zego-api-mediaplayer-defines.h:25
ZEGOAVKIT_API void EnableViewMirror(bool enable, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
开启画面镜像
ZEGOAVKIT_API bool GetPlaybackStatistics(ZegoMediaPlayerStatisticsInfo &stat, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
获取播放器当前播放统计信息
ZEGOAVKIT_API bool GetOnlineResourceCacheStat(int *timeInMS, int *sizeInByte, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void UpdatePosition(const float position[3], ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
更新媒体播放器(音频源)位置
ZEGOAVKIT_API void SetPlayMediaStreamType(ZegoMediaStreamType type, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
设置媒体播放器播放的媒体流类型,用于仅播放音频流或者视频流的场景
ZEGOAVKIT_API void SetVolume(int volume, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZegoMediaPlayerAudioChannel
Definition: zego-api-mediaplayer-defines.h:45
ZEGOAVKIT_API int GetPlayVolume(ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void EnableStatusMonitor(bool enable, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
开启播放器启异常状态监控
ZEGOAVKIT_API int GetPublishVolume(ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SetPublishVolume(int volume, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API bool RequireHWDecoder(ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SetAccurateSeekTimeout(long timeoutInMS, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SetVideoDataWithIndexCallback(IZegoMediaPlayerVideoDataWithIndexCallback *callback, ZegoMediaPlayerVideoPixelFormat format, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SetPlaySpeed(float speed, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SetBufferThreshold(int thresholdInMS, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZegoMediaPlayerType
Definition: zego-api-mediaplayer-defines.h:19
ZegoLiveAudioEffectMode
Live audio effect mode.
Definition: zego-api-mediaplayer-defines.h:99
ZEGOAVKIT_API void SetLoopCount(int loopCount, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SetPlayVolume(int volume, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void LoadCopyrightedMusic(const char *resourceID, long startPosition, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void InitWithType(ZegoMediaPlayerType type, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SeekTo(long duration, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SetBlockDataCallback(IZegoMediaPlayerBlockDataCallback *callback, int blockSize, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SetOnlineResourceCache(int timeInMS, int sizeInByte, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SetEventWithIndexCallback(IZegoMediaPlayerEventWithIndexCallback *callback, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void Resume(ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SetHttpHeaders(ZegoMediaPlayerHttpHeader *headers, int headerSize, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void Stop(ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SetMediaSideInfoCallback(IZegoMediaPlayerMediaSideInfoCallback *callback, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void ClearView(ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void TakeSnapshot(ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API bool SetProcessInterval(long interval, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void EnableAudioChannelKeyShift(ZegoMediaPlayerAudioChannel channel, bool enable, float keyShiftValue, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void EnableFrequencySpectrumMonitor(bool enable, unsigned int timeInMS=200, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
是否开启频谱监听
ZEGOAVKIT_API void SetAudioChannelKeyShift(ZegoMediaPlayerAudioChannel channel, float keyShiftValue, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void MuteLocal(bool mute, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void EnableLocalCache(bool enable, const char *cache_dir, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
开启本地缓存文件
ZEGOAVKIT_API void Pause(ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SetAudioPublishStream(long streamIndex, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void SetViewMode(AV::ZegoVideoViewMode mode, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZegoMediaStreamType
Definition: zego-api-mediaplayer-defines.h:116
ZEGOAVKIT_API void SetLoadResourceTimeout(int timeoutInMS, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void EnableSoundLevelMonitor(bool enable, unsigned int timeInMS=200, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
是否开启声浪监听
ZEGOAVKIT_API long GetAudioStreamCount(ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
ZEGOAVKIT_API void StartCopyrightedMusic(const char *resourceID, long startPosition, ZegoMediaPlayerIndex index=ZegoMediaPlayerIndexFirst)
Definition: AVDefines.h:17
Definition: zego-api-defines.h:1545
Definition: zego-api-mediaplayer-defines.h:183
Definition: zego-api-mediaplayer-defines.h:233
Definition: zego-api-mediaplayer-defines.h:195
Definition: zego-api-mediaplayer-defines.h:252
#define ZEGOAVKIT_API
Definition: zego-api-defines.h:59