I'm trying to create an custom view that has a Mediaplayer tied into it. What I want to happen is that once the first frame is rendered on the screen the MediaPlayer will pause for a second or two then finish up the video. I'm having a problem trying to figure out when that first frame comes on the screen. I've tried using:
MediaPlayer.start() then right after Mediaplayer.pause() - this doesn't work because the system needs time to load the video and the screen is black when I do this.
OnBufferingUpdateListener - doesn't work because it only applies to videos from the internet
OnInfoListener MEDIA_INFO_VIDEO_RENDERING_START - the API is 17 and that's too high.
onDraw in custom view - currently testing, I'm not sure how to know when the video frames are being drawn.
What i'm currently doing is setting up a timer in my code to wait like 50 milliseconds then once the timer is done pause the video for a certain amount of time. However, this is just a quick fix and not a long term solution.
I feel the only way to solve this problem is by setting up some sort of custom listener or by using a method that is called once the video frames come on screen. However, my problem is I don't know what to listen for and I haven't found a method that is called when the video starts playing. So any help in solving this problem would be much appreciated.