revoltchat / rvmob

React Native Revolt client. Community-led project.
https://rvlt.gg/rvmob
GNU Affero General Public License v3.0
115 stars 17 forks source link

feat: video player #29

Open account0123 opened 9 months ago

account0123 commented 9 months ago

Features

Video player

In message, video opens as preview. Full-screen control activates full mode (it pauses preview and opens video on modal). Modal contains same header as image viewer modal, with similar actions. I haven't implemented video player in MessageEmbed yet.

Audio player

It was hard to find an audio player component. I tried installing a voice message player but installation failed. Then, I built my own component using TrackPlayer, a service useful for music queues, and I implemented a method to ensure that only one audio is played at a time. Some known bugs:

Please make sure to check the following tasks before opening and submitting a PR

Rexogamer commented 9 months ago

out of curiosity, what failed when trying to install the first library?

account0123 commented 9 months ago
$ yarn add @carchaze/react-native-voice-message-player
<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
 1: 0x55916db37f30 node::Abort() [node]
 2: 0x55916da30f4b  [node]
 3: 0x55916dd538a0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
Rexogamer commented 9 months ago

ahhh. there seems to be an issues where the latest releases of React Native - and, by extension, packages that depend on them - can't be installed due to a Yarn bug; your alternate solution should be fine (although it'd be preferable to fix the known issues first), and the seeming solution to this issue is to switch to Yarn Berry (I'll wait for v4 to release) so no worries

Rexogamer commented 8 months ago

Conflicting

account0123 commented 8 months ago

Hi! As you said before I tried to install (in new branch) @carchaze/react-native-voice-message-player. Installation was successful, but in execution time it has a very weird bug related to react-native-sound dependency. I followed steps but nothing worked so I give up trying to install that library. On other hand I am thinking of creating my own native sound module instead of using react-native-track-player because it's not necessary to use background audio service that this dependency requires. So in the new branch I am going to experiment with audio native modules or creating my own module and create a PR when everything works fine. TL;DR: I will fix conflicts keeping only video components. Audio components will be in another PR.

Rexogamer commented 8 months ago

I will also mention that you might be able to follow the steps here if you haven't already - however, if you have to no avail, no worries. I think splitting this PR would be a good idea regardless; take as much time as you need ^^

account0123 commented 8 months ago

hehe that task doesnt exist in the gradle project, then I manually deleted ~/.gradle/cache. Same error.