PlaceHolderRepository

This is a simple placeholder repository that will return no information. It can be used during development to be able to already lay out UI elements or setup and text compile NewPlayer without actually having a functioning media repository.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open suspend override fun getChapters(item: String): List<Chapter>

This should return the chapters associated with an item. If an item does not have chapters you may return an empty list.

Link copied to clipboard

Supply a custom HttpDataSource.Factory. This is important for Youtube.

Link copied to clipboard
open suspend override fun getMetaInfo(item: String): MediaMetadata

Get MediaMetadata information for a certain item. Please refer to the media3 documentation for MediaMetadata.

Link copied to clipboard
open suspend override fun getPreviewThumbnail(item: String, timestampInMs: Long): Nothing?

This should return a thumbnail associated with the provided timestamp of the provided item. The reason this function does not simply return a Uri to a bitmap is that some platforms like Youtube provide the preview thumbnail as a collage of multiple thumbnails within one jpeg file. It is then the task of the client to crop this jpeg to only show the piece of that image that depicts the thumbnail for the given timestamp.

Link copied to clipboard

The amount of review thumbnails an item provides. This is used to tell async requesting tools how much requests to spawn to get all thumbnails. It's also used to calculate the correct keys for the caching repository.

Link copied to clipboard

Returns the information of the repository. Please see the documentation for RepoMetaInfo for more details.

Link copied to clipboard
open suspend override fun getStreams(item: String): List<Stream>

This should return all the Streams associated with an item.

Link copied to clipboard
open suspend override fun getSubtitles(item: String): List<Subtitle>

This should return all the Subtitles associated with an item.

Link copied to clipboard
open suspend override fun getTimestampLink(item: String, timestampInSeconds: Long): String

Should return the link to a certain timestamp of the video/audio stream associated by item. An example for a timestamp link would be this (don't watch it though its dangerous): https://www.youtube.com/watch?v=H8ZH_mkfPUY&t=19s