private void fitVideoSurfaceToScreen(Orientation ori) {
    SurfaceHolder holder = mSurfv.getHolder();

    // Scale video with fixed-ratio.
    int vw = mMp.getVideoWidth();
    int vh = mMp.getVideoHeight();

    if (0 >= vw || 0 >= vh) return;

    // TODO
    // Is there good way to get screen size without branching two cases?
    // Below codes looks dirty to me....
    // But, at this moment, I failed to find any other way...
    //
    // NOTE
    // Status bar hiding/showing has animation effect.
    // So, getting status bar height sometimes returns unexpected value.
    // (Not perfectly matching window's FLAG_FULLSCREEN flag)
    //
    // Showing animation means "status bar is shown".
    // So, even if FLAG_FULLSCREEN flag is cleared, rect.top of visible frame is NOT 0
    //   because (I think) status bar is still in animation and it is not hidden perfectly yet.
    // But, in case of showing status bar, even if status bar is not fully shown,
    //   status bar already hold space for it. So, rect.top of visible frame is unexpected value.
    //
    // To handle above issue, below hack is used.
    //
    // Because of the reason described above, at this moment, we can't get height of status bar with
    // sure.
    // So, we should get in advance when we are sure to get valid height of status bar.
    // mStatusBarHeight is used for that reason.
    // And onWindowFocusChanged is the right place to get status height.
    Rect rect = Utils.getVisibleFrame(this);
    int sw = rect.width();
    // default is full screen.
    int sh = rect.bottom;

    // HACK! : if user interface is NOT shown, even if 0 != rect.top, it is ignored.
    if (isUserInterfaceVisible())
      // When user interface is shown, status bar is also shown.
      sh -= mStatusBarHeight;

    if ((Orientation.LANDSCAPE == ori && sw < sh) || (Orientation.PORTRAIT == ori && sw > sh)) {
      // swap
      int tmp = sw;
      sw = sh;
      sh = tmp;
    }

    // Now, sw is always length of longer axis.
    int[] sz = new int[2];
    ImageUtils.fitFixedRatio(sw, sh, vw, vh, sz);
    holder.setFixedSize(sz[0], sz[1]);

    ViewGroup.LayoutParams lp = mSurfv.getLayoutParams();
    lp.width = sz[0];
    lp.height = sz[1];
    mSurfv.setLayoutParams(lp);
    mSurfv.requestLayout();
  }