New feat : Redesigned audio player (#279)

* New audio player

* New style

* Readd vertical bar

* Improve appearance safari

* Improve layout

* Improve alignement of bottom elements

* Align
This commit is contained in:
Alexandre
2025-04-12 10:09:03 +02:00
committed by GitHub
parent a0087b2911
commit 7c22e2593e
5 changed files with 787 additions and 45 deletions
+4 -2
View File
@@ -244,7 +244,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) {
<a href="https://wikipedia.org/wiki/<?php echo $sciname;?>" target="_blank"><img style=";cursor:pointer;float:unset;display:inline" title="Wikipedia" src="images/wiki.png" width="20"></a>
<img style=";cursor:pointer;float:unset;display:inline" title="View species stats" onclick="generateMiniGraph(this, '<?php echo $comnamegraph; ?>')" width=20 src="images/chart.svg"><br>
<b>Confidence:</b> <?php echo round((float)round($todaytable['Confidence'],2) * 100 ) . '%';?><br></div><br>
<video onplay='setLiveStreamVolume(0)' onended='setLiveStreamVolume(1)' onpause='setLiveStreamVolume(1)' controls poster="<?php echo $filename.".png";?>" preload="none" title="<?php echo $filename;?>"><source preload="none" src="<?php echo $filename;?>"></video>
<div class='custom-audio-player' data-audio-src="<?php echo $filename; ?>" data-image-src="<?php echo $filename.".png";?>"></div>
</td>
<?php } else { //legacy mode ?>
<tr class="relative" id="<?php echo $iterations; ?>">
@@ -511,7 +511,8 @@ function loadDetections(detections_limit, element=undefined) {
} else {
document.getElementById("detections_table").innerHTML= this.responseText;
}
// Reinitialize custom audio players for newly loaded elements
initCustomAudioPlayers();
}
if(searchterm != ""){
xhttp.open("GET", "todays_detections.php?ajax_detections=true&display_limit="+detections_limit+"&searchterm="+searchterm, true);
@@ -560,6 +561,7 @@ window.addEventListener("load", function(){
}
</style>
<script src="static/custom-audio-player.js"></script>
<script>
function generateMiniGraph(elem, comname) {
// Make an AJAX call to fetch the number of detections for the bird species