For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 9 replies, 2 voices, and was last updated 13 years, 6 months ago by
support-octavio.
-
AuthorPosts
-
BrandonMemberI am trying to set the Audio widget source using a simple javascript line, but I think Im missing something. I thought it would be like the html5 code
$(‘#m1-mainpoint-audio1’).attr(‘src’,’url to file.mp3′);or even like the video player widget
$(“#m1-mainpoint-audio1”).click(“phoneui.playAudio(‘url to file.mp3’)”);but I cant seem to make it work.
Any help is appreciated.
January 22, 2013 at 10:51 am #334475
BrandonMemberIs there any documentation for the audio widget, I noticed its not listed on the learning center page, makes it hard to use the widgets without any docs:
http://www.genuitec.com/mobile/docs/javaScriptSnippets/javaScriptSnippets.html
The ones on there are great examples, just missing the newer widgets.
Thanks
January 22, 2013 at 5:53 pm #334504
support-octavioMemberHi CincyPlanet,
We are working on providing an api doc. I am scheduled to assist with testing the api soon.
January 22, 2013 at 6:17 pm #334505
BrandonMemberOK. In the mean time do you have any samples of how to assign it a new url file? Or do I need to use the old way for this project?
January 23, 2013 at 10:14 am #334521
support-octavioMemberHi CincyPlanet,
Next example will help you to understand how to access the jPlayer instance, play/pause and change the src of your audio. Note that main point is to get player id right: it is stored in attribute “data-m1-audio-player-id” in player container <div>
Learn more about jPlayer API here: http://www.jplayer.org/latest/developer-guide/Also note that this is a preliminary info and Test Center’s audio support is not universal.
Attachments:
You must be logged in to view attached files.January 23, 2013 at 10:51 am #334525
BrandonMemberOcatvio,
The sample works great so far and will get me started.
Is there an easy way to select and fire the next item in a list? I tried to search the forum but don’t see anything on it.
January 23, 2013 at 3:36 pm #334533
support-octavioMemberTo change src and play audio file you can call the two instruccions:
$("#m1-audio_player-audio3-player").jPlayer("setMedia", { mp3: "ttp://205.188.215.229:8010/" }); $("#m1-audio_player-audio3-player").jPlayer("play");You should create a function that use a var to change dynamically the mp3 src in the above function.
January 23, 2013 at 3:50 pm #334534
BrandonMemberOctavio,
Thanks, I got that from your sample. And I was able to get the ended function from your link.
However, I still havent been able to get the list item wokring though.
I need to uncheck the currently checked list item and have the next one checked and fire the javascript connected to it. I found several snippets of unselecting, but none for selecting the next one. If I need to I will start a new topic for it.
Thanks for the help the and the great product.
January 23, 2013 at 4:44 pm #334536
BrandonMemberI thought maybe a sample of what I am trying to do would help. It still has some tweaking though.
On the music page I want it to select the next list item and play that song. I have the code in there to detect when the song is over. Just not the list item code.
Thanks,
January 24, 2013 at 5:47 pm #334574
support-octavioMemberI assume your question on next thread is related to this request, please take a look at it and let me know how it goes for you: http://www.genuitec.com/support-genuitec/viewtopic.php?p=14123#p14123
-
AuthorPosts
