Skip to main content

play a video file in RI emulator using Xlet programming

9 replies [Last post]
Joined: 2012-08-27

I have configured the tru2way SDK with eclipse IDE. How to play a video file in the RI emulator using Xlet programming?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-06-19

Two example xlets play video files. See the java code in the directories:

The video files may be found in:

Mapping of the video files to channels is specified in:
$RICOMMONROOT/resources/tunedata/ or

Joined: 2012-08-27

Could you please tell me how I can debug this file "" using eclipse IDE. Before that I have to integrate this eclipse IDE with the RI_Stack but how ??

Joined: 2012-07-19


May I recommend taking a look at the public RI wiki page for some of your questions? I believe the following pages will be very helpful:

Joined: 2012-08-27

Thank you smallman.
I went to that folder : $OCAPROOT/apps/qa/org/cablelabs/xlet/TuneTest and inside that I found three files and among them I think "" is responsible to play the videos in the RI emulator.
Now I want to debug the code using eclipse. I have downloaded and unzip it in C drive. While configuring using "RI Bundle Registry", I am getting the following exception:
org.tru2way.twb.ri.bundle.runtimes.OcapBundleException: Location is not a directory: $(TWB_TOOLROOT)

So I have changed the "TWB_TOOLROOT" with "C:\trunk\ri\RI_Platform". But still I am getting exception.

Should I edit anyportion in "RIBundleManifest.xml" in trunk folder where I have kept the source code of Ocap RI.

Plz give some input on this.

Joined: 2011-10-31

I know one way of playing a specific MPEG-2 format video as below:
1) Use to create a player
2) then start the player using Player.start()

Joined: 2012-08-27

here is the piece of code what I am trying :
try {
// Create a data source for our locator. We could create the player
// directly by calling Manager.createPlayer() with the MediaLocator if we
// preferred - the effect is the same.

locator = new;
DataSource playingDataSource = Manager.createDataSource(locator);
// Now create the player
player = Manager.createPlayer(playingDataSource);
catch (MediaException e) {

when running this code, I am getting this exception : "NoDataSourceException (id =88)"

I don't know how to resolve this. Could you please give some input on this how can I resolve this.

Joined: 2011-10-31

I used HTTP protocol for the video file url. What protocol you are using? That should be supported by RI.

Joined: 2012-08-27

I am using file protocol. Here is the piece of code :

private static final String VIDEO_URL
= "file:///C:/CableLabs/tru2way/tags-RI_I1_2_0_REL_B-21498/ocap-ri/ricommon/resources/tunedata/galaxy_pingpong.mpg";

private static final String VIDEO_URL_2
= "file:///C:/CableLabs/tru2way/tags-RI_I1_2_0_REL_B-21498/ocap-ri/ricommon/resources/tunedata/background.mpg";

// Instance variables

could please share the code which is working In your system for Http protocol ? I also dont know that what are the protocol are supported by RI.

I have read this in the code :
" The URL of the video that we will display. For XleTView we must use a file:// URL because we don't have a broadcast interface. This will NOT work in a real MHP or OCAP implementation because MHP and OCAP do not support playing a video from a file. In a real implementation, this URL should be a dvb:// or ocap:// URL, depending on the platform. "

Joined: 2012-08-27

Hi srinivasrk,

I have tried this piece of code:

I modified that code and give the proper location of the videos which are in "tunedata" folder in CableLabs. When I run that code, I didn't get the video rendering in the emulator. Could you please share the piece of code ?