mirror of
https://git.maid.zone/stuff/soundcloak.git
synced 2025-12-24 04:39:36 +05:00
prefer hls.js over browser (what the fuck does "maybe" mean?)
This commit is contained in:
@@ -12,12 +12,12 @@ templ Track(t sc.Track, stream string) {
|
||||
<script>
|
||||
var audio = document.getElementById('track');
|
||||
var audioSrc = audio.getAttribute('data-stream');
|
||||
if (audio.canPlayType('application/vnd.apple.mpegurl')) {
|
||||
audio.src = audioSrc;
|
||||
} else if (Hls.isSupported()) {
|
||||
if (Hls.isSupported()) {
|
||||
var hls = new Hls();
|
||||
hls.loadSource(audioSrc);
|
||||
hls.attachMedia(audio);
|
||||
} else if (audio.canPlayType('application/vnd.apple.mpegurl')) {
|
||||
audio.src = audioSrc;
|
||||
} else {
|
||||
alert('hls not supported');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user