title: Playing a video after a video in Android's TextureView has issues
body: <p>Using a MediaPlayer inside a TextureView to play videos, it works.</p>
  
  <p>When a video ends and another video should be played,  I resize the TextureView to fit the up-coming video's aspect-ratio (example - from 3:4 to 9:16 and so on..).</p>
  
  <p>The problem, after the first video ends, it's last frame remains shown, 
  Than the TextureView is resized, <strong>the last frame of the first video remains for a split second but now with a bad aspect-ratio</strong>, the second video is being played well.</p>
  
  <p>Images of videos showing a (Size X Size) rectangles:</p>
  
  <p>Image1:
  video 1, (3:4):</p>
  
  <p><img src="https://i.stack.imgur.com/7iWr0.jpg" alt="enter image description here"></p>
  
  <p>Image2:
  video 1, here we are between the 2 videos, video 1's last frame, after resizing it's now at (9:16), but the rectangle is looking bad. the below picture is shown for a split second:</p>
  
  <p><img src="https://i.stack.imgur.com/kfJ8j.jpg" alt="enter image description here"></p>
  
  <p>Image3:
  video 2, (9:16), playing well but after showing image2 for a split second:</p>
  
  <p><img src="https://i.stack.imgur.com/Wrabp.jpg" alt="enter image description here"></p>
  
  <p>There's nothing special about the code being used, here are some parts of it:</p>
  
  <pre><code>// To init the TextureView and MediaPlayer:
  
  public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int width, int height) {
      m_MediaPlayer = new MediaPlayer();
      m_Surface = new Surface(surfaceTexture);
      m_MediaPlayer.setSurface(m_Surface);
  }
  
  m_TextureView.setSurfaceTextureListener(this);
  
  // To Resize:
  LayoutParams layoutParams = new FrameLayout.LayoutParams(newTVWidth, newTVHeight);
  layoutParams.gravity = Gravity.CENTER;
  m_TextureView.setLayoutParams(layoutParams);
  
  // To play:
  m_MediaPlayer.reset();
  m_MediaPlayer.setDataSource(videoFilePath);
  m_MediaPlayer.prepare();
  // &lt;--- Here comes a call to "To Resize" which is shown right above this code
  m_MediaPlayer.start();
  </code></pre>