diff --git a/index.html b/index.html
index 2b3cccd..f1e1281 100644
--- a/index.html
+++ b/index.html
@@ -15,18 +15,11 @@
node: document.getElementById('container')
});
- function setup(args) {
- if (document.getElementById(args[0]) != undefined) {
- vd.setup(args[0], args[1] + "/manifest.mpd")
- } else {
- setTimeout(function() {
- setup(args);
- }, 50);
- }
- }
-
app.ports.registerVideo.subscribe(function(args) {
- setup(args);
+ requestAnimationFrame(function() {
+ console.log(args);
+ vd.setup(args[0], args[1] + "/manifest.mpd")
+ });
});