MediaExtractor.SetDataSource Method

Definition

Overloads

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

Sets the data source as a content Uri.

SetDataSource(String, IDictionary<String,String>)

Sets the data source (file-path or http URL) to use.

SetDataSource(String)

Sets the data source (file-path or http URL) to use.

SetDataSource(FileDescriptor, Int64, Int64)

Sets the data source (FileDescriptor) to use.

SetDataSource(MediaDataSource)

Sets the data source (MediaDataSource) to use.

SetDataSource(AssetFileDescriptor)

Sets the data source (AssetFileDescriptor) to use.

SetDataSource(FileDescriptor)

Sets the data source (FileDescriptor) to use.

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

Sets the data source as a content Uri.

[Android.Runtime.Register("setDataSource", "(Landroid/content/Context;Landroid/net/Uri;Ljava/util/Map;)V", "")]
public void SetDataSource (Android.Content.Context context, Android.Net.Uri uri, System.Collections.Generic.IDictionary<string,string>? headers);
[<Android.Runtime.Register("setDataSource", "(Landroid/content/Context;Landroid/net/Uri;Ljava/util/Map;)V", "")>]
member this.SetDataSource : Android.Content.Context * Android.Net.Uri * System.Collections.Generic.IDictionary<string, string> -> unit

Parameters

context
Context

the Context to use when resolving the Uri

uri
Uri

the Content URI of the data you want to extract from.

        &lt;p&gt;When <code data-dev-comment-type="c">uri</code> refers to a network file the
        <code data-dev-comment-type="c">android.Manifest.permission#INTERNET</code> permission is required.
headers
IDictionary<String,String>

the headers to be sent together with the request for the data. This can be null if no specific headers are to be sent with the request.

Attributes

Remarks

Sets the data source as a content Uri.

Java documentation for android.media.MediaExtractor.setDataSource(android.content.Context, android.net.Uri, java.util.Map<java.lang.String, java.lang.String>).

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

SetDataSource(String, IDictionary<String,String>)

Sets the data source (file-path or http URL) to use.

[Android.Runtime.Register("setDataSource", "(Ljava/lang/String;Ljava/util/Map;)V", "")]
public void SetDataSource (string path, System.Collections.Generic.IDictionary<string,string>? headers);
[<Android.Runtime.Register("setDataSource", "(Ljava/lang/String;Ljava/util/Map;)V", "")>]
member this.SetDataSource : string * System.Collections.Generic.IDictionary<string, string> -> unit

Parameters

path
String

the path of the file, or the http URL

        &lt;p&gt;When <code data-dev-comment-type="c">path</code> refers to a network file the
        <code data-dev-comment-type="c">android.Manifest.permission#INTERNET</code> permission is required.
headers
IDictionary<String,String>

the headers associated with the http request for the stream you want to play. This can be null if no specific headers are to be sent with the request.

Attributes

Remarks

Sets the data source (file-path or http URL) to use.

Java documentation for android.media.MediaExtractor.setDataSource(java.lang.String, java.util.Map<java.lang.String, java.lang.String>).

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

SetDataSource(String)

Sets the data source (file-path or http URL) to use.

[Android.Runtime.Register("setDataSource", "(Ljava/lang/String;)V", "")]
public void SetDataSource (string path);
[<Android.Runtime.Register("setDataSource", "(Ljava/lang/String;)V", "")>]
member this.SetDataSource : string -> unit

Parameters

path
String

the path of the file, or the http URL of the stream

        &lt;p&gt;When <code data-dev-comment-type="c">path</code> refers to a local file, the file may actually be opened by a
        process other than the calling application.  This implies that the pathname
        should be an absolute path (as any other process runs with unspecified current working
        directory), and that the pathname should reference a world-readable file.
        As an alternative, the application could first open the file for reading,
        and then use the file descriptor form <code data-dev-comment-type="c">#setDataSource(FileDescriptor)</code>.

        &lt;p&gt;When <code data-dev-comment-type="c">path</code> refers to a network file the
        <code data-dev-comment-type="c">android.Manifest.permission#INTERNET</code> permission is required.
Attributes

Exceptions

Remarks

Sets the data source (file-path or http URL) to use.

Java documentation for android.media.MediaExtractor.setDataSource(java.lang.String).

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

SetDataSource(FileDescriptor, Int64, Int64)

Sets the data source (FileDescriptor) to use.

[Android.Runtime.Register("setDataSource", "(Ljava/io/FileDescriptor;JJ)V", "")]
public void SetDataSource (Java.IO.FileDescriptor fd, long offset, long length);
[<Android.Runtime.Register("setDataSource", "(Ljava/io/FileDescriptor;JJ)V", "")>]
member this.SetDataSource : Java.IO.FileDescriptor * int64 * int64 -> unit

Parameters

fd
FileDescriptor

the FileDescriptor for the file you want to extract from.

offset
Int64

the offset into the file where the data to be extracted starts, in bytes

length
Int64

the length in bytes of the data to be extracted

Attributes

Exceptions

Remarks

Sets the data source (FileDescriptor) to use. The FileDescriptor must be seekable (N.B. a LocalSocket is not seekable). It is the caller's responsibility to close the file descriptor. It is safe to do so as soon as this call returns.

Java documentation for android.media.MediaExtractor.setDataSource(java.io.FileDescriptor, long, long).

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

SetDataSource(MediaDataSource)

Sets the data source (MediaDataSource) to use.

[Android.Runtime.Register("setDataSource", "(Landroid/media/MediaDataSource;)V", "", ApiSince=23)]
public void SetDataSource (Android.Media.MediaDataSource dataSource);
[<Android.Runtime.Register("setDataSource", "(Landroid/media/MediaDataSource;)V", "", ApiSince=23)>]
member this.SetDataSource : Android.Media.MediaDataSource -> unit

Parameters

dataSource
MediaDataSource

the MediaDataSource for the media you want to extract from

Attributes

Remarks

Sets the data source (MediaDataSource) to use.

Java documentation for android.media.MediaExtractor.setDataSource(android.media.MediaDataSource).

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

SetDataSource(AssetFileDescriptor)

Sets the data source (AssetFileDescriptor) to use.

[Android.Runtime.Register("setDataSource", "(Landroid/content/res/AssetFileDescriptor;)V", "", ApiSince=24)]
public void SetDataSource (Android.Content.Res.AssetFileDescriptor afd);
[<Android.Runtime.Register("setDataSource", "(Landroid/content/res/AssetFileDescriptor;)V", "", ApiSince=24)>]
member this.SetDataSource : Android.Content.Res.AssetFileDescriptor -> unit

Parameters

afd
AssetFileDescriptor

the AssetFileDescriptor for the file you want to extract from.

Attributes

Remarks

Sets the data source (AssetFileDescriptor) to use. It is the caller's responsibility to close the file descriptor. It is safe to do so as soon as this call returns.

Java documentation for android.media.MediaExtractor.setDataSource(android.content.res.AssetFileDescriptor).

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

SetDataSource(FileDescriptor)

Sets the data source (FileDescriptor) to use.

[Android.Runtime.Register("setDataSource", "(Ljava/io/FileDescriptor;)V", "")]
public void SetDataSource (Java.IO.FileDescriptor fd);
[<Android.Runtime.Register("setDataSource", "(Ljava/io/FileDescriptor;)V", "")>]
member this.SetDataSource : Java.IO.FileDescriptor -> unit

Parameters

fd
FileDescriptor

the FileDescriptor for the file you want to extract from.

Attributes

Exceptions

Remarks

Sets the data source (FileDescriptor) to use. It is the caller's responsibility to close the file descriptor. It is safe to do so as soon as this call returns.

Java documentation for android.media.MediaExtractor.setDataSource(java.io.FileDescriptor).

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