Files
mattermost-mobile/patches/react-native-video+5.2.0.patch
Elias Nahum 5de54471b7 [Gekidou] Gallery (#6008)
* Gallery screen (ground work)

* Open the gallery from posts

* Open the gallery from post draft

* feedback review

* Feedback review 2

* do not remove dm channel names and localization fix

* update to the latest network-client

* do not override file width, height and imageThumbail if received file does not have it set

* bring back ScrollView wrapper for message component

* Remove Text wrapper for markdown paragraph

* Fix YouTube play icon placeholder

* Make video file play button container round

* Add gif image placeholder

* Save images & videos to camera roll

* Feedback review 3

* load video thumbnail when post is in viewport

* simplify prefix
2022-03-01 13:55:44 -03:00

84 lines
4.4 KiB
Diff

diff --git a/node_modules/react-native-video/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/node_modules/react-native-video/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java
index fe95fdf..90c39f6 100644
--- a/node_modules/react-native-video/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java
+++ b/node_modules/react-native-video/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java
@@ -14,6 +14,7 @@ import android.view.Window;
import android.view.accessibility.CaptioningManager;
import android.widget.FrameLayout;
import android.widget.ImageButton;
+import android.widget.ImageView;
import com.brentvatne.react.R;
import com.brentvatne.receiver.AudioBecomingNoisyReceiver;
@@ -317,6 +318,7 @@ class ReactExoplayerView extends FrameLayout implements
playerControlView.setPlayer(player);
playerControlView.show();
playPauseControlContainer = playerControlView.findViewById(R.id.exo_play_pause_container);
+ playerControlView.findViewById(R.id.exo_fullscreen_button).setOnClickListener(v -> setFullscreen(!isFullscreen));
// Invoking onClick event for exoplayerView
exoPlayerView.setOnClickListener(new OnClickListener() {
@@ -736,6 +738,7 @@ class ReactExoplayerView extends FrameLayout implements
@Override
public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
String text = "onStateChanged: playWhenReady=" + playWhenReady + ", playbackState=";
+ eventEmitter.playbackRateChange(playWhenReady && playbackState == com.google.android.exoplayer2.ExoPlayer.STATE_READY ? 1.0f : 0.0f);
switch (playbackState) {
case Player.STATE_IDLE:
text += "idle";
@@ -1305,6 +1308,7 @@ class ReactExoplayerView extends FrameLayout implements
Window window = activity.getWindow();
View decorView = window.getDecorView();
int uiOptions;
+ ImageView fullscreenButton = playerControlView.findViewById(R.id.exo_fullscreen_icon);
if (isFullscreen) {
if (Util.SDK_INT >= 19) { // 4.4+
uiOptions = SYSTEM_UI_FLAG_HIDE_NAVIGATION
@@ -1316,10 +1320,12 @@ class ReactExoplayerView extends FrameLayout implements
}
eventEmitter.fullscreenWillPresent();
decorView.setSystemUiVisibility(uiOptions);
+ fullscreenButton.setImageResource(R.drawable.exo_controls_fullscreen_exit);
eventEmitter.fullscreenDidPresent();
} else {
uiOptions = View.SYSTEM_UI_FLAG_VISIBLE;
eventEmitter.fullscreenWillDismiss();
+ fullscreenButton.setImageResource(R.drawable.exo_controls_fullscreen_enter);
decorView.setSystemUiVisibility(uiOptions);
eventEmitter.fullscreenDidDismiss();
}
diff --git a/node_modules/react-native-video/android-exoplayer/src/main/res/layout/exo_player_control_view.xml b/node_modules/react-native-video/android-exoplayer/src/main/res/layout/exo_player_control_view.xml
index becee6a..96cbfc9 100644
--- a/node_modules/react-native-video/android-exoplayer/src/main/res/layout/exo_player_control_view.xml
+++ b/node_modules/react-native-video/android-exoplayer/src/main/res/layout/exo_player_control_view.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
@@ -71,6 +72,22 @@
android:paddingRight="4dp"
android:includeFontPadding="false"
android:textColor="#FFBEBEBE"/>
+ <FrameLayout
+ android:id="@+id/exo_fullscreen_button"
+ android:layout_width="32dp"
+ android:layout_height="wrap_content"
+ android:layout_gravity="right">
+
+ <ImageView
+ android:id="@+id/exo_fullscreen_icon"
+ android:layout_width="32dp"
+ android:layout_height="32dp"
+ android:layout_gravity="center"
+ android:adjustViewBounds="true"
+ android:scaleType="fitCenter"
+ app:srcCompat="@drawable/exo_controls_fullscreen_enter" />
+
+ </FrameLayout>
</LinearLayout>
</LinearLayout>