PHP Classes
elePHPant
Icontem

File: index.html

Recommend this page to a friend!
  Classes of Rahman Haghparast  >  PHP Live Radio Streaming  >  index.html  >  Download  
File: index.html
Role: Auxiliary data
Content type: text/plain
Description: showcase of how it works
Class: PHP Live Radio Streaming
Serve MP3 audio files to play from a playlist
Author: By
Last change:
Date: 2 years ago
Size: 931 bytes
 

Contents

Class file image Download
<html>
<head>
    <script language="JavaScript" src="jquery-2.1.4.js"></script>
    <style>
        iframe {
            border: 0;
        }
    </style>
</head>
<body>
<div id="place-holder"></div>
<iframe height="100" src="playsong.php"></iframe>
<script language="JavaScript">
    jQuery(document).ready(function ($) {
        function setCaption(){
            $.ajax({
                url: "info.php",
                type: "post"
            }).done(function (response, textStatus, jqXHR) {
                console.log(response);
                var data = $.parseJSON(response);
                data = 'Playing: ' + data.playing.name + '(' + data.playing.duration + ')' + '<br />' + "\n" + 'Next: ' + data.next.name + '(' + data.next.duration + ')';
                $('#place-holder').html(data);
            })
        }
        setInterval(setCaption,2000);
    })
</script>
</body>
</html>