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

Detecting SWF vs HTML5 output

Contributor ,
Sep 12, 2016 Sep 12, 2016

Copy link to clipboard

Copied

Cap 9.0.2.421 on Windows

We publish some courses to both SWF and HTML5 and use the multiscreen file. However, some customized content doesn't behave or display properly on the HTML5 side. So:

1. Is there some undocumented Cap variable we can access to determine if the output being used is SWF or HTML?

2. Is there some JS I can use to determine it? I've tried

if(typeof window.cp === 'undefined'){

    /* SWF */

    window.cpAPIInterface.setVariableValue("varOutputType","SWF");

    } else {

    /* HTML5 */

    window.cpAPIInterface.setVariableValue("varOutputType","HTML5");

    }

on the Enter of the first slide. It works for SWF (testing against the project.htm file) but just sits at the Loading screen for HTML5 (testing with the index.html file)

Views

576

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
Enthusiast ,
Sep 12, 2016 Sep 12, 2016

Copy link to clipboard

Copied

Hi Jefferbob,

I don't have an answer to your question but I do have an interest in the underlying function. When you publish multiscreen do you know the order the browser checks? For example Safari will obviously only check for HTML5, but what about Chrome? Does it check for HTML5 first and load if it finds it,  or does it check SWF first and loads SWF if it finds it.

I am publishing to an LMS that requires that both versions be produced. I have a widget that only works in HTML5 that I would like to use for this project but can't,  until I resolve this issue. 

Any experience you would like to share?

Cheers

Steve

Votes

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
People's Champ ,
Sep 12, 2016 Sep 12, 2016

Copy link to clipboard

Copied

It checks if it is handheld first. If the navigator.userAgent is:

["blackberry","android","iphone","ipad","symbian","smartphone","ios","windows ce","webos"];

it loads html5, else it loads Flash.

Votes

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
Enthusiast ,
Sep 12, 2016 Sep 12, 2016

Copy link to clipboard

Copied

Awesome ! Thanks for the speedy response TLC!

Votes

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
People's Champ ,
Sep 12, 2016 Sep 12, 2016

Copy link to clipboard

Copied

It works for me both ways. Are you executing this in the JS Window? Try getting rid of the comments and put double quotes around "undefined"

Votes

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
Contributor ,
Sep 12, 2016 Sep 12, 2016

Copy link to clipboard

Copied

Still nope. I've tried with both singles and doubles, and now no comments. It works in both previews within Captivate, and the SWF version works when published, but not the HTML5 one.

Yes - the code is in a script window on the Enter of the first slide.

Votes

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
People's Champ ,
Sep 12, 2016 Sep 12, 2016

Copy link to clipboard

Copied

Con you check the console and see if there any errors? Press F12 in the browser.

Votes

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
Contributor ,
Sep 12, 2016 Sep 12, 2016

Copy link to clipboard

Copied

Nothing earlier, but now see that the /dr/imgmd.json file is throwing a 404. The file is present on the server.

Votes

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 ,
Sep 12, 2016 Sep 12, 2016

Copy link to clipboard

Copied

Ask your web server administrator to ensure the JSON mimetype is allowed.  Previous versions of Captivate didn't have JSON files in the output.  Cp 9.0.2 does.

Votes

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
Contributor ,
Sep 12, 2016 Sep 12, 2016

Copy link to clipboard

Copied

LATEST

Not our first HTML5 course in 9.0.2 - other Cap HTML5 courses play fine and do not exhibit a missing file.

Votes

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