Your Digital Media Has Never Looked So Good

 
CoryM
Topic Author
Posts: 3
Joined: Wed Apr 27, 2011 1:55 pm

roVideoScreen + roAudioPlayer

Wed Apr 27, 2011 2:00 pm

It seems that if I have an roAudioPlayer playing or paused if I try to Show() a roVideoScreen it sends a isScreenClosed() event immediately.

Is this intentional? Is there a way around it?

I don't really need the audio playing along with the video. I would be fine with pausing it and resuming it once the video is complete.
 
jbrave
Posts: 716
Joined: Mon Mar 22, 2010 3:00 pm
Location: Ben Lomond, CA
Contact:

Re: roVideoScreen + roAudioPlayer

Wed Apr 27, 2011 5:47 pm

If you use a global for the audio player like:

m.audioplayer=createobject("roaudioplayer")



Then the audioplayer should continue to exist no matter what else you do. (except assign it to something else) You can also pass a non-global audioplayer to the video routine:
audioplayer=createobject("roaudioplayer")

audioplayer=playvideo(content,audioplayer)

function playvideo(content as object, audioplayer as object) as object

...
return audioplayer 
end function
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
 
CoryM
Topic Author
Posts: 3
Joined: Wed Apr 27, 2011 1:55 pm

Re: roVideoScreen + roAudioPlayer

Thu Apr 28, 2011 5:58 am

I'm sorry, that wasn't what I was asking.

a=createobject("roaudioplayer")
v=createobject("rovideoscreen")

'Setup the Content Metadata......

a.Play()

port = CreateObject("roMessagePort")
v.SetMessagePort(port)
v.Show()

while true
    msg = wait(0, port)
        if type(msg) = "roVideoScreenEvent" then
            if msg.isScreenClosed()
                print "This gets called right away, the video never plays"

 
User avatar
RokuKevin
Roku Engineering
Posts: 796
Joined: Tue Sep 22, 2009 2:29 pm

Re: roVideoScreen + roAudioPlayer

Thu Apr 28, 2011 9:12 am

In your example, you didn't setup any content-meta data for the roVideoScreen to play...

Nonetheless, you can't play audio and video simultaneously. There is no mixing of the audio.

--Kevin
 
CoryM
Topic Author
Posts: 3
Joined: Wed Apr 27, 2011 1:55 pm

Re: roVideoScreen + roAudioPlayer

Thu Apr 28, 2011 9:23 am

'Setup the Content Metadata......

was just suppose to be a placeholder :-) That is all of the code talking to our service. Anyway....

If I Pause() the AudioPlayer, it still doesn't work. The AudioPlayer has to be Stopped or the VideoScreen will not launch.

Is this the expected behavior?

I'm not looking to mix the audio. I just want an mp3 to be playing, play a video, then continue playing the mp3 from where it left off.
 
User avatar
RokuKevin
Roku Engineering
Posts: 796
Joined: Tue Sep 22, 2009 2:29 pm

Re: roVideoScreen + roAudioPlayer

Thu Apr 28, 2011 9:27 am

That's expected behavior.

--Kevin
 
RyanMarquiste
Posts: 61
Joined: Sat Apr 23, 2011 6:26 pm

Re: roVideoScreen + roAudioPlayer

Sat Apr 30, 2011 2:40 am

CoryM wrote:
I just want an mp3 to be playing, play a video, then continue playing the mp3 from where it left off.


I haven't tested it, but I'd recommend trying the following.

1. When you create the roAudioPlayer, create an roTimespan as well.
2. When you set the roAudioPlayer to play, call Mark() with the roTimeSpan.
3. Just before starting the video, grab the total milliseconds from the roTimeSpan.
4. After the video has finished playing, recreate your roAudioPlayer with the same Meta data and then use Seek to get back to where you left off.
 
renojim
** Valued Community Member **
Posts: 3490
Joined: Mon Feb 15, 2010 1:35 pm

Re: roVideoScreen + roAudioPlayer

Sat Apr 30, 2011 4:22 am

Seeking within an MP3 doesn't work.

-JT

Who is online

Users browsing this forum: No registered users and 10 guests