Custom captions button with seamless play

jellis5612
Community Member Posts: 4
Seamless play seems to break everything that I've programmed in non-seamless courses and it's getting frustrating. Anyway, I'd been using
if(document.getElementById(“mep_0_captions_none”).checked){
document.getElementById(“mep_0_captions_en”).click();
} else {
document.getElementById(“mep_0_captions_none”).click();
};
Of course with seamless play enabled this breaks. So I changed the code up to
if(getDisplayDocument().getElementById("mep_0_captions_none").checked){
getDisplayDocument().getElementById("mep_0_captions_en").click();
} else {
getDisplayDocument().getElementById("mep_0_captions_none").click();
};
This works on the first page of the course, one time only. All other pages give a null error. When going back to the first page, it gives a null error as well. So it's not finding the mep_0_captions.
Is there another element to target to do this?
if(document.getElementById(“mep_0_captions_none”).checked){
document.getElementById(“mep_0_captions_en”).click();
} else {
document.getElementById(“mep_0_captions_none”).click();
};
Of course with seamless play enabled this breaks. So I changed the code up to
if(getDisplayDocument().getElementById("mep_0_captions_none").checked){
getDisplayDocument().getElementById("mep_0_captions_en").click();
} else {
getDisplayDocument().getElementById("mep_0_captions_none").click();
};
This works on the first page of the course, one time only. All other pages give a null error. When going back to the first page, it gives a null error as well. So it's not finding the mep_0_captions.
Is there another element to target to do this?
Comments
-
Where's your video located in the title explorer? Is it on chapter or title level?
I just tested this in Lectora 17.1.4:
My video is on chapter level.
When I open the first page the caption buttons id is "mep_0_captions_none"
When I go to the next page that also contains the video from chapter level the id is "mep_1_captions_none"
When I return to the first page the id is "mep_2_captions_none"
So it may not be able to find the button by id because it does not exist.
When published without Seamless Play the id stays the same "mep_0_captions_none"
-
Categories
- 35.9K All Categories
- 109 ✫ Announcements
- 33.1K Lectora®
- 31.1K Lectora Discussions
- 29K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 36 Lectora Accessibility User Group (LAUG)
- 25 ELB Learning Content
- 25 ELB Learning Content Discussions
- 329 CenarioVR®
- 196 CenarioVR Discussions
- 133 CenarioVR Feature Requests
- 42 Rockstar Learning Platform®
- 39 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 47 ReviewLink®
- 47 ReviewLink Discussions
- 7 The Training Arcade®
- 7 The Training Arcade Discussions
- 936 All Things eLearning
- 37 eLearning Development
- 546 Learning Management System (LMS) Integration
- 333 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products