Język

MediaPlayer.SetDataSourceAsync Method

Definition

Overloads

Name Description
SetDataSourceAsync(Context, Uri, IDictionary<String,String>, IList<HttpCookie>)

Configures URI-based media input with headers and cookies on a background task.

SetDataSourceAsync(FileDescriptor, Int64, Int64)

Configures a file-descriptor media region on a background task.

SetDataSourceAsync(Context, Uri, IDictionary<String,String>)

Configures URI-based media input with request headers on a background task.

SetDataSourceAsync(Context, Uri)

Configures URI-based media input on a background task.

SetDataSourceAsync(MediaDataSource)

Configures a callback-based media source on a background task.

SetDataSourceAsync(FileDescriptor)

Configures media from a file descriptor on a background task.

SetDataSourceAsync(AssetFileDescriptor)

Configures an asset-based media source on a background task.

SetDataSourceAsync(String)

Configures path-based media input on a background task.

SetDataSourceAsync(Context, Uri, IDictionary<String,String>, IList<HttpCookie>)

Configures URI-based media input with headers and cookies on a background task.

public System.Threading.Tasks.Task SetDataSourceAsync(Android.Content.Context context, Android.Net.Uri uri, System.Collections.Generic.IDictionary<string,string>? headers, System.Collections.Generic.IList<Java.Net.HttpCookie>? cookies);
member this.SetDataSourceAsync : Android.Content.Context * Android.Net.Uri * System.Collections.Generic.IDictionary<string, string> * System.Collections.Generic.IList<Java.Net.HttpCookie> -> System.Threading.Tasks.Task

Parameters

context
Context

The context used when resolving the media URI.

uri
Uri

The URI identifying the media source.

headers
IDictionary<String,String>

Optional request headers. Supply cookies through cookies, not this header map.

cookies
IList<HttpCookie>

A cookie list, or null. With a non-null list, any installed default cookie handler must be a CookieManager.

Returns

A task representing completion of the synchronous source setup call with the supplied headers and cookies.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

SetDataSourceAsync(FileDescriptor, Int64, Int64)

Configures a file-descriptor media region on a background task.

public System.Threading.Tasks.Task SetDataSourceAsync(Java.IO.FileDescriptor? fd, long offset, long length);
member this.SetDataSourceAsync : Java.IO.FileDescriptor * int64 * int64 -> System.Threading.Tasks.Task

Parameters

fd
FileDescriptor

The seekable descriptor containing the media region.

offset
Int64

The starting byte offset of the media region within the file.

length
Int64

The number of bytes in the media region.

Returns

A task representing completion of the synchronous file-region source setup call.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

SetDataSourceAsync(Context, Uri, IDictionary<String,String>)

Configures URI-based media input with request headers on a background task.

public System.Threading.Tasks.Task SetDataSourceAsync(Android.Content.Context context, Android.Net.Uri uri, System.Collections.Generic.IDictionary<string,string>? headers);
member this.SetDataSourceAsync : Android.Content.Context * Android.Net.Uri * System.Collections.Generic.IDictionary<string, string> -> System.Threading.Tasks.Task

Parameters

context
Context

The context used when resolving the media URI.

uri
Uri

The URI identifying the media source.

headers
IDictionary<String,String>

Optional HTTP headers for a network request.

Returns

A task representing completion of the synchronous URI-source setup call with the supplied headers.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

SetDataSourceAsync(Context, Uri)

Configures URI-based media input on a background task.

public System.Threading.Tasks.Task SetDataSourceAsync(Android.Content.Context context, Android.Net.Uri uri);
member this.SetDataSourceAsync : Android.Content.Context * Android.Net.Uri -> System.Threading.Tasks.Task

Parameters

context
Context

The context used when resolving the media URI.

uri
Uri

The URI identifying the media source.

Returns

A task representing completion of the synchronous URI-based source setup call.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

SetDataSourceAsync(MediaDataSource)

Configures a callback-based media source on a background task.

public System.Threading.Tasks.Task SetDataSourceAsync(Android.Media.MediaDataSource? dataSource);
member this.SetDataSourceAsync : Android.Media.MediaDataSource -> System.Threading.Tasks.Task

Parameters

dataSource
MediaDataSource

The callback-based source that supplies the media data.

Returns

A task representing completion of the synchronous custom-source setup call.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

SetDataSourceAsync(FileDescriptor)

Configures media from a file descriptor on a background task.

public System.Threading.Tasks.Task SetDataSourceAsync(Java.IO.FileDescriptor? fd);
member this.SetDataSourceAsync : Java.IO.FileDescriptor -> System.Threading.Tasks.Task

Parameters

fd
FileDescriptor

The seekable file descriptor to use during media-source setup.

Returns

A task representing completion of the synchronous file-descriptor source setup call.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

SetDataSourceAsync(AssetFileDescriptor)

Configures an asset-based media source on a background task.

public System.Threading.Tasks.Task SetDataSourceAsync(Android.Content.Res.AssetFileDescriptor afd);
member this.SetDataSourceAsync : Android.Content.Res.AssetFileDescriptor -> System.Threading.Tasks.Task

Parameters

afd
AssetFileDescriptor

The asset descriptor; its declared media range is used when a length is available.

Returns

A task representing completion of the synchronous asset-source setup call.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

SetDataSourceAsync(String)

Configures path-based media input on a background task.

public System.Threading.Tasks.Task SetDataSourceAsync(string? path);
member this.SetDataSourceAsync : string -> System.Threading.Tasks.Task

Parameters

path
String

A media file path or HTTP/RTSP stream URL.

Returns

A task representing completion of the synchronous path-based source setup call.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to