/**
  * Build Iframe URL and display the player
  *
  * @param entryId
  * @param partnerId
  * @param width
  * @param height
  * @param components to hide when opening fullscreen
  */
 public void showPlayer(
     String entryId, String partnerId, int width, int height, List<View> components) {
   mComponents = components;
   mWidth = width;
   mHeight = height;
   mPlayerView.setPlayerViewDimensions(width, height);
   mPlayerView.addComponents(partnerId, entryId, mActivity);
 }
 private void closeFullscreen() {
   mInFS = false;
   if (mComponents != null) {
     for (Iterator<View> i = mComponents.iterator(); i.hasNext(); ) {
       i.next().setVisibility(View.VISIBLE);
     }
   }
   mPlayerView.setPlayerViewDimensions(mWidth, mHeight);
 }
 public void notifyConfigurationChanged(Configuration newConfig) {
   if (mIsLargeScreen) {
     if (mInFS) {
       Point size = new Point();
       mActivity.getWindowManager().getDefaultDisplay().getSize(size);
       mPlayerView.setPlayerViewDimensions(size.x, size.y);
     }
   } else {
     if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
       openFullscreen();
     } else {
       closeFullscreen();
     }
   }
 }
  private void openFullscreen() {
    mInFS = true;
    if (mComponents != null) {
      for (Iterator<View> i = mComponents.iterator(); i.hasNext(); ) {
        i.next().setVisibility(View.GONE);
      }
    }

    Point size = new Point();
    mActivity.getWindowManager().getDefaultDisplay().getSize(size);
    if (mLayout != null) {
      LayoutParams params = (LayoutParams) mLayout.getLayoutParams();
      params.width = LayoutParams.MATCH_PARENT;
      params.height = LayoutParams.MATCH_PARENT;
      mLayout.invalidate();
    }
    mPlayerView.setPlayerViewDimensions(size.x, size.y);
  }
 /**
  * Creates a new PlayerHelper
  *
  * @param player instance to control
  * @param activity that holds the player
  * @param isLargeScreen boolean if false player will open in fullscreen upon screen rotation
  */
 public PlayerHelper(PlayerViewController player, Activity activity, Boolean isLargeScreen) {
   mPlayerView = player;
   mActivity = activity;
   mIsLargeScreen = isLargeScreen;
   mPlayerView.setOnFullScreenListener(this);
 }