If you ever use the JW Player (http://www.longtailvideo.com/support/jw-player) inside the AnythingSlider, and you place a video in the last panel of your UL list, you’ll run into a pesky and non-trivial headache: The AnythingSlider automatically duplicates the last "panel" — so it was duplicating the video tag. This fixes it by looking for the duplicate ID of my video tag (all my video tags start with "vid-") and renaming the ID to something random:
if (this.id.indexOf(“vid-“) != -1){
this.id = this.id + “_” + Math.floor(Math.random()*11);
console.warn(‘Multiple ID #’+this.id);
}
}
});
});
All the browsers that will need to use the Flash fallback player will now work correctly. Of course, you’d need to change the "vid-" to the start of whatever ID you’ve given your video tag. This issue may also manifest itself in other situations where duplicate IDs are not desirable :D
Author
Posts
Viewing 1 post (of 1 total)
The forum ‘JavaScript’ is closed to new topics and replies.