Help me test the On Done Playing action on Android
October 1, 2013 12:00 AM
Hello all,
I've built a four-page course to test whether a page will automatically navigate to the next when a media file finishes playing. All works well on iOS, but I've had no success on Android.
If you have an Android device will you kindly try the link and let me know if On Done Playing works on your particular device.
Thanks!
http://invendev.com/test/odp/
Discussion (3)
Sorry, what I'm ACTUALLY working on doesn't use the native audio controller. I meant to change my example to use it. It should start out like this, if you want the controller:
[/CODE]
Otherwise, you can leave it invisible and trigger with an action that calls this JavaScript:
[CODE]startAudio(); [/CODE][CODE][/CODE]
Otherwise, you can leave it invisible and trigger with an action that calls this JavaScript:
startAudio(); [/CODE][CODE]startAudio(); [/CODE]
@tnunes. Thanks for the feedback and the possible solution. I'll have to take a deeper look into what you're doing. I am going to be building hundreds of courses with dozens of audio and video files in each and need the most efficient workflow possible.
In general, I don't have any problems with html5 output. Everything behaves as expected except the OnDonePlaying on Android.
Here's the word from Lectora support:
--
I happen to be using extensive video with ODP navigation, so events are not going to work.
The action didn't fire after the audio completed for me. (Android 4.1.2 in Chrome version 18.0.1025469)
I've been wrestling for a while with getting Lectora content to play well on this particular tablet. There are some kinks in its html5 output. Here's what I have created as a workaround, you are welcome to try out:
On each page (that requires audio) insert an html extension at the top and paste this code into it:
[/CODE]
[I]Note that I didn't worry about including an ogg audio type for Firefox, but you will probably need to. (our company is pretty locked down by IT and I'm in the weird position of having to make this thing utilize html5 for tablet Chrome but also be backward compatible to IE 8. (but only IE.)[/I]
Next paste this audio function code into a new .js file (named "audioFunction.js" and referenced in the html extension above).
- You will need to manually add this file to your html folder in your title's output.
- You will also need to manually copy the audio files to the media folder--Lectora won't "see" them inside this code at publish time.
[CODE]/***************** THIS CALLS THE AUDIO *********************/
function startAudio() {
//check for new browser feature
if( document.addEventListener ){
//VO = document.getElementById("VO");
VO.play();
VO.addEventListener('ended', voEnd);
} else {
//play the embed audio
vo_fallback.Play();
}
}
//function gets called when VO has ended (html5 audio only)
function voEnd() {
trivNextPage();
//this calls the Lecotora Next function that was automatically generated to navigate to your next page.
//
//if you didn't want to auto-advance you could also just show or hide images (like a next button), like below
//document.getElementById('image4704').style.visibility="hidden";//hide an image
}
//add the listener to the audio object
var VO=document.getElementById('VO');
VO.addEventListener('ended', voEnd);
[/CODE]
Note, the listener does not work in older browsers, so you may want to display a Next button in the fallback audio path.
Happy trails.[CODE]
[/CODE]
Note that I didn't worry about including an ogg audio type for Firefox, but you will probably need to. (our company is pretty locked down by IT and I'm in the weird position of having to make this thing utilize html5 for tablet Chrome but also be backward compatible to IE 8. (but only IE.)
Next paste this audio function code into a new .js file (named "audioFunction.js" and referenced in the html extension above).
- You will need to manually add this file to your html folder in your title's output.
- You will also need to manually copy the audio files to the media folder--Lectora won't "see" them inside this code at publish time.
/***************** THIS CALLS THE AUDIO *********************/
function startAudio() {
//check for new browser feature
if( document.addEventListener ){
//VO = document.getElementById("VO");
VO.play();
VO.addEventListener('ended', voEnd);
} else {
//play the embed audio
vo_fallback.Play();
}
}
//function gets called when VO has ended (html5 audio only)
function voEnd() {
trivNextPage();
//this calls the Lecotora Next function that was automatically generated to navigate to your next page.
//
//if you didn't want to auto-advance you could also just show or hide images (like a next button), like below
//document.getElementById('image4704').style.visibility="hidden";//hide an image
}
//add the listener to the audio object
var VO=document.getElementById('VO');
VO.addEventListener('ended', voEnd);
[/CODE]
Note, the listener does not work in older browsers, so you may want to display a Next button in the fallback audio path.
Happy trails.[CODE]/***************** THIS CALLS THE AUDIO *********************/
function startAudio() {
//check for new browser feature
if( document.addEventListener ){
//VO = document.getElementById("VO");
VO.play();
VO.addEventListener('ended', voEnd);
} else {
//play the embed audio
vo_fallback.Play();
}
}
//function gets called when VO has ended (html5 audio only)
function voEnd() {
trivNextPage();
//this calls the Lecotora Next function that was automatically generated to navigate to your next page.
//
//if you didn't want to auto-advance you could also just show or hide images (like a next button), like below
//document.getElementById('image4704').style.visibility="hidden";//hide an image
}
//add the listener to the audio object
var VO=document.getElementById('VO');
VO.addEventListener('ended', voEnd);
[/CODE]
Note, the listener does not work in older browsers, so you may want to display a Next button in the fallback audio path.
Happy trails.
Discussions have been disabled for this post