Support » Alpha/Beta » [Resolved] Audio glitch on iOS

[Resolved] Audio glitch on iOS

  • Here’s my site page: http://thetracksmiths.com/beats/bap-adapt/

    Problem: WP 3.6 audio players inside the table (when datatables is enabled) do not play on iOS (iPad / iPhone).

    Scenario: I’m using a free WP plugin called TablePress. This plugin creates html tables as you’ll see on my site above. It also uses (optionally) a javascript library called Datatables to enhance the html table with column sorting, pagination, search, etc. When I disable the datatables functionality, i.e. just a plain html table, the players play across all browsers and platforms. When I enable it, only iOS won’t play the players.

    Naturally, I concluded the issue is somewhere in the datatables functionality. After much back & forth on datatables’ forums, here’s what the author had to say:

    So I’ve just had a bit more of a look into this, and I can fairly easily replicate the issue without DataTables. All that needs to be done is to remove the element from the document and then add it back in again. The media player simply fails to play after that on iOS (and this removal and addition is fundamental to how DataTables works).

    For example, if you disable DataTables on your page and add this code:

    jQuery(document).ready( function ($) {
        var a = $('#tablepress-2 tbody tr:eq(2)')[0];
        a.parentNode.removeChild( a );
        $('#tablepress-2 tbody').append( a );
    } );

    All of the players in the table will work, expect the very last row (the one that has been removed and re-added).

    So its not something that DataTables is doing wrong, but it is a problem in the media player that is triggered by the actions DataTables take. As I say, this is fundamental to DataTables and isn’t likely to change, so we need to know either if the author of the media player library can fix it for when items are removed and then added back into the DOM. Or if there is some sort of re-initialisation that can be called when the element is added back into the DOM.

    If I’m understanding correctly (I’m no coder!), what the author is saying is that something in the audio code is playing nasty with iOS when it’s taken off the page and then re-added. Since the audio functionality is part of the WP core now, here I am! I’m hoping the good people of the WP forum will be able to solve this mystery!

Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] Audio glitch on iOS’ is closed to new replies.