1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Make book player restore location on resume

This commit is contained in:
Daniyar Itegulov 2020-06-06 19:02:08 +10:00
parent 553bbee6fe
commit d5991348c2
No known key found for this signature in database
GPG key ID: 4DB862B7839037FD

View file

@ -238,11 +238,17 @@ export class BookPlayer {
this.bindEvents();
return this._rendition.book.locations.generate(1024).then(() => {
return this._rendition.book.locations.generate(1024).then(async () => {
if (cancellationToken.shouldCancel) {
return reject();
}
const percentageTicks = options.startPositionTicks / 10000000;
if (percentageTicks !== 0.0) {
const resumeLocation = book.locations.cfiFromPercentage(percentageTicks);
await rendition.display(resumeLocation);
}
this._loaded = true;
epubElem.style.display = 'block';
rendition.on('relocated', (locations) => {