CHAPTER 11: Digital Video: Streaming Video, MediaPlayer, and MediaController classes 441
As you can see in Figure 11-34, the code is error-free, and ready to test using a Run As ➤ Android
Application menu sequence. As you can see on the left side of Figure 11-35, thanks to that trick I
taught you in the previous section on scaling video assets non-uniformly, your looping digital video
asset now fills your screen, and (not in the screenshot, unfortunately) you can watch your 3D planet
flyover digital video asset loop seamlessly on the screen. The right side shows the MediaController,
which we’ll be adding in the next section, but which I put in this screenshot to save space. You have
implemented looping digital video in your application using only 12 lines of Java code, not counting
the 3 import statements (which you can see at the top of Figure 11-34).
Figure 11-34. Adding the onPrepared( ) method to our new MediaPlayer.OnPreparedListener( ) callback structure