Code example for MediaPlayer

Methods: release

0
      mPlayer = new MediaPlayer();
    } 
 
    @Override 
    protected void tearDown() throws Exception { 
        mPlayer.release();
        super.tearDown(); 
    } 
 
    // Generate a random number, sends it to the ping test player. 
    @Suppress 
    @MediumTest 
    public void testPing() throws Exception { 
        mPlayer.setDataSource("test:invoke_mock_media_player.so?url=ping");
 
        Parcel request = mPlayer.newRequest();
        Parcel reply = Parcel.obtain();
 
        int val = rnd.nextInt();
        request.writeInt(val);
        mPlayer.invoke(request, reply);