MediaMetadataRetriever.SetDataSource Method

Definition

Overloads

SetDataSource(FileDescriptor, Int64, Int64)

Sets the data source (FileDescriptor) to use.

SetDataSource(String, IDictionary<String,String>)

Sets the data source (URI) to use.

SetDataSource(Context, Uri)

Sets the data source as a content Uri.

SetDataSource(FileDescriptor)

Sets the data source (FileDescriptor) to use.

SetDataSource(MediaDataSource)

Sets the data source (MediaDataSource) to use.

SetDataSource(String)

Sets the data source (file pathname) to use.

SetDataSource(FileDescriptor, Int64, Int64)

Sets the data source (FileDescriptor) to use.

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

Parameters

fd
FileDescriptor

the FileDescriptor for the file you want to play

offset
Int64

the offset into the file where the data to be played starts, in bytes. It must be non-negative

length
Int64

the length in bytes of the data to be played. It must be non-negative.

Attributes

Exceptions

if the arguments are invalid

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. Call this method before the rest of the methods in this class. This method may be time-consuming.

Java documentation for android.media.MediaMetadataRetriever.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(String, IDictionary<String,String>)

Sets the data source (URI) to use.

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

Parameters

uri
String

The URI of the input media.

headers
IDictionary<String,String>

the headers to be sent together with the request for the data

Attributes

Remarks

Sets the data source (URI) to use. Call this method before the rest of the methods in this class. This method may be time-consuming.

Java documentation for android.media.MediaMetadataRetriever.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(Context, Uri)

Sets the data source as a content Uri.

[Android.Runtime.Register("setDataSource", "(Landroid/content/Context;Landroid/net/Uri;)V", "GetSetDataSource_Landroid_content_Context_Landroid_net_Uri_Handler")]
public virtual void SetDataSource (Android.Content.Context? context, Android.Net.Uri? uri);
[<Android.Runtime.Register("setDataSource", "(Landroid/content/Context;Landroid/net/Uri;)V", "GetSetDataSource_Landroid_content_Context_Landroid_net_Uri_Handler")>]
abstract member SetDataSource : Android.Content.Context * Android.Net.Uri -> unit
override this.SetDataSource : Android.Content.Context * Android.Net.Uri -> unit

Parameters

context
Context

the Context to use when resolving the Uri

uri
Uri

the Content URI of the data you want to play

Attributes

Exceptions

if the Uri is invalid

if the Uri cannot be used due to lack of permission.

Remarks

Sets the data source as a content Uri. Call this method before the rest of the methods in this class. This method may be time-consuming.

Java documentation for android.media.MediaMetadataRetriever.setDataSource(android.content.Context, android.net.Uri).

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", "GetSetDataSource_Ljava_io_FileDescriptor_Handler")]
public virtual void SetDataSource (Java.IO.FileDescriptor? fd);
[<Android.Runtime.Register("setDataSource", "(Ljava/io/FileDescriptor;)V", "GetSetDataSource_Ljava_io_FileDescriptor_Handler")>]
abstract member SetDataSource : Java.IO.FileDescriptor -> unit
override this.SetDataSource : Java.IO.FileDescriptor -> unit

Parameters

fd
FileDescriptor

the FileDescriptor for the file you want to play

Attributes

Exceptions

if the FileDescriptor is invalid

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. Call this method before the rest of the methods in this class. This method may be time-consuming.

Java documentation for android.media.MediaMetadataRetriever.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

SetDataSource(MediaDataSource)

Sets the data source (MediaDataSource) to use.

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

Parameters

dataSource
MediaDataSource

the MediaDataSource for the media you want to play

Attributes

Remarks

Sets the data source (MediaDataSource) to use.

Java documentation for android.media.MediaMetadataRetriever.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(String)

Sets the data source (file pathname) to use.

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

Parameters

path
String

The path, or the URI (doesn't support streaming source currently) of the input media file.

Attributes

Exceptions

If the path is invalid.

Remarks

Sets the data source (file pathname) to use. Call this method before the rest of the methods in this class. This method may be time-consuming.

Java documentation for android.media.MediaMetadataRetriever.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