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

Is it possible to control the 'embed code' setting of a web object?

Community Beginner ,
Nov 15, 2017 Nov 15, 2017

I am using youtube to deliver videos for my course. Each course has 15+ videos. The closed caption functionality on youtube is exceptionally good, so I want to allow users to use that. So I have put youtube embed code into a web object and all is well. The video plays with the familiar controls - youtube handles the streaming and the resolution - everything works. Great. If the user wants to see subtitles, they hit the CC button. Again, that works fantastically well. The minor issue that I have is that the user must hit the CC button every time that a new video plays. This gets boring quickly when you've got 15+ short videos to go through. So I need to be able to capture the user's preference for CC in captivate, and then dynamically build the embed code with the appropriate option set...

No CC => www.youtube.com?cc_load_policy=0

Yes CC => www.youtube.com?cc_load_policy=1

Can this be done in captivate?

If not, is there a cute alternative that selectively picks slides that have hardwired web objects (with the option already set) according to the users preference?

Thanks

Simon

242
Translate
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, 2017 Nov 15, 2017

There might be a way you can do with with Javascript. I'm no expert but I wonder if your answer can be found on this developer page from Google.

IFrame Player API

Paul Wilson, CTDP
Translate
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
People's Champ ,
Nov 16, 2017 Nov 16, 2017
LATEST

Don't know how you would be able to tell if the user actually clicked the CC button in the YouTube player to enable a preference, but you can change the source of an iframe which holds the video.

var interval = setInterval( checkExists, 100, e )

function checkExists( e )

{

var myFrame = document.getElementsByTagName("iframe");

if ( myFrame )

{

   clearInterval( interval );

  interval = null;

iurl = "your new URL";

myFrame[0].src = iurl;

}

}

Translate
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
Resources
Help resources