Skip to main content
Known Participant
May 4, 2018
Question

Video and image out of Sync

  • May 4, 2018
  • 5 replies
  • 1221 views

I have images on a slide that appear a specific times along the timeline.  They appear in sync with a video that plays at the start of the slide.  On the main menu a button is pressed to jump to the slide with the images and video.  When I Project>Preview, I press the button to jump to the slide, but the time from the time of clicking on the button to when the slide begins is several seconds.  When the slide plays, the video plays, but there is a now a delay for the images to appear, the video and images are not out of sync.  I'm concerned due to the lenght of video (6 minutes) and number of images (36), its taking too long to load.  It there a fix to this.  I use png images, and I try to keep their files size to to a miminum.  Thank you.

This topic has been closed for replies.

5 replies

TLCMediaDesign
Inspiring
May 22, 2018

sometimes the video tag is not there yet when the script executes. Try this ( you can always log everything to see what's going on.):

var interval = setInterval( checkExists, 100, e );

function checkExists( e )
{
var vid = document.getElementsByTagName("video")[0];

  if ( vid.length > 0 )
{
  clearInterval(interval);
  vid.addEventListener("timeupdate",vidTimer,false);
}

function vidTimer()
{

if (vid.currentTime>4 && vid.currentTime<8)
{
  cp.show("txt_3Sec");
}
else
{
  cp.hide("txt_3Sec");
}

if (vid.currentTime>20)
{
  vid.removeEventListener("timeupdate",VidTimer,false);
}
}

TLCMediaDesign
Inspiring
May 21, 2018

You cannot name the video by the name of the video, it must be:

var vid = document.getElementsByTagName("video")[0];

Tom_JanusAuthor
Known Participant
May 21, 2018

Thank you,  I change the script to:

var vid = document.getElementsByTagName("video")[0];

vid.addEventListener("timeupdate",vidTimer,false);

function vidTimer()

{

if (vid.currentTime>4 && vid.currentTime<8)

{

cp.show("txt_3Sec");

}

else

{

cp.hide("txt_3Sec");

}

if (vid.currentTime>20)

{

vid.removeEventListener("timeupdate",VidTimer,false);

}

}

Unfortunately,  The text object still fails to show.  Not sure where I'm making the mistake.

TLCMediaDesign
Inspiring
May 6, 2018

You can use JavaScript to monitor the time update of a video, regardless of how long it takes to load. If you execute this on enter of the slide that has video, you can turn on and off elements and it will always be in-synch. You'd need to add your conditions in the vidTimer function.

var vid = document.getElementsByTagName("video")[0];
vid.addEventListener("timeupdate",vidTimer,false);

function vidTimer()
{  
if ( vid.currentTime > 37.5 && vid.currentTime < 41.7 )

  cp.show("user_name"); 
}
else
{
  cp.hide("user_name"); 
}

  if ( vid.currentTime > 42 )
{
  vid.removeEventListener("'timeupdate", vidTimer, false);
}
}

Tom_JanusAuthor
Known Participant
May 7, 2018

Thank you for the suggestion.  This could work.

David Burnham HBA
Inspiring
May 5, 2018

One of the things I have noticed with the movement away from flash and now working with html, server latency (loading time) is a bigger issue. In a recent project I just completed I created the slide with a 3 minute video and timed the objects that appear on the slide to the video in the Captivate timeline. I then published that slide as an mp4 which now has all the images and text smart shapes and audio in the video file.  I then placed that mp4 on the slide a as multi-slide video and it plays nicely in the timeline. Normally I would do this kind of video editing in Adobe Premiere, but I wanted to try it in Captivate and it appears to be working well for the project needs. I have also cut up larger videos into smaller pieces and distributed them over a number of slides as Lilybiri suggests and this has also helped with the loading issue. But again I find that its best to use Adobe Premiere for doing this for longer videos of more than say 2 minutes in duration. Its the only way I believe that you can ensure synchronization.

Tom_JanusAuthor
Known Participant
May 7, 2018

David,  Thank you I will try this method.

Lilybiri
Legend
May 4, 2018

Problem is not with the images but with the video which needs loading time. Is it not possible to distribute the video and images over several slides to shorten loadig time on each slide?

Tom_JanusAuthor
Known Participant
May 4, 2018

Thank you,  I will give it a try.