nvshortvideo

Last updated:

0 purchases

nvshortvideo Image
nvshortvideo Images
Add to Cart

Description:

nvshortvideo

美摄Flutter短视频模块 #
开发环境要求 #

Fluuter 2.5.0+
iOS

iOS 12.0 及以上的 iPhone
Swift 5
CocoaPods


Anroid

Android Studio 3.0+



支持媒体格式 #
详见:美摄sdk产品概述
系统授权 #
iOS #
App 需要在 Info.plist 中添加以下权限,否则将无法使用短视频模块。
<key>NSCameraUsageDescription</key>
<string>App需要您的同意,才能访问相机</string>
<key>NSMicrophoneUsageDescription</key>
<string>App需要您的同意,才能访问麦克风</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>App需要您的同意,才能访问相册</string>
<key>NSAppleMusicUsageDescription</key>
<string>App需要您的同意,才能访问音乐</string>
copied to clipboard
Android #
在 AndroidManifest.xml 中添加以下权限
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /> -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" /> <!-- <uses-permission android:name="android.permission.INTERNET" /> -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <!-- 用于进行网络定位 -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 用于访问GPS定位 -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- 用于读取手机当前的状态 -->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
copied to clipboard
美摄SDK授权 #
在美摄官网注册用户后,创建应用,配置App包名,由美摄商务同事开通授权后,可在应用信息中下载授权文件。
将下载授权.lic文件重命名为meicam_licence.lic,放入原生项目中

SDK授权和App的包名绑定。未授权时,SDK全功能不再检查授权,都可以使用,绘制的画面会带MEISHE水印。

网络接口配置 #
短视频模块用到的滤镜、贴纸、音乐等文件均通过网络接口获取。需要服务端按接口文档实现相应的接口。
在App工程中配置服务器地址及公共参数。
import 'package:nvshortvideo/nvshortvideo.dart';
...
/// assetRequestUrl 素材列表请求 Material list request
/// assetCategoryUrl 素材分类列表请求 Material category list request
/// assetMusiciansUrl 音乐列表请求 Music list request
/// assetFontUrl 字体列表请求 Font list request
/// assetDownloadUrl 下载地址请求 Download address request
/// assetPrefabricatedUrl 预制素材请求 Prefabricated material request
/// assetAutoCutUrl 一键成片网络请求 AutoCut request
/// assetTagUrl 模版标签列表请求 Template tag list request
/// clientId clientId
/// clientSecret clientSecret
/// assemblyId assemblyId
/// isAbroad 海外数据请求,0==全部,1==海外 Overseas data request, 0== all, 1== overseas
Map<String,dynamic> map = {
'host':'https://mall.meishesdk.com/api/shortvideo/',
'assetRequestUrl':'materialcenter/mall/custom/listAllAssemblyMaterial',
'assetCategoryUrl':'materialcenter/appSdkApi/listTypeAndCategory',
'assetMusiciansUrl':'materialcenter/appSdkApi/listMusic',
'assetFontUrl':'materialcenter/appSdkApi/material/listAll',
'assetDownloadUrl':'materialcenter/mall/custom/materialInteraction',
'assetPrefabricatedUrl':'materialcenter/beautyAssets/latest',
'assetAutoCutUrl':'materialcenter/recommend/listTemplate',
'assetTagUrl':'materialcenter/appSdkApi/listTemplateTag',
'clientId':'7480f2bf193d417ea7d93d64',
'clientSecret':'e4434ff769404f64b33f462331a80957',
'assemblyId':'MEISHE_MATERIAL_LIST',
'isAbroad':1
};
shortVideoOperator().configServerInfo(map);

copied to clipboard
预制素材 #
短视频模块依赖的素材包可根据需要选择。预制素材详见:短视频模块预制素材
短视频模块主要方法 #
模块单例:shortVideoOperator()
调用示例:
import 'package:nvshortvideo/nvshortvideo.dart';

NvVideoConfig videoConfig = NvVideoConfig();
shortVideoOperator().startVideoDualCaptrue(config: videoConfig);

copied to clipboard
视频录制 #
/*! \if ENGLISH
*
* \brief Shooting entrance
* \param config Configuration item
* \param music The default is nil,If you need to shoot with music, you need to pass an audio object, and the path of the audio must be local and has been downloaded
* \else
*
* \brief 拍摄入口
* \param config 配置项
* \param music 默认是nil,如果拍摄时需要带音乐拍摄,需要传递一个音频对象,音频的路径必须是本地的,已经下载的路径
* \endif
*/
startVideoCapture({NvVideoConfig? config, NvMusicInfo? musicInfo});

copied to clipboard
合拍 #
/*! \if ENGLISH
*
* \brief PIP entrance By default, the album is opened, and a material from the album is taken into the beat
* \param config Configuration item
* \else
*
* \brief 合拍入口,默认打开相册,从相册取一个素材进入合拍
* \param config 配置项
* \endif
*/
startVideoDualCapture({NvVideoConfig? config});

/*! \if ENGLISH
*
* \brief PIP entrance
* \param config Configuration item
* \param videoPath The video path to be filmed must be a local path
* \else
*
* \brief 合拍入口
* \param config 配置项
* \param videoPath 准备合拍的视频路径,必须是本地路径
* \endif
*/
startVideoDualCaptureWithVideo(String videoPath, {NvVideoConfig? config});

copied to clipboard
视频编辑 #
/*! \if ENGLISH
*
* \brief Edit entrance
* \param config Configuration item
* \else
*
* \brief 编辑入口
* \param config 配置项
* \endif
*/
startSelectFilesForEdit({NvVideoConfig? config});

copied to clipboard
视频编辑完成回调 #
/*! \if ENGLISH
* \brief Edit module event callback
* \else
* \brief 编辑模块事件回调
* \endif
*/
setVideoEditEventHandler(Function(NvVideoEditEvent event, Map info)? handler);

copied to clipboard
选择封面 #
/*! \if ENGLISH
* \brief Select Cover Image
* \else
* \brief 选择封面
* \endif
*/
Future selectCoverImage();

copied to clipboard
保存草稿 #
/*! \if ENGLISH
* \brief save draft
* \else
* \brief 保存草稿
* \endif
*/
Future saveDraft(String info);

copied to clipboard
合成视频 #
/*! \if ENGLISH
* \brief Composite video
* \else
* \brief 合成视频
* \endif
*/
Future compileCurrentTimeline(Map configure);

copied to clipboard
视频合成回调 #
/*! \if ENGLISH
* \brief Composite video event callback
* \else
* \brief 视频合成事件回调
* \endif
*/
setVideoCompileEventHandler(
Function(NvVideoCompileEvent event, Map compileInfo)? handler);

copied to clipboard
保存封面图片 #
/*! \if ENGLISH
* \brief save image
* \else
* \brief 保存图片
* \endif
*/
Future saveImage(String info);
copied to clipboard
退出短视频模块 #
视频发布页退出时调用
/*! \if ENGLISH
*
* \brief Exit the entire publisher call
* \param taskId Returned by the edit completion callback
* \warning This method will clean up the current draft and SDK-held resources, please call after completely exiting the editing and publishing process
* \else
*
* \brief 退出整个发布器调用
* \param taskId 由编辑完成回调中返回
* \warning 该方法会清理当前草稿以及sdk持有资源,请在完全退出编辑发布流程之后,调用
* \endif
*/
exitEdit(String taskId);

copied to clipboard
获取草稿列表 #
/*! \if ENGLISH
* \brief get draft list
* \else
* \brief 获取草稿列表
* \endif
*/
Future getDraftList();
copied to clipboard
删除草稿 #
/*! \if ENGLISH
* \brief delete draft
* \else
* \brief 删除草稿
* \endif
*/
Future deleteDraft(String draftId);
copied to clipboard
打开草稿 #
/*! \if ENGLISH
*
* \brief Enter the editing portal through draft data recovery
* \param draftId Current draft id
* \param config Configuration item
* \else
*
* \brief 通过草稿数据恢复,进入编辑入口
* \param draftId 当前草稿id
* \param config 配置项
* \endif
*/
Future reeditDraft(String draftId, {NvVideoConfig? config});

copied to clipboard
模块设置 #
短视频模块设置类NvVideoConfig,包含功能模块设置、UI定制。详见:短视频功能模块设置、短视频UI模块设置
隐私协议 #
美摄短视频隐私协议

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.