This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 829
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into fix-pip-color
- Loading branch information
Showing
615 changed files
with
23,180 additions
and
4,936 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ package-lock.json | |
/src/component-index.js | ||
|
||
.DS_Store | ||
*.tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Media handling | ||
|
||
Surely media should be as easy as just putting a URL into an `img` and calling it good, right? | ||
Not quite. Matrix uses something called a Matrix Content URI (better known as MXC URI) to identify | ||
content, which is then converted to a regular HTTPS URL on the homeserver. However, sometimes that | ||
URL can change depending on deployment considerations. | ||
|
||
The react-sdk features a [customisation endpoint](https://github.com/vector-im/element-web/blob/develop/docs/customisations.md) | ||
for media handling where all conversions from MXC URI to HTTPS URL happen. This is to ensure that | ||
those obscure deployments can route all their media to the right place. | ||
|
||
For development, there are currently two functions available: `mediaFromMxc` and `mediaFromContent`. | ||
The `mediaFromMxc` function should be self-explanatory. `mediaFromContent` takes an event content as | ||
a parameter and will automatically parse out the source media and thumbnail. Both functions return | ||
a `Media` object with a number of options on it, such as getting various common HTTPS URLs for the | ||
media. | ||
|
||
**It is extremely important that all media calls are put through this customisation endpoint.** So | ||
much so it's a lint rule to avoid accidental use of the wrong functions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.