Saturday, March 17, 2012
A mileStone of MediaPlay Exercise for video
My exercise of MediaPlay for video is almost finished. But there are still have some problem in last exercise:
- When you play a narrow video, then play a wider video: the new SurfaceView will be narrow, even cannot play. It's because the the code calculate aspect ratio (doPreSet() in PlayerFragment.java) base on the current SurfaceView, not the whole available area. To solve it, a LinearLayout is added to hold the SurfaceView, allocate whole available area. calculate aspect ratio base on the the LinearLayout.
- Improve life-cycle of the mediaPlayer, and the background thread for timelineMonitor.
- And a un-solved problem of getFrameAtTime: videoFrame is a NULL pointer for un-supported video.
Download the files.