Skip to content

Commit

Permalink
add podcasts to spotify embeds (#5514)
Browse files Browse the repository at this point in the history
  • Loading branch information
haileyok authored Sep 27, 2024
1 parent c7b48cb commit dd2fedb
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/lib/strings/embed-player.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Dimensions} from 'react-native'

import {isSafari} from 'lib/browser'
import {isWeb} from 'platform/detection'
import {isSafari} from '#/lib/browser'
import {isWeb} from '#/platform/detection'

const {height: SCREEN_HEIGHT} = Dimensions.get('window')

Expand Down Expand Up @@ -185,6 +185,20 @@ export function parseEmbedPlayerFromUrl(
playerUri: `https://open.spotify.com/embed/track/${id ?? idOrType}`,
}
}
if (typeOrLocale === 'episode' || idOrType === 'episode') {
return {
type: 'spotify_song',
source: 'spotify',
playerUri: `https://open.spotify.com/embed/episode/${id ?? idOrType}`,
}
}
if (typeOrLocale === 'show' || idOrType === 'show') {
return {
type: 'spotify_song',
source: 'spotify',
playerUri: `https://open.spotify.com/embed/show/${id ?? idOrType}`,
}
}
}
}

Expand Down

0 comments on commit dd2fedb

Please sign in to comment.