Skip to main content
nitinvaidya
Participant
May 13, 2015
Answered

Play bar for the slide instead of the entire project

  • May 13, 2015
  • 2 replies
  • 407 views

Can you explain how to create play bar per slide instead of entire project? or to show run time per slide?

This topic has been closed for replies.
Correct answer Lilybiri

I don't understand why you want a playbar per slide? Perhaps slides are too long?

Time: you have the editor's time, which can be calculated from the slide duration and the framerate, but the real time that a user spent on a slide can be totally different if you have interactivity. Have a look at this blog post:

Display Time information - Captivate blog

2 replies

TLCMediaDesign
Inspiring
May 14, 2015

I do have some JavaScript that will show the duration of the slide in 00:00 for HTML5. For SWF we have playbars that show slide progress.

nitinvaidya
Participant
May 14, 2015

Hi,

Would it possible for you to share the script?

Regards,

TLCMediaDesign
Inspiring
May 14, 2015

Create a user variable myTime to display in a text caption. Put the script in the head of the index.html.

var gSlide, res, cSlide, csTo, csFrom, csTotal;
var thisTime, mm, ss;

var interfaceObj;
var eventEmitterObj;

window.addEventListener("moduleReadyEvent", function(evt)
{
interfaceObj = evt.Data;
eventEmitterObj = interfaceObj.getEventEmitter();
    initializeEventListeners();
});

function initializeEventListeners()
{
if(interfaceObj)
{
     if(eventEmitterObj)
  {
         eventEmitterObj.addEventListener("CPAPI_SLIDEENTER",function(e){  
   setPage();
            });
  }
}
}

function setPage()
{
gSlide = cp.model.data.project_main.slides;
res = gSlide.split(",");
cSlide = res[window.cpInfoCurrentSlide - 1];
csTo = eval('cp.model.data.'+cSlide+'.to');
csFrom = eval('cp.model.data.'+cSlide+'.from');
csTotal =  csTo - csFrom;
sf = window.cpInfoCurrentFrame;

window.cpAPIEventEmitter.addEventListener("CPAPI_VARIABLEVALUECHANGED",function(){
   runTimer(csTotal, sf, csTo);},"cpInfoCurrentFrame");
}

function runTimer(st, sf, ef)

thisTime = Math.round((st - (window.cpInfoCurrentFrame - sf) - 1) / 30);
mm = Math.floor(thisTime % 3600 / 60);
ss = Math.floor(thisTime % 3600 % 60);
newTime = ((mm > 0 ? (mm < 10 ? "0" : "") + mm + ":" : "00:") + (ss < 10 ? "0" : "") + ss);

window.myTime = String(newTime);
}

Lilybiri
LilybiriCorrect answer
Legend
May 13, 2015

I don't understand why you want a playbar per slide? Perhaps slides are too long?

Time: you have the editor's time, which can be calculated from the slide duration and the framerate, but the real time that a user spent on a slide can be totally different if you have interactivity. Have a look at this blog post:

Display Time information - Captivate blog