Support time

This commit is contained in:
2020-10-04 21:31:16 +02:00
parent 42de337746
commit a1ccbbefa3
3 changed files with 57 additions and 5 deletions
+14 -1
View File
@@ -17,9 +17,22 @@
flags: { width: window.innerWidth, height: window.innerHeight }
});
var lastId, player;
app.ports.registerVideo.subscribe(function(args) {
var time = parseInt(args[2], 10) || undefined;
requestAnimationFrame(function() {
vd.setup(args[0], args[1] + "/manifest.mpd")
if (args[0] !== lastId) {
lastId = args[0];
player = vd.setup(args[0], {
v: args[1] + "/manifest.mpd",
t: parseInt(args[2], 10) || 0
});
} else if (time !== undefined ){
player.currentTime(time);
}
});
});
</script>