title: How do I draw Bitmap on TextureView
body: <p>I'm trying to play video on android with <code>TextureView</code>. Regarding video everithing works well. But <code>MediaPlayer.prepare();</code> takes some time. So I would like to show some placeholder for that time. I'm trying to do it with Glide like this:</p>
  
  <pre><code>public static final Rect rc = new Rect();
  @Override
  public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int w, int h) {
      Surface s = new Surface(surfaceTexture);
      Glide.with(mTextureView.getContext())
              .load(thumbUrl)
              .asBitmap()
              .dontAnimate()
              .centerCrop()
              .into(new SimpleTarget&lt;Bitmap&gt;(w, h) {
                  @Override
                  public void onResourceReady(Bitmap resource, GlideAnimation glideAnimation) {
                      rc.set(0,0,w,h);
                      Canvas c = mTextureView.lockCanvas(rc);
                      if (c == null)
                          return;
                      c.drawBitmap(resource, 0, 0, null);
                      mTextureView.unlockCanvasAndPost(c);
                  }
              });
  
      try {
          mMediaPlayer.setDataSource(url);
          mMediaPlayer.setSurface(s);
          mMediaPlayer.prepareAsync();
          mMediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
              @Override
              public void onPrepared(MediaPlayer mediaPlayer) {
                  mMediaPlayer.setVideoScalingMode(MediaPlayer.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING);
                  mMediaPlayer.setVolume(0,0);
                  mMediaPlayer.start();
              }
          });
          mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
      } catch (IllegalArgumentException e) {
          e.printStackTrace();
      } catch (SecurityException e) {
          e.printStackTrace();
      } catch (IllegalStateException e) {
          e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>But it does not show any picture. I case of <code>SurfaceView</code> we need to call <code>onDraw</code> manualy. And SurfaceHolder has been used for this. But <code>TextureView</code> does not have <code>getSurfaceHolder()</code> method. </p>
  
  <p>What is the right way of doing this ?</p>
  
  <p>UPD: What I figured out is that picture is displayed if I do not set up <code>MediaPlayer</code> it means that <code>MediaPlayer</code> keeps surface black while it is buffering video. Is it possible to override this behavior somehow ?</p>