Forum Discussion
JustinStiper-2f
2 days agoCommunity Member
Video Publishing Error
I have a course that I tried to publish as a video. In it, on one slide I have a variable increasing in value and that value being displayed. If I publish it as a course, it works fine. If I try to p...
Nathan_Hilliard
1 day agoCommunity Member
Yes, likely due to the animation timing limitations versus the frame rate. The animations you use as a timer are limited a minimum of 0.1s steps. The frame rate is 30fps. The animations can't keep pace and create lags in the captures.
One alternative would be to create a JavaScript timer to increment your counter variable. This would run more quickly in the background, and better keep up with the video frame rate.
I attached a modified version of your slide and the published video output. It uses a simple text string to specify the variable and timer settings. You can tweak the exact timings to get the animations and variables to match exactly.
The code is below for reference.
/*jshint -W033, esversion: 7*/
function tick(duration, varStart, varEnd, varName) {
let step = 3
let interval = duration * 1000 / (varEnd - varStart) * step
let varValue = varStart
let ref = setInterval(()=>{
if (varValue <= (varEnd - step)) {
varValue += step
GetPlayer().setVar(varName, varValue)
}
else {
clearInterval(ref)
varValue = varEnd
GetPlayer().setVar(varName, varValue)
}
},interval)
}
//arg is a comma separated string holding duration(seconds), varStart(value), varEnd(value), varName(text)
//arg is broken apart and numbers converted below
let arg = GetPlayer().getVar("arg")
let a = arg.split(",")
tick(Number(a[0]),Number(a[1]),Number(a[2]),a[3])
Related Content
- 11 months ago
- 1 year ago
- 11 months ago