johnny8ch
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2013
01:48 AM
SOLVED: roAudioPlayer Buffering Delays for Http mp3 streams
So for anyone out there who was running into the problem of the audio player buffer buffering for a ridiculous ( over 5 secs) amount of time i found a solution i think.
basically, just after setting the roPlayer object to play -- then set a negative Seek in milliseconds , i used -180000 for - 3minutes
thats a minus sign - not a dash
so i added the blablabla.Seek( -180000) to the files indicated below:
from the audioapp example file AudioPlayer.brs :
.....
else if newstate = 2 then ' PLAYING
if m.isplaystate = 0
m.audioPlayer.play() ' STOP->START
m.audioPlayer.Seek(-180000)
else
.....
or if your are using the videoplayer example to play audio, in appDetailScreen.brs ( modified according to:
viewtopic.php?p=352494 )
.....
else if button = AUDIO_BUTTON_PLAY()
isPlaying = true
isPaused = false
audio.Play()
audio.Seek(-180000)
show.CurrentPosition = 0
zeroProgressBar(screen, show)
.....
good luck
if anyone know a better way please let me know -- it took me forever to get anything going but this seems to work --
i was getting like 30-60 second delays and after unplugging my router with the stream playing noticed that it was playing
for like 2 minutes -- maybe, roAudioPlayer saves the position in the stream at which you stopped and tries to get back to that
position after you return to the same url ?
if this works for others maybe Roku folks would consider documenting
ps- im not a big forum poster guy so if this is not appropriate please inform me as such and direct accordingly, thx
basically, just after setting the roPlayer object to play -- then set a negative Seek in milliseconds , i used -180000 for - 3minutes
thats a minus sign - not a dash
so i added the blablabla.Seek( -180000) to the files indicated below:
from the audioapp example file AudioPlayer.brs :
.....
else if newstate = 2 then ' PLAYING
if m.isplaystate = 0
m.audioPlayer.play() ' STOP->START
m.audioPlayer.Seek(-180000)
else
.....
or if your are using the videoplayer example to play audio, in appDetailScreen.brs ( modified according to:
viewtopic.php?p=352494 )
.....
else if button = AUDIO_BUTTON_PLAY()
isPlaying = true
isPaused = false
audio.Play()
audio.Seek(-180000)
show.CurrentPosition = 0
zeroProgressBar(screen, show)
.....
good luck
if anyone know a better way please let me know -- it took me forever to get anything going but this seems to work --
i was getting like 30-60 second delays and after unplugging my router with the stream playing noticed that it was playing
for like 2 minutes -- maybe, roAudioPlayer saves the position in the stream at which you stopped and tries to get back to that
position after you return to the same url ?
if this works for others maybe Roku folks would consider documenting
ps- im not a big forum poster guy so if this is not appropriate please inform me as such and direct accordingly, thx
5 REPLIES 5
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2013
03:06 AM
Re: SOLVED: roAudioPlayer Buffering Delays for Http mp3 stre
Bless you! I don't know if this is the best first post ever, but it's certainly the most timely. I've been struggling with this problem the whole weekend. For me, it only happens once in a while and often goes away by itself, so it's very hard to try to find some workaround. I'll give this a shot and see how it goes.
It was definitely appropriate for you to post here. The only suggestion I'd make is that the next time you post code, enclose it in "code" tags, then you can get proper formatting and set your code off from the rest of your post:
-JT
It was definitely appropriate for you to post here. The only suggestion I'd make is that the next time you post code, enclose it in "code" tags, then you can get proper formatting and set your code off from the rest of your post:
else if button = AUDIO_BUTTON_PLAY()
isPlaying = true
isPaused = false
audio.Play()
audio.Seek(-180000)
show.CurrentPosition = 0
zeroProgressBar(screen, show)
end if
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2013
02:13 PM
Re: SOLVED: roAudioPlayer Buffering Delays for Http mp3 stre
To follow up, this definitely works! Thanks again.
-JT
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
bubasknr
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2013
12:25 AM
Re: SOLVED: roAudioPlayer Buffering Delays for Http mp3 stre
sweet thanks so much!
greubel
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2013
06:51 AM
Re: SOLVED: roAudioPlayer Buffering Delays for Http mp3 stre
Please check this post ! http://forums.roku.com/viewtopic.php?f=34&t=56762
I have 5.1 build 1012
I have 5.1 build 1012
steco
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2016
04:44 AM
Re: SOLVED: roAudioPlayer Buffering Delays for Http mp3 stre
Hi all
Where do I add the seek to the appvideoscreen.brs file?
This is what my appvideo.brs file looks like
Function showVideoScreen(episode As Object)
if type(episode) <> "roAssociativeArray" then
print "invalid data passed to showVideoScreen"
return -1
endif
port = CreateObject("roMessagePort")
screen = CreateObject("roVideoScreen")
screen.SetMessagePort(port)
screen.Show()
screen.SetContent(episode)
screen.Show()
'Uncomment his line to dump the contents of the episode to be played
'PrintAA(episode)
while true
msg = wait(0, port)
if type(msg) = "roVideoScreenEvent" then
print "showHomeScreen | msg = "; msg.getMessage() " | index = "; msg.GetIndex()
if msg.isScreenClosed()
print "Screen closed"
exit while
elseif msg.isRequestFailed()
print "Video request failure: "; msg.GetIndex(); " " msg.GetData()
elseif msg.isStatusMessage()
print "Video status: "; msg.GetIndex(); " " msg.GetData()
elseif msg.isButtonPressed()
print "Button pressed: "; msg.GetIndex(); " " msg.GetData()
else
print "Unexpected event type: "; msg.GetType()
end if
else
print "Unexpected message class: "; type(msg)
end if
end while
End Function
Where do I add the seek to the appvideoscreen.brs file?
This is what my appvideo.brs file looks like
Function showVideoScreen(episode As Object)
if type(episode) <> "roAssociativeArray" then
print "invalid data passed to showVideoScreen"
return -1
endif
port = CreateObject("roMessagePort")
screen = CreateObject("roVideoScreen")
screen.SetMessagePort(port)
screen.Show()
screen.SetContent(episode)
screen.Show()
'Uncomment his line to dump the contents of the episode to be played
'PrintAA(episode)
while true
msg = wait(0, port)
if type(msg) = "roVideoScreenEvent" then
print "showHomeScreen | msg = "; msg.getMessage() " | index = "; msg.GetIndex()
if msg.isScreenClosed()
print "Screen closed"
exit while
elseif msg.isRequestFailed()
print "Video request failure: "; msg.GetIndex(); " " msg.GetData()
elseif msg.isStatusMessage()
print "Video status: "; msg.GetIndex(); " " msg.GetData()
elseif msg.isButtonPressed()
print "Button pressed: "; msg.GetIndex(); " " msg.GetData()
else
print "Unexpected event type: "; msg.GetType()
end if
else
print "Unexpected message class: "; type(msg)
end if
end while
End Function