private void handleRecordingStopped() {
    //
    // mLiveBanner.startAnimation(AnimationUtils.loadAnimation(getActivity().getApplicationContext(), R.anim.slide_to_left));
    //        mLiveBanner.setVisibility(View.INVISIBLE);
    preparingBroadcastTextView.setVisibility(View.INVISIBLE);

    //        broadcastingTopHeaderView.setVisibility(View.GONE);
    mCameraView.setBackgroundResource(R.color.transparentBlue84);
    //        recordButton.setVisibility(View.VISIBLE);
    //        broadcastingTitleEditText.setVisibility(View.VISIBLE);

  }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    if (VERBOSE) Log.i(TAG, "onCreateView");

    View root;
    if (mBroadcaster != null
        && getActivity().getResources().getConfiguration().orientation
            == Configuration.ORIENTATION_PORTRAIT) {
      root = inflater.inflate(R.layout.fragment_broadcast, container, false);
      initializeCommentList(root);

      CustomFrameLayout fragmentBroadcastMainLayout =
          (CustomFrameLayout) root.findViewById(R.id.fragmentBroadcastMainLayout);
      fragmentBroadcastMainLayout.setDoubleTapCallback(this);

      mCameraView = (GLCameraEncoderView) root.findViewById(R.id.cameraPreview);
      mCameraView.setKeepScreenOn(true);
      mCameraView.setBackgroundResource(R.color.transparentBlue84);

      preparingBroadcastTextView = (TextView) root.findViewById(R.id.preparingBroadcastTextView);
      mBroadcaster.setPreviewDisplay(mCameraView);

      this.mediaPlayerFooterLayout = root.findViewById(R.id.mediaPlayerFooterLayout);
      this.mediaPlayerFooterLayout.setVisibility(View.INVISIBLE);
      this.mediaPlayerHeaderLayout = root.findViewById(R.id.mediaPlayerHeaderLayout);
      this.mediaPlayerHeaderLayout.setVisibility(View.INVISIBLE);
      this.mediaPlayerLiveTextView = root.findViewById(R.id.mediaPlayerLiveTextView);

      this.mediaPlayerHeaderImageView =
          (ImageView) root.findViewById(R.id.mediaPlayerHeaderImageView);
      this.mediaPlayerUsernameTextView =
          (TextView) root.findViewById(R.id.mediaPlayerUsernameTextView);
      this.mediaPlayerLocationTextView =
          (TextView) root.findViewById(R.id.mediaPlayerLocationTextView);
      this.mediaPlayerWatchersCountTextView =
          (TextView) root.findViewById(R.id.mediaPlayerWatchersCountTextView);
      this.mediaPlayerStreamTitle = (TextView) root.findViewById(R.id.mediaPlayerStreamTitle);
      this.bandwithTooLowLayout = root.findViewById(R.id.bandwithTooLowLayout);
      View mediaPlayerAddCommentEditText = root.findViewById(R.id.mediaPlayerAddCommentEditText);
      mediaPlayerAddCommentEditText.setVisibility(View.GONE);

      //            this.broadcastingTitleEditText =
      // root.findViewById(R.id.broadcastingTitleEditText);
      //            recordButton.setOnClickListener(mRecordButtonClickListener);
      View closeViewButton = root.findViewById(R.id.mediaPlayerCloseViewButton);
      closeViewButton.setOnClickListener(mRecordButtonClickListener);

      //            mLiveBanner.setOnClickListener(mShareButtonClickListener);

      /*            if (mBroadcaster.isLive()) {
                      setGuiToReadyState();
                      mLiveBanner.setVisibility(View.VISIBLE);
                  }
      */
      if (mBroadcaster.isRecording()) {
        //                recordButton.setBackgroundResource(R.drawable.red_dot_stop);
        if (!mBroadcaster.isLive()) {
          setBannerToBufferingState();
          //                    mLiveBanner.setVisibility(View.VISIBLE);
        } else {
          setGuiToReadyState();
        }
      } else {
        handleRecordingStopped();
      }
      setupFilterSpinner(root);
      setupCameraFlipper(root);
    } else root = new View(container.getContext());
    return root;
  }