Class: NvsTimeline

NvsTimeline()

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.

Constructor

new NvsTimeline()

Source:

Extends

Methods

addAnimatedSticker(inPoint, duration, animatedStickerPackageId, isPanoramic, isCustom, customImagePath) → {Num}

add animated sticker
Parameters:
Name Type Description
inPoint in point
duration duration
animatedStickerPackageId animated sticker packageId
isPanoramic panoramic or not
isCustom customize or not
customImagePath custome image path
Source:
Returns:
Type
Num

addBuiltinTimelineVideoFx(inPoint, duration, videoFxName) → {Num}

add builtin timeline video fx
Parameters:
Name Type Description
inPoint in point
duration duration
videoFxName video fx name
Source:
Returns:
Type
Num

addCaption(captionText, inPoint, duration, captionStylePackageId, isPanoramic) → {Num}

add caption
Parameters:
Name Type Description
captionText caption text
inPoint in point
duration duration
captionStylePackageId caption style package id
isPanoramic panoramic or not
Source:
Returns:
Type
Num

addCompoundCaption(inPoint, duration, compoundCaptionPackageId) → {Num}

add compound caption
Parameters:
Name Type Description
inPoint in point
duration duration
compoundCaptionPackageId compound caption package id
Source:
Returns:
Type
Num

addModularCaption(captionText, inPoint, duration) → {Num}

add modular caption
Parameters:
Name Type Description
captionText caption text
inPoint in point
duration duration
Source:
Returns:
Type
Num

addPackagedTimelineVideoFx(inPoint, duration, videoFxPackageId) → {Num}

add packaged timeline video fx
Parameters:
Name Type Description
inPoint in point
duration duration
videoFxPackageId video fx package id
Source:
Returns:
Type
Num

addWatermark(filePath, displayWidth, displayHeight, opacity, position, marginX, marginY) → {Num}

add watermark
Parameters:
Name Type Description
filePath file path
displayWidth display width
displayHeight display height
opacity opacity
position position
marginX margin x
marginY margin y
Source:
Returns:
Type
Num

addWatermark2(sceneWidth, sceneHeight, imageName, imgWidth, imgHeight, tx, ty, dirPath, opacity) → {Num}

add watermark
Parameters:
Name Type Description
sceneWidth
sceneHeight
imageName
imgWidth
imgHeight
tx
ty
dirPath
opacity
Source:
Returns:
Type
Num

appendAudioTrack() → {Num}

append audio track
Source:
Returns:
Type
Num

appendVideoTrack() → {Num}

append video track
Source:
Returns:
Type
Num

applyTheme(themeId) → {Num}

apply theme
Parameters:
Name Type Description
themeId theme id
Source:
Returns:
Type
Num

audioTrackCount() → {Num}

get count of audio track
Source:
Returns:
Type
Num

changeVideoSize(videoWidth, videoHeight) → {Num}

change video size
Parameters:
Name Type Description
videoWidth video width
videoHeight video height
Source:
Returns:
Type
Num

changeVideoSize2(videoWidth, videoHeight) → {Num}

change video size
Parameters:
Name Type Description
videoWidth video width
videoHeight video height
Source:
Returns:
Type
Num

deleteWatermark() → {Num}

delete watermark
Source:
Returns:
Type
Num

getAnimatedStickersByTimelinePosition(timelinePos) → {Num}

get animated sticker according to timeline position
Parameters:
Name Type Description
timelinePos timeline position
Source:
Returns:
Type
Num

getAudioRes() → {Num}

get audio resolution
Source:
Returns:
Type
Num

getAudioTrackByIndex(trackIndex) → {Num}

get audio track according to index
Parameters:
Name Type Description
trackIndex track index
Source:
Returns:
Type
Num

getCaptionsByTimelinePosition(timelinePos) → {Num}

get caption according to timeline position
Parameters:
Name Type Description
timelinePos timeline position
Source:
Returns:
Type
Num

getCompoundCaptionsByTimelinePosition(timelinePos) → {Num}

get compound caption according to timeline
Parameters:
Name Type Description
timelinePos timeline position
Source:
Returns:
Type
Num

getCurrentThemeId() → {Num}

get current theme id
Source:
Returns:
Type
Num

getDuration() → {Num}

get timeline duration
Source:
Returns:
Type
Num

getFirstAnimatedSticker() → {Num}

get first animated sticker
Source:
Returns:
Type
Num

getFirstCaption() → {Num}

get first capition
Source:
Returns:
Type
Num

getFirstCompoundCaption() → {Num}

get first compound caption
Source:
Returns:
Type
Num

getFirstTimelineVideoFx() → {Num}

get first timeline video fx
Source:
Returns:
Type
Num

getInternalObject() → {Num}

get internal object
Overrides:
Source:
Returns:
Type
Num

getLastAnimatedSticker() → {Num}

get last animated sticker
Source:
Returns:
Type
Num

getLastCaption() → {Num}

get last caption
Source:
Returns:
Type
Num

getLastCompoundCaption() → {Num}

get last compound caption
Source:
Returns:
Type
Num

getLastTimelineVideoFx()

get last timeline video fx
Source:

getMaxAudioStreamSupportedOnVideoTrack() → {Num}

get max audio stream of video track supported
Source:
Returns:
Type
Num

getNextAnimatedSticker(animatedSticker) → {Num}

get next animated sticker
Parameters:
Name Type Description
animatedSticker animated sticker
Source:
Returns:
Type
Num

getNextCaption(caption) → {Num}

get next caption
Parameters:
Name Type Description
caption caption
Source:
Returns:
Type
Num

getNextCompoundCaption(caption) → {Num}

get next compound caption
Parameters:
Name Type Description
caption caption
Source:
Returns:
Type
Num

getNextTimelineVideoFx(timelineVideoFx) → {Num}

get next timeline video fx
Parameters:
Name Type Description
timelineVideoFx timeline video fx
Source:
Returns:
Type
Num

getPrevAnimatedSticker(animatedSticker) → {Num}

get previous animated sticker
Parameters:
Name Type Description
animatedSticker animated sticker
Source:
Returns:
Type
Num

getPrevCaption(caption) → {Num}

get previous caption
Parameters:
Name Type Description
caption caption
Source:
Returns:
Type
Num

getPrevCompoundCaption(caption) → {Num}

get previous compound caption
Parameters:
Name Type Description
caption caption
Source:
Returns:
Type
Num

getPrevTimelineVideoFx(timelineVideoFx) → {Num}

get previous timeline video fx
Parameters:
Name Type Description
timelineVideoFx timeline video fx
Source:
Returns:
Type
Num

getTemplateAttachment(key) → {Num}

get template attachment according key
Parameters:
Name Type Description
key key
Overrides:
Source:
Returns:
Type
Num

getThemeMusicVolumeGain() → {Num}

get max volume gain of theme music
Source:
Returns:
Type
Num

getTimelineVideoFxByTimelinePosition(timelinePos) → {Num}

get timeline video fx according to timeline position
Parameters:
Name Type Description
timelinePos timeline position
Source:
Returns:
Type
Num

getVideoRes() → {Num}

get video resolution
Source:
Returns:
Type
Num

getVideoTrackByIndex(trackIndex) → {Num}

get video track according to index
Parameters:
Name Type Description
trackIndex track index
Source:
Returns:
Type
Num

getWatermarkInfo() → {Num}

get watermark information
Source:
Returns:
Type
Num

insertAudioTrack(insertPoint) → {Num}

insert audio track
Parameters:
Name Type Description
insertPoint insert point
Source:
Returns:
Type
Num

insertVideoTrack(insertPoint) → {Num}

insert video track
Parameters:
Name Type Description
insertPoint insert point
Source:
Returns:
Type
Num

removeAnimatedSticker(animatedSticker) → {Num}

remove animated sticker
Parameters:
Name Type Description
animatedSticker animated sticker
Source:
Returns:
Type
Num

removeAudioTrack(trackIndex) → {Num}

remove audio track
Parameters:
Name Type Description
trackIndex track index
Source:
Returns:
Type
Num

removeCaption(caption) → {Num}

remove caption
Parameters:
Name Type Description
caption caption
Source:
Returns:
Type
Num

removeCompoundCaption(caption) → {Num}

remove compound capition
Parameters:
Name Type Description
caption caption
Source:
Returns:
Type
Num

removeCurrentTheme()

remove current theme
Source:
Returns:

removeTimelineVideoFx(timelineVideoFx) → {Num}

remove timeline video fx
Parameters:
Name Type Description
timelineVideoFx timeline video fx
Source:
Returns:
Type
Num

removeVideoTrack(trackIndex) → {Num}

remove video track
Parameters:
Name Type Description
trackIndex track index
Source:
Returns:
Type
Num

setInternalObject(obj)

set internal object
Parameters:
Name Type Description
obj internal object
Overrides:
Source:
Returns:

setMaxAudioStreamSupportedOnVideoTrack(maxStream) → {Num}

set max audio stream of video track supported
Parameters:
Name Type Description
maxStream max count of stream
Source:
Returns:
Type
Num

setPlaybackRateControl(playbackRateControlRegions) → {Num}

set playback rate control
Parameters:
Name Type Description
playbackRateControlRegions control region of playback rate
Source:
Returns:
Type
Num

setTemplateAttachment(key, value)

get template attachment
Parameters:
Name Type Description
key key
value value
Overrides:
Source:
Returns:

setThemeMusicVolumeGain(leftVolumeGain, rightVolumeGain)

set volume gain of theme music
Parameters:
Name Type Description
leftVolumeGain left volume gain
rightVolumeGain right volume gain
Source:
Returns:

setThemeTitleCaptionText(text)

set caption text of theme title
Parameters:
Name Type Description
text text
Source:
Returns:

setThemeTrailerCaptionText(text)

set caption text of theme trailer
Parameters:
Name Type Description
text text
Source:
Returns:

setWatermarkOpacity(opacity) → {Num}

set watermark opacity
Parameters:
Name Type Description
opacity opacity
Source:
Returns:
Type
Num

videoTrackCount() → {Num}

get count of video track
Source:
Returns:
Type
Num