question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Content from Podcast Provider Megaphone.fm does not load fully.

See original GitHub issue

It seems Megaphone.fm inserts dynamic ads into the stream. When loading streams into WaveSurfer only the ad loads BUT looking at network traffic you can see the entire audio file is downloaded.

Wavesurfer.js version(s): Latest from https://unpkg.com/wavesurfer.js

Browser and operating system version(s): Mac, PC Chrome, Explorer, Safari, etc,

Code needed to reproduce the issue:

<!DOCTYPE html><!--suppress ALL -->
<html xmlns="http://www.w3.org/1999/html">
<head>
<script src="https://unpkg.com/wavesurfer.js"></script>
<script>
	document.addEventListener("DOMContentLoaded", () => {

		const wavesurfer = WaveSurfer.create({container: '#waveform',waveColor: 'blue', progressColor: 'red'});
		wavesurfer.load('https://traffic.megaphone.fm/HSW2183165052.mp3');

		document.querySelector('#wfplay').onclick = (e => {
			wavesurfer.play();
		});
	});
</script>
</head>
<body>
	<div id="waveform"></div>
	<button id='wfplay'>Play</button>

	<br/><br/>

	<audio controls preload>
		<source src="https://traffic.megaphone.fm/HSW2183165052.mp3" type="audio/mp3" preload></source>
	</audio>
</body>

Use behaviour needed to reproduce the issue:

Notice that Wavesurfer downloads the entire MP3 which is 40 minutes long, about 45 MB. BUT it only loads the first 15 or 30 seconds into the player.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
rick-rheocommented, Sep 5, 2019

Look at your own response to see a douchebag. “I don’t care about megafone” etc. You could have spent 10 minutes looking to see why the audio doesn’t load or you could have pointed me to the right place to look myself. Instead you threw up excuses and blame. There’s a problem in your code. This is not just related to megafone, and I’m sure its something they are doing that does not break the MP3 spec that you are not handing. That’s something I would think an author would be concerned about. But instead you want to be a dick. So I’m going to fix this myself and if anyone out there runs into the same thing, contact me and I’ll send you the fix because I’m sure as hell not going to commit it upstream.

1reaction
rick-rheocommented, Sep 4, 2019

Not asking for magic. I guess I was wrong that the author would be concerned that a major podcast CDN is serving content that can’t be loaded into their library and that same author would know their code well enough to debug what’s going wrong fairly easily. But clearly you don’t care.

I’ll just figure it out myself on my own fork. Thanks for being so helpful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Audio Processing Statuses | Megaphone Help Center
Below are explanations of the various audio statuses that you may see when navigating throughout Megaphone. Podcast Draft Episode Tab. Needs Audio: This...
Read more >
Transferring Your Podcast to Megaphone
If you have an existing podcast that you're moving to Megaphone, you'll need to do two things: First, import your existing content to...
Read more >
Megaphone: A Modern Podcasting Platform
The Megaphone API (https://cms.megaphone.fm/api) allows podcast producers and partners to view, create, update, and delete podcasts and episodes.
Read more >
Reporting Overview - Podcast Performance
This report shows you impressions per podcast, for the dates and time buckets of your choosing.
Read more >
Transferring a Podcast Checklist - Megaphone Help Center
Confirm That All Episodes Are in Megaphone: After your show has finished importing (episodes will no longer display a yellow "audio processing" icon),...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found