Implementing a mediaplayer into my application

h3. Hello,
I am working on a project for school. This involves editing a freeware java program for a Lego NXT robot to function under keyboard input aswell as button input, and implementing a media player into the application so that live video material from the robot can be viewed through the app. The video will be created from an RTP protocol for stream, but I haven't got the slightest idea about how to implement the media player into the application. The app itself is a GUI which holds the buttons to control the NXT robot. The media player is of the type specified in the JMF 2.1.1 as I found JMF most suitable for the situation.
h4. My first try was this:
if(mediaPlayer != null)
mediaPlayer.close();
String location = ("rtp:10.110.110.224:1234");
try{
     MediaLocator ml = new MediaLocator(location);
     if(ml == null)
         System.err.println("Can't build MediaLocator for RTP");
     mediaPlayer = (MediaPlayer) Manager.createPlayer(ml);
catch (NoPlayerException e){
     System.err.println("Error:" + e);
catch (MalformedURLException e){
     System.err.println("Error:" + e);
catch (IOException e){
     System.err.println("Error:" + e);
mediaPlayer.setControlPanelVisible(true);
mediaPlayer.setFixedAspectRatio(true);
mediaPlayer.setPlaybackLoop(false);
mediaPlayer.prefetch ();
addComponent(contentPane, mediaPlayer, 10,28,400,200);
mediaPlayer.start ();addComponent is a method which places the component in a pre-defined container and adds it to the GUI. But somehow, it doesn't recognize the RTP adress specified as the location.
I already tried something with the AVReceive3 class which sun so generously distributed (http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/AVReceive3.java), but this didn't seem to work aswell.
{noformat}I hope that you can help me find a solution fast,{noformat}
{noformat}best wishes,{noformat}
{noformat}Roy
{noformat}

Get rid of the file:// part of the RTP address. rtp:// is like http:// or file://...it's the prefix telling the URL what protocol to use.
String location = "rtp://10.110.110.224:1234"; I've tried your sollution, but it doesn't seem to work.
I've tried another approach:
* Setting the properties for the mediaplayer object
if(mediaPlayer != null)
            mediaPlayer.close();
//Source for streaming video
String location = "rtsp://localhost:1234";
//String location = "file://C:/Documents and Settings/Administrator/Desktop/Capture.AVI";
try{
            ml = new MediaLocator(location);
            if(ml == null)
                System.err.println("Unable to build MediaLocator");
            DataSource ds = new DataSource(ml);
}I switched to using the localhost, as the stream is intended to be streamed from a server to the client program, and I've tried using a datasource.
HOWEVER, using this approach insists on implementing the 4 standard abstract methods which come with the DataSource constructor:
DataSource ds = new DataSource(ml) {
            public InputStream getInputStream() throws IOException {
                    throw new UnsupportedOperationException("Not supported yet.");
            public OutputStream getOutputStream() throws IOException {
                    throw new UnsupportedOperationException("Not supported yet.");
            public String getContentType() {
                    throw new UnsupportedOperationException("Not supported yet.");
            public String getName() {
                    throw new UnsupportedOperationException("Not supported yet.");
};And after that, it insists on getting rid of the medialocator argument, as I implemented an annonymous class.
I'm sure it's rather obvious that I'm a novice to this stuff... but I really want to fix this, as I could use the experience.

Similar Messages

  • Implementing Google Search into Apex Application

    Hello everyone
    I've recently been moved to handling Apex at work so I've been creating applications in my free time. At the moment, I'm working on a game wishlist application, where users can add games to a wishlist, get email updates upon release, etc.
    I had the idea that a user can click on a game's title and be brought to a overview of that games details, including a news section where you could see recent news around the title. What I'd like is to integrate Google News into my application and have the search term dynamically change depending on which game the user is viewing.
    Would this be possible and what would be the best way of doing it?

    Not something I've ever done, but perhaps create a URL based region and define the source as the relevant google URL with your search field substituted in
    ie, taking the URL example from 4.1
    http://quote.yahoo.com/q?d=b&s=ORCLAnd try changing it to
    http://quote.yahoo.com/q?d=b&s=&P1_SEARCH.
    Scott

  • Implementing OAM - SSO for Multiple Applications

    I am trying to implement OAM - SSO for 2 applications. I already have completed the setup of SSO for one application . OID -- OAM -- OHS ( 11g webgate ) - Weblogic Server - OBIEE . ( All the components are 11.1.1.5 version ).
    Now I am looking to add a 2nd application ( OBIEE 11.1.1.6.5 version ) into the mix. So should I install a separate OHS and webgate for the new application or can I use the existing OHS to add another application.
    Any tips on this would be helpful please.
    Thanks

    You may use the same OHS server in reverse proxy to the two applications and configure corresponding policies in OAM console.
    Let us know if you get into any issues.

  • Where is the best place to implement business logic in ADF application?

    I am using jdeveloper 11g R2 , JSF Facelet
    Where is the best place to implement business logic in ADF application?
    I mean something like service layer in Spring
    Appreciate your comments
    Regards
    Mohsen

    Depends on what your logic does and what data it deals with, but in general business logic is in the ADF BC layer.
    Some goes into entity objects - for things like attribute or row validation.
    Some goes into view objects - for things like calculation.
    Some goes into AM - for things like service methods for UI clients.

  • How to implement command pattern into BC4J framework?

    How to implement command pattern into BC4J framework, Is BC4J just only suport AIDU(insert,update,delete,query) function? Could it support execute function like salary caculation in HR system or posting in GL(general ledger) system? May I create a java object named salaryCalc which use view objects to get the salary by employee and then write it to database?
    Thanks.

    BC4J makes it easy to support the command pattern, right out of the box.
    You can write a custom method on your application module class, then visit the application module wizard and see the "Client Methods" tab to select which custom methods should be exposed for invocation as task-specific commands by clients.
    BC4J is not only for Insert,Update,Delete style applications. It is a complete application framework that automates most of the typical things you need to do while building J2EE applications. You can have a read of my Simplifying J2EE and EJB Development Using BC4J whitepaper to read up on an overview of all the basic J2EE design patterns that the framework implements for you.
    Let us know if you have more specific questions on how to put the framework into practice.

  • How do i show javascript into  java application?

    hi
    ( please help me!!!!!!!!!!!!!!!!!)
    how do i run javascript into java application ?( looks like microsoft frontpage )
    thank you ?

    There is a JavaScript interpreter called Rhino implemented in Java, maybe you can use it: http://www.mozilla.org/rhino/

  • Implementing KM scheduler in WD application

    HI All,
    Can anybody guide me on KM schedulers and how to implement the same in WD applications.
    We have a WD application where we are creating PDF forms. Now we need to schedule the process and want to run the job at a regular interval of time. Is KM scheduler the right way to do it?
    Please suggest on how to implement the same.
    Regards,
    Becky.

    Hi Ashok,
    Yes, u were correct. I didnt configured my Index at portal correctly and so was the issue.
    Now I am able to get search-results.
    Thank you.
    Now can you tell me about what all parameters I could get from these search results?
    I mean I tried Standard Search URL of portal :-
    http://serverHost:serverPort/irj/servlet/prt/portal/prteventname/HtmlbEvent/prtroot/com.sap.km.cm.basicsearch?SearchType=seealso&SeeAlsoUri=
    It shows various other details along with what we get using KM API.
    for example: search relevance percentage, seached text etc
    How do I get these parameters from API?
    Thanks and regards,
    Amey Mogare

  • How can I get back into my application aftermath invoking Start up page of index.htm ?

    Gorgeous Hello All,
    If anyone of you can please provide me a solution for the following, will help me in plentious and galore.
    Am using Adobe RoboHelp, Version 10 and IE version being 10.
    A hurdle :-
    I have a application which has been developed in ASP .NET, Version 4.0. Help link has been created in this application wherein here the Start up page of index.htm has been linked to be read from the RoboHelp local project folder\!SSL!\Multiscreen_HTML5\desktop. All are working absolutely fine except when
    I login into the above-said application -> click on the Help page -> the index.htm opens with Contents, Index, Glossary -> Am able to successfully perform any task by respective clickings
    -> But I am not able to get back into my application when I click on the IE provided Back button (Alt+Left) -> Any amount of invoking Back button makes the system getting looped into this Start up page of index.htm only -> When I Close Tab (Ctrl + W) or Close ( X ) -> The window session gets closed and I have to repeat all by relogin once again.
    How can I get back into my application aftermath invoking Start up page of index.htm ?
    (I can always get back into the application easily by erasing those parts in the url which refers to this RoboHelp linkages – but this certainly looks non-polished work)
    Help Please
    Cheese – Vipin Nambiar, Bangalore

    Hey Jeff, I used Internet Explorer 10.0.9200 and Google Chrome 26.0.1410. Alas - it is the same behavior.
    (But Jeff : When I used Microsoft HTML Help as primary layout to generate chm file , My Help when launched from my Application opened in a new browser window and when I closed this Help browser window did not close my application. Looks like need to write few liner code to get this issue settled )
    Thanks Indeed of lots for your concerns Jeff !!!

  • Propagating users/Groups/Roles into partner application

    I am very newbee to portal development. I have a following need.
    I want to use Single SingOn feature of Portal. Once the user logged in to the portal via SSo, there may be several applications(within the portal) to which S/He may have access to. Based on who S/He is, may have different level of authorization to what S/He can do into different applications within the portal. How I can make use of user entered for Single Signon, propagate to the application level inside the portal.
    My understanding so far with the portal is that you can develop a portal which has web clipping portlets, external/internal applications, items etc. When we create the users and groups and assign roles to the users, it is limited to the portal front page that we publish to public.
    My problem is further down, into different applications which I expose with the help of portlet or by any other means. And have control over in that particular application(individual), which portion of the application users should be able to see or take any action.
    Your help is highly appreciated.

    Any one has a clue?

  • With new Photos app, I can no longer drag and drop photos into other applications as I did in the past with iPhoto.

    With the new Photos app, I can no longer drag and drop photos into other applications as I did with iPhoto.  For instance, I have a photo collage app that in the past, I could just drag in the photos I wanted to include.  Now, I can DRAG the photos, but they do not DROP.  So, I have to go through the export process.  It is tedious.  What am I missing?  Where can I turn on the drag and drop feature for Photos?

    YOu're not looking in the right palce. That's inside the iPhoto Application.
    You need to look inside the iPhoto Library
    As I sid above:
    Go to your Pictures Folder and find the iPhoto Library there
    Regards
    TD

  • How can I copy and paste quoted emails from Apple Mail v4.5 into another application?

    Hi,
    Having just moved from Entourage to Apple Mail on an Exchange back-end, everything is running smoothly except for one thing - when I copy emails that include quotes from replies (i.e. those coloured vertical lines down the left of the message) and paste them into other applications (Word, TextEdit, etc.) these indentations are not preserved, and instead each line starts at the left margin. This makes following interleaved conversations in the pasted document very difficult. It's as though Mail allows me to copy the view onto the message, rather than the source of the message (I believe that Mail simply reinterprets the '>' quote indentations for presentation, but retains these in the stored message).
    How can I restore copying of quote indentation in Apple Mail for pasting in other documents?
    CT

    You will need Pages or a sjmilar word processing program for this, TextEdit doesn't appear to be capable. Using Pages:
    Open your message. From the 'View' Menu choose "Message>Raw Source'.
    Copy the body of the message.
    Paste into a Pages Word Processing blank template.
    Open Find, click 'Advanced'.
    Set 'Find' to '>' (no quotes)
    Set 'Replace' to tab (select from the 'Insert' drop-down menu)
    Click 'Replace All'.
    Set 'Find' to '=20' (no quotes)
    Set 'Replace' to a single space.
    Click 'Replace all'.
    Obviously this will lose the colours which identify the level of quotes but you will have the indentation.

  • I reinstalled operating system software on my MacBook Air (Yosemite 10.10.3) and tried reinstalling Adobe Acrobat 9 Pro.  I was able to install the software into my Applications folder but I was unable to enter the serial number or go any further with the

    I reinstalled operating system software on my MacBook Air (Yosemite 10.10.3) and tried reinstalling Adobe Acrobat 9 Pro.  I was able to install the software into my Applications folder but I was unable to enter the serial number or go any further with the installation.  When I click on the Adobe Acrobat icon in the Applications folder, nothing happens.

    Hi Tom,
    kindly check the System requirements | Acrobat family of products—older versions (XI, X, 9)
    For serial number message try: 
    Error "Invalid serial number" | Acrobat 9 | CS4
    Thanks,
    Atul Saini

  • I received an error "iTunes requires 64-bit mode" says to go into my iTunes application and 'uncheck' the 'open in 32-bit mode' checkbox - i went into the application and the box was not checked anyway so why am i getting this prompt?  Never happened b4

    i received an error message "iTunes requires 64-bit mode" says to go into my iTunes application and 'uncheck' the 'open in 32-bit mode' checkbox - i went into the application and the box was not checked anyway so why am i getting this prompt?  Never happened before. yesterday did the sofware update for maverick.

    Thank you for your response, Chris. But I'm afraid I have to disagree. There are native 64 bit versions of iTunes available for OSX and Windows.
    In a 64 Bit Windows environment native 64 Bit Applications install the DLL's in a directory called "Program Files" and a directory called "Program Files (x86)" (32 Bit applications only use the ladder).
    iTunes 9 is consistent with this behavior - and it identified itself to the system as a 64 bit application (meaning it's process appears without a "*32" tag on it).

  • Copying from microsoft word into my application

    I am copying from microsoft word into my application..
    and them on submit, i am calling a procedure i get the following error
    Caused by: java.sql.SQLException: ORA-01460: unimplemented or unreasonable conversion requested
    i think its down to special characters used.. like apostrophe is different in word then normal.. anyone got solution for this error not to occur?

    74 questions, 72 unresolved.
    And this one: sadly we are not looking over your shoulder, so we don't know what 'copying' means, which version of Word, which 4-digit version of the database, and which SQL statement fails.
    Sybrand Bakker
    Senior Oracle DBA

  • Download DMS attachment into an application server in background mode?

    Is it possible to download DMS attachment into an application server in background mode?
    Currently I am using the following code but does not work in background mode
      CALL FUNCTION 'CVAPI_DOC_GETDETAIL'
        EXPORTING
          pf_dokar     = 'Z06'
          pf_doknr     = gs_drad-doknr
          pf_dokvr     = gs_drad-dokvr
          pf_doktl      = gs_drad-doktl
          pf_read_kpro = 'X'
        TABLES
          pt_files      = lt_file
        EXCEPTIONS
          not_found    = 1
          no_auth       = 2
          error            = 3
          OTHERS       = 4.
    *Copy Attachment from DMS to PC File
      CALL FUNCTION 'CVAPI_DOC_VIEW'
        EXPORTING
          pf_dokar      = 'Z06'
          pf_doknr      = gs_drad-doknr
          pf_dokvr       = gs_drad-dokvr
          pf_doktl          = gs_drad-doktl
          pf_appl_start = ' '
          pf_apptp      = '1'
          pf_filename   = 'C:\TEMP\ZLINK.BMP'
          ps_file       = ls_file
        IMPORTING
          pfx_file      = l_pfx_file
        EXCEPTIONS
          OTHERS        = 0.
    *Load BMP into SE78
      PERFORM import_bitmap_bds
        IN PROGRAM saplstxbitmaps
        USING l_filename             "Local File for Upload/Download
                   l_bmpnam             "Name
                  'GRAPHICS'           "Application Object
                  'BMAP'                   "ID
                  'BCOL'                   "Color
                  'BMP'                     "Extension
                  'ZLINK PICTURE'   "Title
                  space          "Resides in Printer Memory in Print Request
                 'X'                 "Reserve Height of Graphic Automatically
                 space           "Graphic Storage: Compressed Bitmaps
        CHANGING l_docid
               l_wf_res.   "Graphic Resolution
    Thanks

    Hi!
    You didn't find answer for this, because it is not possible. If you run your program in background, it is running on the server, and does not have any connection to your local machine. That's why you can't upload/download in background mode.
    You might try to address somehow your local PC, with its IP or MAC address, but I don't think does this task worth so much time.
    Run your program in online mode, or if you want to run it in background, then upload your file into the SAP server.
    Regards
    Tamá

Maybe you are looking for

  • UK Payroll Issue :Gross Wage Type /101 missing from RT

    Hi, We are facing an issue for some of the employees wherein Gross wage type /101 is not being generated when payroll is run .In place of /101 , /A01 wage type is getting created. This issue is being faced by employees whose claims were entered in Ma

  • How to view all the metalink notes in a single window?

    Friends, I have metalink access...i want to view all the metalink notes in a single shot. now i am searching the metalink notes by entering the artical id...is there any way to get all the documents in one shot ... like how we are seeing the forum th

  • JTree node lazy loading + icons problem

    Hi all, I need to build a large tree (10000 nodes). Since this is large to load all at once, i want to load the last level dynamically using the 'treeWillExpand' Level 1 --Level 2 ---Lever 3 ----Node loaded dynamically 4.1 ----Node loaded dynamically

  • Java.text

    Where on the web can I find a short tutorial as to how to use java.text package?

  • Dynamic tray selection - SAPScript

    Hi, I need to dynamically select a tray to print a form using SAPScript, depending on some condition. Need to know how to do this? Thanks in advance! regards, Karen