Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cordova-plugin-video-trim

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-video-trim

视频剪辑功能的Cordova插件

  • 2.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

cordova-plugin-video-trim

短视频剪辑cordova插件

开发环境版本
cordova≥ 9.0.0
cordova-android≥ 8.0.0
cordova-ios≥ 5.0.0

视频剪辑需要在手机设备运行,虚拟机无法剪辑

安装

cordova plugin add cordova-plugin-video-trim

安装需要消耗大约20MB流量

方法列表

方法描述
videoTrim.trimVideo视频剪辑 (支持android与ios)
videoTrim.trimSelectedVideo从相册选择视频后剪辑 (支持android与ios)
videoTrim.trimRecordedVideo录像后前辑 (支持android与ios)
videoTrim.play播放全屏视频 (支持android与ios)
videoTrim.getVideoPreviewImg获取视频预览图 (支持android,暂时不支持ios)

视频剪辑

  videoTrim.trimVideo(videoPath,trimSuccess,trimFail);
  function trimSuccess(result) {
      console.log('trimSuccess, path: ' + result);
  }
  function trimFail(err) {
      console.log('trimFail, err: ' + err);
  }

从相册选择视频后剪辑

  videoTrim.trimSelectedVideo(trimSuccess,trimFail);
  function trimSuccess(filePath) {
      console.log('trimSuccess, path: ' + filePath);
  }
  function trimFail(err) {
      console.log('trimFail, err: ' + err);
  }

录像后前辑

  videoTrim.trimRecordedVideo(trimSuccess,trimFail);
  function trimSuccess(filePath) {
      console.log('trimSuccess, path: ' + filePath);
  }
  function trimFail(err) {
      console.log('trimFail, err: ' + err);
  }

获取视频预览图

 videoTrim.getVideoPreviewImg(videoPath,
    function(url){
        $("body").append("<img src='" + url + "' />");
    },
    function(){
        console.log('error');
    }
);

播放视频(允许全屏)

videoTrim.play(videoPath,success,error);
function success(){

}
function error(){

}

Demo

可以下载 示例项目

videoTrim2

感谢开源项目 Android-Video-Trimmer 提供部分安卓源代码

推荐其它开源库

websql-orm

Keywords

FAQs

Package last updated on 04 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc