clipVideo 1.6.1+

GameRecorderManager.clipVideo(Object object)

剪辑精彩的视频片段。

输入

属性类型默认值是否必填说明
pathstringpath的值为停止录屏拿到的视频地址
successfunction剪辑成功的回调函数
failfunction剪辑失败的回调函数

输出

success返回对象参数的扩展属性:

名称数据类型描述
videoPathstring剪辑的视频地址

示例

  1. const recorder = tt.getGameRecorderManager();
  2. recorder.start({
  3. microphoneEnabled: true,
  4. })
  5. // 记录当前时刻前三秒,后三秒
  6. recorder.recordClip({
  7. timeRange: [3, 3]
  8. })
  9. recorder.onStop(({ videoPath })=>{
  10. recorder.clipVideo({
  11. path: videoPath,
  12. success(res){
  13. console.log(res.videoPath);
  14. }
  15. })
  16. })