//readium-streamer/org.readium.r2.streamer/Streamer
Streamer¶
[androidJvm]\ class Streamer(context: Context, parsers: List<PublicationParser> = emptyList(), ignoreDefaultParsers: Boolean = false, contentProtections: List<ContentProtection> = emptyList(), archiveFactory: ArchiveFactory = DefaultArchiveFactory(), pdfFactory: PdfDocumentFactory<*>? = null, httpClient: DefaultHttpClient = DefaultHttpClient(), onCreatePublication: Publication.Builder.() -> Unit = {})
Opens a Publication using a list of parsers.
The Streamer is configured to use Readium's default parsers, which you can bypass using ignoreDefaultParsers. However, you can provide additional parsers which will take precedence over the default ones. This can also be used to provide an alternative configuration of a default parser.
Parameters¶
androidJvm
context | Application context. |
parsers | Parsers used to open a publication, in addition to the default parsers. |
ignoreDefaultParsers | When true, only parsers provided in parsers will be used. |
archiveFactory | Opens an archive (e.g. ZIP, RAR), optionally protected by credentials. |
pdfFactory | Parses a PDF document, optionally protected by password. |
httpClient | Service performing HTTP requests. |
onCreatePublication | Called on every parsed Publication.Builder. It can be used to modify the Manifest, the root Fetcher or the list of service factories of a Publication. |
Constructors¶
Streamer | [androidJvm] fun Streamer(context: Context, parsers: List<PublicationParser> = emptyList(), ignoreDefaultParsers: Boolean = false, contentProtections: List<ContentProtection> = emptyList(), archiveFactory: ArchiveFactory = DefaultArchiveFactory(), pdfFactory: PdfDocumentFactory<*>? = null, httpClient: DefaultHttpClient = DefaultHttpClient(), onCreatePublication: Publication.Builder.() -> Unit = {}) |
Functions¶
Name | Summary |
---|---|
open | [androidJvm] suspend fun open(asset: PublicationAsset, credentials: String? = null, allowUserInteraction: Boolean, sender: Any? = null, onCreatePublication: Publication.Builder.() -> Unit = {}, warnings: WarningLogger? = null): PublicationTry<Publication> Parses a Publication from the given asset. |