Spaces:
Running
Running
<script src="https://cdn.bootcss.com/flv.js/1.5.0/flv.min.js"></script> | |
<video id="videoElement" controls></video> | |
<script> | |
(() => { | |
let isStarted = false | |
// When user clicks anywhere outside of the modalCompanies, close it | |
window.onclick = function(event) { | |
console.log('something was clicked!') | |
if (!isStarted) { | |
isStarted = true | |
if (flvjs.isSupported()) { | |
var videoElement = document.getElementById('videoElement'); | |
var flvPlayer = flvjs.createPlayer({ | |
type: 'flv', | |
url: 'https://jbilcke-hf-media-server.hf.space/live/webtv.flv' | |
}); | |
flvPlayer.attachMediaElement(videoElement); | |
flvPlayer.load(); | |
console.log('playing video..'); | |
flvPlayer.play(); | |
} | |
} | |
} | |
})() | |
</script> |