Catalog npm
PACKAGE EXPLORERView in registry

@0-a-e/react-native-media-viewing

npm

React Native modal component for viewing image and movie as a sliding gallery

galleryimageimage-galleryimage-viewerreactreact-nativevideo
Versions collected8
Direct dependencies11From release 99999.114514.6
Last observed20 Oct, 21:53 UTC

README

Current package documentation

react-native-media-viewing

react-native-image-viewingのフォークです.動画再生に対応.音声にも後で対応するかも. Expo非対応

React Native modal component for viewing image and Video as a sliding gallery.

npm version styled with prettier

  • 🔥Pinch zoom for both iOS and Android
  • 🔥Double tap to zoom for both iOS and Android
  • 🔥Supports swipe-to-close animation
  • 🔥Custom header and footer components
  • 🔥Uses VirtualizedList to optimize image loading and rendering

Installation

yarn add react-native-image-viewing

or

npm install --save react-native-image-viewing

Usage

import MediaView from "@0-a-e/react-native-media-viewing";

const medias = [
  {
    uri: "https://images.unsplash.com/photo-1571501679680-de32f1e7aad4",
  },
  {
    uri: "https://images.unsplash.com/photo-1573273787173-0eb81a833b34",
  },
  {
    uri: "https://images.unsplash.com/photo-1569569970363-df7b6160d111",
  },
];

const [visible, setIsVisible] = useState(false);

<MediaView
  mediaSource={medias}
  mediaIndex={0}
  visible={visible}
  onRequestClose={() => setIsVisible(false)}
  unknownErrorMessage={"不明なエラー"}
  unsupportedFiletypeMessage={"対応していないファイル形式です"}
  errorMessage={"エラー"}
  noFileMessage={'表示可能なメディアがありません。'}
/>;

See Example

Props

Prop nameDescriptionTypeRequired
mediasArray of medias to displayImageSource[]true
keyExtractorUniqely identifying each image(imageSrc: ImageSource, index: number) => stringfalse
mediaIndexCurrent index of image to displaynumbertrue
visibleIs modal shown or notbooleantrue
onRequestCloseFunction called to close the modalfunctiontrue
onImageIndexChangeFunction called when image index has been changedfunctionfalse
onLongPressFunction called when image long pressedfunction (event: GestureResponderEvent, image: ImageSource)false
delayLongPressDelay in ms, before onLongPress is called: default 800numberfalse
animationTypeAnimation modal presented with: default fadenone, fade, slidefalse
presentationStyleModal presentation style: default: fullScreen Android: Use overFullScreen to hide StatusBarfullScreen, pageSheet, formSheet, overFullScreenfalse
backgroundColorBackground color of the modal in HEX (#000000EE)stringfalse
swipeToCloseEnabledClose modal with swipe up or down: default truebooleanfalse
doubleTapToZoomEnabledZoom image by double tap on it: default truebooleanfalse
HeaderComponentHeader component, gets current imageIndex as a propcomponent, functionfalse
FooterComponentFooter component, gets current imageIndex as a propcomponent, functionfalse
unknownErrorMessageunknown Error Message.stringfalse
unsupportedFiletypeMessageUnsupported file Message.stringfalse
errorMessageerror Message.stringfalse
noFileMessageno file Message.stringfalse

Contributing

To start contributing clone this repo and then run inside react-native-media-viewing folder:

yarn

Then go inside example folder and run:

yarn & yarn start

This will start packager for expo so you can change /src/ImageViewing and see changes in expo example app.

License(ライセンス)

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 8

Collected releases
VersionPublishedDirect dependenciesOpen version
99999.114514.6Registry latest27 Dec 202211
99999.114514.526 Dec 202211
99999.114514.423 Dec 202211
99999.114514.322 Dec 202211
99999.114514.222 Dec 202210
99999.114514.112 Dec 20228
1.0.012 Dec 20228
0.1.011 Dec 20228

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
0-a-e/react-native-media-viewing

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:53 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:7a7950071272e9804445028b7697ae2f9470ebc8679670bd7bfa1ebac295d6a9