Class ZegoMediaRecorder
- java.lang.Object
-
- com.zego.zegoavkit2.mediarecorder.ZegoMediaRecorder
-
- All Implemented Interfaces:
IZegoMediaRecordCallback2
public class ZegoMediaRecorder extends java.lang.Object implements IZegoMediaRecordCallback2
Copyright © 2018 Zego. All rights reserved.
-
-
Constructor Summary
Constructors Constructor Description ZegoMediaRecorder()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
onMediaRecord(int errCode, ZegoMediaRecordChannelIndex channelIndex, java.lang.String storagePath)
void
onRecordStatusUpdate(ZegoMediaRecordChannelIndex channelIndex, java.lang.String storagePath, long duration, long fileSize, ZegoPublishStreamQuality q)
录制信息更新回调 注意:如果录制时在推流,quality数据与推流质量数据一致,建议录制回调时间间隔和推流质量回调时间间隔设置成一样void
setZegoMediaRecordCallback(IZegoMediaRecordCallback callback)
设置媒体录制回调void
setZegoMediaRecordCallback(IZegoMediaRecordCallback2 callback)
设置媒体录制回调boolean
startRecord(ZegoMediaRecordChannelIndex channelIndex, ZegoMediaRecordType recordType, android.net.Uri storageUri, boolean enableStatusCallback, int interval)
开始录制boolean
startRecord(ZegoMediaRecordChannelIndex channelIndex, ZegoMediaRecordType recordType, android.net.Uri storageUri, boolean enableStatusCallback, int interval, ZegoMediaRecordFormat recordFormat)
开始录制boolean
startRecord(ZegoMediaRecordChannelIndex channelIndex, ZegoMediaRecordType recordType, android.net.Uri storageUri, boolean enableStatusCallback, int interval, ZegoMediaRecordFormat recordFormat, boolean isFragment)
开始录制boolean
startRecord(ZegoMediaRecordChannelIndex channelIndex, ZegoMediaRecordType recordType, java.lang.String storagePath)
boolean
startRecord(ZegoMediaRecordChannelIndex channelIndex, ZegoMediaRecordType recordType, java.lang.String storagePath, boolean enableStatusCallback, int interval)
开始录制boolean
startRecord(ZegoMediaRecordChannelIndex channelIndex, ZegoMediaRecordType recordType, java.lang.String storagePath, boolean enableStatusCallback, int interval, ZegoMediaRecordFormat recordFormat)
开始录制boolean
startRecord(ZegoMediaRecordChannelIndex channelIndex, ZegoMediaRecordType recordType, java.lang.String storagePath, boolean enableStatusCallback, int interval, ZegoMediaRecordFormat recordFormat, boolean isFragment)
开始录制boolean
startRecord(ZegoMediaRecordConfig config)
boolean
stopRecord(ZegoMediaRecordChannelIndex channelIndex)
停止录制
-
-
-
Method Detail
-
startRecord
public boolean startRecord(ZegoMediaRecordChannelIndex channelIndex, ZegoMediaRecordType recordType, java.lang.String storagePath)
开始录制- Parameters:
channelIndex
- 录制通道recordType
- 录制类型storagePath
- 录制文件存储路径,传入的路径需要包含文件名- Returns:
- true:调用成功,false:调用失败
-
startRecord
public boolean startRecord(ZegoMediaRecordChannelIndex channelIndex, ZegoMediaRecordType recordType, java.lang.String storagePath, boolean enableStatusCallback, int interval)
开始录制- Parameters:
channelIndex
- 录制通道recordType
- 录制类型storagePath
- 录制文件存储路径,传入的路径需要包含文件名enableStatusCallback
- 是否开启录制文件状态回调interval
- 录制文件状态回调频率,单位毫秒,有效范围:1000-10000- Returns:
- true:调用成功,false:调用失败
-
startRecord
public boolean startRecord(ZegoMediaRecordChannelIndex channelIndex, ZegoMediaRecordType recordType, android.net.Uri storageUri, boolean enableStatusCallback, int interval)
开始录制说明:在系统版本高于 20 的设备上,访问受限资源需要动态申请权限
- Parameters:
channelIndex
- 录制通道recordType
- 录制类型storageUri
- 录制文件存储路径,比如通过 Intent.ACTION_CREATE_DOCUMENT 创建的 application/octet-stream 类型文件 UrienableStatusCallback
- 是否开启录制文件状态回调interval
- 录制文件状态回调频率,单位毫秒,有效范围:1000-10000- Returns:
- true:调用成功,false:调用失败
-
startRecord
public boolean startRecord(ZegoMediaRecordChannelIndex channelIndex, ZegoMediaRecordType recordType, java.lang.String storagePath, boolean enableStatusCallback, int interval, ZegoMediaRecordFormat recordFormat)
开始录制- Parameters:
channelIndex
- 录制通道recordType
- 录制类型storagePath
- 录制文件存储路径,传入的路径需要包含文件名enableStatusCallback
- 是否开启录制文件状态回调interval
- 录制文件状态回调频率,单位毫秒,有效范围:1000-10000recordFormat
- 录制文件的文件格式- Returns:
- true:调用成功,false:调用失败
-
startRecord
public boolean startRecord(ZegoMediaRecordChannelIndex channelIndex, ZegoMediaRecordType recordType, android.net.Uri storageUri, boolean enableStatusCallback, int interval, ZegoMediaRecordFormat recordFormat)
开始录制说明:在系统版本高于 20 的设备上,访问受限资源需要动态申请权限
- Parameters:
channelIndex
- 录制通道recordType
- 录制类型storageUri
- 录制文件存储路径,比如通过 Intent.ACTION_CREATE_DOCUMENT 创建的 application/octet-stream 类型文件 UrienableStatusCallback
- 是否开启录制文件状态回调interval
- 录制文件状态回调频率,单位毫秒,有效范围:1000-10000recordFormat
- 录制文件的文件格式- Returns:
- true:调用成功,false:调用失败
-
startRecord
public boolean startRecord(ZegoMediaRecordChannelIndex channelIndex, ZegoMediaRecordType recordType, java.lang.String storagePath, boolean enableStatusCallback, int interval, ZegoMediaRecordFormat recordFormat, boolean isFragment)
开始录制- Parameters:
channelIndex
- 录制通道recordType
- 录制类型storagePath
- 录制文件存储路径,传入的路径需要包含文件名enableStatusCallback
- 是否开启录制文件状态回调interval
- 录制文件状态回调频率,单位毫秒,有效范围:1000-10000recordFormat
- 录制文件的文件格式isFragment
- 录制文件是否分片,MP4格式才有效- Returns:
- true:调用成功,false:调用失败
-
startRecord
public boolean startRecord(ZegoMediaRecordChannelIndex channelIndex, ZegoMediaRecordType recordType, android.net.Uri storageUri, boolean enableStatusCallback, int interval, ZegoMediaRecordFormat recordFormat, boolean isFragment)
开始录制说明:在系统版本高于 20 的设备上,访问受限资源需要动态申请权限
- Parameters:
channelIndex
- 录制通道recordType
- 录制类型storageUri
- 录制文件存储路径,比如通过 Intent.ACTION_CREATE_DOCUMENT 创建的 application/octet-stream 类型文件 UrienableStatusCallback
- 是否开启录制文件状态回调interval
- 录制文件状态回调频率,单位毫秒,有效范围:1000-10000recordFormat
- 录制文件的文件格式isFragment
- 录制文件是否分片,MP4格式才有效- Returns:
- true:调用成功,false:调用失败
-
startRecord
public boolean startRecord(ZegoMediaRecordConfig config)
-
stopRecord
public boolean stopRecord(ZegoMediaRecordChannelIndex channelIndex)
停止录制- Parameters:
channelIndex
- 录制通道- Returns:
- true:调用成功,false:调用失败
-
setZegoMediaRecordCallback
public void setZegoMediaRecordCallback(IZegoMediaRecordCallback callback)
设置媒体录制回调- Parameters:
callback
- 媒体录制回调
-
setZegoMediaRecordCallback
public void setZegoMediaRecordCallback(IZegoMediaRecordCallback2 callback)
设置媒体录制回调- Parameters:
callback
- 媒体录制回调
-
onMediaRecord
public void onMediaRecord(int errCode, ZegoMediaRecordChannelIndex channelIndex, java.lang.String storagePath)
-
onRecordStatusUpdate
public void onRecordStatusUpdate(ZegoMediaRecordChannelIndex channelIndex, java.lang.String storagePath, long duration, long fileSize, ZegoPublishStreamQuality q)
Description copied from interface:IZegoMediaRecordCallback2
录制信息更新回调 注意:如果录制时在推流,quality数据与推流质量数据一致,建议录制回调时间间隔和推流质量回调时间间隔设置成一样- Specified by:
onRecordStatusUpdate
in interfaceIZegoMediaRecordCallback2
- Parameters:
channelIndex
- 录制通道storagePath
- 录制文件存储路径duration
- 录制时长,单位毫秒fileSize
- 文件大小,单位字节q
- 录制质量
-
-