Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

[React Native] Enable scrolling of the thumbnails

Lyubomir Marinovb6a6c99c9dd3
diff --git a/react/features/filmStrip/components/FilmStrip.js b/react/features/filmStrip/components/FilmStrip.js
index 8fa04a59ba..a492f99e9c 100644
--- a/react/features/filmStrip/components/FilmStrip.js
+++ b/react/features/filmStrip/components/FilmStrip.js
@@ -1,5 +1,6 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
+import { ScrollView } from 'react-native';
import { Container } from '../../base/react';
@@ -22,14 +23,34 @@ class FilmStrip extends Component {
<Container
style = { styles.filmStrip }
visible = { this.props.visible }>
- {
- this.props.participants
- .sort((a, b) => b.local - a.local)
- .map(p =>
- <Thumbnail
- key = { p.id }
- participant = { p } />)
- }
+ <ScrollView
+
+ // eslint-disable-next-line react/jsx-curly-spacing
+ contentContainerStyle = {
+ styles.filmStripScrollViewContentContainer
+ } // eslint-disable-line react/jsx-curly-spacing
+ horizontal = { true }
+ showsHorizontalScrollIndicator = { false }
+ showsVerticalScrollIndicator = { false }>
+ {
+ this.props.participants
+
+ // Group the remote participants so that the local
+ // participant does not appear in between remote
+ // participants.
+ .sort((a, b) => b.local - a.local)
+
+ // Have the local participant at the rightmost side.
+ // Then have the remote participants from right to
+ // left with the newest added/joined to the leftmost
+ // side.
+ .reverse()
+ .map(p =>
+ <Thumbnail
+ key = { p.id }
+ participant = { p } />)
+ }
+ </ScrollView>
</Container>
);
}
diff --git a/react/features/filmStrip/components/styles.js b/react/features/filmStrip/components/styles.js
index 83223c33e4..6e28d9c366 100644
--- a/react/features/filmStrip/components/styles.js
+++ b/react/features/filmStrip/components/styles.js
@@ -36,15 +36,26 @@ export const styles = {
},
/**
- * Participants container style.
+ * The style of the Container which represents the very film strip.
*/
filmStrip: {
+ alignItems: 'flex-end',
alignSelf: 'stretch',
bottom: 10,
flex: 1,
- flexDirection: 'row',
+ flexDirection: 'column',
+ left: 0,
position: 'absolute',
- right: 5
+ right: 0
+ },
+
+ /**
+ * The style of the content container of the ScrollView which is placed
+ * inside filmStrip and which contains the participants' thumbnails in order
+ * to allow scrolling through them if they do not fit within the display.
+ */
+ filmStripScrollViewContentContainer: {
+ paddingHorizontal: 10
},
/**