A (175)

(Tuis.) #1
CHAPTER 11: Digital Video: Streaming Video, MediaPlayer, and MediaController classes 435

Run the application, and select the Fly Over Planet menu option, as seen in Figure 11-30, to watch
the digital video play!


As you can see in the center pane of Figure 11-30, the digital video asset is maintaining its 480x800
resolution and aspect ratio, and is not scaling up to fill the screen even though we have specified
a match_parent constant in both the X and Y dimensions in both the FrameLayout container and
the VideoView UI widget. This is what the digital video (and imaging) industry terms as “respecting”
the aspect ratio, and the Android FrameLayout class is coded so as to not distort an image or video
asset, even if the match_parent constant has been specified.


Figure 11-29. Add a PlayVideo child tag under the parent tag in the AndroidManifest.xml

Free download pdf