Skip to content

Commit

Permalink
Cleanup player setup example in API.md
Browse files Browse the repository at this point in the history
Closes #4929
  • Loading branch information
robwalch committed Sep 28, 2022
1 parent 46e9c89 commit 5bb06ab
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,17 +209,17 @@ You need to provide manifest URL as below:
if (Hls.isSupported()) {
var video = document.getElementById('video');
var hls = new Hls();
// bind them together
hls.attachMedia(video);
hls.on(Hls.Events.MEDIA_ATTACHED, function () {
console.log('video and hls.js are now bound together !');
hls.loadSource('http://my.streamURL.com/playlist.m3u8');
hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) {
console.log(
'manifest loaded, found ' + data.levels.length + ' quality level'
);
});
});
hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) {
console.log(
'manifest loaded, found ' + data.levels.length + ' quality level'
);
});
hls.loadSource('http://my.streamURL.com/playlist.m3u8');
// bind them together
hls.attachMedia(video);
}
</script>
```
Expand Down

0 comments on commit 5bb06ab

Please sign in to comment.