Browse Source

server player

master
zeus 4 years ago
parent
commit
24234814bf
  1. 16
      aplayer.html

16
aplayer.html

@ -1,6 +1,10 @@
<html> <html>
<head> <head>
<link rel="stylesheet" type="text/css" href="/player/asciinema-player.css" /> <link rel="stylesheet" type="text/css" href="/player/asciinema-player.css" />
</head>
<body>
<asciinema-player id="p1" title="Linux" author="swarmlab.io" author-url="http://www.swarmlab.io" font-size="small" speed="2" theme="monokai" src="/player/hybrid-linux/demo.cast"></asciinema-player>
<script src="/player/asciinema-player.js"></script>
<script> <script>
var url_string = window.location.href var url_string = window.location.href
var url = new URL(url_string); var url = new URL(url_string);
@ -8,6 +12,14 @@
var llo = url.searchParams.get("llo"); var llo = url.searchParams.get("llo");
var src = '/player/'+llo+'/'+item+'.cast' var src = '/player/'+llo+'/'+item+'.cast'
var video = document.getElementById('p1');
var source = document.createElement('source');
source.setAttribute('src', src);
video.appendChild(source);
//video.play();
var div = document.createElement('asciinema-player'); var div = document.createElement('asciinema-player');
document.body.appendChild(div); //appending the element document.body.appendChild(div); //appending the element
@ -32,9 +44,5 @@
div.setAttributeNode(theme); div.setAttributeNode(theme);
</script> </script>
</head>
<body>
<asciinema-player title="Linux" author="swarmlab.io" author-url="http://www.swarmlab.io" font-size="small" speed="2" theme="monokai" src="/player/hybrid-linux/demo.cast"></asciinema-player>
<script src="/player/asciinema-player.js"></script>
</body> </body>
</html> </html>

Loading…
Cancel
Save