VideoView.AddSubtitleSource(Stream, MediaFormat) Method

Definition

Adds an external subtitle source file (from the provided input stream.

[Android.Runtime.Register("addSubtitleSource", "(Ljava/io/InputStream;Landroid/media/MediaFormat;)V", "GetAddSubtitleSource_Ljava_io_InputStream_Landroid_media_MediaFormat_Handler")]
public virtual void AddSubtitleSource (System.IO.Stream? is, Android.Media.MediaFormat? format);
[<Android.Runtime.Register("addSubtitleSource", "(Ljava/io/InputStream;Landroid/media/MediaFormat;)V", "GetAddSubtitleSource_Ljava_io_InputStream_Landroid_media_MediaFormat_Handler")>]
abstract member AddSubtitleSource : System.IO.Stream * Android.Media.MediaFormat -> unit
override this.AddSubtitleSource : System.IO.Stream * Android.Media.MediaFormat -> unit

Parameters

is
Stream

input stream containing the subtitle data. It will be closed by the media framework.

format
MediaFormat

the format of the subtitle track(s). Must contain at least the mime type (MediaFormat#KEY_MIME) and the language (MediaFormat#KEY_LANGUAGE) of the file. If the file itself contains the language information, specify "und" for the language.

Attributes

Remarks

Adds an external subtitle source file (from the provided input stream.)

Note that a single external subtitle source may contain multiple or no supported tracks in it. If the source contained at least one track in it, one will receive an MediaPlayer#MEDIA_INFO_METADATA_UPDATE info message. Otherwise, if reading the source takes excessive time, one will receive a MediaPlayer#MEDIA_INFO_SUBTITLE_TIMED_OUT message. If the source contained no supported track (including an empty source file or null input stream), one will receive a MediaPlayer#MEDIA_INFO_UNSUPPORTED_SUBTITLE message. One can find the total number of available tracks using MediaPlayer#getTrackInfo() to see what additional tracks become available after this method call.

Java documentation for android.widget.VideoView.addSubtitleSource(java.io.InputStream, android.media.MediaFormat).

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