SOCommMediaClient
Interface for a client that handles all media-related topics with a remote SOComm device. This can be seen as a facade / middleware to communicate with the PictureManager of the SOComm device. To initialize / de-initialize this client, call start / stop respectively. After start has been called, this client will wait until a connection to the SOComm device is established (this client will not establish the connection itself, the connection needs to be established on the provided com.swarovskioptik.comm.SOCommOutsideAPI provided to the SOCommMediaClientBuilder when creating a new SOCommMediaClient). After the connection has been established, the respective com.swarovskioptik.comm.definition.SOContexts will be used in order to receive either picture or video thumbnails. On connection interruptions / disconnect & reconnect events, the this client will automatically recover.
The connectionState will emit information about the state this SOCommMediaClient is in in respect to the connection to the SOComm device.
The availableThumbnails will emit an always up-to-date list of media files that are available on the SOComm device but not yet on this smartphone (so they are ready to be downloaded).
The availableMedia will emit the basically the same as availableThumbnails, but only provides the file-names, and not the thumbnails of the items, but therefore may emit an updated list sooner than availableThumbnails).
The localMedia will emit always to updated list of media files that are currently available on the given smartphone.
Using turnOnMediaDownload (and the respective counterpart turnOffMediaDownload) a WIFI connection will be established to download the available files on the SOComm device to the smartphone.
Using downloadMedia will basically turnOnMediaDownload, emit a progress of the download, and will turnOffMediaDownload again.
This is to be used in combination with an instance of com.swarovskioptik.comm.SOCommOutsideAPI.
Use the SOCommMediaClientBuilder to create new instances of this client. One client can either serve pictures, videos or both at the same time. Check SOCommMediaClientBuilder.mediaTypes for that. However, multiple instances of this client (e.g. one for pictures and one for videos) can also be used at the same time.
Types
An enum containing all possible states this client can be in:
A somewhat public API to insert media items from an external source into this MediaClient.
Properties
The emitted Observable emits a list of available media items on the remote device. The list will only retrieve new items / updates, when an active connection to a remote device is established (i.e. when this MediaClients connectionState is in the ConnectedToPreview or ConnectedToMediaDownload state).
The emitted Observable emits a new list at any change of available media items on the remote device. The list will only retrieve new items / updates, when an active connection to a remote device is established (i.e. when this MediaClients connectionState is in the ConnectedToPreview or ConnectedToMediaDownload state).
The emitted ConnectionState states the state this client is currently in.
Returns an Observable which contains the list of files (and updates thereof) of locally stored media files.
Functions
Deletes all given localMediaItems from the local storage. This is a permanent delete that cannot be undone.
Deletes a given localMediaItem from the local storage. This is a permanent delete that cannot be undone.
Downloads all available media items in full resolution, so that all items currently available as thumbnails (or only as filenames) will be stored locally and made accessible as localMedia.
Returns an implementation of ExternalSource for the given mediaType.
Returns a MediaItemSource for the given mediaItem. This method should be used when trying to get the content of a MediaItem.
Stops the automatic downloading of media files (pictures or videos, depending on the MediaType) that has been started by calling turnOnMediaDownload.
Initiates the download of all media files (pictures or videos, depending on the MediaType) available on the remote device.