I have the need to stop javascript code execution until a video in my app stops playing. In order to do this, I have a function that looks like the following...
function playVideo(source, volume) {
//Some stuff
return media.play(source).finally(function() {
//Some cleanup stuff
}
)
}
On all browsers except for Safari 9, the code inside the finally block does not execute until my video has stopped playing. How can I get the code to behave the same for Safari 9 also?