Skip to content

Commit

Permalink
Create default player ID for podcasts
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisChinchilla committed May 24, 2024
1 parent 1b2d248 commit f014042
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/layouts/PodcastLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export interface Props {
podcast: CollectionEntry<'podcasts'>;
}
const { podcast, episodeData } = Astro.props;
const urlParams = new URLSearchParams(podcast.enclosure.att_url);
const podcastID = urlParams.get('awEpisodeId')
const meta: MetaSEO = {
title: frontmatter?.title,
image: podcast.image.att_href,
Expand Down Expand Up @@ -75,17 +76,10 @@ function slugify(str) {
<div class="my-2" set:html={truncateMarkdown(podcast.description, { limit: 500, ellipsis: true })} />
<h2 class="text-xl sm:text-2xl leading-tight mb-2 font-heading dark:text-slate-300">Listen and download</h2>

{episodeData.player_embed ?

<iframe height="200px" width="100%" frameborder="no" scrolling="no" seamless src=`https://player.simplecast.com/${episodeData.player_embed}`></iframe>

<iframe height="200px" width="100%" frameborder="no" scrolling="no" seamless src=`https://player.simplecast.com/${podcastID}`></iframe>

:

<audio controls src={podcast.enclosure.att_url} preload="none">
<a href={podcast.enclosure.att_url}>Download audio</a>
</audio>

}

<ul>
{episodeData.descript_embed ?
<li><a href=`${episodeData.descript_embed}`>Interactive transcript</a></li> : ''}
Expand Down

0 comments on commit f014042

Please sign in to comment.