语言

MediaExtractor.SetDataSourceAsync 方法

定义

重载

名称 说明
SetDataSourceAsync(AssetFileDescriptor)

在后台任务上配置基于资产的媒体源。

SetDataSourceAsync(MediaDataSource)

在后台任务上配置基于回调的媒体源。

SetDataSourceAsync(FileDescriptor)

从后台任务的文件描述符配置媒体。

SetDataSourceAsync(String)

在后台任务上配置基于路径的媒体输入。

SetDataSourceAsync(String, IDictionary<String,String>)

使用后台任务上的请求标头配置基于路径的媒体输入。

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

在后台任务上配置基于 URI 的媒体输入。

SetDataSourceAsync(FileDescriptor, Int64, Int64)

在后台任务上配置文件描述符媒体区域。

SetDataSourceAsync(AssetFileDescriptor)

在后台任务上配置基于资产的媒体源。

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

参数

afd
AssetFileDescriptor

资产描述符;当长度可用时,将使用其声明的范围。

返回

表示资产描述符源设置完成的任务。

注解

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

SetDataSourceAsync(MediaDataSource)

在后台任务上配置基于回调的媒体源。

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

参数

dataSource
MediaDataSource

提供媒体字节的基于回调的源。

返回

表示完成自定义数据源设置的任务。

注解

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

SetDataSourceAsync(FileDescriptor)

从后台任务的文件描述符配置媒体。

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

参数

fd
FileDescriptor

媒体数据的可查找描述符。

返回

表示完成文件描述符源设置的任务。

注解

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

SetDataSourceAsync(String)

在后台任务上配置基于路径的媒体输入。

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

参数

path
String

媒体文件路径或 HTTP URL。

返回

表示完成基于路径的源设置的任务。

注解

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

SetDataSourceAsync(String, IDictionary<String,String>)

使用后台任务上的请求标头配置基于路径的媒体输入。

public System.Threading.Tasks.Task SetDataSourceAsync(string path, System.Collections.Generic.IDictionary<string,string>? headers);
member this.SetDataSourceAsync : string * System.Collections.Generic.IDictionary<string, string> -> System.Threading.Tasks.Task

参数

path
String

媒体文件路径或 HTTP URL。

headers
IDictionary<String,String>

HTTP 请求标头,或 null 不需要额外的标头时。

返回

一个任务,表示使用提供的标头完成源设置。

注解

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

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

在后台任务上配置基于 URI 的媒体输入。

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

参数

context
Context

需要内容提供程序解析时要使用的上下文。

uri
Uri

标识媒体数据的 URI。

headers
IDictionary<String,String>

网络源的可选 HTTP 标头。

返回

表示完成基于 URI 的源设置的任务。

注解

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

SetDataSourceAsync(FileDescriptor, Int64, Int64)

在后台任务上配置文件描述符媒体区域。

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

参数

fd
FileDescriptor

包含媒体数据的可查找描述符。

offset
Int64

文件中媒体区域的起始字节偏移量。

length
Int64

媒体区域中的字节数。

返回

表示完成文件区域源设置的任务。

注解

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于