Browse Source

server player

master
zeus 4 years ago
parent
commit
7226ab98ec
  1. 6
      aplayer.html

6
aplayer.html

@ -4,7 +4,7 @@
</head> </head>
<body onLoad="GetVideo()"> <body onLoad="GetVideo()">
<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" autoplay></asciinema-player> <asciinema-player id="p1" title="Linux" author="swarmlab.io" author-url="http://www.swarmlab.io" font-size="small" speed="2" theme="monokai"></asciinema-player>
<script src="/player/asciinema-player.js"></script> <script src="/player/asciinema-player.js"></script>
<script> <script>
function GetVideo() { function GetVideo() {
@ -17,6 +17,10 @@
var video = document.getElementById('p1'); var video = document.getElementById('p1');
video.setAttribute('src', src); video.setAttribute('src', src);
//document.querySelector("#p1").setAttribute("src", src); //document.querySelector("#p1").setAttribute("src", src);
document.getElementById('p1').addEventListener('canplaythrough', function(e) {
document.getElementById('p1').play()
console.log("all ready to play");
})
} }

Loading…
Cancel
Save