Playing music outside of the datatable.

Playing music outside of the datatable.

jkathirjkathir Posts: 18Questions: 5Answers: 0
  1. Need a best web mp3 player with equalizier and other options which will be displayed first
  2. Below the music player a datatable with exist with huge rows and each row will point to a mp3
  3. Need to play the music player to play the selected row of a datatable?

What would be the Web music player
Invoke on when row is clicked with a button

Number of music mp3 files would be 2,000

This question has an accepted answers - jump to answer

Answers

  • jkathirjkathir Posts: 18Questions: 5Answers: 0

    @allan any suggestion on this?

  • kthorngrenkthorngren Posts: 21,363Questions: 26Answers: 4,956

    Choosing the audio player you use is outside the scope of this forum.

    One option is to use the Select extension. There are some examples of using the API for events and getting selected items.

    Kevin

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin

    Yup - what Kevin says :).

    Allan

  • jkathirjkathir Posts: 18Questions: 5Answers: 0

    I agree it is related to integration. Any link for reference to have the integration with datatable.

  • jkathirjkathir Posts: 18Questions: 5Answers: 0

    Want to use the following player when a row is clicked -

    https://alloyui.com/examples/audio/real-world

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin
    $('#myTable').on( 'click', 'tbody tr', function () {
      var rowData = table.row( this ).data();
    
      // some code to change the audio player's source
      ...
    
      audio.play();
    } );
    

    would seem to do it.

    Allan

  • jkathirjkathir Posts: 18Questions: 5Answers: 0

    Thanks for your kind reply Allan as usual. I hope you will understand the alloy ui audio above example very easily than i can. Is it possible for you to give me a sample code with single row with any mp3 file link.

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin

    Sure - happy to write that code for you under the Quick Support 180 package.

    Allan

  • jkathirjkathir Posts: 18Questions: 5Answers: 0

    No issues, allan. I have done it by myself...Do you know any beautiful open source player with equalizier and stereo effects which can be integrated as alloy? Just a suggestion would be helpful.

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin

    Nope sorry. Web audio isn't something I've used much.

    Allan

  • jkathirjkathir Posts: 18Questions: 5Answers: 0

    @allan after getting the row data as below

    var rowData = table.row( this ).data();

    how to get the specific column value? example my column is the 4th column and first column is serial number - it may be auto-incremented or manual

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin
    Answer ✓

    rowData[3] if you are using arrays. rowData.myDataPropertyName if you are using objects.

    Allan

  • pettedemonpettedemon Posts: 38Questions: 6Answers: 0
    edited November 2017

    Hi,
    I have a media elements player outside the table.
    The script to play audio is this

    $("#canzoni_player tbody").on("click", "tr td div.click_play", function () { 
        // get Canzone name
            var canzone=$(this).find("input[type="hidden"]").val();
        // switch out player"s video source and reload
        var player = $("#player2")[0].player.media;
        player.setSrc("/songs/" + canzone);
        player.load();
        player.play();
        
        $(".playing,.now").removeClass("now").removeClass("playing").addClass("start");
        
        $(".playing-stop,.now").removeClass("now").removeClass("playing-stop").addClass("start");
        
        
        $(this).addClass("playing");
        $(this).addClass("now");
        $(this).removeClass("start");
    });
    

    But I cannot use the player outside the table, I cannot select it... it is impossible?
    thanks

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin

    @pettedemon - I'm not sure how your question relates to DataTables? Perhaps you can link to the page showing the issue so I can take a look please?

    Allan

This discussion has been closed.