Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
pscmedia
Visitor

SOLVED-Unexpected event 20 playing MP3 with SDK videoplayer

Hi all,
I'm trying to get mp3 audio to play alongside of my live hls video, so I followed the helpful advice from Belltown here: viewtopic.php?f=34&t=51192
However, when I go to play an item, the display breifly flashes it's "retrieving" and then falls back to the previous screen.

The relevant debug output says:

showHomeScreen | msg = Stream started. | index = 0
Unexpected event type: 20
showHomeScreen | msg = Content contains no playable tracks. | index = 0
Video status: 0 0
showHomeScreen | msg = | index = -5
Video request failure: -5 1


I'm trying to use 120MB mp3s that are about an hour long and have id3 tags, however, in these forums there seems to be a question about what is supported, so I also tried short, small mp3s without metadata of any kind, CBR 128kb/s and 32,24, and 16 bit at 48kHz and also 44.1kHz - all to no avail - same error. I've tried non-existent files (which produces an obvious error) and checked the server logs, so I know the files are being pulled by the roku. But now I'm at a loss! Any help would be fantastically helpful 🙂

My test Roku: Model: 3100X, Software version: 4.9 - build 5060

Thanks so much!
0 Kudos
5 REPLIES 5
RokuJoel
Binge Watcher

Re: Unexpected event 20 playing MP3 with SDK videoplayer

your hls stream has to contain the mp3 audio, you can't use audioplayer simultaneously with your video playback. This only will work on Roku2 and Roku3 players, won't work on the old "classic" players running firmware 3.1

The video playback component will play audio only streams though. Not recommended, as it shows either a blank screen (on "classic" devices) or a blank screen with a trick mode bar. The only benefit of using the video component is you might be able to hack in a semi-working bookmarking function to resume from where you left off, this probably won't work on classic devices either.

- Joel
0 Kudos
pscmedia
Visitor

Re: Unexpected event 20 playing MP3 with SDK videoplayer

I'm looking to just have a black screen while the audio plays, that's fine for our use. I'm using the video component as we have other categories with video, but we want an audio-only category with mp3s as well.

So if it is supported? Do you have any thoughts on what I'm doing wrong?

Thanks so much for your reply!
0 Kudos
RokuJoel
Binge Watcher

Re: Unexpected event 20 playing MP3 with SDK videoplayer

you would need to post an example of the data you are feeding the video playback component for someone to be able to help you troubleshoot this, possibly an excerpt of the xml you are using as well.

- Joel
0 Kudos
pscmedia
Visitor

Re: Unexpected event 20 playing MP3 with SDK videoplayer

I've tried many variations on the streamBitrate, including 0, 100, the actual file bitrate, 200, 400,1000..etc..but otherwise I don't know what I have wrong here:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed>
<resultLength>4</resultLength>
<endIndex>4</endIndex>
<item sdImg="http://myimage" hdImg="http://myimage">
<title>Long - no metadata - 44.1k - 24bit</title>
<contentId>6000</contentId>
<contentType>audio</contentType>
<contentQuality>SD</contentQuality>
<media>
<streamFormat>mp3</streamFormat>
<streamQuality>SD</streamQuality>
<streamBitrate>128</streamBitrate>
<streamUrl>http://site.org/media/audio/roku.mp3</streamUrl>
</media>
<synopsis>Test</synopsis>
<genres>Talk</genres>
<runtime>3600</runtime>
</item>

<item sdImg="http://myimage" hdImg="http://myimage">
<title>Short - no metadata - 44.1k - 24bit </title>
<contentId>6001</contentId>
<contentType>Talk</contentType>
<contentQuality>SD</contentQuality>
<media>
<StreamFormat>MP3</StreamFormat>
<streamQuality>SD</streamQuality>
<streamBitrate>128</streamBitrate>
<streamUrl>http://site.org/media/audio/rokuShort.mp3</streamUrl>
</media>
<synopsis>Test</synopsis>
<genres>Talk</genres>
<runtime>120</runtime>
</item>

<item sdImg="http://myimage" hdImg="http://myimage">
<title>Short - no metadata - 44.1k - 16bit </title>
<contentId>6002</contentId>
<contentType>Talk</contentType>
<contentQuality>SD</contentQuality>
<media>
<streamFormat>mp3</streamFormat>
<streamQuality>SD</streamQuality>
<streamBitrate>128</streamBitrate>
<streamUrl>http://site.org/media/audio/rokuShort16.mp3</streamUrl>
</media>
<synopsis>Test</synopsis>
<genres>Talk</genres>
<runtime>120</runtime>
</item>

<item sdImg="http://myimage" hdImg="http://myimage">
<title>Not here</title>
<contentId>6003</contentId>
<contentType>Talk</contentType>
<contentQuality>SD</contentQuality>
<media>
<streamFormat>mp3</streamFormat>
<streamQuality>SD</streamQuality>
<streamBitrate>100</streamBitrate>
<streamUrl>http://site.org/media/audio/nonexistent.mp3</streamUrl>
</media>
<synopsis>Test</synopsis>
<genres>Talk</genres>
<runtime>0</runtime>
</item>

</feed>



The files specified in the streamURLs for easy clicking:
http://site.org/media/audio/roku.mp3
http://site.org/media/audio/rokuShort.mp3
http://site.org/media/audio/rokuShort16.mp3

Thanks so much!
0 Kudos
pscmedia
Visitor

Re: SOLVED-Unexpected event 20 playing MP3 with SDK videopla

The bitrate value isn't required and the streamFormat belongs outside of the media tag - and then the mod from Belltown works wonderfully !

<item sdImg="http://test.png" hdImg="http://test.png">
<title>The First Test </title>
<contentId>6045</contentId>
<contentType>audio</contentType>
<contentQuality>SD</contentQuality>
<streamFormat>mp3</streamFormat>

<media>
<streamQuality>SD</streamQuality>
<streamBitrate></streamBitrate>
<streamUrl>http://site.org/media/audio/roku.mp3</streamUrl>
</media>
<synopsis>5 - Test </synopsis>
<genres>Church</genres>
<runtime>3600</runtime>
</item>
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.