title: Android - rendering same video on Multiple views
body: <p>I have a media datasource, and I am playing the media using android <code>MediaPlayer</code>. </p>
  
  <p>How can I display the video output from the <code>MediaPlayer</code> to multiple views in the same <code>Activity</code>, is there any alternative ways to do this? </p>
  
  <p>I want the video part of the media to be rendered in <strong>two different views</strong> without reading multiple times from data source.</p>
  
  <p>Current Code :</p>
  
  <pre><code>TextureView mTextureView1;
  TextureView mTextureView2;
  
  mTextureView1.setSurfaceTextureListener(new TextureView.SurfaceTextureListener() {
          @Override
          public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
              mMediaPlayer = new MediaPlayer(AppActivity.this);
              try {
                  mMediaPlayer.setDataSource(getApplicationContext(), Uri.parse(path));
              } catch (IOException e) {
                  e.printStackTrace();
              }
              mMediaPlayer.setSurface(new Surface(surface));
              mMediaPlayer.setLooping(true);
              mMediaPlayer.prepareAsync();
  
              mMediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
                  @Override
                  public void onPrepared(MediaPlayer mp) {
                      mp.start();
                  }
              });
          }
  </code></pre>