@speechkit/speechkit-audio-player
Version:
A web player component that can play audio from https://speechkit.io
36 lines (35 loc) • 945 B
HTML
<html>
<head>
<meta charset="utf-8">
<title>Speechkit example</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
/* margin-left: 4rem; */
}
</style>
</head>
<body style="height: 2000px;">
<div id="app" class="app">
<h1>Embedded player</h1>
<div id="render-here"></div>
</div>
<script src="./speechkit-player.js"></script>
<script src="./data.js"></script>
<script>
var player = new SpeechKit.players.EmbeddedPlayer(options).load()
player.on('didPlay', function(podcast) {
console.log('Started playing: ' + podcast.id)
})
player.on('didEnd', function() {
if (player.hasNext()) {
player.loadNextPodcast().play()
} else {
player.loadPodcastWithIndex(0)
}
})
</script>
</body>
</html>