<!DOCTYPE html>
<html>
    <head>
        <script src=/media-resources/video-test.js></script>
        <script src=/media-resources/media-file.js></script>

        <script>
            function start()
            {
                var media = findMediaFile('audio', '../../../../media/content/silence');
                var type = mimeTypeForExtension(media.split('.').pop());
                var audio = document.querySelector("audio");

                audio.src = 'http://127.0.0.1:8000/media/resources/serve_video.py?name=' + media + '&type=' + type + '&content-length=no&icy-data=yes';

                waitForEventAndFail('error');
                waitForEventAndEnd('ended');
            }
        </script>
    </head>
    <body onload="start()">
        <audio controls autoplay></audio>
        <p><b>Test ended by:</b>
        <ol>
            <li>Play streamed media.</li>
            <li>Verify that the 'ended' event fires upon finishing the playback.</li>
        </ol>
        </p>
        <br/>
    </body>
</html>
