Skip to content

4.0.0-alpha.3

Pre-release
Pre-release

Choose a tag to compare

@mickael-menu mickael-menu released this 16 Nov 17:54
· 1 commit to develop since this release
a60b0ed

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

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 Timeline lays 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.

Navigator

  • New playback controls and states for the AudioNavigator:
    • stop() stops the playback and ends the audio session.
    • MediaPlaybackState.ended is reported when the playback reaches the end of the publication, by playing or seeking up to it.
    • MediaPlaybackState.playsWhenReady indicates 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.speed and Configuration.pitch adjust the speech rate and pitch, see the user guide.
    • Configuration.voices selects 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.prefersAssistiveTechnologyVoice speaks 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.containerEntriesMetadataPolicy reads the audio files of a remote package, or opens a package without reading them.
    • New AudioMetadataReader to customize how AudioParser reads 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.generatesTableOfContentsFromReadingOrder and ReadiumWebPubParser.Configuration.generatesAudiobookTableOfContentsFromReadingOrder.

Changed

Shared

  • Locator.Locations.fragments is now an array of URLFragment, 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 now async, 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 the AudioSessionUser instead of an AudioSessionToken, which is removed.
    • AudioSessionUser.play() is removed. Conformers must implement the new interruption hooks instead.
  • NowPlayingInfo.Media.chapterNumber moved to NowPlayingInfo.Playback.chapterNumber, see the migration guide.

Navigator

  • NavigatorDelegate.navigator(_:didFailToLoadResourceAt:withError:) takes an AnyURL instead of a RelativeURL, to report resources with an absolute HREF. Implementations must be updated or they are no longer called, see the migration guide.
  • The AudioNavigator is 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:) or seek(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 returns false.
    • AudioNavigatorDelegate.navigator(_:shouldPlayNextResource:) is no longer called after the last resource. Use the new MediaPlaybackState.ended to detect the end of the publication, see the migration guide.
  • The PublicationSpeechSynthesizer picks up its configuration differently:
    • Changing config while 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.voices is spoken with the best voice of its base language, instead of the default voice of the engine, see the migration guide.

Streamer

  • AudioPublicationManifestAugmentor is replaced by AudioMetadataReader, 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 AudioNavigator no 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 .loading instead of .paused during 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 viewport including 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.

What's Changed

New Contributors

Full Changelog: 4.0.0-alpha.2...4.0.0-alpha.3