import {Dimensions} from 'react-native' import {IS_WEB} from '#/env' const {height: SCREEN_HEIGHT} = Dimensions.get('window') const IFRAME_HOST = IS_WEB ? // @ts-ignore only for web window.location.host === 'localhost:8100' ? 'http://localhost:8100' : 'https://bsky.app' : __DEV__ && !process.env.JEST_WORKER_ID ? 'http://localhost:8100' : 'https://bsky.app' export const embedPlayerSources = [ 'youtube', 'youtubeShorts', 'twitch', 'spotify', 'soundcloud', 'appleMusic', 'vimeo', 'giphy', 'tenor', 'klipy', 'flickr', 'bandcamp', ] as const export type EmbedPlayerSource = (typeof embedPlayerSources)[number] export type EmbedPlayerType = | 'youtube_video' | 'youtube_short' | 'twitch_video' | 'spotify_album' | 'spotify_playlist' | 'spotify_song' | 'soundcloud_track' | 'soundcloud_set' | 'apple_music_playlist' | 'apple_music_album' | 'apple_music_song' | 'vimeo_video' | 'giphy_gif' | 'tenor_gif' | 'klipy_gif' | 'flickr_album' | 'bandcamp_album' | 'bandcamp_track' export const externalEmbedLabels: Record = { youtube: 'YouTube', youtubeShorts: 'YouTube Shorts', vimeo: 'Vimeo', twitch: 'Twitch', giphy: 'GIPHY', tenor: 'Tenor', klipy: 'KLIPY', spotify: 'Spotify', appleMusic: 'Apple Music', soundcloud: 'SoundCloud', flickr: 'Flickr', bandcamp: 'Bandcamp', } /** * These sources are proxied through our CDN and do not leak any user data, * thus are safe to embed without a warning. */ export const exemptExternalEmbedSources = new Set([ 'tenor', 'klipy', ]) export interface EmbedPlayerParams { type: EmbedPlayerType playerUri: string /** * Web-only ordered list of `` tags for `