Support for HLS
This commit is contained in:
+12
-2
@@ -23,14 +23,15 @@
|
||||
if (app.ports !== undefined && app.ports.registerVideo !== undefined) {
|
||||
app.ports.registerVideo.subscribe(function(args) {
|
||||
window.scrollTo(0, 0);
|
||||
var time = vd.parseTime(args[2]) || undefined;
|
||||
var time = vd.parseTime(args[2]);
|
||||
time = time || vd.parseTime(localStorage.getItem(args[0]));
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
if (args[0] !== lastId) {
|
||||
lastId = args[0];
|
||||
|
||||
player = vd.setup(args[0], {
|
||||
v: args[1] + "/manifest.mpd",
|
||||
v: args[1] + "/manifest.m3u8",
|
||||
t: time,
|
||||
focus: true
|
||||
});
|
||||
@@ -38,6 +39,8 @@
|
||||
player.currentTime(time);
|
||||
}
|
||||
});
|
||||
|
||||
setTimeout(recordPosition, 1000);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -47,6 +50,13 @@
|
||||
lastId = undefined;
|
||||
});
|
||||
}
|
||||
|
||||
function recordPosition() {
|
||||
if (lastId !== undefined) {
|
||||
localStorage.setItem(lastId, player.currentTime());
|
||||
setTimeout(recordPosition, 1000);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user