LoadVideo function
Implementation
Future<HTML.VideoElement> LoadVideo(String url) {
Completer<HTML.VideoElement> c = Completer();
HTML.VideoElement video = HTML.VideoElement();
// this is crucial since we are waiting for "onplaying"
video.autoplay = true;
video.loop = true;
video.onPlaying.first.then((_) => c.complete(video));
video.src = url;
return c.future;
}