Spaces:
Running
Running
Commit
•
4dead22
1
Parent(s):
9ac2fe8
pausing the data collection loop
Browse files- public/test.html +26 -0
public/test.html
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script src="https://cdn.bootcss.com/flv.js/1.5.0/flv.min.js"></script>
|
2 |
+
<video id="videoElement" controls></video>
|
3 |
+
<script>
|
4 |
+
(() => {
|
5 |
+
let isStarted = false
|
6 |
+
|
7 |
+
// When user clicks anywhere outside of the modalCompanies, close it
|
8 |
+
window.onclick = function(event) {
|
9 |
+
console.log('something was clicked!')
|
10 |
+
if (!isStarted) {
|
11 |
+
isStarted = true
|
12 |
+
if (flvjs.isSupported()) {
|
13 |
+
var videoElement = document.getElementById('videoElement');
|
14 |
+
var flvPlayer = flvjs.createPlayer({
|
15 |
+
type: 'flv',
|
16 |
+
url: 'https://jbilcke-hf-media-server.hf.space/live/webtv.flv'
|
17 |
+
});
|
18 |
+
flvPlayer.attachMediaElement(videoElement);
|
19 |
+
flvPlayer.load();
|
20 |
+
console.log('playing video..');
|
21 |
+
flvPlayer.play();
|
22 |
+
}
|
23 |
+
}
|
24 |
+
}
|
25 |
+
})()
|
26 |
+
</script>
|