Click here to Skip to main content
15,887,888 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want too play two audio files using php
First file should play first and when it stops the second one should start playing .I have the following code but the PROBLEM is both are getting played simultaneously and its really getting mixed up plz help

What I have tried:

?php

$y=2;
$z=3;
$filea="bflat.mp3";
$fileb="SUUCgrcp.mp3";   
if($y==2){
    
     echo "<embed src =\"$filea\" hidden=\"true\" autostart=\"false\"></embed>";
    
    
} 

if($z==3){
    
  echo "<embed src =\"$fileb\" hidden=\"true\" autostart=\"false\"></embed>";
}
Posted
Updated 9-Oct-17 21:29pm
Comments
Richard MacCutchan 10-Oct-17 3:35am    
You need some way of detecting when the first file has finished playing. However, running them asynchronously in the above manner may not be possible.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900