Question

How do I create a Player for a Podcast using RSS Feed?

Posted March 5, 2021 499 views
PHPNode.jsAPIJavaScriptCSSHTML

I am building a website using html, css and bootstrap for my podcast, my problem is that I want to put a player of the podcast in the hero image part of the website so people can come and listen to my podcast at the moment of entering into the website. I want the player to use the RSS Feed of my podcast to always update the player with the latest episode, I hace been trying to look for a solution for that but I have found anything. I made an account here on stack overflow to reach some expert on this field to help me with this problem.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi there,

You would need to add some JavaScript so that it could query the RSS feed and then you could use that response and render the output on your page.

To make an HTTP request to the RSS feed, you could do something like this:

const RSS_URL = `https://bobbyiliev.com/feed/`;

fetch(RSS_URL)
  .then(response => response.text())
  .then(str => new window.DOMParser().parseFromString(str, "text/xml"))
  .then(data => console.log(data))

You can take a look at this tutorial here on how to parse the response.

Regards,
Bobby