Jump to content

Recommended Posts

I have php code that uses mp3 audio files stored in a database for the user to listen to. The page loads and the audio controls work and the files play on a desktop and laptop just fine. When trying to play a file on an android or IPhone, when you press the play (or any other control) nothing happens. It acts like the page is static. There is a home button on the webpage and it works so I know the page is interactive. Below is the code. I would appreciate any help. Thank you.

<?php
  $sermons = $database->select("sermon","*");;
  foreach( $sermons as $sermon )
  {
    $audio_file = 'http://xxxxxxx.com/sermons/'.$sermon['file_name'];
    $player = "<audio id='sermon_'$sermon[id] controls>
                <source src='$audio_file' type='audio/mpeg'>
                <source src='$audio_file' type='audio/mp3'>
                Your browser does not support the audio element.
              </audio>";
    echo "<tr>
          <td>$sermon[sermon_date]</td>
          <td>$sermon[title]</td>
          <td>$sermon[speaker]</td>
          <td>$player</td>
          </tr>";
  }
  ?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.