MOH: Fix duplicate ID warning and playback.

This commit is contained in:
Nate 2020-03-31 11:46:49 -06:00
parent d87fa6eb77
commit 88471e5aa3
1 changed files with 2 additions and 3 deletions

View File

@ -444,6 +444,7 @@
$previous_name = '';
//loop through the array
$x = 0;
foreach ($streams as $row) {
//set the variables
@ -521,7 +522,6 @@
//list the stream files
if (is_array($stream_files) && @sizeof($stream_files) != 0) {
$x = 0;
foreach ($stream_files as $stream_file_path) {
$row_uuid = uuid();
$stream_file = pathinfo($stream_file_path, PATHINFO_BASENAME);
@ -546,9 +546,8 @@
}
echo " <td class='overflow'>".escape($stream_file)."</td>\n";
echo " <td class='button center no-link no-wrap'>";
echo "<audio id='recording_audio_".$row_uuid."' style='display: none;' preload='none' ontimeupdate=\"update_progress('".$row_uuid."')\" onended=\"recording_reset('".$row_uuid."');\" src='music_on_hold.php?action=download&id=".escape($row['music_on_hold_uuid'])."' type='".$stream_file_type."'></audio>";
echo "<audio id='recording_audio_".$row_uuid."' style='display: none;' preload='none' ontimeupdate=\"update_progress('".$row_uuid."')\" onended=\"recording_reset('".$row_uuid."');\" src='music_on_hold.php?action=download&id=".escape($row['music_on_hold_uuid'])."&file=".urlencode($stream_file)."' type='".$stream_file_type."'></audio>";
echo button::create(['type'=>'button','title'=>$text['label-play'].' / '.$text['label-pause'],'icon'=>$_SESSION['theme']['button_icon_play'],'id'=>'recording_button_'.$row_uuid,'onclick'=>"recording_play('".$row_uuid."');"]);
//echo button::create(['type'=>'button','title'=>$text['label-stop'],'icon'=>$_SESSION['theme']['button_icon_stop'],'onclick'=>"recording_stop('".$row_uuid."'); this.blur(); return false;"]);
echo button::create(['type'=>'button','title'=>$text['label-download'],'icon'=>$_SESSION['theme']['button_icon_download'],'link'=>"?action=download&id=".urlencode($row['music_on_hold_uuid'])."&file=".urlencode($stream_file)]);
echo " </td>\n";
echo " <td class='right no-wrap hide-xs'>".escape($stream_file_size)."</td>\n";