Code example for MediaPlayer

Methods: setDisplay

0
        if (holder != null)
            holder.addCallback(mSurfaceCallback);
    } 
 
    private SurfaceHolder.Callback mSurfaceCallback = new Callback() {
        public void surfaceChanged(SurfaceHolder holder, int format, int width, 
                int height) { 
        } 
 
        public void surfaceCreated(SurfaceHolder holder) { 
        } 
 
        public void surfaceDestroyed(SurfaceHolder holder) { 
            if (mMediaPlayer != null) { 
                mMediaPlayer.release(); 
            } 
        } 
    }; 
 
//    @Override 
//    public void setAudioStreamType(int streamMusic) {