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

Fix video and audio loading with authenicated media #1946

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

ShadowRZ
Copy link
Contributor

Description

Continuation of #1930, Appeareantly Firefox (and maybe Chrome) won't let service workers take over requests from

Fixes #1818 (comment)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Appeareantly Firefox (and maybe Chrome) won't let service workers take over requests from <video> and <audio> tags, so we just fetch the URL ourselves.
Copy link

Preview: https://1946--pr-cinny.netlify.app
⚠️ Exercise caution. Use test accounts. ⚠️

@@ -4,7 +4,8 @@ import { decryptFile } from '../../../utils/matrix';
export const getFileSrcUrl = async (
httpUrl: string,
mimeType: string,
encInfo?: EncryptedAttachmentInfo
encInfo?: EncryptedAttachmentInfo,
forceFetch?: boolean
Copy link
Member

Choose a reason for hiding this comment

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

This function was made to decrypt file but maybe named wrong so I think we should use different function for fetching unencrypted file as adding a boolean param make it hard to reason what this function do.

Apart from it maybe in a different PR we can later remove the line: 15 createObjectURL outside it.

Copy link
Member

Choose a reason for hiding this comment

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

actually I think I can fix it, I am currently working on fixing the download problem and has to changed getFileSrcUrl usage as I found we already have a decryptFile function in app/utils/matrix

@ajbura ajbura merged commit f2c31d2 into cinnyapp:dev Sep 11, 2024
2 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for MSC3916: Authenticated Media
2 participants