Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: YTPlayer plugin errors if you remove/add two consecutive videos

JaXL:

I am coming across a bit of a problem. I use a jQuery Plugin called jquery.mb.YTPlayer (http://ift.tt/ZpMxBO) for playing YouTube background videos on a few slides of a carousel. I am using the data-property tag with a YouTube video url on a div within each slide's html. As there are a few slides in the carousel, I have multiples instances of these div's with different videos specified on one page.

My issue is that I want to play the video when a slide that has a background video set by the plugin but destroy it when I have moved away from it but equally re-create the video if I end up revisiting the same slide later. I have used the YTPPlayerDestroy() method to perform the removal and YTPlayer() method for creating it on the carousel's changed event listener but I keep getting a 'Uncaught TypeError: Cannot read property 'toString' of null' error message from the plugin if I swipe in between two slides that have a background video set on consecutively to each other. Any ideas on how to make a simple function that can do what I trying to do?

Fiddle: http://ift.tt/2srPQw4















Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: YTPlayer plugin errors if you remove/add two consecutive videos

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×