The MediaPlayer interface for Android encapsulates the functionality and behavior of a media player.
TVSDK provides one implementation of the
MediaPlayer interface, the
DefaultMediaPlayer class. When you need video playback functionality, instantiate
Interact with the
DefaultMediaPlayer instance only with the methods that are exposed by the
Instantiate a MediaPlayer using the public
DefaultMediaPlayer.create factory method, passing a Java Android application context object.
public static MediaPlayer create(Context context)
MediaPlayer.getView to get a reference to the
MediaPlayerView getView() throws IllegalStateException;
MediaPlayerView instance in a
FrameLayout instance, which places the video on the device’s screen.
FrameLayout playerFrame = (FrameLayout) view.findViewById(R.id.playerFrame); playerFrame.addView(mediaPlayer.getView());
MediaPlayer instance is now available and properly configured to display video content on the device screen.