• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

Control Event Video timing with Javascript?

Community Beginner ,
Nov 15, 2022 Nov 15, 2022

Copy link to clipboard

Copied

I notice with Slide Videos you can control the start and stop point of the video, however I cannot find a feature that allows this with Event Videos. Also, you can only have one Slide Video per slide and I need a second video to play on the same slide. All of our video source files have a required leader and trailer that I need to skip over in Captivate. I'm guessing the solution lies within Javascript. Is there any way that you can control the start and end points within an Event Video?

TOPICS
Advanced , Audio and video , Editing

Views

565

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 15, 2022 Nov 15, 2022

Copy link to clipboard

Copied

Do you embed the videos? If you stream them from YouTube or Video, you can use the functionality of those platforms to reach your goal: control the start point and the duration which is defined by the end point.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 15, 2022 Nov 15, 2022

Copy link to clipboard

Copied

They will not be streamed.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 16, 2022 Nov 16, 2022

Copy link to clipboard

Copied

Sorry, I hope that the JS experts will pop in. Event video plays independently from Captivate's timeline.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 17, 2022 Nov 17, 2022

Copy link to clipboard

Copied

This script will get the videos and set the start time to 10 seconds for each video and pause it at 15 seconds. Change the 10 and 15 to the start and end times of your videos:

 

var vids

const myTimeout = setTimeout(getVideo, 1000);

function getVideo() {
vids = document.getElementsByTagName("video");
vids[0].currentTime = 10;
vids[0].addEventListener("timeupdate", endVideo1)
vids[1].currentTime = 10;
}

function endVideo1()
{
if ( vids[0].currentTime > 15 )
{
vids[0].pause();
}
}

function endVideo2()
{
f ( vids[1].currentTime > 15 )
{
vids[1].pause();
}

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 17, 2022 Nov 17, 2022

Copy link to clipboard

Copied

Thank you, I will test this when I get a chance. Do you replace "video" with its Captivate component name or file name? Also, is there a way to set the variables in this up like Shared Actions or will each slide require its own unique script?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 17, 2022 Nov 17, 2022

Copy link to clipboard

Copied

LATEST

No, you leave it as video"

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines