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: 
mixe
Visitor

Re: v3.0 Beta SDK available for download

Hi Is there going to be any support for a audio compression format when using the roAudioResource device :idea:
0 Kudos
RokuKevin
Visitor

Re: v3.0 Beta SDK available for download

roAudioResource currently only supports .wav files.

--Kevin
0 Kudos
RokuKevin
Visitor

Re: v3.0 Beta SDK available for download

The Java sample does not run on a Roku. It runs on an Android phone and is a remote application example.

The applications you can build that run on the Roku are all developed using Brightscript.

--Kevin.
0 Kudos

Re: v3.0 Beta SDK available for download

"RokuKevin" wrote:
The Java sample does not run on a Roku. It runs on an Android phone and is a remote application example.

The applications you can build that run on the Roku are all developed using Brightscript.

--Kevin.


Is there a Reciever.java file that needs to be part of the sample code?
0 Kudos
mixe
Visitor

Re: v3.0 Beta SDK available for download

I have had a few problems with using Brightscript Beta 3.0 build 2207, which could be just finger trouble on my part. Theses are;

1. After using "roUrlTransfer" the "roAudioPlayer" does not seem to work!
2. If the "roTransfer" fails, when using Microsoft IIS then you have to restart IIS.
3. Then mixing "roScreen" objects and the Roku built-in screen component types. The built-in screen components stop working!

I hope this information is useful :?
0 Kudos
TheEndless
Channel Surfer

Re: v3.0 Beta SDK available for download

"mixe" wrote:
I have had a few problems with using Brightscript Beta 3.0 build 2207, which could be just finger trouble on my part. Theses are;

1. After using "roUrlTransfer" the "roAudioPlayer" does not seem to work!
2. If the "roTransfer" fails, when using Microsoft IIS then you have to restart IIS.
3. Then mixing "roScreen" objects and the Roku built-in screen component types. The built-in screen components stop working!

I hope this information is useful :?

I've never seen #1 or #2, and I've used all three of those (roUrlTransfer, roAudioPlayer, and IIS) in conjunction with each in a number of my channels.

#3 is actually documented in the BrightScript Reference:
"BrightScriptReferenceManual - 11.1" wrote:
Once an roScreen is created, the display stack enters “Game Mode”, and other screen components documented in the Component Reference cannot be used. Other screen components cannot be intermixed with roScreens as the roScreen display stack is maintained independently from the main screen component display stack. When the final roScreen component is closed, other screen components can be used again.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
destruk
Streaming Star

Re: v3.0 Beta SDK available for download

Is there any ETA on when 3.0 will be released?
0 Kudos
tamatura
Visitor

Re: v3.0 Beta SDK available for download

Hi,

I just downloaded the 3.0 SDK. And I have a few questions/issues:

1. The Android remote control client does not build. There is some class called Receiver() which is not found. I assume that this is a file as part of the example thats not there in the zip? I'm using Android 2.2
2. Is there any plans to provide a Bluetooth API for Roku2?

Thanks,
Shreesh
0 Kudos
Mister_DNA
Visitor

Re: v3.0 Beta SDK available for download

I'd like to make a request/suggestion: before the 3.0 SDK gets a full release, could some of the example sources be updated/modified, too?

I use the videoplayer example, so I can't speak to the other examples, but from what I understand, the videoplayer example has things in the code/xml that have been obsolete since v 2.6.

I realize this wouldn't be the thread for doing that, but it would be nice to see some sticky threads dedicated to cleaning up, fixing, and improving upon some of the example sources.
If you want a vision of the future, imagine a boot stamping on a human face - forever. - George Orwell
0 Kudos
kavulix
Visitor

Re: v3.0 Beta SDK available for download

Tested on Roku 2 HD using firmware v4.1

BUGS in v3 SDK

  • SetDisplayMode() IS a member of ifSpringboardScreen interface but is not documented

  • SetDisplayMode() IS a member of ifPosterScreen interface but is not documented

  • SetTitle() is NOT a member of ifSearchScreen interface but is documented as such. If used it will result in the error below.

    Member function not found in BrightScript Component or interface.

  • roPosterScreen.SetListStyle("flat-episodic") does not display the posters for any item not in focus even when not using episode numbers.

  • Using roPosterScreen.SetListStyle("flat-episodic-16x9") with roPosterScreen.SetListDisplayMode("scale-to-fit") successfully displays the non-focused posters but the scale-to-fit setting is only applied to the in-focus poster. The posters to the side of the in-focus poster do not preserve the original aspect ratio.

  • It is not possible to use Seek() on a mp3 file using roAudioPlayer or roVideoScreen with one exception (see last section of code below)


Features that would greatly improve audio support

  • Add SetPositionNotificationPeriod() to ifAudioPlayer interface

  • Add isPlaybackPosition() event type to roAudioPlayerEvent

  • Use PlayStart Meta-Data attribute to resume audio playback from a specific position

  • Use SDPosterUrl and HDPosterUrl meta-data attributes to set a background image on roVideoScreens

  • Add SetBGDisplayMode() method to roVideoScreen to determine whether background image should be full screen or scale-to-fit


Resuming playback for audio files
I've only tested these issues using mp3 files. The main stream that I use for testing is hosted on archive.org. I initially tried to implement an audio player that provided a save/resume feature using a springboard screen and roAudioPlayer. Unfortunately since there isn't a playback notification event there was no way to retrieve the current position. The only way I was able to determine the audio playback position was to use a roTimespan object in combination with the wait() function. The code below is a much abbreviated example of how this worked.

currentpos = 0
totalLength = 3600
isPlaying = false
timer = CreateObject("roTimespan")
while true
msg = wait(1000, port)
if type(msg) = "roAudioPlayerEvent" then
if msg.isStatusMessage() then
message = msg.getMessage()
if message = "start of play" then
timer.Mark() 'start the timer
isPlaying = true
endif
elseif msg.isPaused()
currentpos = currentpos + timer.TotalSeconds()
isPlaying = false
elseif msg.isResumed()
timer.Mark() 'restart the timer
isPlaying = true
endif
elseif isPlaying then
springboard.SetProgressIndicator(currentpos + timer.TotalSeconds(), totalLength)
endif
end while

I was able to keep track of the current playback position and update the progress indicator on the springboard screen but there was no way to resume playback at a specific position. Calling Pause() and then Resume() work just fine, but if the playback position is saved to the registry and you want to return to that position at a later time then there was simply no way to accomplish it. The PlayStart and StreamStartTimeOffset meta-data attributes have no effect on a mp3 file (possibly all audio files but I haven't tested wma). Calling the Seek() method on a roAudioPlayer prior to or after calling Play() had no effect. As far as I know it is literally impossible to resume playback at a specific position using roAudioPlayer.

My last option was to switch to a roVideoScreen just to play mp3 files. Unfortunately I discovered some of the same issues with roVideoScreen. While it did provide the playback position notification and eliminated the need to use roTimespan/wait I still couldn't resume at a specific position. Calling Seek() prior to or after calling Show() had no effect, calling Seek() from the isStreamStarted() notification had no effect, and the PlayStart and StreamStartTimeOffset meta-data attributes were ignored for mp3 files. The ONLY way I was able to resume playback at a specific position was with the code below.

resume = 100
currentpos = 0
isResumed = false
while true
msg = wait(0, port)
if type(msg) = "roVideoScreenEvent" then
if msg.isPlaybackPosition() then
currentpos = msg.GetIndex()
print "playback position: "; currentpos
if not isResumed and resume > 0 then
isResumed = true
player.Seek((resume + 1) * 1000)
endif
endif
endif
end while

It really shouldn't be that difficult to save/resume an audio playback position. Since it CAN be accomplished using roVideoScreen I think it would be incredibly useful to have the option to set a default background image on that screen. If a roVideoScreen is being used to play an audio file then it will only display a black background along with the progress bar. I know I could use roImageCanvas to display an image on top of the roVideoScreen but I would then lose the user controls (play, pause, etc). Please add the option to use the SDPosterUrl and HDPosterUrl meta-data to display a background image on roVideoScreens. I think a new method should also be added to control the scaling/aspect ratio for the bg image (e.g., SetBGDisplayMode("scale-to-fit").
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.