Builder
class Builder : MediaItem.Builder
This Builder class simplifies the creation of a UriMediaItem
object.
Summary
Public constructors |
Creates a new Builder object with a content Uri.
|
Creates a new Builder object with a content Uri.
|
Public constructors
<init>
Builder(@NonNull uri: Uri)
Creates a new Builder object with a content Uri.
Parameters |
uri |
Uri: the Content URI of the data you want to play |
<init>
Builder(
@NonNull uri: Uri,
@Nullable headers: MutableMap<String!, String!>?,
@Nullable cookies: MutableList<HttpCookie!>?)
Creates a new Builder object with a content Uri. To provide cookies for the subsequent HTTP requests, you can install your own default cookie handler and use other variants of setMediaItem APIs instead.
Note that the cross domain redirection is allowed by default, but that can be changed with key/value pairs through the headers parameter with "android-allow-cross-domain-redirect" as the key and "0" or "1" as the value to disallow or allow cross domain redirection.
Parameters |
uri |
Uri: the Content URI of the data you want to play |
headers |
MutableMap<String!, String!>?: the headers to be sent together with the request for the data The headers must not include cookies. Instead, use the cookies param. |
cookies |
MutableList<HttpCookie!>?: the cookies to be sent together with the request |
Exceptions |
IllegalArgumentException |
if the cookie handler is not of CookieManager type when cookies are provided. |
Public methods