Repository navigation
4.0.0-alpha.3
Pre-release
Pre-release
·
1 commit
to develop
since this release
Warning
Minor releases (a.B.c) of the Readium toolkit may now include minor breaking changes, such as dependency upgrades or small API modifications. Major version numbers are reserved for significant architectural changes.
Documentation
- Versioned Documentation – Complete API reference on readium.org.
- Migration Guide – Instructions for upgrading from previous versions.
Changelog
Added
Shared
- New experimental
Publication.timeline()API to locate the current chapter, measure what is left in it and step through the chapters, see the user guide.- A
Timelinelays out the table of contents on the reading order, measured in time, pages or positions depending on the publication. Timeline.segments(maxDepth:)splits the reading order into consecutive segments covering it from start to end, each with its current table of contents entry, if any.
- A
Navigator
- New playback controls and states for the
AudioNavigator:stop()stops the playback and ends the audio session.MediaPlaybackState.endedis reported when the playback reaches the end of the publication, by playing or seeking up to it.MediaPlaybackState.playsWhenReadyindicates whether the player is playing or will as soon as it is ready, e.g. to choose between a play and a pause button.
- New text-to-speech settings in
PublicationSpeechSynthesizer:Configuration.speedandConfiguration.pitchadjust the speech rate and pitch, see the user guide.Configuration.voicesselects a voice per language, so that each utterance of a multilingual publication is spoken with the voice of its language, see the user guide.Configuration.prefersAssistiveTechnologyVoicespeaks with the voice selected in the accessibility settings of the device.voice(for:)returns the voice speaking a language, e.g. to show it in a voice picker.
Streamer
- Audio publications without a manifest, such as a standalone M4B or MP3 file or a container of audio files, now have a table of contents built from the chapters embedded in their audio files.
- The audio files of a ZIP or ZAB package are read too, when the package is stored on the device and its files are stored without compression, see the user guide.
AudioParser.Configuration.containerEntriesMetadataPolicyreads the audio files of a remote package, or opens a package without reading them.- New
AudioMetadataReaderto customize howAudioParserreads the metadata of each audio file.
- Audiobooks without a table of contents now get one from the titles of their reading order resources. Disable it with
AudioParser.Configuration.generatesTableOfContentsFromReadingOrderandReadiumWebPubParser.Configuration.generatesAudiobookTableOfContentsFromReadingOrder.
Changed
Shared
Locator.Locations.fragmentsis now an array ofURLFragment, percent-encoded in memory and in the JSON. Locators serialized by previous versions are still readable, see the migration guide.- The audio session APIs changed, see the migration guide:
AudioSessionManaging.start(with:isPlaying:)is nowasync, so that the audio session is activated off the main thread. It returns when the audio session is ready to play.AudioSessionManaging.end(with:)takes theAudioSessionUserinstead of anAudioSessionToken, which is removed.AudioSessionUser.play()is removed. Conformers must implement the new interruption hooks instead.
NowPlayingInfo.Media.chapterNumbermoved toNowPlayingInfo.Playback.chapterNumber, see the migration guide.
Navigator
NavigatorDelegate.navigator(_:didFailToLoadResourceAt:withError:)takes anAnyURLinstead of aRelativeURL, to report resources with an absolute HREF. Implementations must be updated or they are no longer called, see the migration guide.- The
AudioNavigatoris no longer confined to the current resource when playing and seeking:play()at the end of a resource plays the next one, or restarts from the beginning of the publication after the last one, instead of doing nothing.seek(by:)moves over to the adjacent resources when skipping past the start or the end of the current one, instead of stopping at its bounds.- Seeking up to the end of a resource with
seek(to:)orseek(by:)ends it, like playing up to it.AudioNavigatorDelegate.navigator(_:shouldPlayNextResource:)is called, and the playback is paused at the end of the resource when it returnsfalse. AudioNavigatorDelegate.navigator(_:shouldPlayNextResource:)is no longer called after the last resource. Use the newMediaPlaybackState.endedto detect the end of the publication, see the migration guide.
- The
PublicationSpeechSynthesizerpicks up its configuration differently:- Changing
configwhile playing restarts the current utterance with the new configuration, instead of applying it from the next utterance. - An utterance whose language has no voice in
Configuration.voicesis spoken with the best voice of its base language, instead of the default voice of the engine, see the migration guide.
- Changing
Streamer
AudioPublicationManifestAugmentoris replaced byAudioMetadataReader, which reads the metadata of one audio file, see the migration guide.
Fixed
Shared
- Improved reading local ZIP packages:
- Seeking in an entry stored without compression no longer reads the entry again from its start.
- Fixed a crash when reading a corrupted compressed entry.
- Fixed missing items in the table of contents of some PDFs, when their named destinations are declared as dictionaries.
Navigator
- Fixed audio interruptions:
- The TTS pauses when an audio interruption begins, and resumes when it ends.
- The
AudioNavigatorno longer resumes after an audio interruption if it was paused beforehand.
- Fixed seeking with the
AudioNavigator:- The target of a seek in progress is reported as the current time, instead of the old position until the seek completes.
- The playback is reported as
.loadinginstead of.pausedduring a seek, when it resumes afterwards.
- Fixed several issues in the
EPUBNavigatorViewController:- #632 Fixed decorations being duplicated on both pages when a fixed-layout EPUB is displayed as a two-page spread (contributed by @mvanhorn).
- Fixed a memory leak when quickly turning the pages of a fixed-layout publication (contributed by @deltakosh).
- Fixed the vertical position of fixed-layout pages with uneven content insets. The pages are now centered on the screen, and moved only as far as needed to stay between the insets.
- Fixed reflowable EPUBs being displayed as a single column on the iPhone Duo unfolded in landscape, by porting the responsive columns fix of Readium CSS 1.1.2.
- The current locator is now reported as soon as the current page is loaded, instead of waiting for the preloading of adjacent resources.
- Fixed several issues in the
PDFNavigatorViewController:- Fixed the
viewportincluding the off-screen pages in paginated mode. - Fixed opening on the first page instead of the initial location, when the preferences are submitted while the PDF document is loading.
- Fixed the
What's Changed
- Fix TTS and audiobook audio interruptions handling by @mickael-menu in #904
- Improve concurrency around
AudioSessionManagingby @mickael-menu in #905 - Fix Now Playing info being reset when the chapter changes by @mickael-menu in #906
- Fix seeking with the
AudioNavigatorandNowPlayingby @mickael-menu in #908 - Fix
AudioNavigatorplayback at the end of a resource and after a loading failure by @mickael-menu in #910 - Skip across resources with
AudioNavigator.seek(by:)by @mickael-menu in #911 - Report the end of the publication with
MediaPlaybackState.endedby @mickael-menu in #912 - Add
TemporalSelectorfor Media Fragments by @mickael-menu in #913 - Fix
PDFResourceContentIteratorTestswith Xcode 27 by @mickael-menu in #914 - Apply FXL spread decorations per page instead of broadcasting them by @mvanhorn in #915
- Fix memory leak when quickly turning the pages of a fixed-layout publication by @deltakosh in #917
- Read audio metadata embedded in audio files by @mickael-menu in #918
- Move the audio resource loader to Shared as
ResourceAssetLoaderby @mickael-menu in #921 - Stream ZIP entries in chunks and seek in stored entries by @mickael-menu in #922
- Fix two columns on the iPhone Duo unfolded in landscape by @mickael-menu in #919
- Read the audio metadata of uncompressed ZIP entries and remote files by @mickael-menu in #923
- Add an experimental timeline for audio, EPUB and PDF publications by @mickael-menu in #925
- Fix missing entries in the table of contents of some PDFs by @mickael-menu in #926
- Add speed and pitch settings to
PublicationSpeechSynthesizerby @mickael-menu in #928 - Measure the timeline in pages and positions by @mickael-menu in #932
- Select a TTS voice per language by @mickael-menu in #933
- Cover the whole reading order with timeline segments by @mickael-menu in #936
- Add a user guide for the Timeline API by @mickael-menu in #937
- Fix single pages of a paginated PDF moving vertically when dragged by @mickael-menu in #938
- Fix the vertical position of fixed-layout pages with asymmetric insets by @mickael-menu in #939
- Keep FXL pages centered on the screen with uneven content insets by @mickael-menu in #940
- Keep the fragments of a
Locatorpercent-encoded by @mickael-menu in #916 - Fix opening the initial location of a PDF when preferences are submitted early by @mickael-menu in #941
- 4.0.0-alpha.3 by @mickael-menu in #942
New Contributors
- @mvanhorn made their first contribution in #915
- @deltakosh made their first contribution in #917
Full Changelog: 4.0.0-alpha.2...4.0.0-alpha.3