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:
parent
553bbee6fe
commit
d5991348c2
1 changed files with 7 additions and 1 deletions
|
@ -238,11 +238,17 @@ export class BookPlayer {
|
||||||
|
|
||||||
this.bindEvents();
|
this.bindEvents();
|
||||||
|
|
||||||
return this._rendition.book.locations.generate(1024).then(() => {
|
return this._rendition.book.locations.generate(1024).then(async () => {
|
||||||
if (cancellationToken.shouldCancel) {
|
if (cancellationToken.shouldCancel) {
|
||||||
return reject();
|
return reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const percentageTicks = options.startPositionTicks / 10000000;
|
||||||
|
if (percentageTicks !== 0.0) {
|
||||||
|
const resumeLocation = book.locations.cfiFromPercentage(percentageTicks);
|
||||||
|
await rendition.display(resumeLocation);
|
||||||
|
}
|
||||||
|
|
||||||
this._loaded = true;
|
this._loaded = true;
|
||||||
epubElem.style.display = 'block';
|
epubElem.style.display = 'block';
|
||||||
rendition.on('relocated', (locations) => {
|
rendition.on('relocated', (locations) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue