Skip to main content

play a video file in RI emulator using Xlet programming

9 replies [Last post]
santanu_telB
Offline
Joined: 2012-08-27
Points: 0

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.
smallman
Offline
Joined: 2004-06-19
Points: 0

Two example xlets play video files. See the java code in the directories:
$OCAPROOT/apps/qa/org/cablelabs/xlet/TuneTest
$OCAPROOT/apps/qa/org/cablelabs/xlet/RiExerciser

The video files may be found in:
$RICOMMONROOT/resources/tunedata

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

santanu_telB
Offline
Joined: 2012-08-27
Points: 0

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

rwahlers
Offline
Joined: 2012-07-19
Points: 0

santanu_telB,

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:

https://community.cablelabs.com/wiki/display/OCORI/Configuring+Eclipse+for+OCAP+stack+debugging

https://community.cablelabs.com/wiki/display/OCORI/Home+Networking+Testing+with+RiExerciser

santanu_telB
Offline
Joined: 2012-08-27
Points: 0

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 "TuneTestXlet.java" is responsible to play the videos in the RI emulator.
Now I want to debug the code using eclipse. I have downloaded eclipse-rcp-ganymede-SR2-win32.zip 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.

srinivasrk
Offline
Joined: 2011-10-31
Points: 0

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

santanu_telB
Offline
Joined: 2012-08-27
Points: 0

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 javax.media.MediaLocator(VIDEO_URL);
DataSource playingDataSource = Manager.createDataSource(locator);
// Now create the player
player = Manager.createPlayer(playingDataSource);
............
catch (MediaException e) {
e.printStackTrace();
}

...........
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.

srinivasrk
Offline
Joined: 2011-10-31
Points: 0

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

santanu_telB
Offline
Joined: 2012-08-27
Points: 0

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. "

santanu_telB
Offline
Joined: 2012-08-27
Points: 0

Hi srinivasrk,

I have tried this piece of code: http://read.pudn.com/downloads97/sourcecode/embed/396042/XletviewJMFExam...

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 ?