getSize

abstract fun getSize(context: Context): Long

Returns the size of the MediaItem in bytes.

Return

The size of the MediaItem in bytes.

Parameters

context

Any Context, used to get a ContentResolver

Throws

May throw RuntimeExceptions when media could not be retrieved / no media file has been found for the given mediaItem (e.g. just about to be stored). In short: library consumers should handle when this method throws an Exception.