Skip to content

Commit 93809b9

Browse files
committed
Remove buzzsprout player
1 parent 27f14f7 commit 93809b9

File tree

4 files changed

+9
-65
lines changed

4 files changed

+9
-65
lines changed

src/app/podcast/[slug]/page.tsx

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,11 @@ import { notFound } from 'next/navigation';
44
import { Fragment } from 'react';
55
import DisplayHtml from '@/components/DisplayHtml';
66
import PodcastSubscribe from '@/components/PodcastSubscribe';
7-
import {
8-
getEpisode,
9-
getEpisodes,
10-
getTranscript,
11-
getPlayerSrc,
12-
getPlayerUrl,
13-
getPlayerStreamUrl,
14-
} from '@/data/podcast';
7+
import { getEpisode, getEpisodes, getTranscript } from '@/data/podcast';
158
import { dateForDisplay } from '@/util/date';
169
import { sanitizeCmsData } from '@/util/sanitizeCmsData';
1710
import createCmsImage from '@/util/cmsimage';
1811
import { Metadata } from 'next';
19-
import Script from 'next/script';
2012

2113
export async function generateStaticParams() {
2214
const podcastEpisodes = await getEpisodes({ limit: 99 });
@@ -42,18 +34,13 @@ async function getEpisodeData(slug: string) {
4234
return {
4335
episode: sanitizedEpisode,
4436
transcript,
45-
playerSrc: getPlayerSrc({ id: episode.podcastBuzzsproutId }),
46-
playerUrl: getPlayerUrl({ id: episode.podcastBuzzsproutId }),
47-
playerStreamUrl: getPlayerStreamUrl({ id: episode.podcastBuzzsproutId }),
4837
};
4938
}
5039

5140
export async function generateMetadata({
5241
params,
5342
}: NextPageProps<'slug'>): Promise<Metadata> {
54-
const { episode, playerUrl, playerStreamUrl } = await getEpisodeData(
55-
params.slug,
56-
);
43+
const { episode } = await getEpisodeData(params.slug);
5744

5845
const cardImage = episode.podcastEpisodeCard && episode.podcastEpisodeCard[0];
5946

@@ -88,14 +75,6 @@ export async function generateMetadata({
8875
description: description,
8976
card: 'player',
9077
site: '@VirtualCoffeeIO',
91-
players: [
92-
{
93-
width: 500,
94-
height: 210,
95-
playerUrl: playerUrl,
96-
streamUrl: playerStreamUrl,
97-
},
98-
],
9978
images: cardImage
10079
? [
10180
{
@@ -116,11 +95,10 @@ export async function generateMetadata({
11695
}
11796

11897
export default async function Newsletter({ params }: NextPageProps<'slug'>) {
119-
const { episode, transcript, playerSrc } = await getEpisodeData(params.slug);
98+
const { episode, transcript } = await getEpisodeData(params.slug);
12099

121100
return (
122101
<>
123-
<Script src={playerSrc} strategy="afterInteractive" />
124102
<main id="maincontent" className="container-lg py-md-4">
125103
<h1 className="display-5">{episode.title}</h1>
126104
<div className="text-right mb-2">
@@ -137,16 +115,6 @@ export default async function Newsletter({ params }: NextPageProps<'slug'>) {
137115

138116
<DisplayHtml className="lead" html={episode.podcastShortDescription} />
139117

140-
<div className="my-4 podcastplayer">
141-
{playerSrc && (
142-
<>
143-
<div
144-
id={`buzzsprout-player-${episode.podcastBuzzsproutId}`}
145-
></div>
146-
</>
147-
)}
148-
</div>
149-
150118
<PodcastSubscribe />
151119

152120
<hr />

src/app/podcast/page.tsx

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ import Link from 'next/link';
22
import DefaultLayout from '@/components/layouts/DefaultLayout';
33
import PodcastSubscribe from '@/components/PodcastSubscribe';
44
import PostList from '@/components/PostList';
5-
import { getEpisodes, getPlayerSrc } from '@/data/podcast';
5+
import { getEpisodes } from '@/data/podcast';
66
import { createMetaData } from '@/util/createMetaData.server';
77
import createCmsImage from '@/util/cmsimage';
8-
import Script from 'next/script';
98

109
export const metadata = createMetaData({
1110
title: 'Virtual Coffee Podcast',
@@ -19,17 +18,12 @@ export default async function PodcastsIndex() {
1918
const podcastEpisodes = await getEpisodes({ limit: 99 });
2019

2120
const latestEpisode = podcastEpisodes[0];
22-
const latestEpisodePlayerSrc = getPlayerSrc({
23-
id: latestEpisode.podcastBuzzsproutId!,
24-
});
2521

2622
return (
2723
<DefaultLayout
2824
heroHeader="Virtual Coffee Podcast"
2925
Hero="UndrawWalkInTheCity"
3026
>
31-
<Script src={latestEpisodePlayerSrc} strategy="afterInteractive" />
32-
3327
<div className="container bodycopy py-5 lead">
3428
<p>
3529
Virtual Coffee is an intimate community for developers at all stages
@@ -60,15 +54,6 @@ export default async function PodcastsIndex() {
6054
<Link href={latestEpisode.url!}>{latestEpisode.title}</Link>
6155
</h3>
6256

63-
<div className="mt-4 podcastplayer">
64-
{latestEpisodePlayerSrc && (
65-
<>
66-
<div
67-
id={`buzzsprout-player-${latestEpisode.podcastBuzzsproutId}`}
68-
></div>
69-
</>
70-
)}
71-
</div>
7257
{!!latestEpisode.episodeSponsors.length && (
7358
<>
7459
<div className="mt-3">

src/components/PodcastSubscribe.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ export default function PodcastSubscribe({
5555
</g>
5656
</svg>
5757
</a>
58-
<a href="https://feeds.buzzsprout.com/1558601.rss" aria-label="RSS Feed">
58+
<a
59+
href="https://feeds.virtualcoffee.io/virtual-coffee-podcast.rss"
60+
aria-label="RSS Feed"
61+
>
5962
<svg width="160" height="40" xmlns="http://www.w3.org/2000/svg">
6063
<g fill="none" fillRule="evenodd">
6164
<rect fill="#000" width="160" height="40" rx="7" />

src/data/podcast.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ export async function getTranscript({
249249
}: Partial<PodcastEpisode>): Promise<Transcript | null> {
250250
try {
251251
const response: { segments: TranscriptSegment[] } = await fetch(
252-
`https://www.buzzsprout.com/${buzzsproutPodcastId}/${id}/transcript.json`,
252+
`https://feeds.virtualcoffee.io/podcast-assets/${id}/transcript.json`,
253253
).then((res) => res.json());
254254

255255
if (response && response.segments) {
@@ -291,15 +291,3 @@ export async function getTranscript({
291291
return null;
292292
}
293293
}
294-
295-
export function getPlayerSrc({ id }: Pick<PodcastEpisode, 'id'>) {
296-
return `https://www.buzzsprout.com/${buzzsproutPodcastId}/${id}.js?container_id=buzzsprout-player-${id}&player=small`;
297-
}
298-
299-
export function getPlayerUrl({ id }: Pick<PodcastEpisode, 'id'>) {
300-
return `https://www.buzzsprout.com/${buzzsproutPodcastId}/${id}?client_source=twitter_card&amp;player_type=full_screen`;
301-
}
302-
303-
export function getPlayerStreamUrl({ id }: Pick<PodcastEpisode, 'id'>) {
304-
return `https://www.buzzsprout.com/${buzzsproutPodcastId}/${id}.mp3?blob_id=${id}&client_source=twitter_card`;
305-
}

0 commit comments

Comments
 (0)