Explore the community Forums Lectora Lectora Questions & Answers Custom player breaks video Reply To: Custom player breaks video

#378884 Score: 0
Profile photo of Jason Dalrymple
Jason Dalrymple
Member
beginner
intermediate
profile
wise owl
curious george
contributor
friend finder
advanced
picture perfect
54 pts
@JasonADal

I had often wondered, but never took the time to research, what the purpose of the (^) was. This could be exceedingly helpful going forward as I think about things.

Instead of the HTML name, I replaced “mep” with “audio” so only applies to div’s that begin with “audio”. This worked AND didn’t affect other pages with different players. Yay!

For the next trick, though, when I have my custom captions button (I disabled the player version, since it breaks tab use), if the audio is below the video, it breaks. This is because the div is based on the order (video = mep_0, audio = mep_1).

My question is – Can I dynamically target the “mep” just for audio? Here’s the JS I’m using (from a previous thread):

if(document.getElementById(“mep_0_captions_none”).checked){
document.getElementById(“.mep_0_captions_none”).click();
} else {
document.getElementById(“mep_0_captions_none”).click();
};

I tried changing “0” to “1” and it didn’t seem to work. Is it possible to use the selector in the JS?