NELivePlayer class

Properties

hashCode int
The hash code for this object.
no setterinherited
onCompletionListener ↔ void Function()?
注册一个回调函数,在视频播放完成后调用 Register a callback that is called when the video playback is complete
getter/setter pair
onErrorListener ↔ void Function(PlayerErrorType what, int extra)?
注册一个回调函数,监听错误状态 Register a callback that is called when an error occurs
getter/setter pair
onFirstAudioDisplayListener ↔ void Function()?
注册一个回调函数,在第一帧音频完成时回调 Register a callback that is called when the first audio frame plays
getter/setter pair
onFirstVideoDisplayListener ↔ void Function()?
注册一个回调函数,在第一帧视频显示时回调 Register a callback that is called when the first video frame is loaded
getter/setter pair
onLoadStateChangeListener ↔ void Function(PlayStateType type, int extra)?
视频加载状态变化时回调 Called when the video loading state changes
getter/setter pair
onPreparedListener ↔ void Function()?
注册一个回调函数,在视频预处理完成后调用 Register a callback that is called when the video pre-processing is complete
getter/setter pair
onReleasedListener ↔ void Function()?
注册一个回调函数,在release操作完成时调用 Register a callback that is called when the release operation is complete
getter/setter pair
onVideoSizeChangedListener ↔ void Function(int width, int height)?
注册一个回调函数,在视频大小发生变化时调用 Register a callback that is called when the video size changes
getter/setter pair
playerId String
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textureIdAndroid String?
getter/setter pair

Methods

getCurrentPosition() Future<int>
获取当前播放位置的时间点 单位: ms, 需要在收到onPrepare的通知后调用 返回: 当前播放位置的时间点 -1: 失败 Get the timestamp of the current playback position. Unit: milliseconds. The method is called after receiving the notification sent by onPrepare. Return: The current playback position. -1: failure
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepareAsync() Future<void>
预处理播放器,为播放做准备 Get prepared for playback
release() Future<void>
释放播放器所有资源 Release all resources consumed by the player
setAutoRetryConfig(NEAutoRetryConfig config) Future<void>
配置自动重试信息 Configure auto retry settings
setBufferStrategy(PlayerBufferStrategy bufferStrategy) Future<void>
设置缓冲策略, 在prepaerAsync前调用 默认使用nelpLowDelay为直播低延时模式。 Set a buffer strategy before calling prepareAsync. By default, use nelpLowDelay for low latency mode.
setHardwareDecoder(bool isOpen) Future<void>
设置是否开启硬件解码, 在prepareAsync前调用 默认使用软件解码 Enable or disable hardware decoding before calling prepareAsync. By default, the software decoding mode is used.
setMute(bool isMute) Future<void>
设置静音 Mute the volume
setPlaybackTimeout(int timeout) Future<void>
设置拉流超时时间, 需要在设置播放路径接口后调用(范围: 0 ~ 10秒,不包括0,默认是10秒,设置的值超过10秒使用默认值) Set the playback timeout. Call the API after you configure the playback path. Timeout range: 0 ~ 10 seconds. The value 0 is excluded. The default value is 10. If a value is set to a number greater than 10, the default value is applied.
setPlayerUrl(String dataSource) Future<void>
设置播放地址,在prepareAsync前调用 Set playback URLs before calling prepareAsync.
setShouldAutoplay(bool isAutoplay) Future<void>
设置prepareAsync完成后是否自动播放,若设置成false,需要手动调用start()进行播放, 在prepareAsync前调用 Enable or disable autoPlay after prepareAsync is complete. If the value is set to false, you must manually play by calling the start() method before prepareAsync is called.
setVolume(double volume) Future<void>
设置音量(0.0 ~ 1.0, 0.0为静音,1.0为最大) Set the volume. Volume range: 0.0 ~ 1.0. A value of 0.0 indicates the muted state and 1.0 indicates the maximum volume.
start() Future<void>
开始播放 Start playback
stop() Future<void>
停止播放 Stop playback
switchContentUrl(String url) Future<void>
播放过程中切换播放地址,第一次播放不能调用该接口,仅支持当前播放结束切换到下一个视频,或者播放过程中切换下一个视频 参数: url - 播放地址 You can change the playback URL during playback. You cannot call the API for the first playback. However, you can change the URL for the following video file or switch to the next video file during playback. Parameter: url - playback URL
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

addPreloadUrls(List<String> urls) Future<void>
添加预调度拉流链接地址 Add preload URLs
create({void onPreparedListener()?, void onCompletionListener()?, void onErrorListener(PlayerErrorType what, int extra)?, void onVideoSizeChangedListener(int width, int height)?, void onReleasedListener()?, void onLoadStateChangeListener(PlayStateType type, int extra)?, void onFirstVideoDisplayListener()?, void onFirstAudioDisplayListener()?}) Future<NELivePlayer>
创建播放器实例 Create a player instance
getVersion() Future<String>
获取SDK版本号 Get the SDK version
initAndroid(NeLiveConfig config) Future<void>
Android初始化SDK,使用播放器时必须先进行初始化才能进行后续操作。 Initialize SDK for Android. To run the player, initialize the SDK first.
queryPreloadUrls() Future<Map<String?, PlayerPreloadState?>>
查询预调度拉流链接地址的结果信息 Query preloaded URLs
removePreloadUrls(List<String> urls) Future<void>
移除预调度拉流链接地址 Remove preloaded URLs
setPreloadResultValidityIos(int validity) Future<void>
设置预调度结果有效期 validity 有效期(单位秒)。默认:3060 最小取值:60 Android 可以设置initAndroid 中的Config:refreshPreLoadDuration Set the validity period for preload results for iOS validity Validity period in seconds. Default value: 3060. Minimal value: 60. Android Set initAndroid in Config: refreshPreLoadDuration