FileMediaItem
public
class
FileMediaItem
extends MediaItem
java.lang.Object | ||
↳ | androidx.media2.common.MediaItem | |
↳ | androidx.media2.common.FileMediaItem |
Structure for media item for a file.
Users should use FileMediaItem.Builder
to create FileMediaItem
.
You cannot directly send this object across the process through ParcelUtils
. See
MediaItem
for detail.
See also:
Summary
Nested classes | |
---|---|
class |
FileMediaItem.Builder
This Builder class simplifies the creation of a |
Constants | |
---|---|
long |
FD_LENGTH_UNKNOWN
Used when the length of file descriptor is unknown. |
Inherited constants |
---|
Public methods | |
---|---|
long
|
getFileDescriptorLength()
Returns the content length associated with the ParcelFileDescriptor of this media item. |
long
|
getFileDescriptorOffset()
Returns the offset associated with the ParcelFileDescriptor of this media item. |
ParcelFileDescriptor
|
getParcelFileDescriptor()
Returns the ParcelFileDescriptor of this media item. |
Inherited methods | |
---|---|
Constants
FD_LENGTH_UNKNOWN
public static final long FD_LENGTH_UNKNOWN
Used when the length of file descriptor is unknown.
See also:
Constant Value: 576460752303423487 (0x07ffffffffffffff)
Public methods
getFileDescriptorLength
public long getFileDescriptorLength ()
Returns the content length associated with the ParcelFileDescriptor of this media item.
FD_LENGTH_UNKNOWN
means same as the length of source content.
Returns | |
---|---|
long |
the content length associated with the ParcelFileDescriptor of this media item |
getFileDescriptorOffset
public long getFileDescriptorOffset ()
Returns the offset associated with the ParcelFileDescriptor of this media item.
It's meaningful only when it has been set by the MediaItem.Builder
.
Returns | |
---|---|
long |
the offset associated with the ParcelFileDescriptor of this media item |
getParcelFileDescriptor
public ParcelFileDescriptor getParcelFileDescriptor ()
Returns the ParcelFileDescriptor of this media item.
Returns | |
---|---|
ParcelFileDescriptor |
the ParcelFileDescriptor of this media item |
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-02-24 UTC.