Gets areas for current screen.
console.log(projectDataInstance.getScreen(0).getAreas()) // array of areas object
Gets area with given index
for current screen.
console.log(projectDataInstance.getScreen(0).getArea(0)) // gets area with index 0 (first area)
Calculates screen duration. It's useful when there is need to manually set screen duration.
console.log(projectDataInstance.getScreen(0).calculateScreenDuration())
Filters areas to find only video ones. Checks if count of video areas is more than 0, then counts sum of wordCount
s.
Otherwise returns maxDuration
if there is one, or duration
.
console.log(projectDataInstance.getScreen(0).getMaxPossibleDuration())
All the setters of screen instance can be called in chain.
Renderforest.getProjectData(15220886)
.then((projectDataInstance) =>
projectDataInstance.setCurrentScreenId(0)
.save()
)
If screen's duration is not adjustable, then throws error. If given duration
is more than max possible duration,
then also throws error. Otherwise sets given value.
Renderforest.getProjectData(15220886)
.then((projectDataInstance) =>
projectDataInstance.getScreen(0)
.setDuration(5)
.save()
)
If screen does not have icon adjustment, then throws error. Otherwise toggles icon position.
Renderforest.getProjectData(15220886)
.then((projectDataInstance) =>
projectDataInstance.setDuration(5)
.toggleIconPosition()
.save()
)
See screen duration and toggle icon position adjustment example
If screen does'nt have lower third settings then throws error.
Otherwise sets start
and duration
params for lower third settings.
Renderforest.getProjectData(15220886)
.then((projectDataInstance) =>
projectDataInstance.getScreen(0)
.setLowerThirdSettings(2, 5)
.save()
)
See lower third settings adjustment example
For project data manipulation sometimes there is need to step back from area object to project data for further development.
projectDataInstance.getScreen(0)
.setLowerThirdSettings(2, 5)
.returnProjectData()
.getScreen(1)
.setDuration(8)
Save method works with the same logic as the project data one. From the hood it steps back project data then calls save method.
projectDataInstance.getScreen(0)
.setLowerThirdSettings(2, 5)
.returnProjectData()
.getScreen(1)
.setDuration(8)
.save()