Android7.0中文文件(API)--- VideoView
VideoView
Displays a video file. The VideoView class can load images from various sources (such as resources or content providers), takes care of computing its measurement from the video so that it can be used in any layout manager, and provides various display options
such as scaling and tinting.
播放一個視訊檔案。VideoView類可以從不同的源載入視訊(如資源或content provider),並負責計算從視訊中得到的尺寸,這樣它就可以在任何佈局管理器中使用,並提供各種顯示選項,例如縮放和著色。
Note: VideoView does not retain its full state when going into the background. In particular, it does not restore the current play state, play position, selected tracks, or any subtitle tracks added via
. Applications should save and restore these on their
own in and
.
注意:VideoView進入後臺後,並不保留它的全部狀態。
Also note that the audio session id (from ) may change from its previously returned value when the
VideoView is restored.
同樣,請注意音訊會話id()也可能在VideoView恢復時改變先前返回的值。
摘要
Public方法 |
|
---|---|
void |
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.
|
void |
draw(Canvas
canvas)
Manually render this view (and all of its children) to the given Canvas. |
Return the class name of this object to be used for accessibility purposes. |
|
int |
Get the audio session id for the player used by this VideoView. |
boolean |
Implement this method to handle touch screen motion events. |
boolean |
Implement this method to handle trackball motion events. |
void |
pause()
|
int |
resolveAdjustedSize(int desiredSize, int measureSpec)
|
void |
seekTo(int msec)
|
void |
Sets which type of audio focus will be requested during the playback, or configures playback to not request audio focus.
|
void |
Register a callback to be invoked when the end of a media file has been reached during playback.
|
void |
Register a callback to be invoked when an error occurs during playback or setup.
|
void |
Register a callback to be invoked when an informational event occurs during playback or setup.
|
void |
Register a callback to be invoked when the media file is loaded and ready to go.
|
void |
Sets video path. |
void |
Sets video URI using specific headers. |
void |
Sets video URI. |
void |
start()
|