jbilcke-hf HF staff commited on
Commit
181da2e
1 Parent(s): 4dead22

cool, it works.

Browse files
Files changed (2) hide show
  1. public/index.html +20 -15
  2. public/test.html +0 -26
public/index.html CHANGED
@@ -1,24 +1,29 @@
1
  <html>
2
  <head>
3
- <title>AI WebTV</title>
4
  <link href="https://cdn.jsdelivr.net/npm/daisyui@3.1.6/dist/full.css" rel="stylesheet" type="text/css" />
5
  <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
6
  <script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"></script>
7
  <script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.2/iframeResizer.contentWindow.min.js"></script>
8
- <script src="https://cdn.dashjs.org/latest/dash.all.min.js"></script>
9
  </head>
10
- <body>
11
- <div class="w-full h-48">
12
- <iframe src="/stats" width="500" height="500"></iframe>
13
- </div>
14
- <div>
15
- <video
16
- data-dashjs-player
17
- autoplay
18
- src="https://jbilcke-hf-media-server.hf.space/live/webtv/index.mpd"
19
- controls
20
- class="w-full"
21
- ></video>
22
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  </body>
24
- </html>
 
1
  <html>
2
  <head>
3
+ <title>AI Web TV 🤗</title>
4
  <link href="https://cdn.jsdelivr.net/npm/daisyui@3.1.6/dist/full.css" rel="stylesheet" type="text/css" />
5
  <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
6
  <script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"></script>
7
  <script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.2/iframeResizer.contentWindow.min.js"></script>
8
+ <script src="https://cdn.bootcss.com/flv.js/1.5.0/flv.min.js"></script>
9
  </head>
10
+ <body class="fixed inset-0 bg-[rgb(0,0,0)] flex flex-col w-full items-center justify-center">
11
+ <div class="flex w-full">
12
+ <video id="videoElement" muted autoplay class="aspect-video w-full"></video>
 
 
 
 
 
 
 
 
 
13
  </div>
14
+ <script>
15
+ (() => {
16
+ if (flvjs.isSupported()) {
17
+ var videoElement = document.getElementById('videoElement')
18
+ var flvPlayer = flvjs.createPlayer({
19
+ type: 'flv',
20
+ url: 'https://jbilcke-hf-media-server.hf.space/live/webtv.flv'
21
+ })
22
+ flvPlayer.attachMediaElement(videoElement)
23
+ flvPlayer.load()
24
+ flvPlayer.play()
25
+ }
26
+ })()
27
+ </script>
28
  </body>
29
+ </html>
public/test.html DELETED
@@ -1,26 +0,0 @@
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>