Video Tag autoplay and pause


I have a touch carousel on the homepage of the following website which has a video on it. I am trying to find a way to get the video to autoplay when the page loads and pause when the user clicks on the slider. I found the following solution below:

However i cant get this to work on the website below:

I hope someone can help out here. If there is not enough information please let me know.


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The page has a number of validation errors that appear to be directly related to the problem:

You need to have clean markup if you expect the effect to work correctly.  If there is still a problem after fixing them, then check for javascript errors in the console, and post them.

Hopefully we won't have to go beyond that, because with all the junk on the page it is not going to be easy to isolate this kind of a problem.

Andy6350Author Commented:
Thank you for that. I am going through correcting all the errors and there is one that i cant work out.
The carousel is displaying featured images without the "alt text" which is flagging as errors. I have found the code that displays the image info in the carousel. I have modified it and tried my best using the code below but it just displays:

<img src="" width="449" height="313" alt="">

The code i am using is this:

if($thumb) {
                                           $width = (int)$this->getAttributeValue('width', $m);
                                          $height = (int)$this->getAttributeValue('height', $m);
                                           $image_data = $this->vt_resize( $thumb, '', $width, $height, $name, true );
                                          $alt = get_post_meta($thumb_id, '_wp_attachment_image_alt', true);
                                           return "<img src=\"{$image_data['url']}\" width=\"{$image_data['width']}\" height=\"{$image_data['height']}\" alt=\"{$alt['_wp_attachment_image_alt']}\" />";
                                     } else {
                                           return "";

Any ideas?

Thank you
My first thought is that _wp_attachment_image_alt is empty

However if the only error is the missing alt text, it shoudl not be preventing the scripting from running successfully.  So you must be getting scripting errors.  

What browser are you using to look at it?
Are there any errors reported in the console?

The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Andy6350Author Commented:
The only errors regarding these featured images are the validation errors because there are no alt values on the images. I am trying to modify the script in the plugin to include the alt text.

I am using chrome developer tools

It looks like is is working now; or am I missing something?

BTW, I like the animation; its quite an eye catcher.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Andy6350Author Commented:
I didnt manage to get it working but my client decided to change the way these wanted the video displayed so i have taken it out of the carousel.
But thank you for your help, i still would like to use this script in the future.
Andy6350Author Commented:
Very quick feedback, however my client changed their mind on the layout so have it sorted out now.

Thanks again
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.