Commit Graph

31 Commits

Author SHA1 Message Date
Alvaro b4c9c3051b
Animated voice-note controls and used image x for playback rate 2022-09-19 17:28:10 -07:00
Alvaro 6cfe2a09df
Consecutive playback and per-conversation playback rate 2022-09-15 14:10:46 -06:00
Jamie Kyle eb10aafd7c
tsc:allowUnreachableCode, eslint:no-unreachable, assert->assertDev 2022-09-15 13:17:15 -06:00
Jamie Kyle 0086216c9d
Add eqeqeq rule but require == for null 2022-09-14 14:40:44 -07:00
Alvaro dd12c4cba3
Fixed playback-speed button bug and updated layout 2022-08-31 14:42:09 -06:00
Alvaro 13046dc020
Added a playback speed button on voice notes 2022-08-18 11:43:44 -04:00
Fedor Indutny decf65078c
Fix screen reader interaction with message audio 2022-04-25 14:12:22 -07:00
Josh Perez 3b5cc26fec
Adds logic around downloading stories 2022-03-28 18:10:08 -07:00
Evan Hahn cc44dca32b
Left-align audio message countdown and right-align metadata 2022-03-09 15:45:18 -06:00
Josh Perez 4e48d7792b
Use a hook for the ever-updating now 2022-03-08 13:11:11 -06:00
Evan Hahn c527de0a8d
Collapse message bubbles when applicable 2022-03-08 08:32:42 -06:00
Evan Hahn 0c31ad25ef
Remove React Virtualized from `<Timeline>` 2022-03-03 14:23:10 -06:00
Fedor Indutny 46ddcc50f9
Update electron to 16.0.6 2022-01-03 17:43:42 -08:00
Fedor Indutny fed84be0b6
Fix crashes when playing media on legacy OS 2021-12-10 15:27:42 -08:00
Evan Hahn 74fde10ff5
Prefer `import type` when importing types 2021-10-26 14:15:33 -05:00
Josh Perez 65ddf0a9e8
Import log instead of using it off of window 2021-09-17 14:27:53 -04:00
Fedor Indutny 59ca63cd2e
Use `audio.ended` in MessageAudio.tsx 2021-09-16 08:02:23 -07:00
Evan Hahn b0750e5f4e
Show "unplayed" dot on incoming audio messages 2021-08-12 13:15:55 -05:00
Evan Hahn 14929fb408
Show "unplayed" dot on outgoing audio messages 2021-07-27 10:42:25 -05:00
Fedor Indutny aa63aabbc6
Fix negative countdown for audio messages 2021-07-16 11:05:11 -07:00
Evan Hahn 831ec98418
Audio messages: move countdown under waveform 2021-07-09 13:27:16 -07:00
Fedor Indutny 2cd4160422
Unify audio playback under App component 2021-06-29 12:58:29 -07:00
Fedor Indutny 05306c2d3d
Handle `durationchange` events in MessageAudio 2021-05-24 09:30:50 -07:00
Fedor Indutny 0b969f3f42
Improve MessageAudio peaks computation
There are two parts to this change:

1. The computation of peaks is moved from `MessageAudio` to the
   `GlobalAudioContext` and thus we can limit the concurrency of the
   computations (`p-queue`!) and de-duplicate the computations as well
2. While the peaks are computed the component has to display spinning
   animation instead of empty waveform and unclickable UI.
2021-04-15 14:02:24 -07:00
Fedor Indutny 7a9a4a1404
Clicking first bars of the waveform should rewind
It is practically impossible to rewind audio prior to this commit. With
this commit - clicking first two bars will rewind the audio to its very
start instead of updating its current play time to a specific non-zero v
alue.
2021-03-24 16:08:57 -07:00
Fedor Indutny 9fa3359477
Mark attachment as corrupted if audio load failed
Sending corrupted audio should not leave user with non-functional
UI. Mark attachment as corrupted and show generic attachment UI for it
instead.
2021-03-22 11:51:53 -07:00
Fedor Indutny d6063d71e5
Change duration to countdown in MessageAudio
Message Audio UI should display remaining time not the duration of the
audio.
2021-03-22 11:15:59 -07:00
Fedor Indutny 3eaa47ec72 Remove useless logic in MessageAudio
`isLoading` was initially used to avoid duplicate loads of the audio on
re-renders, but this has to be handled in GlobalAudioContext not in
MessageAudio.
2021-03-19 16:57:36 -04:00
Fedor Indutny f41ffda3e0 Update types: attachments may not have `url` property 2021-03-19 16:57:36 -04:00
Fedor Indutny 05f59f3db1 Add download button and pending spinner for audio messages 2021-03-19 16:57:36 -04:00
Fedor Indutny 12d7f24d0f New UI for audio playback and global audio player
Introduce new UI and behavior for playing audio attachments in
conversations. Previously, playback stopped unexpectedly during window
resizes and scrolling through the messages due to the row height
recomputation in `react-virtualized`.

With this commit we introduce `<GlobalAudioContext/>` instance that
wraps whole conversation and provides an `<audio/>` element that
doesn't get re-rendered (or destroyed) whenever `react-virtualized`
recomputes messages. The audio players (with a freshly designed UI) now
share this global `<audio/>` instance and manage access to it using
`audioPlayer.owner` state from the redux.

New UI computes on the fly, caches, and displays waveforms for each
audio attachment. Storybook had to be slightly modified to accomodate
testing of Android bubbles by introducing the new knob for
`authorColor`.
2021-03-19 16:57:35 -04:00