Browse Source

server player

master
zeus 4 years ago
parent
commit
46a6d67319
  1. 25
      aplayer.html

25
aplayer.html

@ -3,7 +3,7 @@
<link rel="stylesheet" type="text/css" href="/player/asciinema-player.css" /> <link rel="stylesheet" type="text/css" href="/player/asciinema-player.css" />
</head> </head>
<body> <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> <asciinema-player id="p1" title="Linux" author="swarmlab.io" author-url="http://www.swarmlab.io" font-size="small" speed="2" theme="monokai" src="/player/demo.cast"></asciinema-player>
<script src="/player/asciinema-player.js"></script> <script src="/player/asciinema-player.js"></script>
<script> <script>
var url_string = window.location.href var url_string = window.location.href
@ -18,30 +18,7 @@ var source = document.createElement('source');
source.setAttribute('src', src); source.setAttribute('src', src);
video.appendChild(source); video.appendChild(source);
//video.play();
var div = document.createElement('asciinema-player');
document.body.appendChild(div); //appending the element
var att = document.createAttribute( "src" );
att.value = src ;
div.setAttributeNode(att);
var speed = document.createAttribute( "speed" );
speed.value = 2 ;
div.setAttributeNode(speed);
var author = document.createAttribute( "author" );
author.value = 'swarmlab.io' ;
div.setAttributeNode(author);
var authorurl = document.createAttribute( "author-url" );
authorurl.value = 'http://www.swarmlab.io' ;
div.setAttributeNode(authorurl);
var theme = document.createAttribute( "theme" );
theme.value = 'monokai' ;
div.setAttributeNode(theme);
</script> </script>
</body> </body>

Loading…
Cancel
Save