diff options
author | Paul Frazee <pfrazee@gmail.com> | 2024-01-04 17:37:36 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-04 17:37:36 -0800 |
commit | 0dae24e78ffe0b2d69349a03f669949e4d5afc21 (patch) | |
tree | f2895aebae675d0c5d6c9213626a37a98a53f724 /src/lib/link-meta/link-meta.ts | |
parent | db62f272412df2c34e1a57200291b53fa1cd07aa (diff) | |
download | voidsky-0dae24e78ffe0b2d69349a03f669949e4d5afc21.tar.zst |
Additional embed sources and external-media consent controls (#2424)
* add apple music embed * add vimeo embed * add logic for tenor and giphy embeds * keep it simple, use playerUri for images too * add gif embed player * lint, fix tests * remove links that can't produce a thumb * Revert "remove links that can't produce a thumb" This reverts commit 985b92b4e622db936bb0c79fdf324099b9c8fcd8. * Revert "Revert "remove links that can't produce a thumb"" This reverts commit 4895ded8b5120c4fc52b43ae85c9a01ea0b1a733. * Revert "Revert "Revert "remove links that can't produce a thumb""" This reverts commit 36d04b517ba5139e1639f2eda28d7f9aaa2dbfb6. * properly obtain giphy metadata regardless of used url * test fixes * adjust gif player * add all twitch embed types * support m.youtube links * few logic adjustments * adjust spotify player height * prefetch gif before showing * use memory-disk cache policy on gifs * use `disk` cachePolicy on ios - can't start/stop animation * support pause/play on web * onLoad fix * remove extra pressable, add accessibility, fix scale issues * improve size of embed * add settings * fix(?) settings * add source to embed player params * update tests * better naming and settings options * consent modal * fix test id * why is webstorm adding .tsx * web modal * simplify types * adjust snap points * remove unnecessary yt embed library. just use the webview always * remove now useless WebGifStill 😠* more type cleanup * more type cleanup * combine parse and prefs check in one memo * improve dimensions of youtube shorts * oops didn't commit the test 🫥 * add shorts as separate embed type * fix up schema * shorts modal * hide gif details * support localized spotify embeds * more cleanup * improve look and accessibility of gif embeds * Update routing for the external embeds settings page * Update and simplify the external embed preferences screen * Update copy in embedconsent modal and add 'allow all' button --------- Co-authored-by: Hailey <me@haileyok.com>
Diffstat (limited to 'src/lib/link-meta/link-meta.ts')
-rw-r--r-- | src/lib/link-meta/link-meta.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/link-meta/link-meta.ts b/src/lib/link-meta/link-meta.ts index c17dee51f..c7c8d4130 100644 --- a/src/lib/link-meta/link-meta.ts +++ b/src/lib/link-meta/link-meta.ts @@ -2,6 +2,7 @@ import {BskyAgent} from '@atproto/api' import {isBskyAppUrl} from '../strings/url-helpers' import {extractBskyMeta} from './bsky' import {LINK_META_PROXY} from 'lib/constants' +import {getGiphyMetaUri} from 'lib/strings/embed-player' export enum LikelyType { HTML, @@ -34,6 +35,13 @@ export async function getLinkMeta( let urlp try { urlp = new URL(url) + + // Get Giphy meta uri if this is any form of giphy link + const giphyMetaUri = getGiphyMetaUri(urlp) + if (giphyMetaUri) { + url = giphyMetaUri + urlp = new URL(url) + } } catch (e) { return { error: 'Invalid URL', |