mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-11-10 14:19:08 -05:00
Add media tag
This commit is contained in:
parent
403ed94a7c
commit
f2c72ad712
11
54.md
11
54.md
|
@ -14,8 +14,6 @@ The URI fragment follows [media fragments structure](https://www.w3.org/TR/media
|
||||||
|
|
||||||
The metadata can be appended to any url, like this [NIP-21](21.md) one: `nostr:nevent1qq...pm#a-metadata-name=a-metadata-value`.
|
The metadata can be appended to any url, like this [NIP-21](21.md) one: `nostr:nevent1qq...pm#a-metadata-name=a-metadata-value`.
|
||||||
|
|
||||||
One may also add `url` tags to events to aid in loading resource placeholders on clients that postpone or don't do event `.content` parsing.
|
|
||||||
|
|
||||||
## NIP-94 File Fragments
|
## NIP-94 File Fragments
|
||||||
|
|
||||||
Besides available w3c and proprietary URI fragment usage, nostr uses existing [NIP-94](94.md) tags as file fragment name-value pairs. NIP-94 event `.content` is equivalent to `alt` fragment field. For example, one could join the following strings to form an image url with inline metadata:
|
Besides available w3c and proprietary URI fragment usage, nostr uses existing [NIP-94](94.md) tags as file fragment name-value pairs. NIP-94 event `.content` is equivalent to `alt` fragment field. For example, one could join the following strings to form an image url with inline metadata:
|
||||||
|
@ -44,16 +42,17 @@ Multiple array values use repeated names and are positioned in the same order of
|
||||||
|
|
||||||
## Tag Usage
|
## Tag Usage
|
||||||
|
|
||||||
Some event kinds may have been designed with urls inside tags instead of in `.content`. For these cases, use `url` tags (or `r` tags if it needs to be indexed by relays – in this case, metadata fragment keys and query parameter keys SHOULD be arranged in ascending order).
|
When publishing events of kinds designed with urls inside tags instead of in `.content`, use `media` tags specifically for images and videos
|
||||||
|
or else pick another tag. One may also add `media` tags to events to aid in loading media placeholders on clients that postpone or don't do event `.content` parsing.
|
||||||
|
|
||||||
### Tag Examples:
|
### Tag Examples:
|
||||||
|
|
||||||
|
An image with MIME type, dimensions and blurhash:
|
||||||
|
`["media", "https://xyz.com/image001.png#m=image%2Fpng&dim=1342x704&blurhash=MnR3f%2C%25M%252%25MjZ~Wj%40j%5Bt7Rjs%3Aayfkj%5BWB%5C"]`
|
||||||
|
|
||||||
A kind 30023 event JSON file (with `nostr/30023` MIME type):
|
A kind 30023 event JSON file (with `nostr/30023` MIME type):
|
||||||
`["url", "https://xyz.com/example.json#m=nostr%2F30023"]`
|
`["url", "https://xyz.com/example.json#m=nostr%2F30023"]`
|
||||||
|
|
||||||
A PDF file without extension with added MIME type information:
|
|
||||||
`["r", "https://xyz.com/article02#m=application%2Fpdf"]`
|
|
||||||
|
|
||||||
## Recommended client behavior
|
## Recommended client behavior
|
||||||
|
|
||||||
When uploading images during a new post, clients can collect metadata
|
When uploading images during a new post, clients can collect metadata
|
||||||
|
|
Loading…
Reference in New Issue
Block a user