Open DigenPrimeApps opened 1 year ago
My code
<ViewportAwareJWPlayer innerRef={(ref) => (jWPlayerRef = ref)} style={Style.videoContainer} config={{ license: Platform.select({ ios: "...", android: "...", }), autostart: true, controls:true, playlist: [ { mediaId: "0", image: WatchVideoData.thumbnail_file, time: 0, file: WatchVideoData.video_url, autostart: false, // controls: true, repeat: false, displayDescription: false, displaytitle: false, backgroundAudioEnabled: true, fullScreenOnLandscape:true, landscapeOnFullScreen:true, }, ], hideUIGroups: ['casting_menu'], backgroundAudioEnabled: true, fullScreenOnLandscape:true, landscapeOnFullScreen:true, styling: { colors: {}, }, pipEnabled: (platform == 'android') ? false : true, }} // onViewportEnter={() => console.log(${data.title} Entered!)} onViewportLeave={() => { //jWPlayerRef.current.pause(); //console.log("jWPlayerRef.current ", jWPlayerRef); jWPlayerRef.pause(); // console.log(${data.title} Left!); }} onSetupPlayerError={ErrorHandle} onPlayerError={ErrorHandle} onPlay={onPlayHandle} onPause={onPauseHandle} />
My code
<ViewportAwareJWPlayer innerRef={(ref) => (jWPlayerRef = ref)} style={Style.videoContainer} config={{ license: Platform.select({ ios: "...", android: "...", }), autostart: true, controls:true, playlist: [ { mediaId: "0", image: WatchVideoData.thumbnail_file, time: 0, file: WatchVideoData.video_url, autostart: false, // controls: true, repeat: false, displayDescription: false, displaytitle: false, backgroundAudioEnabled: true, fullScreenOnLandscape:true, landscapeOnFullScreen:true, }, ], hideUIGroups: ['casting_menu'], backgroundAudioEnabled: true, fullScreenOnLandscape:true, landscapeOnFullScreen:true, styling: { colors: {}, }, pipEnabled: (platform == 'android') ? false : true, }} // onViewportEnter={() => console.log(${data.title} Entered!)} onViewportLeave={() => { //jWPlayerRef.current.pause(); //console.log("jWPlayerRef.current ", jWPlayerRef); jWPlayerRef.pause(); // console.log(${data.title} Left!); }} onSetupPlayerError={ErrorHandle} onPlayerError={ErrorHandle} onPlay={onPlayHandle} onPause={onPauseHandle} />