Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to hide PIP icon? #177

Open
manamelacedric opened this issue Feb 23, 2022 · 4 comments
Open

How to hide PIP icon? #177

manamelacedric opened this issue Feb 23, 2022 · 4 comments

Comments

@manamelacedric
Copy link

Hi @chaimPaneth, How do I hide the pip icon? I have tried setting the pipEnabled={false} on the player and also on the config but it doesn't work. Clicking the pip icon on android crashes the app and on IOS it does nothing. I just wanted to get rid of it. here is my config

<JWPlayer
          ref={playerRef}
          style={styles.player}
          pipEnabled={false}
          config={{
            license:
              Platform.OS === "android"
                ? "NdTmxf/nTJMfrwsss1F8sFxxUoHsQsQDaEUxxyWEgms2zS7s87Ka3DX6bXSq"
                : "14VMgmaF1pf2bG+/YHDULia3Iz9ddvdsd5aMeYnHdsG+aRrDNiDs+UiXcd",
            backgroundAudioEnabled: false,
            pipEnabled: false,
            autostart: true,
            nextUpDisplay: false,
            playlist,
            ...(isIOS && {
              interfaceBehavior: "normal",
              // enableLockScreenControls: false,
              // offlineMessage: "You are currently offline",
            }),
            ...(!isIOS && {
              hideUIGroup: "casting_menu",
              nativeFullScreen: true, 
              landscapeOnFullScreen: true,
            }),
          }}
          onPlaylistItem={({ nativeEvent }) => {
            setPlaying(playlist[nativeEvent.index].title);
          }}
          onSetupPlayerError={({ nativeEvent }) =>
            console.log("jwplayer setup error", nativeEvent)
          }
          onPlayerError={({ nativeEvent }) =>
            console.log("jwplayer player err", nativeEvent)
          }
    />
@manamelacedric manamelacedric changed the title How to hid PIP icon? How to hide PIP icon? Feb 23, 2022
@chaimPaneth
Copy link
Owner

Hi @manamelacedric

In latest version 0.2.11 there is a new object allowsPictureInPicturePlayback: boolean on the config prop you might wanna check it out.
This was introduced in the latest jw ios sdk

@KestasVenslauskas
Copy link
Contributor

@chaimPaneth @manamelacedric Fixed this one here #203

@SufianBabri
Copy link
Contributor

@manamelacedric Unfortunately, this isn't possible on the JW Player iOS SDK itself.

According to the docs, the picture-in-picture (PIP) button is added to the top-right of the player when the feature is available on the device.

@SufianBabri
Copy link
Contributor

While trying to hide the Chromecast icon on iOS, I found that pip icon can also be hidden with this:

const jwPlayer = useRef<JWPlayer>(null);

useEffect(() => {
	jwPlayer.current?.setVisibility(false, ['pip']);
}, [jwPlayer.current]);

PS: setVisibility(visibility: Boolean, controls: JWControlType[]) is only available on iOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants