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

Use fileCDN with video attachments #624

Merged
merged 2 commits into from
Oct 21, 2024

Conversation

bpollman
Copy link
Contributor

@bpollman bpollman commented Oct 18, 2024

🔗 Issue Link

Jira or Github issue link, if applicable.

🎯 Goal

We need a way for all attachment URL's to be intercepted and adjusted/signed.

🛠 Implementation

This update adds FileCDN handling to all video attachment touch points primarily via the:

  • VideoPreviewLoader for thumbnails
  • Gallery -> StreamVideoPlayer and VideoPlayerView

Also make a few style & comment clean ups from previous FileCDN PR.

🧪 Testing

Added basic tests

🎨 Changes

Add relevant screenshots or videos showcasing the changes.

☑️ Checklist

  • I have signed the Stream CLA (required)
  • Changelog is updated with client-facing changes
  • New code is covered by unit tests
  • Affected documentation updated (docusaurus, tutorial, CMS (task created)

@bpollman bpollman requested a review from a team as a code owner October 18, 2024 05:51
Copy link
Contributor

@martinmitrevski martinmitrevski left a comment

Choose a reason for hiding this comment

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

Thanks again for your contribution! Looks good, but we just need to adjust the VideoPreviewLoader, so it doesn't have breaking changes (check the comment).

@@ -34,31 +34,43 @@ public final class DefaultVideoPreviewLoader: VideoPreviewLoader {
NotificationCenter.default.removeObserver(self)
}

public func loadPreviewForVideo(at url: URL, completion: @escaping (Result<UIImage, Error>) -> Void) {
public func loadPreviewForVideo(at url: URL, fileCDN: FileCDN, completion: @escaping (Result<UIImage, Error>) -> Void) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this would be a breaking change - can you instead inject the FileCDN via our DI mechanism? (@Injected)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem, will get it updated. Thanks for the prompt reviews!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! ✅

Copy link
Contributor

@martinmitrevski martinmitrevski left a comment

Choose a reason for hiding this comment

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

Looks good to me ✅

@martinmitrevski martinmitrevski merged commit b16cd5b into GetStream:develop Oct 21, 2024
5 of 9 checks passed
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