Skip to content

Block video upload (or even selection) on Mobile app #1711

Answered by vishalnarkhede
neopit asked this question in Q&A
Discussion options

You must be logged in to vote

@neopit To disallow video upload, please take a look at How to block certain file extensions from uploads.

But to disallow video selection in media picker, you will need to override native handler, specifically getPhotos handler.

Following implementation for getPhotos handler has been pretty much copied from default handler except for the line which has a comment next to it.

import { registerNativeHandlers } from 'stream-chat-react-native';
import { Image, PermissionsAndroid, Platform } from 'react-native';
import { CameraRoll } from '@react-native-camera-roll/camera-roll';

registerNativeHandlers({
  getPhotos: async ({ after, first }) => {
    try {
      if (Platform.OS === 'android') {

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@neopit
Comment options

@vishalnarkhede
Comment options

@neopit
Comment options

Answer selected by vanGalilea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants