/**
* @overview JSDoc of SDK WEB APPLICATION
* @version 3.4.0
* @copyright Meishe Co., Ltd.
*/
/**
* @classdesc event emitter
*/
class NvsEventEmitter {
/**
* @constructor
*/
constructor() {
this.store = {}
}
/**
* @description on
*/
on(key, fn) {
if (this.store[key]) {
this.store[key].push(fn)
} else {
this.store[key] = [fn]
}
}
/**
* @description emit
*/
emit(key, ...args) {
if (!this.store[key]) {
return
}
while (this.store[key].length > 0) {
let fn = this.store[key][0]
fn(...args)
this.off(key, fn)
}
}
/**
* @description off
*/
off(key, fn) {
if (!this.store[key]) {
return
}
const idx = this.store[key].findIndex(i => i === fn)
if (idx === -1) {
return
}
this.store[key].splice(idx, 1)
}
}
/**
* @description videoFx
*/
const NvsStreamingSdkFuncVideoFx = 'videoFx';
/**
* @description animatedSticker
*/
const NvsStreamingSdkFuncAnimatedSticker = 'animatedSticker';
/**
* @description music
*/
const NvsStreamingSdkFuncMusic = 'music';
/**
* @description caption
*/
const NvsStreamingSdkFuncCaption = 'caption';
/**
* @description videoFxExtension
*/
const NvsStreamingSdkFuncVideoFxExtension = 'videoFxExtension';
/**
* @description videoTransition
*/
const NvsStreamingSdkFuncVideoTransition = 'videoTransition';
/**
* @description theme
*/
const NvsStreamingSdkFuncTheme = 'theme';
/**
* @description particleVideoFx
*/
const NvsStreamingSdkFuncParticleVideoFx = 'particleVideoFx';
/**
* @description template
*/
const NvsStreamingSdkFuncTemplate = 'template';
/**
* @description useTemplate
*/
const NvsStreamingSdkFuncUseTemplate = 'useTemplate';
/**
* @description videoTransitionExtension
*/
const NvsStreamingSdkFuncVideoTransitionExtension = 'videoTransitionExtension';
/**
* @description changeSpeed
*/
const NvsStreamingSdkFuncChangeSpeed = 'changeSpeed';
/**
* @description clipSplit
*/
const NvsStreamingSdkFuncClipSplit = 'clipSplit';
/**
* @description videoColorAdjust
*/
const NvsStreamingSdkFuncVideoColorAdjust = 'videoColorAdjust';
/**
* @description captionStyleSetting
*/
const NvsStreamingSdkFuncCaptionStyleSetting = 'captionStyleSetting';
const nvsEventEmitter = new NvsEventEmitter();
/**
* @description streamingEngineStateStopped
*/
const streamingEngineStateStopped = 'streamingEngineStateStopped';
/**
* @classdesc sdk version
*/
class NvsSdkVersion {
/**
* @constructor
* @param {Number} majorVersion major version
* @param {Number} minorVersion minor version
* @param {Number} revisionNumber revision number
*/
constructor(majorVersion, minorVersion, revisionNumber) {
this.majorVersion = majorVersion;
this.minorVersion = minorVersion;
this.revisionNumber = revisionNumber;
}
}
/**
* @classdesc rational
*/
class NvsRational {
/**
* @constructor
* @param {Number} numerator numerator
* @param {Number} denominator denominator
*/
constructor(numerator, denominator) {
this.num = numerator;
this.den = denominator;
}
}
/**
* @classdesc video resolution
*/
class NvsVideoResolution {
/**
* @constructor
* @param {Number} imageWidth width
* @param {Number} imageHeight height
*/
constructor(imageWidth, imageHeight) {
this.imageWidth = imageWidth;
this.imageHeight = imageHeight;
}
}
/**
* @classdesc audio resolution
*/
class NvsAudioResolution {
/**
* @constructor
* @param {Number} sampleRate sample rate
* @param {Number} channelCount count of channel
*/
constructor(sampleRate, channelCount) {
this.sampleRate = sampleRate;
this.channelCount = channelCount;
}
}
/**
* @description fill mode enum of Live window
*/
const NvsLiveWindowFillModeEnum = Object.freeze({
"PreserveAspectCrop" : 0,
"PreserveAspectFit" : 1,
"Stretch" : 2});
/**
* @classdesc video preview window
*/
class NvsLiveWindow {
/**
* @constructor
*/
constructor() {
this.internalLiveWindow = 0;
}
/**
* @description set file mode
* @param {Number} fillMode fill mode
* @return {Void}
*/
setFillMode(fillMode) {
Module.nvs_liveWindow_setFillMode(this.internalLiveWindow, fillMode);
}
/**
* @description get fill mode
* @return {Number} fill mode
*/
getFillMode() {
return Module.nvs_liveWindow_getFillMode(this.internalLiveWindow);
}
/**
* @description timeline coordinates to view coordinates
* @param {NvsPointF} ptCanonical timeline coordinates
* @return {NvsPointF} view coordinates
*/
mapCanonicalToView(ptCanonical) {
return Module.nvs_liveWindow_mapCanonicalToView(this.internalLiveWindow, ptCanonical);
}
/**
* @description view coordinates to timeline coordinates
* @param {NvsPointF} ptView view coordinates
* @return {NvsPointF} timeline coordinates
*/
mapViewToCanonical(ptView) {
return Module.nvs_liveWindow_mapViewToCanonical(this.internalLiveWindow, ptView);
}
/**
* @description normalized coordinates to view coordinates
* @param {NvsPointF} ptNormalized normalized coordinates
* @return {NvsPointF} view coordinates
*/
mapNormalizedToView(ptNormalized) {
return Module.nvs_liveWindow_mapNormalizedToView(this.internalLiveWindow, ptNormalized);
}
/**
* @description view coordinates to normalized view coordinates
* @param {NvsPointF} view coordinates
* @return {NvsPointF} normalized coordinates
*/
mapViewToNormalized(ptView) {
return Module.nvs_liveWindow_mapViewToNormalized(this.internalLiveWindow, ptView);
}
/**
* @description set background color
* @param {NvsColor} color background color
* @return {}
*/
setBackgroundColor(color) {
Module.nvs_liveWindow_setBackgroundColor(this.internalLiveWindow, color);
}
}
/**
* @description size mode enum of video preview
*/
const NvsVideoPreviewSizeModeEnum = Object.freeze({
"FullSize" : 0,
"LiveWindowSize" : 1});
/**
* @description flag enum of searching
*/
const NvsSeekFlagEnum = Object.freeze({
"ShowCaptionPoster" : 2,
"ShowAnimatedStickerPoster" : 4,
"BuddyHostVideoFrame" : 16,
"WebReaderPrefetchForSeek" : 32});
/**
* @description flag enum of playback
*/
const NvsPlaybackFlagEnum = Object.freeze({
"LowPipelineSize" : 8,
"DisableFixedPrerollTime" : 16,
"BuddyHostVideoFrame" : 32});
/**
* @description status enum of streaming engine
*/
const NvsStreamingEngineStateEnum = Object.freeze({
"StreamingEngineStateStopped" : 0,
"StreamingEngineStatePlayback" : 3,
"StreamingEngineStateSeeking" : 4,
"StreamingEngineStateCompile" : 5});
/**
* @description enum of resource package type
*/
const NvsAssetPackageTypeEnum = Object.freeze({
"VideoFx" : 0,
"VideoTransition" : 1,
"CaptionStyle" : 2,
"AnimatedSticker" : 3,
"Theme" : 4,
"CaptureScene" : 5,
"ARScene" : 6,
"CompoundCaption" : 7,
"CaptionContext" : 8,
"CaptionRenderer" : 9,
"CaptionAnimation" : 10,
"CaptionInAnimation" : 11,
"CaptionOutAnimation" : 12,
"Template" : 13});
/**
* @description enum of resource package status
*/
const NvsAssetPackageStatusEnum = Object.freeze({
"NotInstalled" : 0,
"Installing" : 1,
"Ready" : 2,
"Upgrading" : 3});
/**
* @description type enum of track
*/
const NvsTrackTypeEnum = Object.freeze({
"Video" : 0,
"Audio" : 1});
/**
* @description enum of clip type
*/
const NvsClipTypeEnum = Object.freeze({
"Video" : 0,
"Audio" : 1});
/**
* @description type enum of video clip
*/
const NvsVideoClipTypeEnum = Object.freeze({
"AV" : 0,
"Image" : 1});
/**
* @description motion mode enum of video clip
*/
const NvsVideoClipMotionModeEnum = Object.freeze({
"LetterBoxZoomIn" : 0,
"LetterBoxZoomOut" : 1,
"Image_ROI" : 2});
/**
* @description extra rotation enum of video clip
*/
const NvsVideoClipExtraRotationEnum = Object.freeze({
"Rotation0" : 0,
"Rotation90" : 1,
"Rotation180" : 2,
"Rotation270" : 3});
/**
* @description background mode enum of video clip
*/
const NvsVideoClipBackgroundModeEnum = Object.freeze({
"ColorSolid" : 0,
"Blur" : 1});
/**
* @description theme enum of clip role
*/
const NvsClipRoleInThemeEnum = Object.freeze({
"General" : 0,
"Title" : 1,
"Trailer" : 2});
/**
* @description type enum of video special effects
*/
const NvsVideoFxTypeEnum = Object.freeze({
"Builtin" : 0,
"Package" : 1,
"Custom" : 2});
/**
* @description type enum of video transition
*/
const NvsVideoTransitionTypeEnum = Object.freeze({
"Builtin" : 0,
"Package" : 1});
/**
* @description theme enum of caption role
*/
const NvsCaptionRoleInThemeEnum = Object.freeze({
"General" : 0,
"Title" : 1,
"Trailer" : 2});
/**
* @description permutation enum of caption text
*/
const NvsCaptionTextAlignmentEnum = Object.freeze({
"Left" : 0,
"Center" : 1,
"Right" : 2});
/**
* @description border type enum of subtitle text
*/
const NvsCaptionTextBoundingTypeEnum = Object.freeze({
"Text" : 0,
"TextFrame" : 1,
"Frame" : 2});
/**
* @description separated type enum of subtitle character
*/
const NvsCaptionLetterSpacingTypeEnum = Object.freeze({
"Percentage" : 0,
"Absolute" : 1});
/**
* @description function enum of human detection
*/
const NvsHumanDetectionFeatureEnum = Object.freeze({
"FaceLandmark" : 1,
"FaceAction" : 2,
"AvatarExpression" : 4,
"VideoMode" : 8,
"ImageMode" : 16});
/**
* @description querying mode enum of key frame
*/
const NvsKeyFrameFindModeEnum = Object.freeze({
"Before" : 1,
"After" : 2});
/**
* @description enum of clip wrap mode
*/
const NvsClipWrapModeEnum = Object.freeze({
"RepeatLastFrame" : 0,
"RepeatFirstFrame" : 1,
"Repeat" : 2});
/**
* @description aspect ratio enum of timeline
*/
const NvsTimelineAspectRatioEnum = Object.freeze({
"16v9": 1,
"1v1": 2,
"9v16": 4,
"4v3": 8,
"3v4": 16,
"18v9": 32,
"9v18": 64,
"21v9": 512,
"9v21": 1024});
/**
* @description resume audio context
* @return {Void}
*/
function nvsResumeAudioContext() {
// Under some browsers(such as chrome >= 70) The AudioContext was not allowed to start
// if we don't resume AudioContext after a user gesture on the page.
// For detailed information please refer to https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio
if (typeof(Module['Meishe']) === 'undefined')
Module['Meishe'] = {};
var Meishe = Module['Meishe'];
if (!Meishe.audioContext) {
if (typeof(AudioContext) !== 'undefined')
Meishe.audioContext = new AudioContext();
else if (typeof(webkitAudioContext) !== 'undefined')
Meishe.audioContext = new webkitAudioContext();
else
return;
}
var audioCtx = Meishe.audioContext;
if (audioCtx.state === 'suspended')
audioCtx.resume();
}
/**
* @description resume AudioContext with Promise
* @return {Void}
*/
function nvsResumeAudioContextWithPromise() {
// Under some browsers(such as chrome >= 70) The AudioContext was not allowed to start
// if we don't resume AudioContext after a user gesture on the page.
// For detailed information please refer to https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio
if (typeof(Module['Meishe']) === 'undefined')
return Promise.reject(new Error('Module.Meishe is undefined'));
var Meishe = Module['Meishe'];
if (!Meishe.audioContext) {
console.error('Meishe.audioContext is null!');
return Promise.reject(new Error('Meishe.audioContext is null'));
}
if (Meishe.audioContext.state === 'suspended')
return Meishe.audioContext.resume();
return Promise.resolve();
}
/**
* @description get instance of streaming context
* @return {NvsStreamingContext} engine object of streaming
*/
function nvsGetStreamingContextInstance() {
return Module.Meishe.streamingContext;
}
/**
* @classdesc vector contains float type values
*/
// std::vector<float>
class NvsVectorFloat {
/**
* @constructor
*/
constructor() {
return new Module.VectorFloat();
}
}
/**
* @classdesc vector contains object type values
*/
// std::vector<emscripten::val>
class NvsVectorVal {
/**
* @constructor
*/
constructor() {
return new Module.VectorVal();
}
}
/**
* @classdesc AI toning info
*/
class NvsAIToningInfo {
/**
* @constructor
*/
constructor() {
this.exposure = 0;
this.contrast = 0;
this.shadow = 0;
this.highlight = 0;
this.brightness = 0;
this.blackpoint = 0;
this.saturation = 0;
this.vibrance = 0;
this.definition = 0;
this.sharpeness = 0;
}
}
/**
* @classdesc Streaming context:The streaming context class(NvsStreamingContext) can be refered to as the entry point of the whole SDK framework. In the process of development, NvsStreamingContext provides the static sharedInstance interface, which is the only instance to create streaming context. Through this instantce object, we can turn on the recording device to record videos, adding effects to capture videos, set various parameters for recording, which include autofocus, automatic exposure adjustment, swtiching on/off of the light supplement and so on. Meanwhile, this instance can also create timelines, connecting timelines to real-time preview windows to view the recorded videos in real-time. When the whole video has been produced completely, please destroy the instances of streaming context. When recording with special effects or adding resources packages (recording effects package, scene resources package and so on), one has to first install the package and obtain packageID after installation. For built-in special effects, one only needs to obtain the name of the effect in order to use them.
In the SDK, users need to adopt the full pathway when importing resources or authorizations.
*/
class NvsStreamingContext {
/**
* @constructor
*/
constructor() {
this.onWebRequestWaitStatusChange = function(isVideo, waiting) {
}
this.onWebRequestAuthFinish = function(success, uuid) {
}
this.onPlaybackTimelinePosition = function(timeline, position) {
}
this.onPlaybackStopped = function(timeline) {
}
this.onPlaybackEOF = function(timeline) {
}
this._onStreamingEngineStateChanged = function(state) {
}
this.onAudioVUMeter = function(timeline, leftVUValue, rightVUValue, timeStamp) {
}
this.onImageGrabbedArrived = function(imageData, time) {
}
}
get onStreamingEngineStateChanged() {
return (state) => {
if (state === 0) {
nvsEventEmitter.emit(streamingEngineStateStopped);
}
this._onStreamingEngineStateChanged(state)
}
}
set onStreamingEngineStateChanged(fun) {
this._onStreamingEngineStateChanged = fun
}
/**
* @description ready for modify timeline of streaming engine
* @return {Promise} Promise
*/
streamingEngineReadyForTimelineModification() {
let self = this;
return new Promise((resolve, reject) => {
if (Module.Meishe.streamingContext.getStreamingEngineState() === 0)
resolve();
else {
nvsEventEmitter.on(streamingEngineStateStopped, function slot() {
resolve();
});
self.stop();
}
});
}
/**
* @description verify sdk license file
* @param {} requestUrl request url
* @param {} type type
* @return {}
*/
verifySdkLicenseFile(requestUrl, type = '') {
return Module.nvs_streamingContext_verifySdkLicenseFile(requestUrl, type);
}
/**
* @description verify sdk licence file with extra user data
* @param {String} requestUrl request url
* @param {} extraUserData extra user data
* @return {}
*/
verifySdkLicenseFileWithExtraUserData(requestUrl, extraUserData) {
Module.Meishe.ExtraUserData = extraUserData;
return Module.nvs_streamingContext_verifySdkLicenseFileWithExtraUserData(requestUrl);
}
/**
* @description get sdk version
* @return {NvsSdkVersion} sdk version
*/
getSdkVersion() {
return Module.nvs_streamingContext_getSdkVersion();
}
/**
* @description create timeline
* @param {} videoRes Video file's resolution (specified width to height ratio). For video editting resolution, when importing corresponding params, the imported image's width has to be a multiple of 4, the height has to be a multiple of 2. Note: if one creates NvsStreamingContext's instance that supports 4K video editting, then video editting's resolution cannot be higher then 3840*2160(imageWidth*imageHeight), otherwise the imageWidth*imageHeight cannot exceed 1920* 1080 pixels.
* @param {} fps Frame rate
* @param {} audioRes Audio file's resolution(specified file sampling rate, sampling format and number of channels. For audio editting resolution, imported audio only supports two types of sampling rate, 44100 or 48000.)
* @param {Number} flags Special flags for create timeline. If there is no special requirements please input 0.
* @return {NvsTimeline} timeline
*/
createTimeline(videoRes, fps, audioRes, flags = 0) {
return Module.nvs_streamingContext_createTimeline(videoRes, fps, audioRes, flags);
}
/**
* @description create template timeline according template id
* @param {} templateId template id
* @param {} templateFootages template footages
* @param {Number} flags flags
* @return {NvsTimeline} timeline
*/
createTemplateTimeline(templateId, templateFootages, flags = 0) {
return Module.nvs_streamingContext_createTemplateTimeline(templateId, templateFootages, flags);
}
/**
* @description create timeline of empty template
* @param {} videoRes videoRes Video file's resolution (specified width to height ratio). For video editting resolution, when importing corresponding params, the imported image's width has to be a multiple of 4, the height has to be a multiple of 2. Note: if one creates NvsStreamingContext's instance that supports 4K video editting, then video editting's resolution cannot be higher then 3840*2160(imageWidth*imageHeight), otherwise the imageWidth*imageHeight cannot exceed 1920* 1080 pixels.
* @param {} fps Frame rate
* @param {} audioRes Audio file's resolution(specified file sampling rate, sampling format and number of channels. For audio editting resolution, imported audio only supports two types of sampling rate, 44100 or 48000.)
* @param {} templateId template id
* @param {} flags flags
* @return {NvsTimeline} timeline
*/
createEmptyTemplateTimeline(videoRes, fps, audioRes, templateId, flags = 0) {
return Module.nvs_streamingContext_createEmptyTemplateTimeline(videoRes, fps, audioRes, templateId, flags);
}
/**
* @description remove timeline
* @param {} timeline timeline
* @return {boolean} true means a successful remove, false means failure.
*/
removeTimeline(timeline) {
return Module.nvs_streamingContext_removeTimeline(timeline);
}
/**
* @description create streaming live window according canvas id
* @param {} canvasId canvas id
* @return {NvsLiveWindow} live window
*/
createLiveWindow(canvasId) {
return Module.nvs_streamingContext_createLiveWindow(canvasId);
}
/**
* @description remvoe live window
* @param {} liveWindow live window
* @return {}
*/
removeLiveWindow(liveWindow) {
Module.nvs_streamingContext_removeLiveWindow(liveWindow);
}
/**
* @description connect timeline with Live window
* @param {} timeline timeline
* @param {} liveWindow live window
* @return {boolean}
*/
connectTimelineWithLiveWindow(timeline, liveWindow) {
return Module.nvs_streamingContext_connectTimelineWithLiveWindow(timeline, liveWindow);
}
/**
* @description Seeking the frame at a specific timestamp
* @param {} timeline timeline
* @param {} timestamp Timestamp (in microseconds). Timestamp should be in the range of [0,timeline.duration - 1]. Other input values are invalid and seekTimeline will return false, results can't targeting.
* @param {} videoSizeMode Video preview mode. Please refer to NvsVideoPreviewSizeModeEnum.
* @param {} flags Flags for streaming engine seeking. For specific please refer to NvsSeekFlagEnum.
* @return {boolean}
*/
seekTimeline(timeline, timestamp, videoSizeMode, flags) {
return Module.nvs_streamingContext_seekTimeline(timeline, timestamp, videoSizeMode, flags);
}
/**
* @description playback timeline
* @param {} timeline timeline
* @param {} startTime Start time(in microseconds). Start time should be in the range [0,timeline.duration - 1], other inputs are invalid and playbackTimeline will return false resulting playback cannot be turned on.
* @param {} endTime End time(in microseconds). If endtime input is a negative value, then the playback is defaultly set to play till the end.
* @param {} videoSizeMode If no special requirements please input 0. Please refer to NvsVideoPreviewSizeModeEnum for reference.
* @param {} preload Whether to preload
* @param {} flags Flags for preview. If no special requirements please input 0. Please refer to NvsPlaybackFlagEnum for reference.
* @return {boolean}
*/
playbackTimeline(timeline, startTime, endTime, videoSizeMode, preload, flags) {
return Module.nvs_streamingContext_playbackTimeline(timeline, startTime, endTime, videoSizeMode, preload, flags);
}
/**
* @description playback timeline with proxy scale
* @param {} timeline timeline
* @param {} startTime Start time(in microseconds). Start time should be in the range [0,timeline.duration - 1], other inputs are invalid and playbackTimeline will return false resulting playback cannot be turned on.
* @param {} endTime End time(in microseconds). If endtime input is a negative value, then the playback is defaultly set to play till the end.
* @param {} proxyScale Zoom scale of proxy
* @param {} preload Whether to preload
* @param {} flags Flags for preview. If no special requirements please input 0. Please refer to NvsPlaybackFlagEnum for reference.
* @return {boolean}
*/
playbackTimelineWithProxyScale(timeline, startTime, endTime, proxyScale, preload, flags) {
return Module.nvs_streamingContext_playbackTimelineWithProxyScale(timeline, startTime, endTime, proxyScale, preload, flags);
}
/**
* @description Stops the engine.
* @return {}
*/
stop() {
Module.nvs_streamingContext_stop();
}
/**
* @description get current timeline position
* @param {} timeline timeline
* @return {Number}
*/
getTimelineCurrentPosition(timeline) {
return Module.nvs_streamingContext_getTimelineCurrentPosition(timeline);
}
/**
* @description get streaming engine status
* @return {Number}
*/
getStreamingEngineState() {
return Module.nvs_streamingContext_getStreamingEngineState();
}
/**
* @description get asset package manager
* @return {Num}
*/
getAssetPackageManager() {
return Module.nvs_streamingContext_getAssetPackageManager();
}
/**
* @description get audio/video file information
* @param {} avFilePath file path
* @param {} extraFlag extra flags
* @return {Num}
*/
getAVFileInfo(avFilePath, extraFlag) {
return Module.nvs_streamingContext_getAVFileInfo(avFilePath, extraFlag);
}
/**
* @description register font according file path
* @param {} fontFilePath
* @return {Num}
*/
registerFontByFilePath(fontFilePath) {
return Module.nvs_streamingContext_registerFontByFilePath(fontFilePath);
}
/**
* @description get image from timeline
* @param {} timeline timeline
* @param {} timestamp timestamp
* @param {} proxyScale scale proxy
* @param {} flags flags
* @return {Num}
*/
grabImageFromTimeline(timeline, timestamp, proxyScale, flags) {
return Module.nvs_streamingContext_grabImageFromTimeline(timeline, timestamp, proxyScale, flags);
}
/**
* @description set audio output device volume
* @param {} volume volume
* @return {}
*/
setAudioOutputDeviceVolume(volume) {
Module.nvs_streamingContext_setAudioOutputDeviceVolume(volume);
}
/**
* @description set max count of video file Reader
* @param {} count count
* @return {}
*/
setMaxVideoFileReaderCount(count) {
Module.nvs_streamingContext_setMaxVideoFileReaderCount(count);
}
/**
* @description set max count of video decoding thread
* @param {} count count
* @return {}
*/
setMaxVideoDecodingThreadCount(count) {
Module.nvs_streamingContext_setMaxVideoDecodingThreadCount(count);
}
/**
* @description function authorise
* @param {} sdkFunctionName sdk function name
* @return {Num}
*/
functionalityAuthorised(sdkFunctionName) {
return Module.nvs_streamingContext_functionalityAuthorised(sdkFunctionName);
}
/**
* @description set Chinese language only
* @param {} useChineseLanguageOnly use Chinese language only
* @return {}
*/
setUseChineseLanguageOnly(useChineseLanguageOnly) {
Module.nvs_streamingContext_setUseChineseLanguageOnly(useChineseLanguageOnly);
}
/**
* @description Chinese language only or not
* @return {Num}
*/
isUseChineseLanguageOnly() {
return Module.nvs_streamingContext_isUseChineseLanguageOnly();
}
/**
* @description init human detection
* @param {} modelFilePath mode file path
* @param {} licenseFilePath license file path
* @param {} features features
* @return {Num}
*/
initHumanDetection(modelFilePath, licenseFilePath, features) {
return Module.nvs_streamingContext_initHumanDetection(modelFilePath, licenseFilePath, features);
}
/**
* @description close human detection
* @return {}
*/
closeHumanDetection() {
Module.nvs_streamingContext_closeHumanDetection();
}
/**
* @description preload effects resource
* @return {Num}
*/
preloadEffectResources() {
return Module.nvs_streamingContext_preloadEffectResources();
}
/**
* @description update the notify to webReader
* @param {} webAVFilePath web audio video file path
* @return {Num}
*/
notifyUpdateToWebReader(webAVFilePath) {
return Module.nvs_streamingContext_notifyUpdateToWebReader(webAVFilePath);
}
/**
* @description enable audio VU meter
* @param {} enable enable or not
* @return {Num}
*/
enableAudioVUMeter(enable) {
Module.nvs_streamingContext_enableAudioVUMeter(enable);
}
/**
* @description get automatic tone parameter
* @param {} imageData image data
* @param {} width width
* @param {} height height
* @param {} isRawImage raw image or not
* @return {Num}
*/
getAutoToneParameters(imageData, width, height, isRawImage) {
return Module.nvs_AIAdjustColorDetect_getAutoToneParameters(imageData, width, height, isRawImage);
}
}
const TEMPLATE_KEY_REPLACE_ID = 'MSTemplate-ReplaceId'
const TEMPLATE_KEY_FOOTAGE_ID = 'MSTemplate-FootageId'
const TEMPLATE_KEY_FOOTAGE_TAGS = 'MSTemplate-FootageTags'
/**
* @classdesc project object
*/
class NvsProjObj {
/**
* @constructor
*/
constructor() {
this.internalObj = 0;
}
/**
* @description set internal object
* @param {} obj internal object
* @return {}
*/
setInternalObject(obj) {
this.internalObj = obj;
}
/**
* @description get internal object
* @return {Num}
*/
getInternalObject() {
return this.internalObj;
}
/**
* @description get template attachment
* @param {} key key
* @param {} value value
* @return {}
*/
setTemplateAttachment(key, value) {
Module.nvs_object_setTemplateAttachment(this.internalObj, key, value);
}
/**
* @description get template attachment according key
* @param {} key key
* @return {Num}
*/
getTemplateAttachment(key) {
return Module.nvs_object_getTemplateAttachment(this.internalObj, key);
}
}
/**
* @classdesc Timeline class: edit the timeline entity of the scene. The timeline is composed of tracks and can be regarded as a collection of a series of audio and video tracks. Multiple video tracks and audio tracks can be added or removed on the timeline. Multiple tracks are superimposed and synthesized with each other. When editing a video, you can also add timeline subtitles, themes and corresponding animation stickers as needed to make a beautiful video. In addition, the added material resource package (theme package, animation sticker package, subtitle style package, timeline special effect package, etc.) must be installed first. After successful installation, the packageid can be used, while the built-in timeline special effect (builtin) only needs to obtain the special effect name.
* @extends NvsProjObj
*/
class NvsTimeline extends NvsProjObj {
/**
* @constructor
*/
constructor() {
super();
}
/**
* @description get video resolution
* @return {Num}
*/
getVideoRes() {
return Module.nvs_timeline_getVideoRes(this.internalObj);
}
/**
* @description get audio resolution
* @return {Num}
*/
getAudioRes() {
return Module.nvs_timeline_getAudioRes(this.internalObj);
}
/**
* @description get timeline duration
* @return {Num}
*/
getDuration() {
return Module.nvs_timeline_getDuration(this.internalObj);
}
/**
* @description append video track
* @return {Num}
*/
appendVideoTrack() {
return Module.nvs_timeline_appendVideoTrack(this.internalObj);
}
/**
* @description append audio track
* @return {Num}
*/
appendAudioTrack() {
return Module.nvs_timeline_appendAudioTrack(this.internalObj);
}
/**
* @description insert video track
* @param {} insertPoint insert point
* @return {Num}
*/
insertVideoTrack(insertPoint) {
return Module.nvs_timeline_insertVideoTrack(this.internalObj, insertPoint);
}
/**
* @description insert audio track
* @param {} insertPoint insert point
* @return {Num}
*/
insertAudioTrack(insertPoint) {
return Module.nvs_timeline_insertAudioTrack(this.internalObj, insertPoint);
}
/**
* @description remove video track
* @param {} trackIndex track index
* @return {Num}
*/
removeVideoTrack(trackIndex) {
return Module.nvs_timeline_removeVideoTrack(this.internalObj, trackIndex);
}
/**
* @description remove audio track
* @param {} trackIndex track index
* @return {Num}
*/
removeAudioTrack(trackIndex) {
return Module.nvs_timeline_removeAudioTrack(this.internalObj, trackIndex);
}
/**
* @description get count of video track
* @return {Num}
*/
videoTrackCount() {
return Module.nvs_timeline_videoTrackCount(this.internalObj);
}
/**
* @description get count of audio track
* @return {Num}
*/
audioTrackCount() {
return Module.nvs_timeline_audioTrackCount(this.internalObj);
}
/**
* @description get video track according to index
* @param {} trackIndex track index
* @return {Num}
*/
getVideoTrackByIndex(trackIndex) {
return Module.nvs_timeline_getVideoTrackByIndex(this.internalObj, trackIndex);
}
/**
* @description get audio track according to index
* @param {} trackIndex track index
* @return {Num}
*/
getAudioTrackByIndex(trackIndex) {
return Module.nvs_timeline_getAudioTrackByIndex(this.internalObj, trackIndex);
}
/**
* @description change video size
* @param {} videoWidth video width
* @param {} videoHeight video height
* @return {Num}
*/
changeVideoSize(videoWidth, videoHeight) {
return Module.nvs_timeline_changeVideoSize(this.internalObj, videoWidth, videoHeight);
}
/**
* @description change video size
* @param {} videoWidth video width
* @param {} videoHeight video height
* @return {Num}
*/
changeVideoSize2(videoWidth, videoHeight) {
return Module.nvs_timeline_changeVideoSize2(this.internalObj, videoWidth, videoHeight);
}
/**
* @description get first capition
* @return {Num}
*/
getFirstCaption() {
return Module.nvs_timeline_getFirstCaption(this.internalObj);
}
/**
* @description get last caption
* @return {Num}
*/
getLastCaption() {
return Module.nvs_timeline_getLastCaption(this.internalObj);
}
/**
* @description get previous caption
* @param {} caption caption
* @return {Num}
*/
getPrevCaption(caption) {
return Module.nvs_timeline_getPrevCaption(this.internalObj, caption);
}
/**
* @description get next caption
* @param {} caption caption
* @return {Num}
*/
getNextCaption(caption) {
return Module.nvs_timeline_getNextCaption(this.internalObj, caption);
}
/**
* @description get caption according to timeline position
* @param {} timelinePos timeline position
* @return {Num}
*/
getCaptionsByTimelinePosition(timelinePos) {
return Module.nvs_timeline_getCaptionsByTimelinePosition(this.internalObj, timelinePos);
}
/**
* @description add caption
* @param {} captionText caption text
* @param {} inPoint in point
* @param {} duration duration
* @param {} captionStylePackageId caption style package id
* @param {} isPanoramic panoramic or not
* @return {Num}
*/
addCaption(captionText, inPoint, duration, captionStylePackageId, isPanoramic) {
return Module.nvs_timeline_addCaption(this.internalObj, captionText, inPoint, duration, captionStylePackageId, isPanoramic);
}
/**
* @description add modular caption
* @param {} captionText caption text
* @param {} inPoint in point
* @param {} duration duration
* @return {Num}
*/
addModularCaption(captionText, inPoint, duration) {
return Module.nvs_timeline_addModularCaption(this.internalObj, captionText, inPoint, duration);
}
/**
* @description remove caption
* @param {} caption caption
* @return {Num}
*/
removeCaption(caption) {
return Module.nvs_timeline_removeCaption(this.internalObj, caption);
}
/**
* @description get first compound caption
* @return {Num}
*/
getFirstCompoundCaption() {
return Module.nvs_timeline_getFirstCompoundCaption(this.internalObj);
}
/**
* @description get last compound caption
* @return {Num}
*/
getLastCompoundCaption() {
return Module.nvs_timeline_getLastCompoundCaption(this.internalObj);
}
/**
* @description get previous compound caption
* @param {} caption caption
* @return {Num}
*/
getPrevCompoundCaption(caption) {
return Module.nvs_timeline_getPrevCompoundCaption(this.internalObj, caption);
}
/**
* @description get next compound caption
* @param {} caption caption
* @return {Num}
*/
getNextCompoundCaption(caption) {
return Module.nvs_timeline_getNextCompoundCaption(this.internalObj, caption);
}
/**
* @description get compound caption according to timeline
* @param {} timelinePos timeline position
* @return {Num}
*/
getCompoundCaptionsByTimelinePosition(timelinePos) {
return Module.nvs_timeline_getCompoundCaptionsByTimelinePosition(this.internalObj, timelinePos);
}
/**
* @description add compound caption
* @param {} inPoint in point
* @param {} duration duration
* @param {} compoundCaptionPackageId compound caption package id
* @return {Num}
*/
addCompoundCaption(inPoint, duration, compoundCaptionPackageId) {
return Module.nvs_timeline_addCompoundCaption(this.internalObj, inPoint, duration, compoundCaptionPackageId);
}
/**
* @description remove compound capition
* @param {} caption caption
* @return {Num}
*/
removeCompoundCaption(caption) {
return Module.nvs_timeline_removeCompoundCaption(this.internalObj, caption);
}
/**
* @description get first animated sticker
* @return {Num}
*/
getFirstAnimatedSticker() {
return Module.nvs_timeline_getFirstAnimatedSticker(this.internalObj);
}
/**
* @description get last animated sticker
* @return {Num}
*/
getLastAnimatedSticker() {
return Module.nvs_timeline_getLastAnimatedSticker(this.internalObj);
}
/**
* @description get previous animated sticker
* @param {} animatedSticker animated sticker
* @return {Num}
*/
getPrevAnimatedSticker(animatedSticker) {
return Module.nvs_timeline_getPrevAnimatedSticker(this.internalObj, animatedSticker);
}
/**
* @description get next animated sticker
* @param {} animatedSticker animated sticker
* @return {Num}
*/
getNextAnimatedSticker(animatedSticker) {
return Module.nvs_timeline_getNextAnimatedSticker(this.internalObj, animatedSticker);
}
/**
* @description get animated sticker according to timeline position
* @param {} timelinePos timeline position
* @return {Num}
*/
getAnimatedStickersByTimelinePosition(timelinePos) {
return Module.nvs_timeline_getAnimatedStickersByTimelinePosition(this.internalObj, timelinePos);
}
/**
* @description add animated sticker
* @param {} inPoint in point
* @param {} duration duration
* @param {} animatedStickerPackageId animated sticker packageId
* @param {} isPanoramic panoramic or not
* @param {} isCustom customize or not
* @param {} customImagePath custome image path
* @return {Num}
*/
addAnimatedSticker(inPoint, duration, animatedStickerPackageId, isPanoramic, isCustom, customImagePath) {
return Module.nvs_timeline_addAnimatedSticker(this.internalObj, inPoint, duration, animatedStickerPackageId, isPanoramic, isCustom, customImagePath);
}
/**
* @description remove animated sticker
* @param {} animatedSticker animated sticker
* @return {Num}
*/
removeAnimatedSticker(animatedSticker) {
return Module.nvs_timeline_removeAnimatedSticker(this.internalObj, animatedSticker);
}
/**
* @description get first timeline video fx
* @return {Num}
*/
getFirstTimelineVideoFx() {
return Module.nvs_timeline_getFirstTimelineVideoFx(this.internalObj);
}
/**
* @description get last timeline video fx
*/
getLastTimelineVideoFx() {
return Module.nvs_timeline_getLastTimelineVideoFx(this.internalObj);
}
/**
* @description get previous timeline video fx
* @param {} timelineVideoFx timeline video fx
* @return {Num}
*/
getPrevTimelineVideoFx(timelineVideoFx) {
return Module.nvs_timeline_getPrevTimelineVideoFx(this.internalObj, timelineVideoFx);
}
/**
* @description get next timeline video fx
* @param {} timelineVideoFx timeline video fx
* @return {Num}
*/
getNextTimelineVideoFx(timelineVideoFx) {
return Module.nvs_timeline_getNextTimelineVideoFx(this.internalObj, timelineVideoFx);
}
/**
* @description get timeline video fx according to timeline position
* @param {} timelinePos timeline position
* @return {Num}
*/
getTimelineVideoFxByTimelinePosition(timelinePos) {
return Module.nvs_timeline_getTimelineVideoFxByTimelinePosition(this.internalObj, timelinePos);
}
/**
* @description add builtin timeline video fx
* @param {} inPoint in point
* @param {} duration duration
* @param {} videoFxName video fx name
* @return {Num}
*/
addBuiltinTimelineVideoFx(inPoint, duration, videoFxName) {
return Module.nvs_timeline_addBuiltinTimelineVideoFx(this.internalObj, inPoint, duration, videoFxName);
}
/**
* @description add packaged timeline video fx
* @param {} inPoint in point
* @param {} duration duration
* @param {} videoFxPackageId video fx package id
* @return {Num}
*/
addPackagedTimelineVideoFx(inPoint, duration, videoFxPackageId) {
return Module.nvs_timeline_addPackagedTimelineVideoFx(this.internalObj, inPoint, duration, videoFxPackageId);
}
/**
* @description remove timeline video fx
* @param {} timelineVideoFx timeline video fx
* @return {Num}
*/
removeTimelineVideoFx(timelineVideoFx) {
return Module.nvs_timeline_removeTimelineVideoFx(this.internalObj, timelineVideoFx);
}
/**
* @description get current theme id
* @return {Num}
*/
getCurrentThemeId() {
return Module.nvs_timeline_getCurrentThemeId(this.internalObj);
}
/**
* @description apply theme
* @param {} themeId theme id
* @return {Num}
*/
applyTheme(themeId) {
return Module.nvs_timeline_applyTheme(this.internalObj, themeId);
}
/**
* @description remove current theme
* @return {}
*/
removeCurrentTheme() {
Module.nvs_timeline_removeCurrentTheme(this.internalObj);
}
/**
* @description set caption text of theme title
* @param {} text text
* @return {}
*/
setThemeTitleCaptionText(text) {
Module.nvs_timeline_setThemeTitleCaptionText(this.internalObj, text);
}
/**
* @description set caption text of theme trailer
* @param {} text text
* @return {}
*/
setThemeTrailerCaptionText(text) {
Module.nvs_timeline_setThemeTrailerCaptionText(this.internalObj, text);
}
/**
* @description set volume gain of theme music
* @param {} leftVolumeGain left volume gain
* @param {} rightVolumeGain right volume gain
* @return {}
*/
setThemeMusicVolumeGain(leftVolumeGain, rightVolumeGain) {
Module.nvs_timeline_setThemeMusicVolumeGain(this.internalObj, leftVolumeGain, rightVolumeGain);
}
/**
* @description get max volume gain of theme music
* @return {Num}
*/
getThemeMusicVolumeGain() {
return Module.nvs_timeline_getThemeMusicVolumeGain(this.internalObj);
}
/**
* @description set playback rate control
* @param {} playbackRateControlRegions control region of playback rate
* @return {Num}
*/
setPlaybackRateControl(playbackRateControlRegions) {
Module.nvs_timeline_setPlaybackRateControl(this.internalObj, playbackRateControlRegions);
}
/**
* @description add watermark
* @param {} filePath file path
* @param {} displayWidth display width
* @param {} displayHeight display height
* @param {} opacity opacity
* @param {} position position
* @param {} marginX margin x
* @param {} marginY margin y
* @return {Num}
*/
addWatermark(filePath, displayWidth, displayHeight, opacity, position, marginX, marginY) {
Module.nvs_timeline_addWatermark(this.internalObj, filePath, displayWidth, displayHeight, opacity, position, marginX, marginY);
}
/**
* @description add watermark
* @param {} sceneWidth
* @param {} sceneHeight
* @param {} imageName
* @param {} imgWidth
* @param {} imgHeight
* @param {} tx
* @param {} ty
* @param {} dirPath
* @param {} opacity
* @return {Num}
*/
addWatermark2(sceneWidth, sceneHeight, imageName, imgWidth, imgHeight, tx, ty, dirPath, opacity) {
Module.nvs_timeline_addWatermark2(this.internalObj, sceneWidth, sceneHeight, imageName, imgWidth, imgHeight, tx, ty, dirPath, opacity);
}
/**
* @description delete watermark
* @return {Num}
*/
deleteWatermark() {
Module.nvs_timeline_deleteWatermark(this.internalObj);
}
/**
* @description set watermark opacity
* @param {} opacity opacity
* @return {Num}
*/
setWatermarkOpacity(opacity) {
Module.nvs_timeline_setWatermarkOpacity(this.internalObj, opacity);
}
/**
* @description get watermark information
* @return {Num}
*/
getWatermarkInfo() {
return Module.nvs_timeline_getWatermarkInfo(this.internalObj);
}
/**
* @description set max audio stream of video track supported
* @param {} maxStream max count of stream
* @return {Num}
*/
setMaxAudioStreamSupportedOnVideoTrack(maxStream) {
Module.nvs_timeline_setMaxAudioStreamSupportedOnVideoTrack(this.internalObj, maxStream);
}
/**
* @description get max audio stream of video track supported
* @return {Num}
*/
getMaxAudioStreamSupportedOnVideoTrack() {
return Module.nvs_timeline_getMaxAudioStreamSupportedOnVideoTrack(this.internalObj);
}
}
/**
* @classdesc Track class: track, a structure that holds segments. Tracks can be regarded as a collection of clips, which are divided into audio track and video track. After you create a timeline instance, you can add or remove multiple tracks. On each track, you can add multiple video and audio clips to edit, set the volume of the clips, or remove and move the position.
* @extends NvsProjObj
*/
class NvsTrack extends NvsProjObj {
/**
* @constructor
*/
constructor() {
super();
}
/**
* @description get type
* @return {Num}
*/
getType() {
return Module.nvs_track_getType(this.internalObj);
}
/**
* @description get track index
* @return {Num}
*/
getIndex() {
return Module.nvs_track_getIndex(this.internalObj);
}
/**
* @description get duration
* @return {Num}
*/
getDuration() {
return Module.nvs_track_getDuration(this.internalObj);
}
/**
* @description get count of clip
* @return {Num}
*/
getClipCount() {
return Module.nvs_track_getClipCount(this.internalObj);
}
/**
* @description change in point
* @param {} clipIndex clip index
* @param {} newInPoint new in point
* @return {Num}
*/
changeInPoint(clipIndex, newInPoint) {
return Module.nvs_track_changeInPoint(this.internalObj, clipIndex, newInPoint);
}
/**
* @description change out point
* @param {} clipIndex clip index
* @param {} newOutPoint new out point
* @return {Num}
*/
changeOutPoint(clipIndex, newOutPoint) {
return Module.nvs_track_changeOutPoint(this.internalObj, clipIndex, newOutPoint);
}
/**
* @description split clip
* @param {} clipIndex clip index
* @param {} splitPoint split point
* @return {Num}
*/
splitClip(clipIndex, splitPoint) {
return Module.nvs_track_splitClip(this.internalObj, clipIndex, splitPoint);
}
/**
* @description remove clip
* @param {} clipIndex clip index
* @param {} keepSpace keep space
* @return {Num}
*/
removeClip(clipIndex, keepSpace) {
return Module.nvs_track_removeClip(this.internalObj, clipIndex, keepSpace);
}
/**
* @description remove range
* @param {} startTimelinePos start point position of timeline
* @param {} endTimelinePos end point position of timeline
* @param {} keepSpace keep space
* @return {Num}
*/
removeRange(startTimelinePos, endTimelinePos, keepSpace) {
return Module.nvs_track_removeRange(this.internalObj, startTimelinePos, endTimelinePos, keepSpace);
}
/**
* @description move clip
* @param {} sourceClipIndex source clip index
* @param {} targetClipIndex target clip index
* @return {Num}
*/
moveClip(sourceClipIndex, targetClipIndex) {
return Module.nvs_track_moveClip(this.internalObj, sourceClipIndex, targetClipIndex);
}
/**
* @description move clip according position
* @param {} sourceClipIndex source clip index
* @param {} targetTimelinePos target timeline position
* @param {} isInsertTarget insert target or not
* @param {} keepSpace keep space
* @return {Num}
*/
moveClipByPosition(sourceClipIndex, targetTimelinePos, isInsertTarget, keepSpace) {
return Module.nvs_track_moveClipByPosition(this.internalObj, sourceClipIndex, targetTimelinePos, isInsertTarget, keepSpace);
}
/**
* @description remove all clips
* @return {Num}
*/
removeAllClips() {
return Module.nvs_track_removeAllClips(this.internalObj);
}
/**
* @description set volume gain
* @param {} leftVolumeGain left volume gain
* @param {} rightVolumeGain right volume gain
* @return {Num}
*/
setVolumeGain(leftVolumeGain, rightVolumeGain) {
return Module.nvs_track_setVolumeGain(this.internalObj, leftVolumeGain, rightVolumeGain);
}
/**
* @description get volume gain
* @return {Num}
*/
getVolumeGain() {
return Module.nvs_track_getVolumeGain(this.internalObj);
}
}
/**
* @classdesc video track,the collection of video clips.
A video track is an entity that holds video clips, and users can add, insert, and delete multiple video clips. The video track continues to expand as the clip increases, and video transitions can be inserted between clips. When adding a package transition, users need to install it and get the packageID returned as the handle of the transition. For built-in transition, their names are regarded as handle. Note: The index of the video clip starts from 0.
* @extends NvsTrack
*/
class NvsVideoTrack extends NvsTrack {
/**
* @constructor
*/
constructor() {
super();
}
/**
* @description insert clip
* @param {} videoFilePath video file path
* @param {} insertPoint insert point
* @return {Num}
*/
insertClip(videoFilePath, insertPoint) {
return Module.nvs_videoTrack_insertClip(this.internalObj, videoFilePath, insertPoint);
}
/**
* @description insert clip
* @param {} videoFilePath video file path
* @param {} trimIn trim In
* @param {} trimOut trim Out
* @param {} insertPoint insert point
* @return {Num}
*/
insertClip2(videoFilePath, trimIn, trimOut, insertPoint) {
return Module.nvs_videoTrack_insertClip2(this.internalObj, videoFilePath, trimIn, trimOut, insertPoint);
}
/**
* @description append clip
* @param {} videoFilePath video file path
* @return {Num}
*/
appendClip(videoFilePath) {
return this.insertClip(videoFilePath, this.getClipCount());
}
/**
* @description append clip
* @param {} videoFilePath video file path
* @param {} trimIn trim in
* @param {} trimOut trim out
* @return {Num}
*/
appendClip2(videoFilePath, trimIn, trimOut) {
return this.insertClip2(videoFilePath, trimIn, trimOut, this.getClipCount());
}
/**
* @description add clip
* @param {} videoFilePath video file path
* @param {} inPoint in point
* @return {Num}
*/
addClip(videoFilePath, inPoint) {
return Module.nvs_videoTrack_addClip(this.internalObj, videoFilePath, inPoint);
}
/**
* @description add clip
* @param {} videoFilePath video file path
* @param {} inPoint in point
* @param {} trimIn trim in
* @param {} trimOut trim out
* @return {Num}
*/
addClip2(videoFilePath, inPoint, trimIn, trimOut) {
return Module.nvs_videoTrack_addClip2(this.internalObj, videoFilePath, inPoint, trimIn, trimOut);
}
/**
* @description add clip with speed
* @param {} videoFilePath video file path
* @param {} inPoint in point
* @param {} speed speed
* @param {} keepAudioPitch keep audio pitch
* @return {Num}
*/
addClipWithSpeed(videoFilePath, inPoint, speed, keepAudioPitch) {
return Module.nvs_videoTrack_addClipWithSpeed(this.internalObj, videoFilePath, inPoint, speed, keepAudioPitch);
}
/**
* @description add clip with speed
* @param {} videoFilePath video file path
* @param {} inPoint in point
* @param {} trimIn trim in
* @param {} trimOut trim out
* @param {} speed speed
* @param {} keepAudioPitch keep audio pitch
* @return {Num}
*/
addClipWithSpeed2(videoFilePath, inPoint, trimIn, trimOut, speed, keepAudioPitch) {
return Module.nvs_videoTrack_addClipWithSpeed2(this.internalObj, videoFilePath, inPoint, trimIn, trimOut, speed, keepAudioPitch);
}
/**
* @description get clip by index
* @param {} index index
* @return {Num}
*/
getClipByIndex(index) {
return Module.nvs_videoTrack_getClipByIndex(this.internalObj, index);
}
/**
* @description get clip by timeline position
* @param {} timelinePos timeline position
* @return {Num}
*/
getClipByTimelinePosition(timelinePos) {
return Module.nvs_videoTrack_getClipByTimelinePosition(this.internalObj, timelinePos);
}
/**
* @description set builtin transition
* @param {} srcClipIndex source clip index
* @param {} transitionName transition name
* @return {Num}
*/
setBuiltinTransition(srcClipIndex, transitionName) {
return Module.nvs_videoTrack_setBuiltinTransition(this.internalObj, srcClipIndex, transitionName);
}
/**
* @description set packaged transition
* @param {} srcClipIndex source clip index
* @param {} packageId package id
* @return {Num}
*/
setPackagedTransition(srcClipIndex, packageId) {
return Module.nvs_videoTrack_setPackagedTransition(this.internalObj, srcClipIndex, packageId);
}
/**
* @description get transition by source clip index
* @param {} srcClipIndex source clip index
* @return {Num}
*/
getTransitionBySourceClipIndex(srcClipIndex) {
return Module.nvs_videoTrack_getTransitionBySourceClipIndex(this.internalObj, srcClipIndex);
}
/**
* @description set available in theme
* @param {} available available or not
* @return {Num}
*/
setAvailableInTheme(available) {
return Module.nvs_videoTrack_setAvailableInTheme(this.internalObj, available);
}
/**
* @description available in theme or not
* @return {Num}
*/
isAvailableInTheme() {
return Module.nvs_videoTrack_isAvailableInTheme(this.internalObj);
}
}
/**
* @classdesc Audio track, a collection of audio clips. An audio track is an entity that holds audio clips. Each audio track can add or remove multiple audio clips. When playing one audio clip to another, you need to set the audio transition to facilitate the transition. Note: for a series of interfaces of audio track and the meaning of its parameters, please refer to the corresponding interface of Nvsvideotrack.
* @extends NvsTrack
*/
class NvsAudioTrack extends NvsTrack {
/**
* @constructor
*/
constructor() {
super();
}
/**
* @description insert clip
* @param {} audioFilePath audio file path
* @param {} insertPoint insert point
* @return {Num}
*/
insertClip(audioFilePath, insertPoint) {
return Module.nvs_audioTrack_insertClip(this.internalObj, audioFilePath, insertPoint);
}
/**
* @description insert clip
* @param {} audioFilePath audio file path
* @param {} trimIn trim in
* @param {} trimOut trim out
* @param {} insertPoint insert point
* @return {Num}
*/
insertClip2(audioFilePath, trimIn, trimOut, insertPoint) {
return Module.nvs_audioTrack_insertClip2(this.internalObj, audioFilePath, trimIn, trimOut, insertPoint);
}
/**
* @description append clip
* @param {} audioFilePath audio file path
* @return {Num}
*/
appendClip(audioFilePath) {
return this.insertClip(audioFilePath, this.getClipCount());
}
/**
* @description append clip
* @param {} audioFilePath audio file path
* @param {} trimIn trim in
* @param {} trimOut trim out
* @return {Num}
*/
appendClip2(audioFilePath, trimIn, trimOut) {
return this.insertClip2(audioFilePath, trimIn, trimOut, this.getClipCount());
}
/**
* @description add clip
* @param {} audioFilePath audio file path
* @param {} inPoint in point
* @return {Num}
*/
addClip(audioFilePath, inPoint) {
return Module.nvs_audioTrack_addClip(this.internalObj, audioFilePath, inPoint);
}
/**
* @description add clip
* @param {} audioFilePath audio file path
* @param {} inPoint in point
* @param {} trimIn trim in
* @param {} trimOut trim out
* @return {Num}
*/
addClip2(audioFilePath, inPoint, trimIn, trimOut) {
return Module.nvs_audioTrack_addClip2(this.internalObj, audioFilePath, inPoint, trimIn, trimOut);
}
/**
* @description get clip by index
* @param {} index index
* @return {Num}
*/
getClipByIndex(index) {
return Module.nvs_audioTrack_getClipByIndex(this.internalObj, index);
}
/**
* @description get clip by timeline position
* @param {} timelinePos timeline position
* @return {Num}
*/
getClipByTimelinePosition(timelinePos) {
return Module.nvs_audioTrack_getClipByTimelinePosition(this.internalObj, timelinePos);
}
/**
* @description set builtin transition
* @param {srcClipIndex} source clip index
* @param {transitionName} transition name
* @return {Num}
*/
setBuiltinTransition(srcClipIndex, transitionName) {
return Module.nvs_audioTrack_setBuiltinTransition(this.internalObj, srcClipIndex, transitionName);
}
/**
* @description get transition by source clip index
* @param {srcClipIndex} source clip index
* @return {}
*/
getTransitionBySourceClipIndex(srcClipIndex) {
return Module.nvs_audioTrack_getTransitionBySourceClipIndex(this.internalObj, srcClipIndex);
}
}
/**
* @classdesc Specific description of clips and audio and video files. Clip is an entity containing audio and video content. It is a description of video and audio files. It is divided into audio clip and video clip. It defines the common attributes and behaviors of different types of clips, that is, the derived audio clips and video clips can modify their clipping entry and exit points, left and right channels, playback speed, etc. In the SDK framework, corresponding audio clips and video clips can be added on the track.
* @extends NvsProjObj
*/
class NvsClip extends NvsProjObj {
/**
* @constructor
*/
constructor() {
super();
}
/**
* @description get trim in
* @return {}
*/
getTrimIn() {
return Module.nvs_clip_getTrimIn(this.internalObj);
}
/**
* @description get trim out
* @return {}
*/
getTrimOut() {
return Module.nvs_clip_getTrimOut(this.internalObj);
}
/**
* @description move trim point
* @param {} offset offset
* @return {}
*/
moveTrimPoint(offset) {
return Module.nvs_clip_moveTrimPoint(this.internalObj, offset);
}
/**
* @description get in point
* @return {}
*/
getInPoint() {
return Module.nvs_clip_getInPoint(this.internalObj);
}
/**
* @description get out point
* @return {}
*/
getOutPoint() {
return Module.nvs_clip_getOutPoint(this.internalObj);
}
/**
* @description get type
* @return {}
*/
getType() {
return Module.nvs_clip_getType(this.internalObj);
}
/**
* @description get index
* @return {}
*/
getIndex() {
return Module.nvs_clip_getIndex(this.internalObj);
}
/**
* @description get file path
* @return {}
*/
getFilePath() {
return Module.nvs_clip_getFilePath(this.internalObj);
}
/**
* @description get fx count
* @return {}
*/
getFxCount() {
return Module.nvs_clip_getFxCount(this.internalObj);
}
/**
* @description change trim in point
* @param {} newTrimInPoint new trim in point
* @param {} affectSibling affect sibling
* @return {}
*/
changeTrimInPoint(newTrimInPoint, affectSibling) {
return Module.nvs_clip_changeTrimInPoint(this.internalObj, newTrimInPoint, affectSibling);
}
/**
* @description change trim out point
* @param {} newTrimOutPoint new trim out point
* @param {} affectSibling affect sibling
* @return {}
*/
changeTrimOutPoint(newTrimOutPoint, affectSibling) {
return Module.nvs_clip_changeTrimOutPoint(this.internalObj, newTrimOutPoint, affectSibling);
}
/**
* @description get speed
* @return {}
*/
getSpeed() {
return Module.nvs_clip_getSpeed(this.internalObj);
}
/**
* @description change speed
* @param {} newSpeed new speed
* @param {} keepAudioPitch keep audio pitch
* @return {}
*/
changeSpeed(newSpeed, keepAudioPitch) {
Module.nvs_clip_changeSpeed(this.internalObj, newSpeed, keepAudioPitch);
}
/**
* @description get volume gain
* @return {}
*/
getVolumeGain() {
return Module.nvs_clip_getVolumeGain(this.internalObj);
}
/**
* @description set volume gain
* @param {} leftVolumeGain left volume gain
* @param {} rightVolumeGain right volume gain
* @return {}
*/
setVolumeGain(leftVolumeGain, rightVolumeGain) {
Module.nvs_clip_setVolumeGain(this.internalObj, leftVolumeGain, rightVolumeGain);
}
/**
* @description set duration of fade in
* @param {} duration duration
* @return {}
*/
setFadeInDuration(duration) {
Module.nvs_clip_setFadeInDuration(this.internalObj, duration);
}
/**
* @description get duration of fade in
* @return {}
*/
getFadeInDuration() {
return Module.nvs_clip_getFadeInDuration(this.internalObj);
}
/**
* @description set duration of fade out
* @param {} duration duration
* @return {}
*/
setFadeOutDuration(duration) {
Module.nvs_clip_setFadeOutDuration(this.internalObj, duration);
}
/**
* @description get duration of fade out
* @return {}
*/
getFadeOutDuration() {
return Module.nvs_clip_getFadeOutDuration(this.internalObj);
}
/**
* @description change variable speed of curves
* @param {} curvesString curves string
* @param {} keepAudioPitch keep audio pitch
* @return {}
*/
changeCurvesVariableSpeed(curvesString, keepAudioPitch) {
return Module.nvs_clip_changeCurvesVariableSpeed(this.internalObj, curvesString, keepAudioPitch);
}
/**
* @description get curve character string of clip speed
* @return {}
*/
getClipVariableSpeedCurvesString() {
return Module.nvs_clip_getClipVariableSpeedCurvesString(this.internalObj);
}
/**
* @description get clip position according timeline position curve speed
* @param {} timelinePos timeline position
* @return {}
*/
getClipPosByTimelinePosCurvesVariableSpeed(timelinePos) {
return Module.nvs_clip_getClipPosByTimelinePosCurvesVariableSpeed(this.internalObj, timelinePos);
}
/**
* @description get timeline position according curve speed of clip position
* @param {} clipPos clip position
* @return {}
*/
getTimelinePosByClipPosCurvesVariableSpeed(clipPos) {
return Module.nvs_clip_getTimelinePosByClipPosCurvesVariableSpeed(this.internalObj, clipPos);
}
}
/**
* @classdesc Video clip, description of video file. The video clip source can be video or image. Each video clip can modify its trim in point, trim out point and playback speed, and can also set panning and scanning. When editing a video, you can add or insert multiple video effects according to different types of effects (built-in effects, wrapped effects, beauty effects). When adding resource pack effects, you have to install them first. After the installation is successful, you can use them only by obtaining the packageid, while builtin only needs to obtain the name of the effect.
* @extends NvsClip
*/
class NvsVideoClip extends NvsClip {
/**
* @constructor
*/
constructor() {
super();
}
/**
* @description append builtin fx
* @param {} fxName fx name
* @return {}
*/
appendBuiltinFx(fxName) {
return Module.nvs_videoClip_appendBuiltinFx(this.internalObj, fxName, false);
}
/**
* @description insert builtin fx
* @param {} fxName fx name
* @param {} fxIndex fx index
* @return {}
*/
insertBuiltinFx(fxName, fxIndex) {
return Module.nvs_videoClip_insertBuiltinFx(this.internalObj, fxName, fxIndex, false);
}
/**
* @description append packaged fx
* @param {} fxPackageId fx package id
* @return {}
*/
appendPackagedFx(fxPackageId) {
return Module.nvs_videoClip_appendPackagedFx(this.internalObj, fxPackageId, false);
}
/**
* @description insert packaged fx
* @param {} fxPackageId fx package id
* @param {} fxIndex fx index
* @return {}
*/
insertPackagedFx(fxPackageId, fxIndex) {
return Module.nvs_videoClip_insertPackagedFx(this.internalObj, fxPackageId, fxIndex, false);
}
/**
* @description remove fx
* @param {} fxIndex fx index
* @return {}
*/
removeFx(fxIndex) {
return Module.nvs_videoClip_removeFx(this.internalObj, fxIndex, false);
}
/**
* @description remove all fx
* @return {}
*/
removeAllFx() {
return Module.nvs_videoClip_removeAllFx(this.internalObj);
}
/**
* @description get fx by index
* @param {} fxIndex fx index
* @return {}
*/
getFxByIndex(fxIndex) {
return Module.nvs_videoClip_getFxByIndex(this.internalObj, fxIndex, false);
}
/**
* @description append raw builtin fx
* @param {} fxName fx name
* @return {}
*/
appendRawBuiltinFx(fxName) {
return Module.nvs_videoClip_appendBuiltinFx(this.internalObj, fxName, true);
}
/**
* @description insert raw builtin fx
* @param {} fxName fx name
* @param {} fxIndex fx index
* @return {}
*/
insertRawBuiltinFx(fxName, fxIndex) {
return Module.nvs_videoClip_insertBuiltinFx(this.internalObj, fxName, fxIndex, true);
}
/**
* @description append raw packaged fx
* @param {} fxPackageId package id
* @return {}
*/
appendRawPackagedFx(fxPackageId) {
return Module.nvs_videoClip_appendPackagedFx(this.internalObj, fxPackageId, true);
}
/**
* @description insert raw packaged fx
* @param {} fxPackageId package id
* @param {} fxIndex fx index
* @return {}
*/
insertRawPackagedFx(fxPackageId, fxIndex) {
return Module.nvs_videoClip_insertPackagedFx(this.internalObj, fxPackageId, fxIndex, true);
}
/**
* @description remove raw fx
* @param {} fxIndex fx index
* @return {}
*/
removeRawFx(fxIndex) {
return Module.nvs_videoClip_removeFx(this.internalObj, fxIndex, true);
}
/**
* @description get count of raw fx
* @return {}
*/
getRawFxCount() {
return Module.nvs_videoClip_getRawFxCount(this.internalObj);
}
/**
* @description get raw fx by index
* @param {} fxIndex fx index
* @return {}
*/
getRawFxByIndex(fxIndex) {
return Module.nvs_videoClip_getFxByIndex(this.internalObj, fxIndex, true);
}
/**
* @description get type of video
* @return {}
*/
getVideoType() {
return Module.nvs_videoClip_getVideoType(this.internalObj);
}
/**
* @description get role in theme
* @return {}
*/
getRoleInTheme() {
return Module.nvs_videoClip_getRoleInTheme(this.internalObj);
}
/**
* @description set play in reverse
* @param {} playInReverse reverse of not
* @return {}
*/
setPlayInReverse(playInReverse) {
Module.nvs_videoClip_setPlayInReverse(this.internalObj, playInReverse);
}
/**
* @description get play in reverse
* @return {}
*/
getPlayInReverse() {
return Module.nvs_videoClip_getPlayInReverse(this.internalObj);
}
/**
* @description set extra video rotation
* @param {} rotation rotation
* @return {}
*/
setExtraVideoRotation(rotation) {
Module.nvs_videoClip_setExtraVideoRotation(this.internalObj, rotation);
}
/**
* @description get extra video rotation
* @return {}
*/
getExtraVideoRotation() {
return Module.nvs_videoClip_getExtraVideoRotation(this.internalObj);
}
/**
* @description set pan and scan
* @param {} pan pan
* @param {} scan scan
* @return {}
*/
setPanAndScan(pan, scan) {
Module.nvs_videoClip_setPanAndScan(this.internalObj, pan, scan);
}
/**
* @description get pan and scan
* @return {}
*/
getPanAndScan() {
return Module.nvs_videoClip_getPanAndScan(this.internalObj);
}
/**
* @description set background color of source
* @param {} mode mode
* @return {}
*/
setSourceBackgroundMode(mode) {
Module.nvs_videoClip_setSourceBackgroundMode(this.internalObj, mode);
}
/**
* @description get background mode of source
* @return {}
*/
getSourceBackgroundMode() {
return Module.nvs_videoClip_getSourceBackgroundMode(this.internalObj);
}
/**
* @description set background color of source
* @param {} color color
* @return {}
*/
setSourceBackgroundColor(color) {
Module.nvs_videoClip_setSourceBackgroundColor(this.internalObj, color);
}
/**
* @description get background color of source
* @return {}
*/
getSourceBackgroundColor() {
return Module.nvs_videoClip_getSourceBackgroundColor(this.internalObj);
}
/**
* @description set motion mode of image
* @param {} mode mode
* @return {}
*/
setImageMotionMode(mode) {
Module.nvs_videoClip_setImageMotionMode(this.internalObj, mode);
}
/**
* @description get motion mode of image
* @return {}
*/
getImageMotionMode() {
return Module.nvs_videoClip_getImageMotionMode(this.internalObj);
}
/**
* @description set enabling of image motion animation
* @param {} enabled enabled
* @return {}
*/
setImageMotionAnimationEnabled(enabled) {
Module.nvs_videoClip_setImageMotionAnimationEnabled(this.internalObj, enabled);
}
/**
* @description enable image animation of motion or not
* @return {}
*/
isImageMotionAnimationEnabled() {
return Module.nvs_videoClip_isImageMotionAnimationEnabled(this.internalObj);
}
/**
* @description set wrap mode of clip
* @param {} wrapMode wrapMode
* @return {}
*/
setClipWrapMode(wrapMode) {
Module.nvs_videoClip_setClipWrapMode(this.internalObj, wrapMode);
}
/**
* @description get wrap mode of clip
* @return {}
*/
getClipWrapMode() {
return Module.nvs_videoClip_getClipWrapMode(this.internalObj);
}
/**
* @description enabled clip freeze frame
* @param {} enabled enabled
* @return {}
*/
enableClipFreezeFrame(enabled) {
Module.nvs_videoClip_enableClipFreezeFrame(this.internalObj, enabled);
}
/**
* @description enable clip freeze frame or not
* @return {}
*/
isClipFreezeFrameEnabled() {
return Module.nvs_videoClip_isClipFreezeFrameEnabled(this.internalObj);
}
/**
* @description set trim position of clip freeze frame
* @param {} trimPos trim position
* @return {}
*/
setClipFreezeFrameTrimPosition(trimPos) {
Module.nvs_videoClip_setClipFreezeFrameTrimPosition(this.internalObj, trimPos);
}
/**
* @description get trim position of clip freeze frame
* @return {}
*/
getClipFreezeFrameTrimPosition() {
return Module.nvs_videoClip_getClipFreezeFrameTrimPosition(this.internalObj);
}
/**
* @description get property video fx
* @return {}
*/
getPropertyVideoFx() {
return Module.nvs_videoClip_getPropertyVideoFx(this.internalObj);
}
/**
* @description enable property video fx
* @param {} enable enabled or not
* @return {}
*/
enablePropertyVideoFx(enabled) {
Module.nvs_videoClip_enablePropertyVideoFx(this.internalObj, enabled);
}
}
/**
* @classdesc Audio clip, description of audio file. You can also modify the trim in point and out point of audio clip, insert and remove multiple audio special effects, as well as the playback speed.
* @extends NvsClip
*/
class NvsAudioClip extends NvsClip {
/**
* @constructor
*/
constructor() {
super();
}
/**
* @description append fx
* @param {} fxName fx name
* @return {}
*/
appendFx(fxName) {
return Module.nvs_audioClip_appendFx(this.internalObj, fxName);
}
/**
* @description insert fx
* @param {} fxName fx name
* @param {} fxIndex fx index
* @return {}
*/
insertFx(fxName, fxIndex) {
return Module.nvs_audioClip_insertFx(this.internalObj, fxName, fxIndex);
}
/**
* @description remove fx
* @param {} fxIndex fx index
* @return {}
*/
removeFx(fxIndex) {
return Module.nvs_audioClip_removeFx(this.internalObj, fxIndex);
}
/**
* @description get fx by inddex
* @param {} fxIndex fx index
* @return {}
*/
getFxByIndex(fxIndex) {
return Module.nvs_audioClip_getFxByIndex(this.internalObj, fxIndex);
}
/**
* @description configuration of audio streaming index
* @param {} streamIndex stream index
* @return {}
*/
setAudioStreamIndex(streamIndex) {
Module.nvs_audioClip_setAudioStreamIndex(this.internalObj, streamIndex);
}
/**
* @description get index of audio stream
* @return {}
*/
getAudioSteramIndex() {
return Module.nvs_audioClip_getAudioSteramIndex(this.internalObj);
}
}
/**
* @classdesc pan and scan
*/
class NvsPanAndScan {
/**
* @constructor
* @param {} pan pan
* @param {} scan scan
*/
constructor(pan, scan) {
this.pan = pan;
this.scan = scan;
}
}
/**
* @classdesc volume
*/
class NvsVolume {
/**
* @constructor
* @param {} leftVolume left volume
* @param {} rightVolume right volume
*/
constructor(leftVolume, rightVolume) {
this.leftVolume = leftVolume;
this.rightVolume = rightVolume;
}
}
/**
* @classdesc Custom color class. In the SDK, the nvscolor class attributes R, G, B, and a have a value range of [0,1], not [0255].
*/
class NvsColor {
/**
* @constructor
* @param {} r red
* @param {} g green
* @param {} b blue
* @param {} a alpha
*/
constructor(r, g, b, a) {
this.r = r;
this.g = g;
this.b = b;
this.a = a;
}
}
/**
* @classdesc Two dimensional coordinates point, parameter type is double or float.
*/
class NvsPointF {
/**
* @constructor
* @param {} x x-coordinate
* @param {} y y-coordinate
*/
constructor(x, y) {
this.x = x;
this.y = y;
}
}
/**
* @classdesc rectangular
*/
class NvsRectF {
/**
* @constructor
* @param {} left left
* @param {} top top
* @param {} right right
* @param {} bottom bottom
*/
constructor(left, top, right, bottom) {
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
}
}
/**
* @classdesc watermark information
*/
class NvsWatermarkInfo {
/**
* @constructor
* @param {} sceneWidth scene width
* @param {} sceneHeight scene height
* @param {} imageName image name
* @param {} imgWidth image width
* @param {} imgHeight image height
* @param {} tx
* @param {} ty
* @param {} dirPath
* @param {} opacity
*/
constructor(sceneWidth, sceneHeight, imageName, imgWidth, imgHeight, tx, ty, dirPath, opacity) {
this.sceneWidth = sceneWidth;
this.sceneHeight = sceneHeight;
this.imageName = imageName;
this.imgWidth = imgWidth;
this.imgHeight = imgHeight;
this.tx = tx;
this.ty = ty;
this.dirPath = dirPath;
this.opacity = opacity;
}
}
/**
* @classdesc The resource package manager manages the resource packages in the video scene. During the development of SDK, the resource package manager uniformly installs, upgrades and uninstalls various stunt resource packages needed, including subtitles, themes, animation stickers, etc. When installing, upgrading and uninstalling, there will be corresponding error prompt types in case of errors, so as to quickly locate and solve the errors.
*/
class NvsAssetPackageManager {
/**
* @constructor
*/
constructor() {
this.internalObj = 0;
this.onFinishAssetPackageInstallation = function(assetPackageId, assetPackageFilePath, assetPackageType, error) {
}
this.onFinishTemplatePackageGenerate = function(assetPackageFilePath, error) {
}
}
setInternalObject(obj) {
this.internalObj = obj;
}
getInternalObject() {
return this.internalObj;
}
/**
* @description install resource package
* @param {} assetPackageFilePath resource package file path
* @param {} licenseFilePath license file path
* @param {} type type
* @return {}
*/
installAssetPackage(assetPackageFilePath, licenseFilePath, type) {
return Module.nvs_assetPackageManager_installAssetPackage(assetPackageFilePath, licenseFilePath, type);
}
/**
* @description uninstall resource package
* @param {} assetPackageId package id
* @param {} type type
* @return {}
*/
uninstallAssetPackage(assetPackageId, type) {
return Module.nvs_assetPackageManager_uninstallAssetPackage(assetPackageId, type);
}
/**
* @description get status of asset package
* @param {} assetPackageId package id
* @param {} type type
* @return {}
*/
getAssetPackageStatus(assetPackageId, type) {
return Module.nvs_assetPackageManager_getAssetPackageStatus(assetPackageId, type);
}
/**
* @description particle or not
* @param {} uuidString package id
* @return {}
*/
isParticleFX(uuidString) {
return Module.nvs_assetPackageManager_isParticleFX(uuidString);
}
/**
* @description get resource description of video special effects
* @param {} uuidString package id
* @return {}
*/
getVideoFxAssetPackageDescription(uuidString) {
return Module.nvs_assetPackageManager_getVideoFxAssetPackageDescription(uuidString);
}
/**
* @description get template footage
* @param {} uuidString package id
* @return {}
*/
getTemplateFootages(uuidString) {
return Module.nvs_assetPackageManager_getTemplateFootages(uuidString);
}
/**
* @description get captions of template
* @param {} uuidString package id
* @return {}
*/
getTemplateCaptions(uuidString) {
return Module.nvs_assetPackageManager_getTemplateCaptions(uuidString);
}
/**
* @description get compound captions of template
* @return {}
*/
getTemplateCompoundCaptions() {
return Module.nvs_assetPackageManager_getTemplateCompoundCaptions(uuidString);
}
/**
* @description get template package path
* @param {} uuidString package id
* @return {}
*/
getTemplatePackageDirPath(uuidString) {
return Module.nvs_assetPackageManager_getTemplatePackageDirPath(uuidString);
}
/**
* @description get current aspect ratio of template
* @param {} uuidString package id
* @return {}
*/
getTemplateCurrentAspectRatio(uuidString) {
return Module.nvs_assetPackageManager_getTemplateCurrentAspectRatio(uuidString);
}
/**
* @description get aspect ratio of template default
* @param {} uuidString package id
* @return {}
*/
getTemplateDefaultAspectRatio(uuidString) {
return Module.nvs_assetPackageManager_getTemplateDefaultAspectRatio(uuidString);
}
/**
* @description write template xml
* @param {} timeline timeline
* @param {} aspectRatio aspect ratio
* @param {} uuidString package id
* @return {}
*/
writeTemplateXml(timeline, aspectRatio, uuidString) {
return Module.nvs_assetPackageManager_writeTemplateXml(timeline, aspectRatio, uuidString);
}
/**
* @description generate template package
* @param {} innerAssetDir inner resource path
* @param {} uuidString package id
* @param {} outputPath output path
* @return {}
*/
generateTemplatePackage(innerAssetDir, uuidString, outputPath) {
return Module.nvs_assetPackageManager_generateTemplatePackage(innerAssetDir, uuidString, outputPath);
}
/**
* @description get resource package root directory
* @return {}
*/
getAssetPackageRootDir() {
return Module.nvs_assetPackageManager_getAssetPackageRootDir();
}
/**
* @description change aspect ratio of template
* @param {} uuidString package id
* @param {} aspectRatio aspect ratio
* @return {}
*/
changeTemplateAspectRatio(uuidString, aspectRatio) {
return Module.nvs_assetPackageManager_changeTemplateAspectRatio(uuidString, aspectRatio);
}
}
/**
* @classdesc region information
*/
class NvsRegionInfo {
/**
* @constructor
*/
constructor() {
this.type = '';
this.center = undefined;
this.a = undefined;
this.b = undefined;
this.theta = undefined;
this.points = [];
}
}
/**
* @classdesc Special effects. Special effects are the base classes of different types of special effects such as video FX, audio FX, audio transition and video transition. In the SDK framework, special effects are a key part. Each different type of special effects derived from nvsfx can be added, removed and obtained through clip instances, timeline instances or track instances. At the same time, different API interfaces are provided in the special effect class to set and obtain the special effect parameter types.
* @extends NvsProjObj
*/
class NvsFx extends NvsProjObj {
/**
* @constructor
*/
constructor() {
super();
}
/**
* @description get description information
* @return {}
*/
getDescription() {
return Module.nvs_fx_getDescription(this.internalObj);
}
/**
* @description set integer value
* @param {} fxParam name of parameter
* @param {} val value
* @return {}
*/
setIntVal(fxParam, val) {
Module.nvs_fx_setIntVal(this.internalObj, fxParam, val);
}
/**
* @description get integer value
* @param {} fxParam name of parameter
* @return {}
*/
getIntVal(fxParam) {
return Module.nvs_fx_getIntVal(this.internalObj, fxParam);
}
/**
* @description set integer value at certain time
* @param {} fxParam name of parameter
* @param {} val value
* @param {} time time
* @return {}
*/
setIntValAtTime(fxParam, val, time) {
Module.nvs_fx_setIntValAtTime(this.internalObj, fxParam, val, time);
}
/**
* @description get integer value at certain time
* @param {} fxParam name of parameter
* @param {} time time
* @return {}
*/
getIntValAtTime(fxParam, time) {
return Module.nvs_fx_getIntValAtTime(this.internalObj, fxParam, time);
}
/**
* @description set float value
* @param {} fxParam name of parameter
* @param {} val value
* @return {}
*/
setFloatVal(fxParam, val) {
Module.nvs_fx_setFloatVal(this.internalObj, fxParam, val);
}
/**
* @description get float value
* @param {} fxParam name of parameter
* @return {}
*/
getFloatVal(fxParam) {
return Module.nvs_fx_getFloatVal(this.internalObj, fxParam);
}
/**
* @description set float value at certain time
* @param {} fxParam name of parameter
* @param {} val value
* @param {} time time
* @return {}
*/
setFloatValAtTime(fxParam, val, time) {
Module.nvs_fx_setFloatValAtTime(this.internalObj, fxParam, val, time);
}
/**
* @description get float value at certain time
* @param {} fxParam name of parameter
* @param {} time time
* @return {}
*/
getFloatValAtTime(fxParam, time) {
return Module.nvs_fx_getFloatValAtTime(this.internalObj, fxParam, time);
}
/**
* @description set boolean value
* @param {} fxParam name of parameter
* @param {} val value
* @return {}
*/
setBooleanVal(fxParam, val) {
Module.nvs_fx_setBooleanVal(this.internalObj, fxParam, val);
}
/**
* @description get boolean value
* @param {} fxParam name of parameter
* @return {}
*/
getBooleanVal(fxParam) {
return Module.nvs_fx_getBooleanVal(this.internalObj, fxParam);
}
/**
* @description set boolean value at certain time
* @param {} fxParam name of parameter
* @param {} val value
* @param {} time time
* @return {}
*/
setBooleanValAtTime(fxParam, val, time) {
Module.nvs_fx_setBooleanValAtTime(this.internalObj, fxParam, val, time);
}
/**
* @description get boolean value at certain time
* @param {} fxParam name of parameter
* @param {} time time
* @return {}
*/
getBooleanValAtTime(fxParam, time) {
return Module.nvs_fx_getBooleanValAtTime(this.internalObj, fxParam, time);
}
/**
* @description set menu value
* @param {} fxParam name of parameter
* @param {} val value
* @return {}
*/
setMenuVal(fxParam, val) {
Module.nvs_fx_setMenuVal(this.internalObj, fxParam, val);
}
/**
* @description get menu value
* @param {} fxParam name of parameter
* @return {}
*/
getMenuVal(fxParam) {
return Module.nvs_fx_getMenuVal(this.internalObj, fxParam);
}
/**
* @description set menu value at certain time
* @param {} fxParam name of parameter
* @param {} val value
* @param {} time time
* @return {}
*/
setMenuValAtTime(fxParam, val, time) {
Module.nvs_fx_setMenuValAtTime(this.internalObj, fxParam, val, time);
}
/**
* @description get menu value at certain time
* @param {} fxParam name of parameter
* @param {} time time
* @return {}
*/
getMenuValAtTime(fxParam, time) {
return Module.nvs_fx_getMenuValAtTime(this.internalObj, fxParam, time);
}
/**
* @description set string value
* @param {} fxParam name of parameter
* @param {} val value
* @return {}
*/
setStringVal(fxParam, val) {
Module.nvs_fx_setStringVal(this.internalObj, fxParam, val);
}
/**
* @description get character string
* @param {} fxParam name of parameter
* @return {}
*/
getStringVal(fxParam) {
return Module.nvs_fx_getStringVal(this.internalObj, fxParam);
}
/**
* @description set character string at certain time
* @param {} fxParam name of parameter
* @param {} val value
* @param {} time time
* @return {}
*/
setStringValAtTime(fxParam, val, time) {
Module.nvs_fx_setStringValAtTime(this.internalObj, fxParam, val, time);
}
/**
* @description get string value at certain time
* @param {} fxParam name of parameter
* @param {} time time
* @return {}
*/
getStringValAtTime(fxParam, time) {
return Module.nvs_fx_getStringValAtTime(this.internalObj, fxParam, time);
}
/**
* @description set color value
* @param {} fxParam name of parameter
* @param {} val value
* @return {}
*/
setColorVal(fxParam, val) {
Module.nvs_fx_setColorVal(this.internalObj, fxParam, val);
}
/**
* @description get color value
* @param {} fxParam name of parameter
* @return {}
*/
getColorVal(fxParam) {
return Module.nvs_fx_getColorVal(this.internalObj, fxParam);
}
/**
* @description set color value at certain time
* @param {} fxParam name of parameter
* @param {} val value
* @param {} time time
* @return {}
*/
setColorValAtTime(fxParam, val, time) {
Module.nvs_fx_setColorValAtTime(this.internalObj, fxParam, val, time);
}
/**
* @description get color value at certain time
* @param {} fxParam name of parameter
* @param {} time time
* @return {}
*/
getColorValAtTime(fxParam, time) {
return Module.nvs_fx_getColorValAtTime(this.internalObj, fxParam, time);
}
/**
* @description remove key frame at certain time
* @param {} fxParam name of parameter
* @param {} time time
* @return {}
*/
removeKeyframeAtTime(fxParam, time) {
return Module.nvs_fx_removeKeyframeAtTime(this.internalObj, fxParam, time);
}
/**
* @description remove all key frame
* @param {} fxParam name of parameter
* @return {}
*/
removeAllKeyframe(fxParam) {
return Module.nvs_fx_removeAllKeyframe(this.internalObj, fxParam);
}
/**
* @description has key frame list or not
* @param {} fxParam name of parameter
* @return {}
*/
hasKeyframeList(fxParam) {
return Module.nvs_fx_hasKeyframeList(this.internalObj, fxParam);
}
/**
* @description find key frame at certain time
* @param {} fxParam name of parameter
* @param {} time time
* @param {} flags flags
* @return {}
*/
findKeyframeTime(fxParam, time, flags) {
return Module.nvs_fx_findKeyframeTime(this.internalObj, fxParam, time, flags);
}
/**
* @description set filter intensity
* @param {} intensity intensity
* @return {}
*/
setFilterIntensity(intensity) {
Module.nvs_fx_setFilterIntensity(this.internalObj, intensity);
}
/**
* @description get filter intensity
* @return {}
*/
getFilterIntensity() {
return Module.nvs_fx_getFilterIntensity(this.internalObj);
}
/**
* @description set regional
* @param {} isRegional regional or not
* @return {}
*/
setRegional(isRegional) {
Module.nvs_fx_setRegional(this.internalObj, isRegional);
}
/**
* @description get regional
* @return {}
*/
getRegional() {
return Module.nvs_fx_getRegional(this.internalObj);
}
/**
* @description set ignore background
* @param {} isIgnoreBackground ignore background or not
* @return {}
*/
setIgnoreBackground(isIgnoreBackground) {
Module.nvs_fx_setIgnoreBackground(this.internalObj, isIgnoreBackground);
}
/**
* @description get ignore background
* @return {}
*/
getIgnoreBackground() {
return Module.nvs_fx_getIgnoreBackground(this.internalObj);
}
/**
* @description set region in reverse
* @param {} isInverseRegion inverse region or not
* @return {}
*/
setInverseRegion(isInverseRegion) {
Module.nvs_fx_setInverseRegion(this.internalObj, isInverseRegion);
}
/**
* @description get region in reverse
* @return {}
*/
getInverseRegion() {
return Module.nvs_fx_getInverseRegion(this.internalObj);
}
/**
* @description set region
* @param {} region region
* @return {}
*/
setRegion(region) {
Module.nvs_fx_setRegion(this.internalObj, region);
}
/**
* @description set region at certain time
* @param {} region region
* @param {} time time
* @return {}
*/
setRegionAtTime(region, time) {
Module.nvs_fx_setRegionAtTime(this.internalObj, region, time);
}
/**
* @description set ellipse region
* @param {} center center point
* @param {} a Long semiaxis of ellipse
* @param {} b short semiaxis of ellipse
* @param {} angle angle
* @return {}
*/
setEllipseRegion(center, a, b, angle) {
Module.nvs_fx_setEllipseRegion(this.internalObj, center, a, b, angle);
}
/**
* @description set ellipse region at certain time
* @param {} center center point
* @param {} a Long semiaxis of ellipse
* @param {} b short semiaxis of ellipse
* @param {} angle angle
* @param {} time time
* @return {}
*/
setEllipseRegionAtTime(center, a, b, angle, time) {
Module.nvs_fx_setEllipseRegionAtTime(this.internalObj, center, a, b, angle, time);
}
/**
* @description get region
* @return {}
*/
getRegionInfos() {
return Module.nvs_fx_getRegionInfos(this.internalObj);
}
/**
* @description get region information at certain time
* @param {} time time
* @return {}
*/
getRegionInfosAtTime(time) {
return Module.nvs_fx_getRegionInfosAtTime(this.internalObj, time);
}
/**
* @description set region feather width
* @param {} featherWidth feather width
* @return {}
*/
setRegionalFeatherWidth(featherWidth) {
Module.nvs_fx_setRegionalFeatherWidth(this.internalObj, featherWidth);
}
/**
* @description get regional feather width
* @return {}
*/
getRegionalFeatherWidth() {
return Module.nvs_fx_getRegionalFeatherWidth(this.internalObj);
}
/**
* @description get particle system context
* @return {}
*/
getParticleSystemContext() {
return Module.nvs_fx_getParticleSystemContext(this.internalObj);
}
/**
* @description get ARScene operation
* @return {}
*/
getARSceneManipulate() {
return Module.nvs_fx_getARSceneManipulate(this.internalObj);
}
/**
* @description set Expr value
* @param {} varName variable name
* @param {} varValue variable value
* @return {}
*/
setExprVar(varName, varValue) {
Module.nvs_fx_setExprVar(this.internalObj, varName, varValue);
}
/**
* @description get Expr value
* @param {} varName variable name
* @return {}
*/
getExprVar(varName) {
return Module.nvs_fx_getExprVar(this.internalObj, varName);
}
/**
* @description clear Expr value
* @return {}
*/
clearExprVar() {
Module.nvs_fx_clearExprVar(this.internalObj);
}
/**
* @description clear all Expr value
* @return {}
*/
clearExprVarCtx() {
Module.nvs_fx_clearExprVarCtx(this.internalObj);
}
}
/**
* @classdesc Timeline video effects timeline video effects are video effects that act on timeline instances. Timeline video effects are divided into three types: built-in effects, package effects and custom effects. The built-in special effects are integrated inside the SDK and can be used directly without authorization. Package special effect is to integrate special effect resources into special effect packages. Each special effect package has its one-to-one corresponding authorization file, and must be installed before use. For details, please refer to material package installation. Custom special effect is a special effect timeline realized by users through writing code. The video special effect package includes special effect entry and exit points. Through entry and exit points, we can specify the position and length of the special effect on the timeline, and the entry point should be less than the exit point, The unit is microseconds. Timeline video effects allow superposition, and the rendering order is controlled by the preset Z value.
* @extends NvsFx
*/
class NvsTimelineVideoFx extends NvsFx {
/**
* @constructor
*/
constructor() {
super();
}
/**
* @description get timeline video special effects type
* @return {}
*/
getTimelineVideoFxType() {
return Module.nvs_timelineVideoFx_getTimelineVideoFxType(this.internalObj);
}
/**
* @description get special effects name of built-in timeline
* @return {}
*/
getBuiltinTimelineVideoFxName() {
return Module.nvs_timelineVideoFx_getBuiltinTimelineVideoFxName(this.internalObj);
}
/**
* @description get timeline video special effects packageid
* @return {}
*/
getTimelineVideoFxPackageId() {
return Module.nvs_timelineVideoFx_getTimelineVideoFxPackageId(this.internalObj);
}
/**
* @description get in point
* @return {}
*/
getInPoint() {
return Module.nvs_timelineVideoFx_getInPoint(this.internalObj);
}
/**
* @description get out point
* @return {}
*/
getOutPoint() {
return Module.nvs_timelineVideoFx_getOutPoint(this.internalObj);
}
/**
* @description change in point
* @param {} newInPoint new in point
* @return {}
*/
changeInPoint(newInPoint) {
return Module.nvs_timelineVideoFx_changeInPoint(this.internalObj, newInPoint);
}
/**
* @description change out point
* @param {} newOutPoint new out point
* @return {}
*/
changeOutPoint(newOutPoint) {
return Module.nvs_timelineVideoFx_changeOutPoint(this.internalObj, newOutPoint);
}
/**
* @description move position
* @param {} offset offset
* @return {}
*/
movePosition(offset) {
Module.nvs_timelineVideoFx_movePosition(this.internalObj, offset);
}
/**
* @description Set video effect Z value. The Z value determines the rendering order of the effects. The higher the Z value, the higher the effect is.
* @param {} value value
* @return {}
*/
setZValue(value) {
Module.nvs_timelineVideoFx_setZValue(this.internalObj, value);
}
/**
* @description Get video effect Z value.
* @return {}
*/
getZValue() {
return Module.nvs_timelineVideoFx_getZValue(this.internalObj);
}
/**
* @description Convert timeline coordinates to particle system coordinates.
* @param {} ptCanonical
* @return {}
*/
mapPointFromCanonicalToParticleSystem(ptCanonical) {
return Module.nvs_timelineVideoFx_mapPointFromCanonicalToParticleSystem(this.internalObj, ptCanonical);
}
}
/**
* @classdesc Timeline subtitles are custom text superimposed on the video. When editing video, you can add and remove timeline subtitles and adjust the subtitle position. After adding subtitles, you can also set styles, including font size, color, shadow, stroke, etc.
* @extends NvsFx
*/
class NvsTimelineCaption extends NvsFx {
/**
* @constructor
*/
constructor() {
super();
}
/**
* @description Get the in-point of the caption on the timeline.
* @return {Number} The in-point of the caption on the timeline (in microseconds).
*/
getInPoint() {
return Module.nvs_caption_getInPoint(this.internalObj);
}
/**
* @description Get the out-point of the caption on the timeline.
* @return {Number} The out-point of the caption on the timeline (in microseconds).
*/
getOutPoint() {
return Module.nvs_caption_getOutPoint(this.internalObj);
}
/**
* @description Changes the in-point of the caption on the timeline.
* @param {Number} newInPoint The new in-point of the caption on the timeline (in microseconds).
* @return {Number} Returns the in-point of the caption on the timeline (in microseconds).
*/
changeInPoint(newInPoint) {
return Module.nvs_caption_changeInPoint(this.internalObj, newInPoint);
}
/**
* @description Changes the out-point of the caption on the timeline.
* @param {Number} newOutPoint The new out-point of the caption on the timeline (in microseconds).
* @return {Number} Returns the out-point of the caption on the timeline (in microseconds).
*/
changeOutPoint(newOutPoint) {
return Module.nvs_caption_changeOutPoint(this.internalObj, newOutPoint);
}
/**
* @description Changes the display position of the caption on the timeline (the in and out points are offset from the offset value at the same time).
* @param {} offset Offset value for in and out points changes (in microseconds).
*/
movePosition(offset) {
Module.nvs_caption_movePosition(this.internalObj, offset);
}
/**
* @description get role in theme
* @return {}
*/
getRoleInTheme() {
return Module.nvs_caption_getRoleInTheme(this.internalObj);
}
/**
* @description get category
* @return {}
*/
getCategory() {
return Module.nvs_caption_getCategory(this.internalObj);
}
/**
* @description get caption style package id
* @return {}
*/
getCaptionStylePackageId() {
return Module.nvs_caption_getCaptionStylePackageId(this.internalObj);
}
/**
* @description get modular caption context package id
* @return {}
*/
getModularCaptionContextPackageId() {
return Module.nvs_caption_getModularCaptionContextPackageId(this.internalObj);
}
/**
* @description get modular caption renderer package id
* @return {}
*/
getModularCaptionRendererPackageId() {
return Module.nvs_caption_getModularCaptionRendererPackageId(this.internalObj);
}
/**
* @description get modular caption animation package id
* @return {}
*/
getModularCaptionAnimationPackageId() {
return Module.nvs_caption_getModularCaptionAnimationPackageId(this.internalObj);
}
/**
* @description get modular caption in animation package id
* @return {}
*/
getModularCaptionInAnimationPackageId() {
return Module.nvs_caption_getModularCaptionInAnimationPackageId(this.internalObj);
}
/**
* @description get modular caption out animation package id
* @return {}
*/
getModularCaptionOutAnimationPackageId() {
return Module.nvs_caption_getModularCaptionOutAnimationPackageId(this.internalObj);
}
/**
* @description apply caption style
* @param {} captionStylePackageId caption style package id
* @param {} isUseDefaultAssetParam use resource parameter of default
* @return {}
*/
applyCaptionStyle(captionStylePackageId, isUseDefaultAssetParam) {
Module.nvs_caption_applyCaptionStyle(this.internalObj, captionStylePackageId, isUseDefaultAssetParam);
}
/**
* @description apply modular caption context
* @param {} captionContextPackageId caption context package id
* @return {}
*/
applyModularCaptionContext(captionContextPackageId) {
Module.nvs_caption_applyModularCaptionContext(this.internalObj, captionContextPackageId);
}
/**
* @description apply modular caption renderer
* @param {} captionRendererPackageId caption context package id
* @return {}
*/
applyModularCaptionRenderer(captionRendererPackageId) {
Module.nvs_caption_applyModularCaptionRenderer(this.internalObj, captionRendererPackageId);
}
/**
* @description apply modular caption animation
* @param {} captionAnimationPackageId caption animation package id
* @return {}
*/
applyModularCaptionAnimation(captionAnimationPackageId) {
Module.nvs_caption_applyModularCaptionAnimation(this.internalObj, captionAnimationPackageId);
}
/**
* @description apply modular caption in animation
* @param {} captionInAnimationPackageId caption in animation package id
* @return {}
*/
applyModularCaptionInAnimation(captionInAnimationPackageId) {
Module.nvs_caption_applyModularCaptionInAnimation(this.internalObj, captionInAnimationPackageId);
}
/**
* @description apply modular caption out animation
* @param {} captionOutAnimationPackageId caption out animation package id
* @return {}
*/
applyModularCaptionOutAnimation(captionOutAnimationPackageId) {
Module.nvs_caption_applyModularCaptionOutAnimation(this.internalObj, captionOutAnimationPackageId);
}
/**
* @description set modular caption animation period
* @param {} periodInMS period(milliseconds)
* @return {}
*/
setModularCaptionAnimationPeroid(periodInMS) {
Module.nvs_caption_setModularCaptionAnimationPeroid(this.internalObj, periodInMS);
}
/**
* @description get modular caption animation period
* @return {}
*/
getModularCaptionAnimationPeroid() {
return Module.nvs_caption_getModularCaptionAnimationPeroid(this.internalObj);
}
/**
* @description set modular caption in animation duration
* @param {} inAnimationDurationInMS in animation duration(milliseconds)
* @return {}
*/
setModularCaptionInAnimationDuration(inAnimationDurationInMS) {
Module.nvs_caption_setModularCaptionInAnimationDuration(this.internalObj, inAnimationDurationInMS);
}
/**
* @description get modular caption in animation duration
* @return {}
*/
getModularCaptionInAnimationDuration() {
return Module.nvs_caption_getModularCaptionInAnimationDuration(this.internalObj);
}
/**
* @description set modular caption out animation duration
* @param {} outAnimationDurationInMS out animation duration(milliseconds)
* @return {}
*/
setModularCaptionOutAnimationDuration(outAnimationDurationInMS) {
Module.nvs_caption_setModularCaptionOutAnimationDuration(this.internalObj, outAnimationDurationInMS);
}
/**
* @description get modular caption out animation duration
* @return {}
*/
getModularCaptionOutAnimationDuration() {
return Module.nvs_caption_getModularCaptionOutAnimationDuration(this.internalObj);
}
/**
* @description set caption text
* @param {} text text
* @return {}
*/
setText(text) {
Module.nvs_caption_setText(this.internalObj, text);
}
/**
* @description get caption text
* @return {}
*/
getText() {
return Module.nvs_caption_getText(this.internalObj);
}
/**
* @description Set caption horizontal alignment style
* @param {} textAlign Indicates the caption horizontal alignment style
* @return {}
*/
setTextAlignment(textAlign) {
Module.nvs_caption_setTextAlignment(this.internalObj, textAlign);
}
/**
* @description Get caption horizontal alignment style
* @return {}
*/
getTextAlignment() {
return Module.nvs_caption_getTextAlignment(this.internalObj);
}
/**
* @description Set caption font bold
* @param {} bold Indicates whether the caption font is bold.
* @return {}
*/
setBold(bold) {
Module.nvs_caption_setBold(this.internalObj, bold);
}
/**
* @description Get the caption font bold state
* @return {}
*/
getBold() {
return Module.nvs_caption_getBold(this.internalObj);
}
/**
* @description Set caption font italic.
* @param {} italic Italic or not
* @return {}
*/
setItalic(italic) {
Module.nvs_caption_setItalic(this.internalObj, italic);
}
/**
* @description Get caption font italic.
* @return {}
*/
getItalic() {
return Module.nvs_caption_getItalic(this.internalObj);
}
/**
* @description Set caption underline
* @param {} underline Underline or not
* @return {}
*/
setUnderline(underline) {
Module.nvs_caption_setUnderline(this.internalObj, underline);
}
/**
* @description Get caption underline
* @return {}
*/
getUnderline() {
return Module.nvs_caption_getUnderline(this.internalObj);
}
/**
* @description Set caption word spacing type.
* @param {} letterSpacingType Word spacing type.
* @return {}
*/
setLetterSpacingType(letterSpacingType) {
Module.nvs_caption_setLetterSpacingType(this.internalObj, letterSpacingType);
}
/**
* @description Get caption word spacing type.
* @return {}
*/
getLetterSpacingType() {
return Module.nvs_caption_getLetterSpacingType(this.internalObj);
}
/**
* @description Set caption letter spacing
* @param {} letterSpacing Letter spacing
* @return {}
*/
setLetterSpacing(letterSpacing) {
Module.nvs_caption_setLetterSpacing(this.internalObj, letterSpacing);
}
/**
* @description Get caption letter spacing
* @return {}
*/
getLetterSpacing() {
return Module.nvs_caption_getLetterSpacing(this.internalObj);
}
/**
* @description Set line spacing
* @param {} lineSpacing Line spacing
* @return {}
*/
setLineSpacing(lineSpacing) {
Module.nvs_caption_setLineSpacing(this.internalObj, lineSpacing);
}
/**
* @description Get line spacing
* @return {}
*/
getLineSpacing() {
return Module.nvs_caption_getLineSpacing(this.internalObj);
}
/**
* @description Set caption weight
* @param {} weight Weight
* @return {}
*/
setWeight(weight) {
Module.nvs_caption_setWeight(this.internalObj, weight);
}
/**
* @description Get caption weight
* @return {}
*/
getWeight() {
return Module.nvs_caption_getWeight(this.internalObj);
}
/**
* @description Set caption text color
* @param {} color Text color
* @return {}
*/
setTextColor(color) {
if (color === undefined || color === null || color === '')
return;
Module.nvs_caption_setTextColor(this.internalObj, color);
}
/**
* @description Get caption text color
* @return {}
*/
getTextColor() {
return Module.nvs_caption_getTextColor(this.internalObj);
}
/**
* @description Set caption stroke.
* @param {} drawOutline Whether to stroke the captions.
* @return {}
*/
setDrawOutline(drawOutline) {
Module.nvs_caption_setDrawOutline(this.internalObj, drawOutline);
}
/**
* @description Get caption stroke.
* @return {}
*/
getDrawOutline() {
return Module.nvs_caption_getDrawOutline(this.internalObj);
}
/**
* @description Set the width of the caption stroke.
* @param {} outlineWidth The width of the caption stroke.
* @return {}
*/
setOutlineWidth(outlineWidth) {
Module.nvs_caption_setOutlineWidth(this.internalObj, outlineWidth);
}
/**
* @description Get the width of the caption stroke.
* @return {}
*/
getOutlineWidth() {
return Module.nvs_caption_getOutlineWidth(this.internalObj);
}
/**
* @description Set the color of the caption stroke.
* @param {} color Caption stroke color value
* @return {}
*/
setOutlineColor(color) {
if (color === undefined || color === null || color === '')
return;
Module.nvs_caption_setOutlineColor(this.internalObj, color);
}
/**
* @description Get the color of the caption stroke.
* @return {}
*/
getOutlineColor() {
return Module.nvs_caption_getOutlineColor(this.internalObj);
}
/**
* @description Set caption shadows.
* @param {} drawShadow Whether to set the caption shadow
* @return {}
*/
setDrawShadow(drawShadow) {
Module.nvs_caption_setDrawShadow(this.internalObj, drawShadow);
}
/**
* @description Get caption shadows.
* @return {}
*/
getDrawShadow() {
return Module.nvs_caption_getDrawShadow(this.internalObj);
}
/**
* @description Set caption shadow offset
* @param {} offset offset
* @return {}
*/
setShadowOffset(offset) {
Module.nvs_caption_setShadowOffset(this.internalObj, offset);
}
/**
* @description Get caption shadow offset
* @return {}
*/
getShadowOffset() {
return Module.nvs_caption_getShadowOffset(this.internalObj);
}
/**
* @description Set caption shadow color
* @param {} color Shadow color
* @return {}
*/
setShadowColor(color) {
if (color === undefined || color === null || color === '')
return;
Module.nvs_caption_setShadowColor(this.internalObj, color);
}
/**
* @description Get caption shadow color
* @return {}
*/
getShadowColor() {
return Module.nvs_caption_getShadowColor(this.internalObj);
}
/**
* @description Set the feathering degree of the caption shadow.
* @param {} feather feathering degree
* @return {}
*/
setShadowFeather(feather) {
Module.nvs_caption_setShadowFeather(this.internalObj, feather);
}
/**
* @description Get the feathering degree of the caption shadow.
* @return {}
*/
getShadowFeather() {
return Module.nvs_caption_getShadowFeather(this.internalObj);
}
/**
* @description Set caption font size.
* @param {} fontSize font size
* @return {}
*/
setFontSize(fontSize) {
Module.nvs_caption_setFontSize(this.internalObj, fontSize);
}
/**
* @description Get caption font size.
* @return {}
*/
getFontSize() {
return Module.nvs_caption_getFontSize(this.internalObj);
}
/**
* @description Set caption font by file path
* @param {} filePath font file path
* @return {}
*/
setFontByFilePath(filePath) {
Module.nvs_caption_setFontByFilePath(this.internalObj, filePath);
}
/**
* @description Get caption font file path
* @return {}
*/
getFontFilePath() {
return Module.nvs_caption_getFontFilePath(this.internalObj);
}
/**
* @description Set caption font family
* @param {} family font family
* @return {}
*/
setFontFamily(family) {
Module.nvs_caption_setFontFamily(this.internalObj, family);
}
/**
* @description Get caption font family
* @return {}
*/
getFontFamily() {
return Module.nvs_caption_getFontFamily(this.internalObj);
}
/**
* @description Set the amount of caption translation.
* @param {} translation The horizontal and vertical absolute translation of the caption.
* @return {}
*/
setCaptionTranslation(translation) {
Module.nvs_caption_setCaptionTranslation(this.internalObj, translation);
}
/**
* @description Get the amount of caption translation.
* @return {}
*/
getCaptionTranslation() {
return Module.nvs_caption_getCaptionTranslation(this.internalObj);
}
/**
* @description Caption translation.
* @param {} translationOffset Horizontal and vertical offset values for caption.
* @return {}
*/
translateCaption(translationOffset) {
Module.nvs_caption_translateCaption(this.internalObj, translationOffset);
}
/**
* @description Set caption anchor.
* @param {} anchor anchor
* @return {}
*/
setAnchorPoint(anchor) {
Module.nvs_caption_setAnchorPoint(this.internalObj, anchor);
}
/**
* @description Get caption anchor.
* @return {}
*/
getAnchorPoint() {
return Module.nvs_caption_getAnchorPoint(this.internalObj);
}
/**
* @description Set horizontal scaling factor for caption.
* @param {} scale Horizontal scaling factor.
* @return {}
*/
setScaleX(scale) {
Module.nvs_caption_setScaleX(this.internalObj, scale);
}
/**
* @description Get horizontal scaling factor for caption.
* @return {}
*/
getScaleX() {
return Module.nvs_caption_getScaleX(this.internalObj);
}
/**
* @description Set vertical scaling factor for caption.
* @param {} scale Vertical scaling factor.
* @return {}
*/
setScaleY(scale) {
Module.nvs_caption_setScaleY(this.internalObj, scale);
}
/**
* @description Get vertical scaling factor for caption.
* @return {}
*/
getScaleY() {
return Module.nvs_caption_getScaleY(this.internalObj);
}
/**
* @description Scale caption.
* @param {} scaleFactor scale factor
* @param {} anchor anchor
* @return {}
*/
scaleCaption(scaleFactor, anchor) {
Module.nvs_caption_scaleCaption(this.internalObj, scaleFactor, anchor);
}
/**
* @description Scale caption on center
* @param {} scaleFactor scale factor
* @return {}
*/
scaleCaption2(scaleFactor) {
var rect = this.getTextBoundingRect();
this.scaleCaption(scaleFactor, new NvsPointF((rect.left + rect.right) / 2, (rect.top + rect.bottom) / 2));
}
/**
* @description Set rotation angle for caption.
* @param {} angle angle
* @return {}
*/
setRotationZ(angle) {
Module.nvs_caption_setRotationZ(this.internalObj, angle);
}
/**
* @description Get rotation angle for caption.
* @return {}
*/
getRotationZ() {
return Module.nvs_caption_getRotationZ(this.internalObj);
}
/**
* @description Rotate caption
* @param {} angle angle
* @param {} anchor anchor
* @return {}
*/
rotateCaption(angle, anchor) {
Module.nvs_caption_rotateCaption(this.internalObj, angle, anchor);
}
/**
* @description Rotate caption on center
* @param {} angle angle
* @return {}
*/
rotateCaption2(angle) {
var rect = this.getTextBoundingRect();
this.rotateCaption(angle, new NvsPointF((rect.left + rect.right) / 2, (rect.top + rect.bottom) / 2));
}
/**
* @description Get caption text rectangle
* @return {}
*/
getTextBoundingRect() {
return Module.nvs_caption_getTextBoundingRect(this.internalObj);
}
/**
* @description Get the vertex position of the original enclosing rectangle of the caption after transformation.
* @return {}
*/
getBoundingRectangleVertices() {
return Module.nvs_caption_getBoundingRectangleVertices(this.internalObj);
}
/**
* @description Get the transformed vertices position of the original caption bounding.
* @param {} boundingType Bounding type
* @return {}
*/
getCaptionBoundingVertices(boundingType) {
return Module.nvs_caption_getCaptionBoundingVertices(this.internalObj, boundingType);
}
/**
* @description Set caption Z value.
* @param {} value Z value
* @return {}
*/
setZValue(value) {
Module.nvs_caption_setZValue(this.internalObj, value);
}
/**
* @description Get caption Z value.
* @return {}
*/
getZValue() {
return Module.nvs_caption_getZValue(this.internalObj);
}
/**
* @description Set whether to record user actions.
* @param {} recordingUserOperation Record user actions or not
* @return {}
*/
setRecordingUserOperation(recordingUserOperation) {
Module.nvs_caption_setRecordingUserOperation(this.internalObj, recordingUserOperation);
}
/**
* @description Set caption opacity.
* @param {} opacity opacity
* @return {}
*/
setOpacity(opacity) {
Module.nvs_caption_setOpacity(this.internalObj, opacity);
}
/**
* @description Get caption opacity.
* @return {}
*/
getOpacity() {
return Module.nvs_caption_getOpacity(this.internalObj);
}
/**
* @description Determine if it is a border caption.
* @return {}
*/
isFrameCaption() {
return Module.nvs_caption_isFrameCaption(this.internalObj);
}
/**
* @description Determine if caption text color changed.
* @return {}
*/
isTextColorChanged() {
return Module.nvs_caption_isTextColorChanged(this.internalObj);
}
/**
* @description Determines whether the current caption is a modular caption.
* @return {}
*/
isModular() {
return Module.nvs_caption_isModular(this.internalObj);
}
/**
* @description Set text background color.
* @param {} backgroundColor background color
* @return {}
*/
setBackgroundColor(backgroundColor) {
Module.nvs_caption_setBackgroundColor(this.internalObj, backgroundColor);
}
/**
* @description Get text background color.
* @return {}
*/
getBackgroundColor() {
return Module.nvs_caption_getBackgroundColor(this.internalObj);
}
/**
* @description Set text background rectangle's corner radius.
* @param {} radius radius
* @return {}
*/
setBackgroundRadius(radius) {
Module.nvs_caption_setBackgroundRadius(this.internalObj, radius);
}
/**
* @description Get text background rectangle's corner radius.
* @return {}
*/
getBackgroundRadius() {
return Module.nvs_caption_getBackgroundRadius(this.internalObj);
}
/**
* @description Set the caption KeyFrameTime.
* @param {} time time
* @return {}
*/
setCurrentKeyFrameTime(time) {
Module.nvs_caption_setCurrentKeyFrameTime(this.internalObj, time);
}
/**
* @description Set caption lyrics type
* @param {} isLyrics lyrics
* @return {}
*/
setIsLyrics(isLyrics) {
Module.nvs_caption_setIsLyrics(this.internalObj, isLyrics);
}
/**
* @description Lyrics or not
* @return {}
*/
isLyrics() {
return Module.nvs_caption_isLyrics(this.internalObj);
}
/**
* @description Set the max font size for border caption. Only border caption can use this method.
* @param {} maxFontSize max font size
* @return {}
*/
setFrameCaptionMaxFontSize(maxFontSize) {
Module.nvs_caption_setFrameCaptionMaxFontSize(this.internalObj, maxFontSize);
}
/**
* @description Set the original frame size of the frame caption. If the current caption is not a frame caption, this function has no effect. You can get origin frame size.
* @param {} rect rectangle
* @return {}
*/
setTextFrameOriginRect(rect) {
Module.nvs_caption_setTextFrameOriginRect(this.internalObj, rect);
}
}
/**
* @classdesc Motion parameter information
*/
class NvsMotionParameters {
/**
* @constructor
*/
constructor() {
this.anchorX = 0;
this.anchorY = 0;
this.scaleX = 1;
this.scaleY = 1;
this.rotationZ = 0;
this.transX = 0;
this.transY = 0;
}
}
/**
* @classdesc Timeline compound caption.
Timeline compound captions are compound caption that is superimposed on the video, each compound caption may composed of several sub-captions. When editing a video, users can add or remove timeline compound captions and adjust the captions position. User can also set its properties such as font family, text color, etc.
* @extends NvsFx
*/
class NvsTimelineCompoundCaption extends NvsFx {
/**
* @constructor
*/
constructor() {
super();
}
/**
* @description Get number of sub-cpations in this compound caption.
* @return {}
*/
getCaptionCount() {
return Module.nvs_compoundCaption_getCaptionCount(this.internalObj);
}
/**
* @description Get in point
* @return {}
*/
getInPoint() {
return Module.nvs_compoundCaption_getInPoint(this.internalObj);
}
/**
* @description Get out point
* @return {}
*/
getOutPoint() {
return Module.nvs_compoundCaption_getOutPoint(this.internalObj);
}
/**
* @description Change in point
* @param {} newInPoint new in point
* @return {}
*/
changeInPoint(newInPoint) {
return Module.nvs_compoundCaption_changeInPoint(this.internalObj, newInPoint);
}
/**
* @description Change out point
* @param {} newOutPoint new point
* @return {}
*/
changeOutPoint(newOutPoint) {
return Module.nvs_compoundCaption_changeOutPoint(this.internalObj, newOutPoint);
}
/**
* @description Changes the display position of the caption on the timeline (the in and out points are offset from the offset value at the same time).
* @param {} offset Offset value for in and out points changes (in microseconds).
* @return {}
*/
movePosition(offset) {
Module.nvs_compoundCaption_movePosition(this.internalObj, offset);
}
/**
* @description Set sub-caption text with index
* @param {} captionIndex sub-caption index
* @param {} text text
* @return {}
*/
setText(captionIndex, text) {
Module.nvs_compoundCaption_setText(this.internalObj, captionIndex, text);
}
/**
* @description Get sub-caption text with index
* @param {} captionIndex sub-caption index
* @return {}
*/
getText(captionIndex) {
return Module.nvs_compoundCaption_getText(this.internalObj, captionIndex);
}
/**
* @description Set sub-caption color with index
* @param {} captionIndex sub-caption index
* @param {} color color
* @return {}
*/
setTextColor(captionIndex, color) {
if (color === undefined || color === null || color === '')
return;
Module.nvs_compoundCaption_setTextColor(this.internalObj, captionIndex, color);
}
/**
* @description Get sub-caption color with index
* @param {} captionIndex sub-caption index
* @return {}
*/
getTextColor(captionIndex) {
return Module.nvs_compoundCaption_getTextColor(this.internalObj, captionIndex);
}
/**
* @description Set sub-caption font family with index
* @param {} captionIndex sub-caption index
* @param {} family font family
* @return {}
*/
setFontFamily(captionIndex, family) {
Module.nvs_compoundCaption_setFontFamily(this.internalObj, captionIndex, family);
}
/**
* @description Get sub-caption font family with index
* @param {} captionIndex sub-caption index
* @return {}
*/
getFontFamily(captionIndex) {
return Module.nvs_compoundCaption_getFontFamily(this.internalObj, captionIndex);
}
/**
* @description Set the amount of caption translation.
* @param {} translation The horizontal and vertical translation of the caption.
* @return {}
*/
setCaptionTranslation(translation) {
Module.nvs_compoundCaption_setCaptionTranslation(this.internalObj, translation);
}
/**
* @description Get the amount of caption translation.
* @return {}
*/
getCaptionTranslation() {
return Module.nvs_compoundCaption_getCaptionTranslation(this.internalObj);
}
/**
* @description Translate caption.
* @param {} translationOffset Horizontal and vertical offset values for caption.
* @return {}
*/
translateCaption(translationOffset) {
Module.nvs_compoundCaption_translateCaption(this.internalObj, translationOffset);
}
/**
* @description Set caption anchor.
* @param {} anchor anchor
* @return {}
*/
setAnchorPoint(anchor) {
Module.nvs_compoundCaption_setAnchorPoint(this.internalObj, anchor);
}
/**
* @description Get caption anchor.
* @return {}
*/
getAnchorPoint() {
return Module.nvs_compoundCaption_getAnchorPoint(this.internalObj);
}
/**
* @description Set horizontal scaling factor for caption.
* @param {} scale Horizontal scaling factor.
* @return {}
*/
setScaleX(scale) {
Module.nvs_compoundCaption_setScaleX(this.internalObj, scale);
}
/**
* @description Get horizontal scaling factor for caption.
* @return {}
*/
getScaleX() {
return Module.nvs_compoundCaption_getScaleX(this.internalObj);
}
/**
* @description Set vertical scaling factor for captions.
* @param {} scale Vertical scaling factor.
* @return {}
*/
setScaleY(scale) {
Module.nvs_compoundCaption_setScaleY(this.internalObj, scale);
}
/**
* @description Get vertical scaling factor for captions.
* @return {}
*/
getScaleY() {
return Module.nvs_compoundCaption_getScaleY(this.internalObj);
}
/**
* @description Scale caption
* @param {} scaleFactor scale factor
* @param {} anchor anchor
* @return {}
*/
scaleCaption(scaleFactor, anchor) {
Module.nvs_compoundCaption_scaleCaption(this.internalObj, scaleFactor, anchor);
}
/**
* @description Set the rotation angle for the caption.
* @param {} angle angle
* @return {}
*/
setRotationZ(angle) {
Module.nvs_compoundCaption_setRotationZ(this.internalObj, angle);
}
/**
* @description Get the rotation angle for the caption.
* @return {}
*/
getRotationZ() {
return Module.nvs_compoundCaption_getRotationZ(this.internalObj);
}
/**
* @description Rotate catpion
* @param {} angle angle
* @param {} anchor anchor
* @return {}
*/
rotateCaption(angle, anchor) {
Module.nvs_compoundCaption_rotateCaption(this.internalObj, angle, anchor);
}
/**
* @description Rotate catpion on center
* @param {} angle angle
* @return {}
*/
rotateCaption2(angle) {
var vertices = this.getCompoundBoundingVertices(1);
if (!vertices || vertices.size() !== 4) return;
var cx = 0;
var cy = 0;
for (var i = 0; i < 4; ++i) {
var pt = vertices.get(i);
cx += pt.x;
cy += pt.y;
}
this.rotateCaption(angle, new NvsPointF(cx / 4, cy / 4));
}
/**
* @description Get the transformed vertices position of the original caption bounding.
* @param {} captionIndex sub-caption index
* @param {} boudingType bounding type
* @param {} motionParams motion parameter
* @return {}
*/
getCaptionBoundingVertices(captionIndex, boudingType, motionParams) {
return Module.nvs_compoundCaption_getCaptionBoundingVertices(this.internalObj, captionIndex, boudingType, motionParams);
}
/**
* @description Get the transformed vertices position of the original compound caption bounding.
* @param {} boudingType bounding type
* @param {} motionParams motion parameter
* @return {}
*/
getCompoundBoundingVertices(boudingType, motionParams) {
return Module.nvs_compoundCaption_getCompoundBoundingVertices(this.internalObj, boudingType, motionParams);
}
/**
* @description Set caption Z value.
* @param {} value Z value
* @return {}
*/
setZValue(value) {
Module.nvs_compoundCaption_setZValue(this.internalObj, value);
}
/**
* @description Get caption Z value.
* @return {}
*/
getZValue() {
return Module.nvs_compoundCaption_getZValue(this.internalObj);
}
/**
* @description Set caption opacity
* @param {} value opacity
* @return {}
*/
setOpacity(value) {
Module.nvs_compoundCaption_setOpacity(this.internalObj, value);
}
/**
* @description Get caption opacity
* @return {}
*/
getOpacity() {
return Module.nvs_compoundCaption_getOpacity(this.internalObj);
}
/**
* @description Determine if it is a border caption.
* @param {} captionIndex sub-caption index
* @return {}
*/
isFrameCaption(captionIndex) {
return Module.nvs_compoundCaption_isFrameCaption(this.internalObj, captionIndex);
}
/**
* @description Get the caption style package ID.
* @return {}
*/
getCaptionStylePackageId() {
return Module.nvs_compoundCaption_getCaptionStylePackageId(this.internalObj);
}
}
/**
* @classdesc Timeline animated sticker class.
Timeline animation sticker is a landscaping effect used in video editing to produce animated effects. Users can add and remove animated stickers from the timeline, as well as adjust various properties of the stickers through various APIs, such as position, size, display time, and so on.
Note: The in-point and out-point units of the animated sticker on the timeline are both in microseconds.
* @extends NvsFx
*/
class NvsTimelineAnimatedSticker extends NvsFx {
/**
* @constructor
*/
constructor() {
super();
}
/**
* @description Get animated sticker's in-point on the timeline.
* @return {}
*/
getInPoint() {
return Module.nvs_animatedSticker_getInPoint(this.internalObj);
}
/**
* @description Get animated sticker's out-point on the timeline.
* @return {}
*/
getOutPoint() {
return Module.nvs_animatedSticker_getOutPoint(this.internalObj);
}
/**
* @description Change the in-point of the animated sticker on the timeline. When the new in-point does not conform to the established rules, the final return in-point may be different from the new in-point value. Such as the new in-point is less than 0, the new in-point value is greater than the timeline duration, or the new in-point is greater than the out-point.
* @param {} newInPoint The new in-point of the animated sticker on the timeline (in microseconds).
* @return {}
*/
changeInPoint(newInPoint) {
return Module.nvs_animatedSticker_changeInPoint(this.internalObj, newInPoint);
}
/**
* @description Change the out-point of the animated sticker on the timeline. When the new out-point does not conform to the established rules, the final return out-point may be different from the new out-point value. Such as the new out-point is less than 0, the new out-point value is greater than the timeline duration, or the new out-point is less than the in-point.
* @param {} newOutPoint The out-point of the animated sticker on the timeline (in microseconds).
* @return {}
*/
changeOutPoint(newOutPoint) {
return Module.nvs_animatedSticker_changeOutPoint(this.internalObj, newOutPoint);
}
/**
* @description Change the display position of the animated sticker on the timeline (the in and out points are offset from the offset value at the same time).
* @param {} offset Offset value for in and out points changes (in microseconds).
* @return {}
*/
movePosition(offset) {
Module.nvs_animatedSticker_movePosition(this.internalObj, offset);
}
/**
* @description Set the translation position of the animated sticker in the timeline coordinate system.
* @param {} translation Translation position
* @return {}
*/
setTranslation(translation) {
Module.nvs_animatedSticker_setTranslation(this.internalObj, translation);
}
/**
* @description Get the translation position of the animated sticker in the timeline coordinate system.
* @return {}
*/
getTranslation() {
return Module.nvs_animatedSticker_getTranslation(this.internalObj);
}
/**
* @description Tanslate animated sticker in the timeline coordinate system.The translation coordinates set by this function are stackable.
* @param {} translationOffset Animated sticker translation offset values.
* @return {}
*/
translateAnimatedSticker(translationOffset) {
Module.nvs_animatedSticker_translateAnimatedSticker(this.internalObj, translationOffset);
}
/**
* @description Set the scale value of the animated sticker. The scale value set by this function do not stack.
* @param {} scale Scaling value.
* @return {}
*/
setScale(scale) {
Module.nvs_animatedSticker_setScale(this.internalObj, scale);
}
/**
* @description Get the scale value of the animated sticker.
* @return {}
*/
getScale() {
return Module.nvs_animatedSticker_getScale(this.internalObj);
}
/**
* @description Scale animation sticker with the anchor point as the center. The scaling value set by this function is stackable.
* @param {} scaleFactor Animated sticker scaling factor.
* @param {} anchor Animated sticker scale anchor.
* @return {}
*/
scaleAnimatedSticker(scaleFactor, anchor) {
Module.nvs_animatedSticker_scaleAnimatedSticker(this.internalObj, scaleFactor, anchor);
}
/**
* @description Scale animation sticker on center. The scaling value set by this function is stackable.
* @param {} scaleFactor Animated sticker scaling factor.
* @return {}
*/
scaleAnimatedSticker2(scaleFactor) {
var left, right, top, bottom;
var list = this.getBoundingRectangleVertices();
var point = list.get(0);
left = right = point.x;
top = bottom = point.y;
for (var i = 1; i < 4; i++) {
point = list.get(i);
if (point.x < left)
left = point.x;
else if (point.x > right)
right = point.x;
if (point.y < bottom)
bottom = point.y;
else if (point.y > top)
top = point.y;
}
this.scaleAnimatedSticker(scaleFactor, new NvsPointF((left + right) / 2, (top + bottom) / 2));
}
/**
* @description Set the angle at which the animation sticker rotates clockwise along the Z-axis, which is perpendicular to the screen.The rotation Angle set by this function does not stack.
* @param {} angle Rotation angle value.
* @return {}
*/
setRotationZ(angle) {
Module.nvs_animatedSticker_setRotationZ(this.internalObj, angle);
}
/**
* @description Get the angle at which the animation sticker rotates clockwise along the Z-axis, which is perpendicular to the screen.
* @return {}
*/
getRotationZ() {
return Module.nvs_animatedSticker_getRotationZ(this.internalObj);
}
/**
* @description Rotate the animation sticker around the anchor point. The rotation angle set by this function is stackable.
* @param {} angle rotation angle.
* @param {} anchor rotation anchor.
* @return {}
*/
rotateAnimatedSticker(angle, anchor) {
Module.nvs_animatedSticker_rotateAnimatedSticker(this.internalObj, angle, anchor);
}
/**
* @description Rotate the animation sticker around center. The rotation angle set by this function is stackable.
* @param {} angle rotation angle.
* @return {}
*/
rotateAnimatedSticker2(angle) {
var left, right, top, bottom;
var list = this.getBoundingRectangleVertices();
var point = list.get(0);
left = right = point.x;
top = bottom = point.y;
for (var i = 1; i < 4; i++) {
point = list.get(i);
if (point.x < left)
left = point.x;
else if (point.x > right)
right = point.x;
if (point.y < bottom)
bottom = point.y;
else if (point.y > top)
top = point.y;
}
this.rotateAnimatedSticker(angle, new NvsPointF((left + right) / 2, (top + bottom) / 2));
}
/**
* @description Set the horizontal flip of the animated sticker.
* @param {} flip Whether to flip horizontally. True means horizontal flip, and false means not.
* @return {}
*/
setHorizontalFlip(flip) {
Module.nvs_animatedSticker_setHorizontalFlip(this.internalObj, flip);
}
/**
* @description Get the horizontal flip state of the animated sticker.
* @return {}
*/
getHorizontalFlip() {
return Module.nvs_animatedSticker_getHorizontalFlip(this.internalObj);
}
/**
* @description Set the vertical flip of the animated sticker.
* @param {} flip Set the vertical flip of the animated sticker.
* @return {}
*/
setVerticalFlip(flip) {
Module.nvs_animatedSticker_setVerticalFlip(this.internalObj, flip);
}
/**
* @description Get the vertical flip state of the animated sticker.
* @return {}
*/
getVerticalFlip() {
return Module.nvs_animatedSticker_getVerticalFlip(this.internalObj);
}
/**
* @description Get the vertex positions of the animated sticker's original bounding in the timeline coordinate system.
* @return {}
*/
getBoundingRectangleVertices() {
return Module.nvs_animatedSticker_getBoundingRectangleVertices(this.internalObj);
}
/**
* @description Get animated sticker's package ID.
* @return {}
*/
getAnimatedStickerPackageId() {
return Module.nvs_animatedSticker_getAnimatedStickerPackageId(this.internalObj);
}
/**
* @description Set the sticker Z value.The higher the Z value, the higher the sticker is.
* @param {} value Z value
* @return {}
*/
setZValue(value) {
Module.nvs_animatedSticker_setZValue(this.internalObj, value);
}
/**
* @description Get the sticker Z value.
* @return {}
*/
getZValue() {
return Module.nvs_animatedSticker_getZValue(this.internalObj);
}
/**
* @description Check whether the sticker contains audio.
* @return {}
*/
hasAudio() {
return Module.nvs_animatedSticker_hasAudio(this.internalObj);
}
/**
* @description Set the sticker volume.
* @param {} leftVolumeGain Left channel volume gain,value range [0, 1].
* @param {} rightVolumeGain Right channel volume gain,value range [0, 1].
* @return {}
*/
setVolumeGain(leftVolumeGain, rightVolumeGain) {
Module.nvs_animatedSticker_setVolumeGain(this.internalObj, leftVolumeGain, rightVolumeGain);
}
/**
* @description Get volume information.
* @return {}
*/
getVolumeGain() {
return Module.nvs_animatedSticker_getVolumeGain(this.internalObj);
}
/**
* @description Set the sticker opacity,value range [0, 1].
* @param {} opacity sticker opacity.
* @return {}
*/
setOpacity(opacity) {
Module.nvs_animatedSticker_setOpacity(this.internalObj, opacity);
}
/**
* @description Get the sticker opacity.
* @return {}
*/
getOpacity() {
return Module.nvs_animatedSticker_getOpacity(this.internalObj);
}
/**
* @description Set the sticker's Key frame time
* @param {} time time
* @return {}
*/
setCurrentKeyFrameTime(time) {
Module.nvs_animatedSticker_setCurrentKeyFrameTime(this.internalObj, time);
}
}
/**
* @classdesc There are multiple clips on the track. The transition is the transition effect from one video clip to another, and no video transitions can be added between clips with gaps. Currently it supports multiple video transitions including fade, turning, swap, stretch in, page curl, lens flare, star, dip to black, dip to white,push to right, push to top, upper left into.
Each video transition can be set and retrieved via video track (NvsVideoTrack). The default transition is fade.
* @extends NvsFx
*/
class NvsVideoTransition extends NvsFx {
/**
* @constructor
*/
constructor() {
super();
}
/**
* @description Get video transition type.
* @return {}
*/
getVideoTransitionType() {
return Module.nvs_videoTransition_getVideoTransitionType(this.internalObj);
}
/**
* @description Get built-in video transition name.
* @return {}
*/
getBuiltinVideoTransitionName() {
return Module.nvs_videoTransition_getBuiltinVideoTransitionName(this.internalObj);
}
/**
* @description Get the video transition resource package ID.
* @return {}
*/
getVideoTransitionPackageId() {
return Module.nvs_videoTransition_getVideoTransitionPackageId(this.internalObj);
}
/**
* @description Set video transition duration.
* @param {} duration Video transition duration, min value 250000
* @param {} matchMode Video transition duration scale mode
* @return {}
*/
setVideoTransitionDuration(duration, matchMode) {
return Module.nvs_videoTransition_setVideoTransitionDuration(this.internalObj, duration, matchMode);
}
/**
* @description Get video transition duration.
* @return {}
*/
getVideoTransitionDuration() {
return Module.nvs_videoTransition_getVideoTransitionDuration(this.internalObj);
}
}
/**
* @classdesc Audio transition is an effect between audio clips.
Transitions are typically set and obtained via an audio track (Audio Track). The current default audio transition is a fade.
* @extends NvsFx
*/
class NvsAudioTransition extends NvsFx {
/**
* @constructor
*/
constructor() {
super();
}
}
/**
* @classdesc Video effects.
The video effect is a special effect on the video clip, which can change the overall or partial color, brightness, transparency, etc. of the video image, so that the video can show a special effect. On Video Clip, users can add, remove, and get multiple video effects.
* @extends NvsFx
*/
class NvsVideoFx extends NvsFx {
/**
* @constructor
*/
constructor() {
super();
}
/**
* @description Get video effect's type.
* @return {}
*/
getVideoFxType() {
return Module.nvs_videoFx_getVideoFxType(this.internalObj);
}
/**
* @description Get video effect's index.
* @return {}
*/
getIndex() {
return Module.nvs_videoFx_getIndex(this.internalObj);
}
/**
* @description Get built-in video effect's name.
* @return {}
*/
getBuiltinVideoFxName() {
return Module.nvs_videoFx_getBuiltinVideoFxName(this.internalObj);
}
/**
* @description Get the video effect's resource package ID.
* @return {}
*/
getVideoFxPackageId() {
return Module.nvs_videoFx_getVideoFxPackageId(this.internalObj);
}
/**
* @description mapping point from canonical to particle system
* @param {} ptCanonical
* @return {}
*/
mapPointFromCanonicalToParticleSystem(ptCanonical) {
return Module.nvs_videoFx_mapPointFromCanonicalToParticleSystem(this.internalObj, ptCanonical);
}
}
/**
* @classdesc Audio effects.
Audio effects are effects that are superimposed on an audio clip which can change the tone and rate of the audio clip. After getting an audio clip object instance, users can add or remove multiple audio effects as needed.
* @extends NvsFx
*/
class NvsAudioFx extends NvsFx {
/**
* @constructor
*/
constructor() {
super();
}
/**
* @description Get audio effects' index.
* @return {}
*/
getIndex() {
return Module.nvs_audioFx_getIndex(this.internalObj);
}
/**
* @description Get built-in audio effect's name.
* @return {}
*/
getBuiltinAudioFxName() {
return Module.nvs_audioFx_getBuiltinAudioFxName(this.internalObj);
}
}
/**
* @classdesc Fx parameter information
*/
class NvsParamInfoObject {
/**
* @constructor
*/
constructor() {
this.paramName = '';
this.paramType = '';
this.intDefVal = 0;
this.intMinVal = 0;
this.intMaxVal = 0;
this.floatDefVal = 0;
this.floatMinVal = 0;
this.floatMaxVal = 0;
this.boolDefVal = false;
this.colorDefR = 0;
this.colorDefG = 0;
this.colorDefB = 0;
this.colorDefA = 0;
this.stringType = 0;
this.stringDef = '';
}
}
/**
* @classdesc Effect parameter description class.
A variety of different parameter types of effect are set during capturing and editing. The effect parameter description class is used to obtain various effect parameter values.
*/
class NvsFxDescription {
/**
* @constructor
*/
constructor() {
this.internalObj = 0;
}
/**
* @description Get name
* @return {}
*/
getName() {
return Module.nvs_fxDescription_getName(this.internalObj);
}
/**
* @description Get all parameter information
* @return {}
*/
getAllParamsInfo() {
return Module.nvs_fxDescription_getAllParamsInfo(this.internalObj);
}
}
/**
* @classdesc Particle effect context The particle system is composed of several particle emitters and sub-emitters. The particle emitter emits particles over time, and the sub-emitter emits particles from the particles emitted by the particle emitter.
*/
class NvsParticleSystemContext {
/**
* @constructor
*/
constructor() {
this.contextInterface = 0;
}
/**
* @description Set whether to enable the emitter.
* @param {} emitterName emitter name
* @param {} enable enable or disable, default mode is enable.
* @return {}
*/
setEmitterEnabled(emitterName, enable) {
Module.nvs_particleSystemContext_setEmitterEnabled(this.contextInterface, emitterName, enable);
}
/**
* @description Set the particle emitter's position.
* @param {} emitterName emitter name
* @param {} emitterPositionX particle emitter's X coordinate
* @param {} emitterPositionY particle emitter's Y coordinate
* @return {}
*/
setEmitterPosition(emitterName, emitterPositionX, emitterPositionY) {
Module.nvs_particleSystemContext_setEmitterPosition(this.contextInterface, emitterName, emitterPositionX, emitterPositionY);
}
/**
* @description Append a path position to the particle emitter curve at the specified time point.
* @param {} emitterName emitter name
* @param {} timeSec time point
* @param {} emitterPositionX particle emitter's X coordinate
* @param {} emitterPositionY particle emitter's Y coordinate
* @return {}
*/
appendPositionToEmitterPositionCurve(emitterName, timeSec, emitterPositionX, emitterPositionY) {
Module.nvs_particleSystemContext_appendPositionToEmitterPositionCurve(this.contextInterface, emitterName, timeSec, emitterPositionX, emitterPositionY);
}
/**
* @description Set the particle emitter's position.
* @param {} emitterName emitter name
* @param {} emitterGain emission rate gain
* @return {}
*/
setEmitterRateGain(emitterName, emitterGain) {
Module.nvs_particleSystemContext_setEmitterRateGain(this.contextInterface, emitterName, emitterGain);
}
/**
* @description Set the size gain of the particles emitted by the particle emitter.
* @param {} emitterName emitter name
* @param {} emitterGain emission size gain
* @return {}
*/
setEmitterParticleSizeGain(emitterName, emitterGain) {
Module.nvs_particleSystemContext_setEmitterParticleSizeGain(this.contextInterface, emitterName, emitterGain);
}
}
/**
* @classdesc ARScene manipulate.
*/
class NvsARSceneManipulate {
/**
* @constructor
*/
constructor() {
this.contextInterface = 0;
}
/**
* @description Set detection mode.
* @param {} mode mode
* @return {}
*/
setDetectionMode(mode) {
Module.nvs_arSceneManipulate_setDetectionMode(this.contextInterface, mode);
}
}
const NvsParticleTypeEnum = Object.freeze({
"PARTICLE_TYPE_NORMAL" : 0,
"PARTICLE_TYPE_TOUCH" : 1,
"PARTICLE_TYPE_GESTURE" : 2,
"PARTICLE_TYPE_EYE" : 3,
"PARTICLE_TYPE_MOUTH" : 4});
const NvsEmitterPlaceEnum = Object.freeze({
"EMITTER_PLACE_LEFT" : 0,
"EMITTER_PLACE_RIGHT" : 1,
"EMITTER_PLACE_TOP" : 2,
"EMITTER_PLACE_BOTTOM" : 3,
"EMITTER_PLACE_CENTER" : 4});
class NvsParticleEmitterDesc {
constructor() {
this.emitterPlace = NvsEmitterPlaceEnum.EMITTER_PLACE_CENTER;
this.emitterNames = [];
}
}
/**
* @classdesc Particle effect package parsing class.
*/
class NvsAssetPackageParticleDescParser {
/**
* @constructor
* @param {} fxDescription
*/
constructor(fxDescription) {
this.particleType = NvsParticleTypeEnum.PARTICLE_TYPE_NORMAL;
this.emitters = [];
var fxDescobj = JSON.parse(fxDescription);
if (typeof(fxDescobj.particleType) !== 'undefined') {
if (fxDescobj.particleType === 'touch') {
this.particleType = NvsParticleTypeEnum.PARTICLE_TYPE_TOUCH
} else if (fxDescobj.particleType === 'gesture') {
this.particleType = NvsParticleTypeEnum.PARTICLE_TYPE_GESTURE
} else if (fxDescobj.particleType === 'eye') {
this.particleType = NvsParticleTypeEnum.PARTICLE_TYPE_EYE
} else if (fxDescobj.particleType === 'mouth') {
this.particleType = NvsParticleTypeEnum.PARTICLE_TYPE_MOUTH
}
}
var array = fxDescobj.emitterDesc;
for (var i = 0; i < array.length; i++) {
var emitterDesc = array[i];
var placeDesc = new NvsParticleEmitterDesc();
placeDesc.emitterPlace = NvsEmitterPlaceEnum.EMITTER_PLACE_CENTER;
if (typeof(emitterDesc.place) !== 'undefined') {
if (emitterDesc.place === 'left') {
placeDesc.emitterPlace = NvsEmitterPlaceEnum.EMITTER_PLACE_LEFT;
} else if (emitterDesc.place === 'right') {
placeDesc.emitterPlace = NvsEmitterPlaceEnum.EMITTER_PLACE_RIGHT;
} else if (emitterDesc.place === 'top') {
placeDesc.emitterPlace = NvsEmitterPlaceEnum.EMITTER_PLACE_TOP;
} else if (emitterDesc.place === 'bottom') {
placeDesc.emitterPlace = NvsEmitterPlaceEnum.EMITTER_PLACE_BOTTOM;
}
}
if (typeof(emitterDesc.emitterName) !== 'undefined') {
var emitterNames = emitterDesc.emitterName;
for (var j = 0; j < emitterNames.length; j++) {
var name = emitterNames[j];
placeDesc.emitterNames.push(name);
}
}
this.emitters.push(placeDesc);
}
}
/**
* @description Get the name list of the particle emitter partition with the specified index value.
* @param {} partitionIndex partition index
* @return {}
*/
getParticlePartitionEmitter(partitionIndex) {
if (partitionIndex >= this.emitters.length)
return undefined;
var emitterDesc = this.emitters[partitionIndex];
return emitterDesc.emitterNames;
}
}
/**
* @classdesc Video stream information.
*/
class NvsVideoStreamInfo {
/**
* @constructor
*/
constructor() {
this.width = 0;
this.height = 0;
this.duration = 0;
this.frameRate = new NvsRational(0, 0);
this.pixelAspectRatio = new NvsRational(1, 1);
this.codecType = 0;
this.rotation = 0;
}
}
/**
* @classdesc Audio stream information.
*/
class NvsAudioStreamInfo {
/**
* @constructor
*/
constructor() {
this.channelCount = 0;
this.sampleRate = 0;
this.duration = 0;
}
}
/**
* @classdesc Audio and video file information.
*/
class NvsAVFileInfo {
/**
* @constructor
*/
constructor() {
this.duration = 0;
this.videoStreamInfo = undefined;
this.audioStreamInfo = [];
}
}
/**
* @classdesc Playback rate control region information
*/
class NvsPlaybackRateControlRegion {
/**
* @constructor
*/
constructor() {
this.startTime = 0;
this.endTime = 0;
this.playbackRate = 1;
this.audioGain = 1;
}
}
/**
* @classdesc XML stream writer
*/
class NvsXmlStreamWriter {
/**
* @constructor
* @param {} filePath file path
*/
constructor(filePath) {
this.filePath = filePath;
}
/**
* @description Open writer
* @return {}
*/
open() {
return Module.nvs_xmlStreamWriter_open(this.filePath);
}
/**
* @description Close writer
* @return {}
*/
close() {
return Module.nvs_xmlStreamWriter_close(this.filePath);
}
/**
* @description Write start document
* @return {}
*/
writeStartDocument() {
return Module.nvs_xmlStreamWriter_writeStartDocument(this.filePath);
}
/**
* @description Write end document
* @return {}
*/
writeEndDocument() {
return Module.nvs_xmlStreamWriter_writeEndDocument(this.filePath);
}
/**
* @description Write start element
* @param {} element element name
* @return {}
*/
writeStartElement(element) {
return Module.nvs_xmlStreamWriter_writeStartElement(this.filePath, element);
}
/**
* @description Write end element
* @param {}
* @param {}
* @return {}
*/
writeEndElement() {
return Module.nvs_xmlStreamWriter_writeEndElement(this.filePath);
}
/**
* @description Write attribute
* @param {} name attribute name
* @param {} value attribute value
* @return {}
*/
writeAttribute(name, value) {
return Module.nvs_xmlStreamWriter_writeAttribute(this.filePath, name, value)
}
/**
* @description Write DTD
* @param {} dtd DTD
* @return {}
*/
writeDTD(dtd) {
return Module.nvs_xmlStreamWriter_writeDTD(this.filePath, dtd)
}
/**
* @description Write text element
* @param {} name element name
* @param {} text text
* @return {}
*/
writeTextElement(name, text) {
return Module.nvs_xmlStreamWriter_writeTextElement(this.filePath, name, text)
}
}
/**
* @classdesc XML stream reader
*/
class NvsXmlStreamReader {
/**
* @constructor
* @param {} filePath file path
*/
constructor(filePath) {
this.filePath = filePath;
}
/**
* @description Open reader
* @return {}
*/
open() {
return Module.nvs_xmlStreamReader_open(this.filePath);
}
/**
* @description Close reader
* @return {}
*/
close() {
return Module.nvs_xmlStreamReader_close(this.filePath);
}
/**
* @description Read to the end of stream
* @return {}
*/
atEnd() {
return Module.nvs_xmlStreamReader_atEnd(this.filePath);
}
/**
* @description Encounter an error.
* @return {}
*/
hasError() {
return Module.nvs_xmlStreamReader_hasError(this.filePath);
}
/**
* @description Read next
* @return {}
*/
readNext() {
return Module.nvs_xmlStreamReader_readNext(this.filePath);
}
/**
* @description Read next start element
* @return {}
*/
readNextStartElement() {
return Module.nvs_xmlStreamReader_readNextStartElement(this.filePath);
}
/**
* @description The name of current element
* @return {}
*/
name() {
return Module.nvs_xmlStreamReader_name(this.filePath);
}
/**
* @description Whether start document or not
* @return {}
*/
isStartDocument() {
return Module.nvs_xmlStreamReader_isStartDocument(this.filePath)
}
/**
* @description Whether end document or not
* @return {}
*/
isEndDocument() {
return Module.nvs_xmlStreamReader_isEndDocument(this.filePath)
}
/**
* @description Whether start element or not
* @return {}
*/
isStartElement() {
return Module.nvs_xmlStreamReader_isStartElement(this.filePath)
}
/**
* @description Whether end element or not
* @return {}
*/
isEndElement() {
return Module.nvs_xmlStreamReader_isEndElement(this.filePath)
}
/**
* @description Get attribute value
* @param {} attributeName attribute name
* @return {}
*/
getAttributeValue(attributeName) {
return Module.nvs_xmlStreamReader_getAttributeValue(this.filePath, attributeName)
}
}
/**
* @classdesc Audio file writer
*/
class NvsAudioFileWriter {
/**
* @constructor
* @param {} sampleRate sample rate
* @param {} channelCount count of channel
* @param {} outputAudioFilePath output file path
*/
constructor(sampleRate, channelCount, outputAudioFilePath) {
this.internalObj = 0;
Module.nvs_audioFileWriter_init(this, sampleRate, channelCount, outputAudioFilePath);
}
setInternalObject(obj) {
this.internalObj = obj;
}
getInternalObject() {
return this.internalObj;
}
/**
* @description Write audio data
* @param {} audioData audio data
* @return {}
*/
writeAudioData(audioData) {
return Module.nvs_audioFileWriter_writeAudioData(this, audioData);
}
/**
* @description Close audio file writer
* @return {}
*/
// NOTE: You must call close() to generate the final audio file and release resources hold by wasm!
close() {
return Module.nvs_audioFileWriter_close(this);
}
}
/**
* @description Footage type of template
*/
const NvsFootageTypeEnum = Object.freeze({
"VideoImage" : 0,
"Video" : 1,
"Image" : 2,
"Audio" : 3});
/**
* @classdesc combined clip contained in the footstage in the template resource package
*/
class NvsTemplateFootageCorrespondingClipInfo {
/**
* @constructor
*/
constructor() {
this.trackIndex = 0;
this.clipIndex = 0;
}
}
/**
* @classdesc footage information of template package(TEIMPLATE_FOOTAGE_TYPE)
*/
class NvsTemplateFootageDesc {
/**
* @constructor
*/
constructor() {
this.id = '';
this.type = 0;
this.canReplace = false;
this.name = '';
this.tags = [];
this.correspondingClipInfos = [];
}
}
/**
* @classdesc Subtitle information corresponding to footage in template resource package
*/
class NvsTemplateCaptionDesc {
/**
* @constructor
*/
constructor() {
this.replaceId = 0;
this.text = '';
this.fontFamily = '';
}
}
/**
* @classdesc All combined caption contained in the footstage in the template resource package
*/
class NvsTemplateCompoundCaptionItemDesc {
/**
* @constructor
*/
constructor() {
this.index = 0;
this.text = '';
this.fontFamily = '';
}
}
/**
* @classdesc All combined caption contained in the footstage in the template resource package
*/
class NvsTemplateCompoundCaptionDesc {
/**
* @constructor
*/
constructor() {
this.replaceId = 0;
this.itemList = [];
}
}
function nvsInitClasses() {
Module.Meishe.classMap = {
NvsSdkVersion,
NvsRational,
NvsVideoResolution,
NvsAudioResolution,
NvsLiveWindow,
NvsAIToningInfo,
NvsStreamingContext,
NvsProjObj,
NvsTimeline,
NvsTrack,
NvsVideoTrack,
NvsAudioTrack,
NvsClip,
NvsVideoClip,
NvsAudioClip,
NvsPanAndScan,
NvsVolume,
NvsColor,
NvsPointF,
NvsRectF,
NvsWatermarkInfo,
NvsAssetPackageManager,
NvsRegionInfo,
NvsFx,
NvsTimelineVideoFx,
NvsTimelineCaption,
NvsMotionParameters,
NvsTimelineCompoundCaption,
NvsTimelineAnimatedSticker,
NvsVideoTransition,
NvsAudioTransition,
NvsVideoFx,
NvsAudioFx,
NvsParamInfoObject,
NvsFxDescription,
NvsParticleSystemContext,
NvsARSceneManipulate,
NvsVideoStreamInfo,
NvsAudioStreamInfo,
NvsAVFileInfo,
NvsPlaybackRateControlRegion,
NvsTemplateFootageCorrespondingClipInfo,
NvsTemplateFootageDesc,
NvsTemplateCaptionDesc
};
Module.Meishe.getClassByName = function(className) {
return Module.Meishe.classMap[className];
}
}