Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MM-54866 - Calls: Transcription support #7703

Merged
merged 11 commits into from
Dec 21, 2023
Merged

Conversation

cpoile
Copy link
Member

@cpoile cpoile commented Dec 7, 2023

Summary

  • Adds subtitles support for calls recordings.
  • NOTE: waiting on a UI element (the "cc" icon) to be added to compass-icons, that's why it's marked Do Not Merge. Otherwise, it's ready for review. Updated, can merge now. New screenshots in the thread.
  • Includes a patch to the react-native-video package which fixes how it downloads subtitles. Previously, it was using a deprecated method which swallowed errors. The patched version uses the newer callback method, logs any errors, and uses a dispatch group (essentially a wait group) to sync before loading the video with the subtitles (if any). This doesn't block the main UI thread (the other methods I tried do block).

UX Note: the figma has the color of icons as greyish, but the icons currently are #fff, so I kept that (I didn't want to change all the icons in this PRs).

iOS captions enabled iOS captions disabled
IMG_1388 IMG_1391
Android captions enabled Android captions disabled
Screenshot_20231207-150611 Screenshot_20231207-150617
Android tabled captions enabled Android table captions disabled
Screenshot_20231207_150744_Mattermost Beta Screenshot_20231207_150801_Mattermost Beta

Ticket Link

Checklist

  • Added or updated unit tests (required for all new features)
  • Has UI changes
  • Includes text changes and localization file updates
  • Have tested against the 5 core themes to ensure consistency between them. na

Device Information

  • Android: 13, Pixel 6
  • Android: 13, Galaxy Tab s7+
  • iOS: 16.5.1, iPhone 14

Screenshots

Release Note

Calls: Added transcription subtitles support to Calls recordings.

@cpoile cpoile added 2: Dev Review Requires review by a core commiter Do Not Merge/Awaiting PR Awaiting another pull request before merging (e.g. server changes) 2: UX Review Requires review by a UX Designer labels Dec 7, 2023
@cpoile
Copy link
Member Author

cpoile commented Dec 7, 2023

@matthewbirtch Updated the compass icon, thanks. Here are a couple new screenshots:

iOS cc on iOS cc off
IMG_1398 IMG_1400

@cpoile cpoile removed the Do Not Merge/Awaiting PR Awaiting another pull request before merging (e.g. server changes) label Dec 7, 2023
patches/react-native-video+5.2.1.patch Show resolved Hide resolved
app/screens/gallery/video_renderer/index.tsx Outdated Show resolved Hide resolved
@matthewbirtch
Copy link
Contributor

matthewbirtch commented Dec 8, 2023

@matthewbirtch Updated the compass icon, thanks. Here are a couple new screenshots:

Thanks Chris, the updated icon looks good.

For the actual captions, do we have control over the style, size and position of the text? I had hoped we could do something like the below screenshots. From the screenshots you've shared above, the captions look like they will be hard to read. Figma

What's possible here? Does the caption need to live within the video frame?

@cpoile
Copy link
Member Author

cpoile commented Dec 8, 2023

@matthewbirtch Unfortunately we don't have control over the subtitles -- styling is only supported on android, and then only in the newest version of the video package (which is beta, so we shouldn't upgrade until it stabilizes). I'm pretty sure there's a way if we do our own native code for it, but that would take some time.

@cpoile cpoile requested a review from enahum December 8, 2023 16:12
@matthewbirtch matthewbirtch added the Build Apps for PR Build the mobile app for iOS and Android to test label Dec 8, 2023
@mattermost-build
Copy link
Contributor

Building app in separate branch.

@mattermost-build mattermost-build removed the Build Apps for PR Build the mobile app for iOS and Android to test label Dec 8, 2023
Copy link
Contributor

@matthewbirtch matthewbirtch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so aside from the styling and position (which we can't do anything with), a few things I noticed:

  1. There may be a collision with the button that appears next to the CC button. When tapping the CC button, at times it seems to be actually be executing a download (since the download button is right next). Is it possible the download button has its hit area overlapping with the CC button somehow?
  2. It seems that apostrophe's aren't displaying properly in the captions (though they seem fine in the transcription file)
    IMG_1592
  3. On iOS, when I turn off the captions, it doesn't hide the captions immediately. It seems to wait until the next line of text to hide.
  4. On Android in landscape mode, it looks like the subtitles are getting cut off at the bottom
    Screenshot_20231208-125201
  5. For landscape mode in general (iOS and Android), is there any way to move the subtitles up a bit - the video player controls obscure it while they are showing.
    IMG_1596

@cpoile
Copy link
Member Author

cpoile commented Dec 8, 2023

@matthewbirtch Thanks for the feedback:

  1. Fixed -- I had changed the button container sizes to be in line with the designs, but didn't reduce the hit areas. Now they are the size of the button + 4 px, which just touches the next button b/c of the 8px gap.
  2. That's a known issue that we'll fix server-side.
  3. That's an issue with the iOS player, our changes don't affect the subtitles until the next one is rendered.
  4. and 5. This is a consequence of not having control over the subtitle styling that I described earlier. We'll have to either accept it, or I could backport the subtitle styling for Android (with some effort). If we did that, iOS would still be the same, unless we spent even more time on that (unknown amount).

@matthewbirtch matthewbirtch added the Build Apps for PR Build the mobile app for iOS and Android to test label Dec 8, 2023
@mattermost-build mattermost-build removed the Build Apps for PR Build the mobile app for iOS and Android to test label Dec 8, 2023
@mattermost-build
Copy link
Contributor

Building app in separate branch.

Copy link
Contributor

@matthewbirtch matthewbirtch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Chris. Looks like you've fixed the items you're able to. Not much we can do about the others by the sounds of it.

@matthewbirtch matthewbirtch removed the 2: UX Review Requires review by a UX Designer label Dec 11, 2023
Copy link
Contributor

@streamer45 streamer45 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, left some minor comments.

app/products/calls/utils.ts Outdated Show resolved Hide resolved
app/products/calls/utils.ts Show resolved Hide resolved
app/screens/gallery/index.tsx Show resolved Hide resolved
patches/react-native-video+5.2.1.patch Show resolved Hide resolved
@streamer45
Copy link
Contributor

@cpoile Could you confirm whether the attached text transcript is previewable from Android? I had issues showing it but maybe it's my local setup at fault.

@cpoile
Copy link
Member Author

cpoile commented Dec 21, 2023

@streamer45 oh yah, interesting, there's no inline view of the transcript text file. :/

Copy link
Contributor

@streamer45 streamer45 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, if we can fix the text preview great, otherwise let's file a ticket. Thanks!

@streamer45 streamer45 added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core commiter labels Dec 21, 2023
@cpoile
Copy link
Member Author

cpoile commented Dec 21, 2023

Doesn't look like a quick fix, so filed: https://mattermost.atlassian.net/browse/MM-56365

@cpoile cpoile merged commit 2c1f318 into main Dec 21, 2023
7 checks passed
@cpoile cpoile deleted the MM-54867-transcription-support branch December 21, 2023 21:20
@amyblais amyblais added this to the v2.13.0 milestone Jan 2, 2024
@amyblais amyblais added the Docs/Needed Requires documentation label Jan 2, 2024
fewva pushed a commit to fewva/mattermost-mobile that referenced this pull request Jan 12, 2024
* captions on videos from posts and searches

* add the patch for react-native-video which fixes subtitle downloading

* improve spacing

* fix patch file

* upgrade compass-icons; use cc icon

* revert patch overwrite

* fix patch

* use useMemo

* fix hitslops on pressables

* use new Caption format; refactor for clarity

* simplify tracks creation and use
@cwarnermm
Copy link
Member

@cpoile - Are you open to helping draft the product documentation for this functionality?

@amyblais amyblais added Docs/Done Required documentation has been written and removed Docs/Needed Requires documentation labels Feb 12, 2024
cyrusjc pushed a commit to cyrusjc/mattermost-mobile that referenced this pull request May 18, 2024
* captions on videos from posts and searches

* add the patch for react-native-video which fixes subtitle downloading

* improve spacing

* fix patch file

* upgrade compass-icons; use cc icon

* revert patch overwrite

* fix patch

* use useMemo

* fix hitslops on pressables

* use new Caption format; refactor for clarity

* simplify tracks creation and use
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request Docs/Done Required documentation has been written release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants