Skip to content
Snippets Groups Projects
Commit dc8eb87c authored by zezinho's avatar zezinho
Browse files

added a generated link to a website with lyrics

parent 48be3ed4
Branches master
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>myMpd v1.0.0</title>
<title>myMpd v1.1.0</title>
<style>
body { background-color: grey; color: white; }
......@@ -25,6 +25,7 @@
.bouton { padding:20px; border-radius: 10px; background-color: grey; }
.actif { background-color: #2c5959; border-radius: 10px;}
#journal { padding:2px; border-radius: 5px; background-color: white; color: black; }
#lyricsUrl { position:relative; float:right; padding:2px; border-radius: 5px; background-color: white; color: black; }
#mpdlist { padding:2px; border-radius: 5px; background-color: white; color: black; display:none; }
input[type=button] { padding: 5px; }
.lien {cursor: pointer;}
......@@ -41,6 +42,9 @@
<span id=duree></span>
</div>
<div id=lyricsUrl>
</div>
<div id=boutons>
<input id=prev type=button class=button title="Précédent" value="⏮️" onclick=action('prev')>
<!-- <input id=toggle type=button class=button title="Lire/Pause" value="⏯️" onclick=action('toggle')> -->
......
......@@ -65,6 +65,7 @@
duree = tt[1];
$( "#pos" ).html( pos );
$( "#duree" ).html( duree );
$( "#lyricsUrl" ).html( '<a href=https://www.letras.com.br/' + result['lyricsUrl'] + ' target=_blank >Paroles?</a>' );
// $( "#time" ).html( result['time'] );
// $( "#status" ).html( result['status'] );
if ( result['status'].match( /random:\son/ ) == "random: on" ) {
......
......@@ -19,6 +19,8 @@ if ( isset($_GET['action']) ) {
$etat['playing']=$output[0];
$etat['time']=$output[1];
$etat['status']=$output[2];
setlocale(LC_CTYPE, 'fr_FR');// pour que iconv fonctionne ci-dessous
$etat['lyricsUrl']=str_replace("'",'',str_replace(' ','-',str_replace(' - ','/',strtolower(iconv('UTF-8', 'ASCII//TRANSLIT',$output[0])))));
echo json_encode($etat);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment