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

Distinguish direct video URLs #1192

Merged
merged 3 commits into from
Mar 12, 2024
Merged

Distinguish direct video URLs #1192

merged 3 commits into from
Mar 12, 2024

Conversation

hjiangsu
Copy link
Member

@hjiangsu hjiangsu commented Mar 11, 2024

Pull Request Description

This PR changes the following:

  • Refactored MediaView to reduce code complexity.
  • Refactored parsePostView to reduce code complexity, and added a check for direct video URL extensions
  • Added a new MediaTypeBadgeItem for video types. It uses a purple background as the base colour.
  • Added method to detect video URLs (based off Experimental support for video player #1081)

Additionally, I moved lib/utils/image.dart -> lib/utils/media/image.dart. This helps better categorize media util functions (image/video)

Issue Being Fixed

Issue Number: Partially solves #1177 by showing a badge whenever a video URL is found.

Screenshots / Recordings

5e21be20-6b9e-47df-81b5-02f908e8b712.mp4

Checklist

  • Did you update CHANGELOG.md?
  • Did you use localized strings where applicable?
  • Did you add semanticLabels where applicable for accessibility?

@hjiangsu hjiangsu marked this pull request as ready for review March 11, 2024 23:04
Copy link
Member

@micahmo micahmo left a comment

Choose a reason for hiding this comment

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

Nice! LGTM!

@hjiangsu hjiangsu merged commit 048f60f into develop Mar 12, 2024
1 check passed
@hjiangsu hjiangsu deleted the feature/video-badge branch March 12, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants