#1425: Use Open Graph to determine video orientation in HTML #1526
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issues covered
#1425
Description
Maybe the last of #1425. This uses Open Graph to determine video orientation in HTML. Works for things like YouTube videos where there's an HTML document at the URL. For example: https://www.youtube.com/shorts/ZwlBxvnH-So
That's a YouTube short, and it should appear in portrait orientation in Nos because its height is greater than its width, as determined by the
meta
tags containing the Open Graph properties.We can't do this for things like
note16rs86sh4peyqu6gtppw2y4j88z0nrcmupeefnj5flnwxp3fzdfuqsln02y
because it contains a direct link to a mp4 video, rather than a link to an HTML document.How to test
note1awmfrttfmuqecqvxhstwpad88n3gk66f6zwy3xq88dnmaw0xqmgsga9q3r
note12vlzgjvluewmf92ylxcuqdtqv70n0u6t5jqykj8u43kysf0kds4qmrwtt2
.mp4
. Here's one:note14h3u9pseydfpsxzwzqtr3uc6k5th4nhqwtf8fyuc2wpgud6zsvkqmhgdmd
video/mp4
, so there's no Open Graph metadata.Screenshots/Video
Simulator.Screen.Recording.-.iPhone.SE.3rd.generation.-.2024-09-19.at.18.13.19.mp4
Notes
There's some complexity in the logic here. Open Graph is a fallback; if the Nostr event contains
imeta
tags, those will be used and we won't fetch the Open Graph data. This is all to say: if you want to test this well, make sure your notes don't containimeta
tags. Nos doesn't postimeta
tags (yet!), but Damus does. So post your test notes from Nos.