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

Autoplay with HTML 5

Community Beginner ,
Jul 25, 2012 Jul 25, 2012

Copy link to clipboard

Copied

Hi How can you put AutoPlay on HTML5? I still have to click on an arrow, so that the content starts.  With Flash was not a problem ...  Regards Chris

TOPICS
Advanced , Editing

Views

17.4K

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
Engaged ,
Jul 28, 2012 Jul 28, 2012

Copy link to clipboard

Copied

Yes, I am having this issue too...any suggestions on how to have it bypass the arrow?

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 Beginner ,
Jul 30, 2012 Jul 30, 2012

Copy link to clipboard

Copied

No, Unfortunately not. And you?

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
Engaged ,
Jul 30, 2012 Jul 30, 2012

Copy link to clipboard

Copied

I haven't been able to bypass having to click to start but I was able to remove the arrow and replace that image with an image that looks like my quiz and says click here to start. It took some code modifications and lots of testing but it is much better than it was.

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 Beginner ,
Jul 30, 2012 Jul 30, 2012

Copy link to clipboard

Copied

Well, that is one possibility. I have the content in a lms, with SCORM implemented. When the student start in the lms the content it think it is very bad, if they have to start a second time! Above all, I still use the table of contents, which looks even more stupid. This is not professional.

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
Guest
Jul 30, 2012 Jul 30, 2012

Copy link to clipboard

Copied

If you want autoplay with HTML5, edit index.html and find function DoCPInit(). After CPPostInit(), add the lines

CPPlayButtonHandle("onkeydown");

cp.movie.play();

This will sort of automatically press the play button for you on load. Please note that this will cause problems with audio if you are using IOS. This is because of apple's standards - https://developer.apple.com/library/safari/#documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Vi...

I disabled autoplay for a captivate project I use as a course menu, and I had no problems because there was no audio in the background. However, with projects that have background audio, I just have to get used to the big play button.

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 ,
Aug 04, 2012 Aug 04, 2012

Copy link to clipboard

Copied

Hey Kurrykid;

I am really curious about your arrow image swap solution. It sounds like something that will work for me. Can you explain it a little. Specifically what image did you swap (was it the PlayIcon in the Playbar folder? If so how did you size it correctly?

Any guidance would be greatly appreciated.

Thanks

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
Engaged ,
Aug 04, 2012 Aug 04, 2012

Copy link to clipboard

Copied

Hi Steve,

It took quite a bit of digging into the code to solve this. I had to modify the Index.html file and a CSS file (CPLibrary.css). This css file determines the size and image name and the Index file is checking for the correct browser (and will throw an error...at least how I am using it). It also causes the play button to be centered.

What I did was created an image the size of the screen (1024x768) and "pasted" the play arrow on top of it. So I replace the play Icon image with my image with the play arrow. Here's some details: Edit the index.html to #1 Remove the Browser check #2 Remove the code that is causing the play arrow to be centered.

#1

Index1.html.png

#2

Index2.html.png

On the CSS side, you need to change the code in the CPLibrary.css file to reflect the new image file and the size. #1 shows the original and #2 shows it edited:

#1

css1.png

#2

css2.png

So what happens now is I get a screen that looks like the first page of my quiz with a play button on it. I click it and the quiz begins. Not the best way to do it but it's a decent workaround.

I hope it makes sense and it helps.

Dave

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
New Here ,
Feb 26, 2013 Feb 26, 2013

Copy link to clipboard

Copied

Hello Dave,

Do you know of a way to make to make this permanent?  I modified the CSS library and deleted code in the Captivate source html but it keeps moving the file to the left of center when I publish.

Mike

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
Engaged ,
Feb 26, 2013 Feb 26, 2013

Copy link to clipboard

Copied

Are you updating the files you changed and saved to your webserver? Also, you may need to clear your cache. That's about the only things I can think of as to why the changes wouldn't be permanent.

HTH

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
New Here ,
Sep 06, 2013 Sep 06, 2013

Copy link to clipboard

Copied

I opened up the HTML template in <installed directory>\HTML and added the following line of code at the bottom of the script (just above "</script></body></html>"):

"cp.movie.play();"

The play button still loads, but the cp.movie.play() command happens so fast that you don't even notice the play button.

Ryan

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 Beginner ,
Oct 03, 2015 Oct 03, 2015

Copy link to clipboard

Copied

Thank you for this info.  I just used it with PhoneGap and the Captivate 9 file loaded immediately.

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 ,
Oct 08, 2016 Oct 08, 2016

Copy link to clipboard

Copied

b.rembrandt

Which suggestion (code change) worked for you?

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 Beginner ,
Mar 05, 2015 Mar 05, 2015

Copy link to clipboard

Copied

I'm sorry.  Where is the index.html file?  Is it in the Captivate project or in the published files?  Thanks

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 ,
Mar 05, 2015 Mar 05, 2015

Copy link to clipboard

Copied

With the Published files.

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 Beginner ,
Mar 05, 2015 Mar 05, 2015

Copy link to clipboard

Copied

Hey GMOMike,

I just tried adding the cp.movie.play() to the index_SCORM.html file as suggested above and this worked in Docebo (in Chrome), so apparently it is not getting stripped out of Docebo.

However, Firefox and IE still throw the error message.  I want to try $("#CPUnSupportedBrowserWarning_ID").remove();) as you suggested, but I don't know where you put that.  Can you maybe include a screen shot of your code?

Here is mine (this is what worked for my HTML5 project in Docebo/Chrome)

2015-03-05_15-45-49.png

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 Beginner ,
Mar 06, 2015 Mar 06, 2015

Copy link to clipboard

Copied

Ok, for everyone struggling with this issue I hopefully have a fix (it worked for me so hopefully it works for you too).

I made my HTML5 project autoplay in Chrome, Firefox, IE, and Safari by adding some code.  This worked great EXCEPT Firefox kept giving me the error mentioned above, so I added some additional code to strip out the error message.  Works like a charm now in all four browsers (thanks to our development team who looked at the code for me).  If you haven't been following the thread, this code should be added to the index.html file in our collection of output files you get after publishing the project (the screen shot shows the middle section of the index.html file).

2015-03-06_14-25-41.png

One more note: in order for me to even edit this file, I had to tell my OS to open the index.html file with Notepad (by default, it wanted to open in my browser, which does you no good).  Good luck!

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 Beginner ,
Mar 06, 2015 Mar 06, 2015

Copy link to clipboard

Copied

Hey RBurke82, this is great, thanks. You're right. I was looking at what Docebo was doing too simply. It isn't stripping it out, just encapsulating it several layers down so it's hard to get to from the console.

I'm going to have to try your solution - it would seem like something you could put into the Index.html file in the Captivate folder's HTML folder BEFORE you create your SCORM files.

I've been running a regular expression in a text editor after-the-fact:

In the CPM.js file, first I replace:

,showRuntimeWarning:function\(a,c,e\)\{.*?\rf.*\..*\r.*\r.*?\}\};

with:

,showRuntimeWarning:function(a,c,e){log("browser warning: ",a,c,e)}};

That keeps the warning present; it just puts it into a console log instead of an obtrusive dialog box that would frighten users.

Next, I replace:

(cp.CPProjInit\s*=\s*function\(\))

with:

window.log=function(){log.history=log.history||[];log.history.push(arguments);if(this.console){console.log(Array.prototype.slice.call(arguments))}};\1

That provides a universal console log if they don't have Firefox Firebug extension.

I do already have the fastclick.js fix applied. I found that somewhere else in this forum. That fixed the autoplay issue with Chrome browser for me.

Now, I have a question for you. If you're using Docebo LMS, are you also having any trouble with URLs? There are several ways to link to an address from within Captivate, and all of them seem to be thwarted by Docebo.

Thanks again for your help

Mike

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 ,
Aug 04, 2012 Aug 04, 2012

Copy link to clipboard

Copied

Hey Dave;

Thanks for the detailed answer. Makes total sense ! Appreciate your time and expertise.

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
Engaged ,
Aug 05, 2012 Aug 05, 2012

Copy link to clipboard

Copied

You're welcome. I hope you get it working for you.

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
New Here ,
Nov 14, 2013 Nov 14, 2013

Copy link to clipboard

Copied

Is there a way to eliminate existence of the start arrow? I am using 6.0 and outputing to HTML5 with Autoplay and Preload checked but the program doesn't start automatically - the user must press start. I don't want to change the image, I want the start arrow to be eliminated.

Thanks,

Barbara

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
Explorer ,
Nov 14, 2013 Nov 14, 2013

Copy link to clipboard

Copied

I'm using CP7 and would be keen to know how to get rid of the start arrow once and for all. A solution that requires implementation each time I publish isn't going to be viable.

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 ,
Oct 04, 2014 Oct 04, 2014

Copy link to clipboard

Copied

By the way if you are using CP 8 and need to achieve a similar effect let me know and I will show you the required steps

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
New Here ,
Nov 12, 2014 Nov 12, 2014

Copy link to clipboard

Copied

jeanrouge - hey I'm using Captivate 8 and I can't get the bloody thing to autoplay. When I load the published files in Chrome from my web server it doesn't autoplay! It just sits there with the playbar.

Please show me the required steps!

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
Guest
Dec 18, 2014 Dec 18, 2014

Copy link to clipboard

Copied

In Captivate 8, I opened up index.html and added:

cp.movie.play();

at the end of "function initializeCP()" right after the line "cpInit();"

Now, there is no play button at the start on tablet and mobile versions. Hope that was what you were looking for.

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