Better requests, code needs cleaning
This commit is contained in:
+15
-13
@@ -19,22 +19,24 @@
|
||||
|
||||
var lastId, player;
|
||||
|
||||
app.ports.registerVideo.subscribe(function(args) {
|
||||
var time = parseInt(args[2], 10) || undefined;
|
||||
if (app.ports !== undefined && app.ports.registerVideo !== undefined) {
|
||||
app.ports.registerVideo.subscribe(function(args) {
|
||||
var time = parseInt(args[2], 10) || undefined;
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
if (args[0] !== lastId) {
|
||||
lastId = args[0];
|
||||
requestAnimationFrame(function() {
|
||||
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);
|
||||
}
|
||||
player = vd.setup(args[0], {
|
||||
v: args[1] + "/manifest.mpd",
|
||||
t: parseInt(args[2], 10) || 0
|
||||
});
|
||||
} else if (time !== undefined ){
|
||||
player.currentTime(time);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user