Introduction to common methods of Android MediaPlayer
Method: Create (context context, URI Uri)
Explanation: A static method that creates a multimedia player from a URI.
Method: Create (context context, int resid)
Explanation: Static method, creating a multimedia player with resource ID
Method: Create (context context, Uri Uri, Surfaceholder holder)
Explanation: A static method that creates a multimedia player by URI and specifying Surfaceholder "abstract class"
Method: GetCurrentPosition ()
Explanation: Return Int to get the current playback position
Method: Getduration ()
Explanation: Return Int, time to get the file
Method: Getvideoheight ()
Explanation: Return Int to get the height of the video
Method: Getvideowidth ()
Explanation: Return Int to get the width of the video
Method: Islooping ()
Explanation: Returns Boolean, whether to loop playback
Method: IsPlaying ()
Explanation: Returns a Boolean, whether it is playing
Method: Pause ()
Explanation: No return value, pause
Method: Prepare ()
Explanation: No return value, ready to synchronize
Method: Prepareasync ()
Explanation: No return value, ready for asynchronous
Method: Release ()
Explanation: No return value, Release MediaPlayer object
Method: Reset ()
Explanation: No return value, reset MediaPlayer object
Method: Seekto (int msec)
Explanation: No return value, specifying the playback position (time in milliseconds)
Method: Setaudiostreamtype (int streamtype)
Explanation: No return value, specifying the type of streaming media
Method: Setdatasource (String path)
Explanation: No return value, set multimedia data source "according to Path"
Method: Setdatasource (filedescriptor fd, long offset, long length)
Explanation: No return value, set multimedia data source "according to FileDescriptor"
Method: Setdatasource (FileDescriptor FD)
Explanation: No return value, set multimedia data source "according to FileDescriptor"
Method: Setdatasource (context context, URI Uri)
Explanation: No return value, set multimedia data source "according to Uri"
Method: Setdisplay (Surfaceholder sh)
Explanation: No return value, set to use Surfaceholder to display multimedia
Method: Setlooping (Boolean looping)
Explanation: No return value, setting whether to loop playback
Event: Setonbufferingupdatelistener (Mediaplayer.onbufferingupdatelistener Listener)
Explanation: Monitoring events, buffer monitoring of network streaming media
Event: Setoncompletionlistener (Mediaplayer.oncompletionlistener Listener)
Explanation: Listening events, network streaming media playback end monitoring
Event: Setonerrorlistener (Mediaplayer.onerrorlistener Listener)
Explanation: Listen for events, set error messages to listen
Event: Setonvideosizechangedlistener (Mediaplayer.onvideosizechangedlistener Listener)
Explanation: Monitoring events, video size monitoring
Method: Setscreenonwhileplaying (Boolean Screenon)
Explanation: No return value, setting whether to use Surfaceholder display
Method: SetVolume (float leftvolume, float rightvolume)
Explanation: No return value, set volume
Method: Start ()
Explanation: No return value to start playback
Method: Stop ()
Explanation: No return value, stop playback
Introduction to common methods of Android MediaPlayer