http live streaming

If you must set audio or video tag on your html page with webview, You would better to use the HTTP LIVE STREAMING.

The hls is suggeted by apple for web guard from stolen contents.

If the stolen is aplly, It send only m3u file or m3u8 file only.

the code is like this.



<div onclick="tap1()">     
     <audio id="audio1" oncontextmenu="return false" preload="none" type="audio/mpegURL">audio set</audio> 
</div>
<script>
function tap1(){
     var elem = document.getElementById("audio1");
     elem.src = "url.m3u";
     elem.load();
     elem.play();
}
</script>

The playlist file as m3u is like this.

#EXT-X-VERSION:3
#EXTM3U
#EXT-X-TARGETDURATION:90
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-PLAYLIST-TYPE:LIVE
#EXTINF:90, I wanna see you - Grandcross
https://www.grand-cross.com/
#EXTINF:90, We will be on forever - Grandcross
https://www.grandcross.tokyo/
#EXT-X-ENDLIST

This command can move on webview with stringWithEvaluatingScript tag.