A basic example on how to play clear-key protected media using Encrypted Media Extensions and dash.js library Go to html preview : https://htmlpreview.github.io/?https://github.com/sanjuc/clear-key/blob/master/index.html and see the playback of clear-key encrypted media. You could look at the console warn messages to see the sequence of events in the process.
More info in the article here : https://medium.com/swlh/how-to-play-mpeg-dash-encrypted-protected-content-using-encrypted-media-extensions-eme-in-browser-234f49fdc706