How does js play ts files in m3u8 (audio, not video)

the audio of js cannot play the ts audio file in m3u8. How to solve this problem?

For more information about m3u8 files, please see this article: https://blog.csdn.net/pangrui.

.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ts</title>
</head>
<body>
<audio id="music1" src="./ld-00001.ts"></audio>
<span onclick="paly();"></span>
<script>
function paly(){
    var audio = document.getElementById("music1");
    if(audio!==null){
        if(audio.paused){
            //             
            audio.play();
            return;
        }
        // 
        audio.pause();
    }
}
   
</script>
</body>
</html>

address of m3u8: download address of https://res001.geekbang.org/m.
ts file: https://res001.geekbang.org/m.


use ideo-dev/hls.js/" rel=" nofollow noreferrer "> hls.js

name a chestnut
http://jsfiddle.net/631807682.

Menu