facebook

Audio Widget Question

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #334441 Reply

    Brandon
    Member

    I 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.

    #334475

    Brandon
    Member

    Is 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

    #334504

    Hi CincyPlanet,

    We are working on providing an api doc. I am scheduled to assist with testing the api soon.

    #334505

    Brandon
    Member

    OK. 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?

    #334521

    Hi 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.
    #334525

    Brandon
    Member

    Ocatvio,

    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.

    #334533

    @CincyPlanet,

    To 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.

    #334534

    Brandon
    Member

    Octavio,

    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.

    #334536

    Brandon
    Member

    I thought maybe a sample of what I am trying to do would help. It still has some tweaking though.

    http://goo.gl/w4oDn

    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,

    #334574

    @CincyPlanet,

    I 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

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: Audio Widget Question

You must be logged in to post in the forum log in