react-native-jw-media-player icon indicating copy to clipboard operation
react-native-jw-media-player copied to clipboard

How to hide PIP icon?

Open manamelacedric opened this issue 3 years ago • 4 comments

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 avatar Feb 23 '22 07:02 manamelacedric

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

chaimPaneth avatar Apr 04 '22 11:04 chaimPaneth

@chaimPaneth @manamelacedric Fixed this one here https://github.com/chaimPaneth/react-native-jw-media-player/pull/203

KestasVenslauskas avatar May 13 '22 09:05 KestasVenslauskas

@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 avatar Mar 01 '23 08:03 SufianBabri

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.

SufianBabri avatar Mar 29 '23 13:03 SufianBabri