Note that there are some explanatory texts on larger screens.

plurals
  1. POMobile Safari sends multiple requests to the same URL, can I stop that?
    primarykey
    data
    text
    <p>I have a page with an audio element on it and when the page loads in mobile safari I see in the log that the mp3 file was called twice. I wouldn't have a problem with this, but when it loaded the first time it is supposed to play one file and then the second time it loads it is supposed to play another audio file. But, since it gets called twice it ends up only playing the second file.</p> <p>The path for the file comes from a database and it keeps track of what's played and what's not played.</p> <p>I tried using cookies, but that doesn't seem to be working. For example I set the cookie to 10 seconds so that if it was called twice I could send it back to the first song.</p> <p>This is from the song.php file:</p> <pre><code>if(isset($_COOKIE['TooSoon'])){ header("Location: playPrevious.php?l=".$sl.""); } else{ mysql_query("UPDATE PLAYLIST SET `QUEUE`=0 WHERE `ID` = '" . $ID1 . "'") or die(mysql_error()); setcookie("TooSoon", $value, time()+10); header("Location: http://s3q9av7pbmhhnu.cloudfront.net/".$PATH.".mp3"); } </code></pre> <p>EDIT: Here's the page with the player:</p> <pre><code>&lt;script&gt; soundManager.setup({ url: '../swf/', // optional: use 100% HTML5 mode where available // preferFlash: false, onready: function() { var sound = soundManager.createSound({ id: 'VOP', url: 'song.php?l=&lt;?php echo $login_session;?&gt;', onfinish: function() { soundManager._writeDebug(this.id+' has finished the current track.'); // destroy this sound this.unload(); soundManager.createSound({ id: 'VOP', url: 'song.php?l=&lt;?php echo $login_session;?&gt;', }); soundManager.play('VOP'); }, autoPlay: false }); } }); &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload