Dela via


MediaPlayer.AddTimedTextSource Method

Definition

Overloads

AddTimedTextSource(FileDescriptor, String)

Adds an external timed text source file (FileDescriptor).

AddTimedTextSource(String, String)

Adds an external timed text source file.

AddTimedTextSource(Context, Uri, String)

Adds an external timed text source file (Uri).

AddTimedTextSource(FileDescriptor, Int64, Int64, String)

Adds an external timed text file (FileDescriptor).

AddTimedTextSource(FileDescriptor, String)

Adds an external timed text source file (FileDescriptor).

[Android.Runtime.Register("addTimedTextSource", "(Ljava/io/FileDescriptor;Ljava/lang/String;)V", "GetAddTimedTextSource_Ljava_io_FileDescriptor_Ljava_lang_String_Handler")]
public virtual void AddTimedTextSource (Java.IO.FileDescriptor? fd, string? mimeType);
[<Android.Runtime.Register("addTimedTextSource", "(Ljava/io/FileDescriptor;Ljava/lang/String;)V", "GetAddTimedTextSource_Ljava_io_FileDescriptor_Ljava_lang_String_Handler")>]
abstract member AddTimedTextSource : Java.IO.FileDescriptor * string -> unit
override this.AddTimedTextSource : Java.IO.FileDescriptor * string -> unit

Parameters

fd
FileDescriptor

the FileDescriptor for the file you want to play

mimeType
String

The mime type of the file. Must be one of the mime types listed above.

Attributes

Exceptions

if the mimeType is not supported.

if called in an invalid state.

Remarks

Adds an external timed text source file (FileDescriptor).

It is the caller's responsibility to close the file descriptor. It is safe to do so as soon as this call returns.

Currently supported format is SubRip. Note that a single external timed text source may contain multiple tracks in it. One can find the total number of available tracks using #getTrackInfo() to see what additional tracks become available after this method call.

Java documentation for android.media.MediaPlayer.addTimedTextSource(java.io.FileDescriptor, 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

AddTimedTextSource(String, String)

Adds an external timed text source file.

[Android.Runtime.Register("addTimedTextSource", "(Ljava/lang/String;Ljava/lang/String;)V", "GetAddTimedTextSource_Ljava_lang_String_Ljava_lang_String_Handler")]
public virtual void AddTimedTextSource (string? path, string? mimeType);
[<Android.Runtime.Register("addTimedTextSource", "(Ljava/lang/String;Ljava/lang/String;)V", "GetAddTimedTextSource_Ljava_lang_String_Ljava_lang_String_Handler")>]
abstract member AddTimedTextSource : string * string -> unit
override this.AddTimedTextSource : string * string -> unit

Parameters

path
String

The file path of external timed text source file.

mimeType
String

The mime type of the file. Must be one of the mime types listed above.

Attributes

Exceptions

if the file cannot be accessed or is corrupted.

if the mimeType is not supported.

if called in an invalid state.

Remarks

Adds an external timed text source file.

Currently supported format is SubRip with the file extension .srt, case insensitive. Note that a single external timed text source may contain multiple tracks in it. One can find the total number of available tracks using #getTrackInfo() to see what additional tracks become available after this method call.

Java documentation for android.media.MediaPlayer.addTimedTextSource(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

AddTimedTextSource(Context, Uri, String)

Adds an external timed text source file (Uri).

[Android.Runtime.Register("addTimedTextSource", "(Landroid/content/Context;Landroid/net/Uri;Ljava/lang/String;)V", "GetAddTimedTextSource_Landroid_content_Context_Landroid_net_Uri_Ljava_lang_String_Handler")]
public virtual void AddTimedTextSource (Android.Content.Context? context, Android.Net.Uri? uri, string? mimeType);
[<Android.Runtime.Register("addTimedTextSource", "(Landroid/content/Context;Landroid/net/Uri;Ljava/lang/String;)V", "GetAddTimedTextSource_Landroid_content_Context_Landroid_net_Uri_Ljava_lang_String_Handler")>]
abstract member AddTimedTextSource : Android.Content.Context * Android.Net.Uri * string -> unit
override this.AddTimedTextSource : Android.Content.Context * Android.Net.Uri * string -> unit

Parameters

context
Context

the Context to use when resolving the Uri

uri
Uri

the Content URI of the data you want to play

mimeType
String

The mime type of the file. Must be one of the mime types listed above.

Attributes

Exceptions

if the file cannot be accessed or is corrupted.

if the mimeType is not supported.

if called in an invalid state.

Remarks

Adds an external timed text source file (Uri).

Currently supported format is SubRip with the file extension .srt, case insensitive. Note that a single external timed text source may contain multiple tracks in it. One can find the total number of available tracks using #getTrackInfo() to see what additional tracks become available after this method call.

Java documentation for android.media.MediaPlayer.addTimedTextSource(android.content.Context, android.net.Uri, 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

AddTimedTextSource(FileDescriptor, Int64, Int64, String)

Adds an external timed text file (FileDescriptor).

[Android.Runtime.Register("addTimedTextSource", "(Ljava/io/FileDescriptor;JJLjava/lang/String;)V", "GetAddTimedTextSource_Ljava_io_FileDescriptor_JJLjava_lang_String_Handler")]
public virtual void AddTimedTextSource (Java.IO.FileDescriptor? fd, long offset, long length, string? mime);
[<Android.Runtime.Register("addTimedTextSource", "(Ljava/io/FileDescriptor;JJLjava/lang/String;)V", "GetAddTimedTextSource_Ljava_io_FileDescriptor_JJLjava_lang_String_Handler")>]
abstract member AddTimedTextSource : Java.IO.FileDescriptor * int64 * int64 * string -> unit
override this.AddTimedTextSource : Java.IO.FileDescriptor * int64 * int64 * string -> 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

length
Int64

the length in bytes of the data to be played

mime
String

The mime type of the file. Must be one of the mime types listed above.

Attributes

Exceptions

if the mimeType is not supported.

if called in an invalid state.

Remarks

Adds an external timed text file (FileDescriptor).

It is the caller's responsibility to close the file descriptor. It is safe to do so as soon as this call returns.

Currently supported format is SubRip. Note that a single external timed text source may contain multiple tracks in it. One can find the total number of available tracks using #getTrackInfo() to see what additional tracks become available after this method call.

Java documentation for android.media.MediaPlayer.addTimedTextSource(java.io.FileDescriptor, long, long, 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