Dynamically changing name of media files

mlapl1
Community Member Posts: 350 ☆ Roadie ☆
Hello
In the absence of loop structures in Lectora, I have created an action group that calls itself a number of time to perform certain repetitive actions. One of these actions is to play a media file.
My problem is that I would like to apply the same loop to multiple media files. In order to achieve this I would have to be able to change the name of the played media file dynamically. The catch is that I do not want to use Javascript to do this - or to play the file itself in JS.
If I cannot attribute the media file name dynamically, then the solution would be to create as many action groups as there are audio files. This means duplicating the same group say 10 times but changing the name of the file inside the group. Duplication would just occupy a lot of space and, potentially, be confusing to non-programmers trying to write lessons in "pure" Lectora.
So... is there a simple non-JS -based solution for this difficulty?
Thanks for any help.
Andrew
In the absence of loop structures in Lectora, I have created an action group that calls itself a number of time to perform certain repetitive actions. One of these actions is to play a media file.
My problem is that I would like to apply the same loop to multiple media files. In order to achieve this I would have to be able to change the name of the played media file dynamically. The catch is that I do not want to use Javascript to do this - or to play the file itself in JS.
If I cannot attribute the media file name dynamically, then the solution would be to create as many action groups as there are audio files. This means duplicating the same group say 10 times but changing the name of the file inside the group. Duplication would just occupy a lot of space and, potentially, be confusing to non-programmers trying to write lessons in "pure" Lectora.
So... is there a simple non-JS -based solution for this difficulty?
Thanks for any help.
Andrew
Comments
-
-
Hi Math
attached is a simple example of what I am trying to do. The idea is also to avoid use of javascript at least beyond the setting up stages of the file.
Thanks a lot as ever!
Andrew -
Hi Andrew,
The sample attached is a step in the right direction. I do think its not a complete fix for your issues/question but for sure a step in a possible solution.
What i added:
- variable for the mediaToPlay -> default is 1, then after your first audio played 3x its set to 2
- extra actiongroup to add to the variable whenever needed.
Clicking the play button when your first audio has played 3x, well then the 2nd audio plays.
I/You/We/Us need to figure out whether that will work with 10 audios..and if not find a solution for that.
Another option i think is possible is just use the 'Change Contents' action on the audio file. It is available for audio files too, so should work. Might give that approach a try too.
Regards,
Math -
Next version with 5 audios in it. Works as i thought it would. Slight changes needed on the previous one
- in the ag_updateMedia group:
- mediaToPlay incrementing the variable instead of setting it to a fixed num
- resetting Max_Reps to 0 to ensure when a audio has played 3 times, it can do the same with the next audio
Do replace audio3, 4 and 5 with your own shorter version... just picked 3 audio files i quickly found.. way too long for proper testing ;-)
Minus i just noticed with my longer audios also is that due to the fact you loop Grp_LoopMedia01 after 5 secs..my newest audio ( 3,4,5 ) only play once, because they are longer then 5 seconds. Gonna think of a way to trigger the loop in another way...
Allthough this works swell, i am gonna try to dynamically change a variable and try 'Change Content' on audio...
So some alternatives available soon....
~Math -
I do think this version fits your needs nicely. Using 'Change Content' on a generic audiofile. So you have 1 audioplayer in your project and it gets filled by the next ones in line depending on variables. In fact i did use OnDonePlaying here, because that way also audios longer then that predefined 5 secs in your previous one get played 3x.
Lectora file in my opinion is nice and neat. Any decent developer should have no problem finding their way in this one. You need to make sure your audios end up in the media folder. I did by importing them to stage and then removing them...
Regards,
~Math -
I think that looks genial Math! I was not aware that you could change media files like that. It does mean that I can use OnDonePlaying which, of course, is much more precise than the delays I put in and less troublesome.
I will experiment a bit more and report back.
Thank you so much!
Categories
- 4.7K All Categories
- 3 New Feature Releases
- The Training Arcade®
- Arcades™
- 57 ✫ Announcements
- 6 ✪ Contests
- 34.1K eLearning Brothers® Products
- 33.6K Lectora®
- 31.6K Lectora Discussions
- 1.9K Lectora Feature Requests
- 64 Lectora User Groups
- 16 Asset Library
- 10 AssetLibrary Discussions
- 6 AssetLibrary Feature Requests
- 290 CenarioVR®
- 169 CenarioVR Discussions
- 121 CenarioVR Feature Requests
- 29 Rockstar Learning Platform®
- 20 Rockstar Learning Platform Discussions
- 9 Rockstar Learning Platform Feature Requests
- 4 Off-the-Shelf Course Library
- 3 Off-the-Shelf Course Library Discussions
- 1 Off-the-Shelf Course Library Feature Requests
- 114 CourseMill®
- 107 CourseMill Discussions
- 43 ReviewLink®
- 31 ReviewLink Discussions
- 12 ReviewLink Suggestions
- 2 The Training Arcade®
- 1 The Training Arcade Discussions
- 1 The Training Arcade Feature Requests
- 10 Additional Learning Products
- 2 Adobe®
- 4 Articulate®
- 2 Camtasia®
- Docebo®
- 1 iSpring®
- 1 Microsoft® PowerPoint®
- 911 All Things eLearning
- 5 Course Development Showcase
- 1 eLearning Brothers® Downloads
- 1 Compliance Training
- 10 eLearning Development
- eLearning Game Design
- 7 Instructional Design
- 546 Learning Management System (LMS) Integration
- 2 Mobile Learning
- 5 Visual Design
- 328 Web Accessibility
- 1.2K ♪ The Green Room
- 7 ♡ Community Feedback
- 7 Community Tips