Problem with Player (realize)

Need help!!!
At first use of the given class the player is not realized and there is no sound, events connected with realization of a player appear during the moment of its closing.
At following use all works.
Please help. Thanks in advance.
package ua.cv.usl.sip.audio;
import javax.media.Control;
import javax.media.ControllerEvent;
import javax.media.ControllerListener;
import javax.media.Manager;
import javax.media.Owned;
import javax.media.Player;
import javax.media.RealizeCompleteEvent;
import javax.media.Renderer;
import javax.media.control.BufferControl;
import javax.media.rtp.RTPManager;
import javax.media.rtp.ReceiveStream;
import javax.media.rtp.ReceiveStreamListener;
import javax.media.rtp.SessionListener;
import javax.media.rtp.event.NewReceiveStreamEvent;
import javax.media.rtp.event.ReceiveStreamEvent;
import javax.media.rtp.event.SessionEvent;
import com.sun.media.controls.GainControlAdapter;
class AudioReceiver implements ReceiveStreamListener, SessionListener, ControllerListener {
     private GainControlAdapter gainControl = null;
     // link to MediaManager
     private MediaManager audioManager;
     // buffer param
     public static final int DEFAULT_BUFFER_LENGTH = 350; // 350;
     public static final int RENDER_BUFFER_LENGTH = 200;
     private RTPSocketAdapter connection;
     private Player player;
     public AudioReceiver(MediaManager aManager, RTPSocketAdapter connection) {
          audioManager = aManager;
          this.connection = connection;
     protected void setMute(boolean mute) {
          if (gainControl != null)
               gainControl.setMute(mute);
     protected void setVolume(float vol) {
          if (gainControl != null)
               gainControl.setLevel(vol);
     public synchronized void initialize() {
          audioManager.rtpSessions[1] = RTPManager.newInstance();
          audioManager.rtpSessions[1].addSessionListener(this);
          audioManager.rtpSessions[1].addReceiveStreamListener(this);
          audioManager.rtpSessions[1].initialize(connection);
          // initialize buffer
          BufferControl bc = (BufferControl) audioManager.rtpSessions[1].getControl("javax.media.control.BufferControl");
          if (bc != null) {
               bc.setBufferLength(DEFAULT_BUFFER_LENGTH);
               Control cs[] = audioManager.mediaProcessor.processor.getControls();
               for (int j = 0; j < cs.length; j++)
                    if (cs[j] instanceof Owned && cs[j] instanceof BufferControl)
                         if (((Owned) cs[j]).getOwner() instanceof Renderer)
                              ((BufferControl) cs[j]).setBufferLength(RENDER_BUFFER_LENGTH);
     public synchronized void stop() {
          player.stop();
          player.deallocate();
      * SessionListener.
     public void update(SessionEvent evt) {}
      * ReceiveStreamListener
     public void update(ReceiveStreamEvent evt) {
          if (evt instanceof NewReceiveStreamEvent) {
               try {
                    ReceiveStream stream = ((NewReceiveStreamEvent) evt).getReceiveStream();
                    player = Manager.createPlayer(stream.getDataSource());
                    player.addControllerListener(this);
                    player.realize();
               catch (Exception e) {
                    return;
      * ControllerListener for the Players.
     public void controllerUpdate(ControllerEvent ce) {
          if (player != null) {
               if (ce instanceof RealizeCompleteEvent) {
                    player.start();
                    gainControl = (GainControlAdapter) player.getGainControl();
}

You code is fine.. Mine is about the same... I think the problem is outside AudioReceiver. Something's blocking your thread and doesnt let the Player start. Try starting receiver first, and then transmitter.
Another wild guess: initialize your RTPManager before adding listeners.

Similar Messages

  • Problem with player v. 10

    Hi,
    Does anybody know what had changed in version 10 of browser
    plugin and how
    to fix the issue of disappearing well-worked until now
    projects? Please take
    a look
    http://pbeko.com.pl/doc_morenowe2.html
    Animation at the center of
    page exists but not presents itself above plugin version 9.x
    (IE, Windows
    XP). It had happened to all SWF's communicating with server
    (XML, AC3).

    > Not sure what you mean. swf's can not appear below the
    plugin, they are in
    > the plugin.
    I meant not location of the plugin but its version number.
    "Above plugin
    version 9" means version 10 in this case. Problem is that SWF
    is visible on
    version 9 of plugin and not - under 10. It just disappear.
    Simple animatons
    works fine. More complex - stopped working.
    >Is it a depth problem, or loading problem? Please be more
    specific.
    My intention is recognize the problem and makes SWFs visible
    in version 10
    of plugin. Common used functionality of this disappeared SWFs
    is server
    communication. For your information you can achieve it by
    using eg.
    URLLoader class to load external XML data (what I'm really
    doing).

  • Problem with Player class: Error: (28) class Player not found

    Hi,
    I had this error while attempting to use the Player object of media package. I am using JDeveloper 3.2
    Error: (28) class Player not found in class lyee.Frame5.
    My program code has this shape.
    import java.awt.event.*;
    import java.applet.*;
    import java.net.*;
    import java.io.*;
    import javax.media.*;
    public class Frame5 extends JFrame {
    FlowLayout flowLayout = new FlowLayout();
    JPanel jPanel1 = new JPanel();
    Player lecteur;
    Could someone help me finding where the error is exactly. The Player object is in javax.media pakcage, right ? Is there any librarary missing ??
    Thank you
    Jaouhar

    If you haven't done so already, you have to install JMF -- Java Media Framework, which you can download from the Sun website ( http://java.sun.com ). After that, you have to add that library to your project, in your project settings dialog.

  • Problem with player

    Why i cant watch this youtube video http://www.youtube.com/watch?v=tZQ7cdWa3Tc i have instal last version of flash player and also java? any help

    what flash player version is reported here:  http://helpx.adobe.com/flash-player/kb/find-version-flash-player.html

  • Problems with player

    Please, help me. Yesterday I couldn't download Flash Player
    9. Some errors while downloading.

    Try downloading zipfile from here
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_19166&sliceId=2

  • Mega Player 536 problems with SD Card

    Hello, can any one help me here, i got me MSI mega player 536 , but i can't play files from SD card. I tried 4. diferent types of SD card. Player register the card, but when i try to open files i got message: "No files fund". I found test of player on www.hw.no, and they write in the test that Player has problems with SD card.
    Any one?

    It's hardware problem with player, i'll get a new one. Then we have to conclude that Mega player 536 has not problems with SD card. Thank's to every one on this forum.

  • Index in Berkeley DB XML - Problems with time

    I have some querys that not show a better time after have been indexed.
    I saw that this query that show problems with index realize : ordering , substring and empty values or tag.
    This query was extracted from benchmark xbench x toxgene
    I will post the queryPlan and results before and after add index.
    computer configuration : pentim RAM : 2Gb HD : 160
    Results
    Query 1
    dbxml> query 'for $a in collection("container_db_xbench_250Mb.dbxml")/article w
    here every $b in $a/body/abstract/p satisfies contains($b, "hockey") return $a
    /prolog/title'
    Query - Starting query execution
    Query - container_db_xbench_250Mb.dbxml - U : [405] 2 3 4 5 6 7 8 9 10 11 1
    2 13 14 15 16 17 18 19 20 21 ...
    Query - Finished query execution, time taken = 168.522ms
    102 objects returned for eager expression 'for $a in collection("container_db_xb
    ench_250Mb.dbxml")/article where every $b in $a/body/abstract/p satisfies cont
    ains($b, "hockey") return $a/prolog/title'
    dbxml> queryPlan 'for $a in collection("container_db_xbench_250Mb.dbxml")/articl
    e
    where every $b in $a/body/abstract/p satisfies contains($b, "hockey")
    return $a/prolog/title'
    <XQuery>
    <FLWOR>
    <ForBinding name="a">
    <Navigation>
    <QueryPlanFunction result="collection" container="container_db_xbench_25
    0Mb.dbxml">
    <OQPlan>U</OQPlan>
    </QueryPlanFunction>
    <Step axis="child" name="article" nodeType="element"/>
    </Navigation>
    <Where>
    <EveryFLWOR>
    <ForBinding name="b">
    <Navigation>
    <Variable name="a"/>
    <Step axis="child" name="body" nodeType="element"/>
    <Step axis="child" name="abstract" nodeType="element"/>
    <Step axis="child" name="p" nodeType="element"/>
    </Navigation>
    </ForBinding>
    <Navigation>
    <Variable name="b"/>
    <DbXmlContains>
    <Sequence>
    <AnyAtomicTypeConstructor value="hockey" typeuri="http://www.w3.
    org/2001/XMLSchema" typename="string"/>
    </Sequence>
    </DbXmlContains>
    </Navigation>
    </EveryFLWOR>
    </Where>
    </ForBinding>
    <Navigation>
    <Variable name="a"/>
    <Step axis="child" name="prolog" nodeType="element"/>
    <Step axis="child" name="title" nodeType="element">
    <OQPlan>P(node-element-equality-string,prefix,title)</OQPlan>
    </Step>
    </Navigation>
    </FLWOR>
    </XQuery>
    dbxml>
    dbxml> query 'for $a in collection("container_db_xbench_250Mb.dbxml")/article w
    here every $b in $a/body/abstract/p satisfies contains($b, "hockey") return $a
    /prolog/title'
    Query - Starting query execution
    Query - container_db_xbench_250Mb.dbxml - U : [405] 2 3 4 5 6 7 8 9 10 11 1
    2 13 14 15 16 17 18 19 20 21 ...
    Query - container_db_xbench_250Mb.dbxml - P(title) : [405] 2(0x04020204) 3(
    0x04020204) 4(0x04020204) 5(0x04020204) 6(0x04020204) 7(0x04020204) 8(0x04020204
    ) 9(0x04020204) 10(0x04020204) 11(0x04020204) ...
    Query - Finished query execution, time taken = 710.093ms
    102 objects returned for eager expression 'for $a in collection("container_db_xb
    ench_250Mb.dbxml")/article where every $b in $a/body/abstract/p satisfies cont
    ains($b, "hockey") return $a/prolog/title'
    Query 2
    dbxml> query 'for $a in collection("container_db_xbench_250Mb.dbxml")/article/pr
    olog order by $a/dateline/country return <Output> {$a/title} {$a/dateline/
    country} </Output>'
    Query - Starting query execution
    Query - container_db_xbench_250Mb.dbxml - U : [405] 2 3 4 5 6 7 8 9 10 11 1
    2 13 14 15 16 17 18 19 20 21 ...
    Query - Finished query execution, time taken = 248.939ms
    405 objects returned for eager expression 'for $a in collection("container_db_xb
    ench_250Mb.dbxml")/article/prolog order by $a/dateline/country return <Outpu
    t> {$a/title} {$a/dateline/country} </Output>'
    dbxml> queryPlan 'for $a in collection("container_db_xbench_250Mb.dbxml")/articl
    e/prolog order by $a/dateline/country return <Output> {$a/title} {$a/datel
    ine/country} </Output>'
    <XQuery>
    <FLWOR>
    <ForBinding name="a">
    <Navigation>
    <QueryPlanFunction result="collection" container="container_db_xbench_25
    0Mb.dbxml">
    <OQPlan>U</OQPlan>
    </QueryPlanFunction>
    <Step axis="child" name="article" nodeType="element"/>
    <Step axis="child" name="prolog" nodeType="element"/>
    </Navigation>
    </ForBinding>
    <Sort>
    <Specification modifier="ascending|empty_least">
    <Navigation>
    <Variable name="a"/>
    <Step axis="child" name="dateline" nodeType="element"/>
    <Step axis="child" name="country" nodeType="element">
    <OQPlan>P(node-element-equality-string,prefix,country)</OQPlan>
    </Step>
    </Navigation>
    </Specification>
    </Sort>
    <DOMConstructor type="element">
    <Name>
    <Sequence>
    <AnyAtomicTypeConstructor value="Output" typeuri="http://www.w3.org/20
    01/XMLSchema" typename="string"/>
    </Sequence>
    </Name>
    <Children>
    <Navigation>
    <Variable name="a"/>
    <Step axis="child" name="title" nodeType="element"/>
    </Navigation>
    <Navigation>
    <Variable name="a"/>
    <Step axis="child" name="dateline" nodeType="element"/>
    <Step axis="child" name="country" nodeType="element">
    <OQPlan>P(node-element-equality-string,prefix,country)</OQPlan>
    </Step>
    </Navigation>
    </Children>
    </DOMConstructor>
    </FLWOR>
    </XQuery>
    dbxml>
    Query - container_db_xbench_250Mb.dbxml - P(country) : NONE
    Query - container_db_xbench_250Mb.dbxml - P(country) : NONE
    Query - Finished query execution, time taken = 1573.17ms
    405 objects returned for eager expression 'for $a in collection("container_db_xb
    ench_250Mb.dbxml")/article/prolog order by $a/dateline/country return <Outpu
    t> {$a/title} {$a/dateline/country} </Output>'
    Query 3
    dbxml> query 'for $a in collection("container_db_xbench_250Mb.dbxml")/article/pr
    olog where empty ($a/genre) return <NoGenre> {$a/title} </N
    oGenre>'
    Query - Starting query execution
    Query - container_db_xbench_250Mb.dbxml - U : [405] 2 3 4 5 6 7 8 9 10 11 1
    2 13 14 15 16 17 18 19 20 21 ...
    Query - Finished query execution, time taken = 207.782ms
    170 objects returned for eager expression 'for $a in collection("container_db_xb
    ench_250Mb.dbxml")/article/prolog where empty ($a/genre) return <NoGenre>
    {$a/title} </NoGenre>'
    dbxml> queryPlan 'for $a in collection("container_db_xbench_250Mb.dbxml")/articl
    e/prolog where empty ($a/genre) return <NoGenre> {$a/title}
    </NoGenre>'
    <XQuery>
    <FLWOR>
    <ForBinding name="a">
    <Navigation>
    <QueryPlanFunction result="collection" container="container_db_xbench_25
    0Mb.dbxml">
    <OQPlan>U</OQPlan>
    </QueryPlanFunction>
    <Step axis="child" name="article" nodeType="element"/>
    <Step axis="child" name="prolog" nodeType="element"/>
    </Navigation>
    <Where>
    <Function name="{http://www.w3.org/2005/04/xpath-functions}:empty">
    <Navigation>
    <Variable name="a"/>
    <Step axis="child" name="genre" nodeType="element">
    <OQPlan>P(node-element-presence-none,=,genre)</OQPlan>
    </Step>
    </Navigation>
    </Function>
    </Where>
    </ForBinding>
    <DOMConstructor type="element">
    <Name>
    <Sequence>
    <AnyAtomicTypeConstructor value="NoGenre" typeuri="http://www.w3.org/2
    001/XMLSchema" typename="string"/>
    </Sequence>
    </Name>
    <Children>
    <Navigation>
    <Variable name="a"/>
    <Step axis="child" name="title" nodeType="element"/>
    </Navigation>
    </Children>
    </DOMConstructor>
    </FLWOR>
    </XQuery>
    dbxml>
    0x0402025E) 9(0x040202D0) 10(0x0402023F) 11(0x0402020F) 14(0x0402020F) 15(0x0402
    0253) 17(0x0402025E) 20(0x040202EE) 23(0x040202C0) ...
    Query - container_db_xbench_250Mb.dbxml - P(genre) : [235] 4(0x0402024G) 5(
    0x0402025E) 9(0x040202D0) 10(0x0402023F) 11(0x0402020F) 14(0x0402020F) 15(0x0402
    0253) 17(0x0402025E) 20(0x040202EE) 23(0x040202C0) ...
    Query - Finished query execution, time taken = 2362.08ms
    170 objects returned for eager expression 'for $a in collection("container_db_xb
    ench_250Mb.dbxml")/article/prolog where empty ($a/genre) return <NoGenre>
    {$a/title} </NoGenre>'
    Query 4
    dbxml> query 'for $a in collection("container_db_xbench_250Mb.dbxml")/article/pr
    olog/authors/author where empty($a/contact/text()) return <NoContact> {
    $a/name} </NoContact>'
    Query - Starting query execution
    Query - container_db_xbench_250Mb.dbxml - U : [405] 2 3 4 5 6 7 8 9 10 11 1
    2 13 14 15 16 17 18 19 20 21 ...
    Query - Finished query execution, time taken = 680.503ms
    212 objects returned for eager expression 'for $a in collection("container_db_xb
    ench_250Mb.dbxml")/article/prolog/authors/author where empty($a/contact/text())
    return <NoContact> {$a/name} </NoContact>'
    dbxml> queryPlan 'for $a in collection("container_db_xbench_250Mb.dbxml")/articl
    e/prolog/authors/author where empty($a/contact/text()) return <NoContact>
    {$a/name} </NoContact>'
    <XQuery>
    <FLWOR>
    <ForBinding name="a">
    <Navigation>
    <QueryPlanFunction result="collection" container="container_db_xbench_25
    0Mb.dbxml">
    <OQPlan>U</OQPlan>
    </QueryPlanFunction>
    <Step axis="child" name="article" nodeType="element"/>
    <Step axis="child" name="prolog" nodeType="element"/>
    <Step axis="child" name="authors" nodeType="element"/>
    <Step axis="child" name="author" nodeType="element"/>
    </Navigation>
    <Where>
    <Function name="{http://www.w3.org/2005/04/xpath-functions}:empty">
    <Navigation>
    <Variable name="a"/>
    <Step axis="child" name="contact" nodeType="element">
    <OQPlan>P(node-element-presence-none,=,contact)</OQPlan>
    </Step>
    <Step axis="child">
    <ItemType testType="text"/>
    </Step>
    </Navigation>
    </Function>
    </Where>
    </ForBinding>
    <DOMConstructor type="element">
    <Name>
    <Sequence>
    <AnyAtomicTypeConstructor value="NoContact" typeuri="http://www.w3.org
    /2001/XMLSchema" typename="string"/>
    </Sequence>
    </Name>
    <Children>
    <Navigation>
    <Variable name="a"/>
    <Step axis="child" name="name" nodeType="element">
    <OQPlan>P(node-element-equality-string,prefix,name)</OQPlan>
    </Step>
    </Navigation>
    </Children>
    </DOMConstructor>
    </FLWOR>
    </XQuery>
    2(0x0402020E) 2(0x04020212) 2(0x04020216) 2(0x0402021B) 2(0x0402021F) 2(0x04020
    223) 2(0x04020227) 2(0x0402022C) 2(0x0402022G) ...
    Query - Finished query execution, time taken = 48724.8ms
    212 objects returned for eager expression 'for $a in collection("container_db_xb
    ench_250Mb.dbxml")/article/prolog/authors/author where empty($a/contact/text())
    return <NoContact> {$a/name} </NoContact>'
    Query 5
    dbxml> query 'for $a in collection("container_db_xbench_250Mb.dbxml")/article w
    here contains ($a//p, "the hockey") return <Output> {$a/prolog/ti
    tle} {$a/body/abstract} </Output>'
    Query - Starting query execution
    Query - container_db_xbench_250Mb.dbxml - U : [405] 2 3 4 5 6 7 8 9 10 11 1
    2 13 14 15 16 17 18 19 20 21 ...
    Query - Finished query execution, time taken = 3605.86ms
    383 objects returned for eager expression 'for $a in collection("container_db_xb
    ench_250Mb.dbxml")/article where contains ($a//p, "the hockey") return <O
    utput> {$a/prolog/title} {$a/body/abstract} </Output>'
    dbxml> queryPlan 'for $a in collection("container_db_xbench_250Mb.dbxml")/articl
    e where contains ($a//p, "the hockey") return <Output> {$a/prolo
    g/title} {$a/body/abstract} </Output>'
    <XQuery>
    <FLWOR>
    <ForBinding name="a">
    <Navigation>
    <QueryPlanFunction result="collection" container="container_db_xbench_25
    0Mb.dbxml">
    <OQPlan>U</OQPlan>
    </QueryPlanFunction>
    <Step axis="child" name="article" nodeType="element"/>
    <DbXmlFilter>
    <Navigation>
    <Step axis="descendant" name="p" nodeType="element"/>
    <DbXmlContains>
    <Sequence>
    <AnyAtomicTypeConstructor value="the hockey" typeuri="http://www
    .w3.org/2001/XMLSchema" typename="string"/>
    </Sequence>
    </DbXmlContains>
    </Navigation>
    </DbXmlFilter>
    </Navigation>
    </ForBinding>
    <DOMConstructor type="element">
    <Name>
    <Sequence>
    <AnyAtomicTypeConstructor value="Output" typeuri="http://www.w3.org/20
    01/XMLSchema" typename="string"/>
    </Sequence>
    </Name>
    <Children>
    <Navigation>
    <Variable name="a"/>
    <Step axis="child" name="prolog" nodeType="element"/>
    <Step axis="child" name="title" nodeType="element">
    <OQPlan>P(node-element-equality-string,prefix,title)</OQPlan>
    </Step>
    </Navigation>
    <Navigation>
    <Variable name="a"/>
    <Step axis="child" name="body" nodeType="element"/>
    <Step axis="child" name="abstract" nodeType="element"/>
    </Navigation>
    </Children>
    </DOMConstructor>
    </FLWOR>
    </XQuery>
    dbxml>
    time taken = 6038.12ms

    Hi Miriam,
    What storage model are you using, and are you using DBXML_INDEX_NODES? What indexes did you try to add to make these queries faster?
    John

  • Cache problem with "videos" viewed by thumbnail ?

    Hello,
    When I add video clips to my iTunes library, I have to crite the name of the author, the album... but sometimes display in the video view seems not to refresh : the clip are still listed without albums. I added clips 4 days ago, it refreshed immediately. I added clips three days ago, it still has not refreshed. I added clips two days ago, it took one day to refresh.
    I tried changing view, changing album name, nothing work.

    This is due to a bug in Flash Player 9.0.115.0, released on
    12/3/07.
    Techsmith, the company that produces Camtasia, reported the
    problem to Adobe a few months ago, but Adobe has not released an
    update for it. Adobe suggested downgrading to an older version of
    Flash Player, but older versions of Flash Player have security
    vulnerabilities that could result in your computer being attacked.
    Incidentally, Player 9.0.115.0 is classified as a "critical update"
    by Adobe.
    Techsmith has released a patcher to fix affected Camtasia
    videos, but the fix must be applied to the files on the server (all
    of the Camtasia files) and can't be used by viewers. The problem
    with Player 9.0.115.0 affects more than just Camtasia videos, of
    course.
    Until a newer version of Flash Player is released, you
    probably just need to live with it unless you're willing to risk
    the security holes in older Player versions. We're coming up on
    three months since Player 9.0.115.0 was released. Given the long
    delay in fixing the problem, and since Techsmith claims that Adobe
    has made fixing the problem a high priority, it's possible Adobe's
    engineers can't find a fix. Only time will tell.
    For more information, search this forum for "Flash Player
    & Camtasia Studio", "Player 9.0.115.0 MP3 issues", and "flash
    player audio chirps and video delays". For confirmation of the
    security flaws, search the web for "apsb07-20".

  • Loadvars problem - wrong player's configuration?

    I have a serious problem, i'm using loadvars for my flash
    site, but i get always undefined value.
    I tryed to check a online WORKING site, and surprise, i don't
    see the dinamic text. I also re-check the site with my home pc and
    it's full working...
    I think it's a possible configuration problem with player, i
    tryed to update and re-install.. but with no result.
    sorry for my bad english.

    lollotek wrote:
    > I have a serious problem, i'm using loadvars for my
    flash site, but i get
    > always undefined value.
    > I tryed to check a online WORKING site, and surprise, i
    don't see the dinamic
    > text. I also re-check the site with my home pc and it's
    full working...
    > I think it's a possible configuration problem with
    player, i tryed to update
    > and re-install.. but with no result.
    There is no any configuration in flash player. Pretty much
    flash versions and
    that's about it.
    Could be that you place the SWF in html using
    img/folder/name.swf ?
    Any URL to see it ?
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Audio player with some extra's - can't get player realized

    I try to build an audio player with some extra's like looping between 2 time marks.
    Till now i have an interface that can play back audio files but after that the problems start.
    There is no way i can add functions without creating a {color:#ff0000}NotRealizedError{color}.
    According to the documentation the start() method should realize (etc) the player, but it doesn't in my program and neighter does the method player.realize();.
    Can someone give me a hint to get me on the road again.
    Thanks in advance.
    Here is the complete code which generates the NotRealizedError on the dp.setRate(); method:
    (most of it is older source from a basic player on the internet).
    package dictaplayer;
    import java.awt.*;*
    *import java.awt.event.*;
    import java.io.*;*
    *import java.net.MalformedURLException;*
    *import java.net.URI;*
    *import java.net.URL;*
    *import javax.swing.*;
    import javax.media.*;
    public class DictaPlayer extends JFrame {
    private Player dp;
    private URI uri;
    private URL url;
    private boolean realized = false;
    public DictaPlayer()
    super( "Testing DictaPlayer" );
    JButton openFile = new JButton( "Open file to play" );
    openFile.addActionListener(
    new ActionListener() {
    public void actionPerformed( ActionEvent e ) {
    openFile();
    createPlayer();
    getContentPane().add( openFile, BorderLayout.NORTH );
    setSize( 300, 300 );
    setVisible(true);
    private void openFile()
    File file = null;
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setFileSelectionMode(
    JFileChooser.FILES_ONLY );
    int result = fileChooser.showOpenDialog( this );
    // user clicked Cancel button on dialog
    if ( result != JFileChooser.CANCEL_OPTION )
    file = fileChooser.getSelectedFile();
    try {
    uri = file.toURI();
    } catch (SecurityException e) {
    e.printStackTrace();
    // Convert the absolute URI to a URL object
    try {
    url = uri.toURL();
    } catch (IllegalArgumentException e) {
    e.printStackTrace();
    } catch (MalformedURLException e) {
    e.printStackTrace();
    private void createPlayer()
    if ( url == null )
    return;
    removePreviousPlayer();
    try {
    // create a new player and add listener
    dp = Manager.createPlayer( url );
    // blockingRealize();
    dp.addControllerListener( new EventHandler() );
    dp.start(); // start player
    dp.setRate(2);
    catch ( Exception e ){
    JOptionPane.showMessageDialog( this,
    "Invalid file or location", "Error loading file",
    JOptionPane.ERROR_MESSAGE );
    private void removePreviousPlayer()
    if ( dp == null )
    return;
    dp.close();
    Component visual = dp.getVisualComponent();
    Component control = dp.getControlPanelComponent();
    Container c = getContentPane();
    if ( visual != null )
    c.remove( visual );
    if ( control != null )
    c.remove( control );
    private synchronized void blockingRealize() {
    int teller = 1;
    dp.realize();
    while (!realized && teller <= 20) {
    try {
    wait(1000);
    System.out.println("not realized " +teller);+
    +teller++;
    } catch (java.lang.InterruptedException e) {
    System.exit(1);
    public static void main(String args[])
    DictaPlayer app = new DictaPlayer();
    app.addWindowListener(
    new WindowAdapter() {
    public void windowClosing( WindowEvent e )
    System.exit(0);
    // inner class to handler events from media player
    private class EventHandler implements ControllerListener {
    public void controllerUpdate( ControllerEvent e ) {
    if ( e instanceof RealizeCompleteEvent ) {
    Container c = getContentPane();
    // load Visual and Control components if they exist
    Component visualComponent =
    dp.getVisualComponent();
    if ( visualComponent != null )
    c.add( visualComponent, BorderLayout.CENTER );
    Component controlsComponent =
    dp.getControlPanelComponent();
    if (!realized) {
    System.out.println("not realized.");
    if ( controlsComponent != null )
    c.add( controlsComponent, BorderLayout.SOUTH );
    c.doLayout();
    }

    captfoss,
    Thank you for your comment.
    captfoss wrote:
    Start does realize the player, automatically, before it starts it... if it isn't realizing then it also isn't starting.Right, I thought so, but my test was wrong. I now tested it with getState() and I can see it's going from unrealized to realized.
    First off, you can only call setRate on a player that is realized but not started... further, any of the calls like configure, realize, start, stop, etc... are non-blocking calls...so you have to wait for them to finish before you go on to the next step.So you say that when the rate is changed (f.i. by a user in a gui) the program first has to bring player in non-started realized mode (stop + realize), call the setRate() and start the player again (on the exact position it was stopped)?
    The easiest solution would be to use Manager.createRealizedPlayer rather than Manager.createPlayer...Didn't find out yet why, but when i change this (only this), there is no playing.
    Also, ++teller++ is about the most-confused looking code I've ever seen...Just like all the asterisks, i now know that code changes when i toggle between the tabs (rich/plain/preview) in the message box.
    Beyond that, your "blocking realize" function doesn't appear to do anything except suggest you have no business coding anything this advanced. Your boolean value "realize" isn't ever changed, so, I'm not entirely sure what the point of that function is other than to wait 10 seconds.I got this somewhere from the internet. Thought it could help me realize the player, but it didn't (obvious) so i commented it out.
    Slowly I begin to understand the basics of JMF (at least i think so), but I also understand that there are other (Java) ways to build the application I need. Unfortunatly I have to little (hardly any) knowledge of all those (sound) API's (f.i. JLayer) to find my way through them and to decide which is the best for my use (user controled audio playback (at least WAV and MP3) with looping possiblities between 2 marked positions).
    If someone could give me an advise which API (method or whatever you call it) is best to focus on I shurely would appriciate that.

  • Installation problems with flash player 9

    Hi,
    I am having multiple problems with my copy of flash player. I
    have tried several versions 7-9 and all have had these problems. I
    know one of my problems is that I still use Win98SE. So, I am
    somewhat limited in what I can use. It all started when I visited
    several sites but, primarily www.wpsdlocal6.com, when the video
    tried to load flash9 would crash my explorer. After trying several
    other older versions as sugguested by some forum message, they
    would work once, maybe twice, and then do the same thing. I have
    checked my settings several times and all seem to be where it needs
    to be as far as I know. Out of frustration, I tried again to
    install flash7. During the installation it could not find where to
    place my web brower plug-ins. (I use IE 6.0.2800.1106 and I am not
    sure where IE places its plug-ins to tell it look in a particular
    directory.) I know at one point in time (I have been working on
    this for over a week) I realized my uninstaller was outdated, but I
    got that fixed.
    Any help would be GREATLY appreciated.
    j.logan

    A quick upadate. I have gotten all of my issues corrected,
    but one. I am getting a pop-up message on my home page,
    www.excite.com, saying I am trying to install activeX onto an
    unsupported computer. I only get an "OK" button and it will then
    "unpack." It does this everytime I access the website. Apparently
    there is a setting that needs to be corrected or something in a
    cache making my computer to behave this way. I have another
    computer with similar setup, win98se, ie6, flash 9,0,47,0 and it
    runs as smooth as glass. I finally got flash 8,0,42,0 to work other
    wise on this computer. I am nervous about updating to flash 9
    because I have had problems with flash9 crashing my browser on this
    computer. Any sugguestions?

  • Problems with Adobe Reader and Flash Player

    I had an Adobe update last Monday and, ever since then, I can't view documents (eg credit card statements) on screen and sites that I previously visited regularly without problem suddenly say that I need to have Adobe Flash Player installed. I've downloaded Adobe Flash Player and it says it's installed correctly but when I return to the site, it still says I need Adobe Flash Player. I've also tried doing an uninstall first and then an instal but the same thing happens. I've run disk first aid and it found a problem with the Head which it fixed but I still can't open documents using Adobe in Safari. Adobe Plug ins tells me that the Internet Access plug in is not loaded but when I ran 'repair Adobe Reader installation", it said there were no missing components detected and repair was not needed. I don't know if it's relevant but I've been having problems with Safari for several weeks, quitting 3 or 4 times a day, mainly when I'm switching from Safari to another programme such as Entourage or Excel.
    Message was edited by: Aileen2

    Hi Carolyn
    I don't think I made it clear on the original post that I'm having problems with both Adobe Reader AND Adobe Flash Player. Unfortunately, all the Adobe Reader sites are confidential so I can't give you an illustration on that but for the Adobe Flash Player, try www.jacquielawson.com/ - you can preview cards without being signed in. With the Adobe Reader problems, I get a picture of a blank 'piece of paper' with a small blue square in the top right hand corner that has a white question mark inside it. The first time this happened to me, I was on the UK Inland Revenue site trying to print out some end of year forms. I phoned the Revenue's helpline and they said to try doing a 'save as' to my desktop. It seemed bizarre - saving a blank piece of paper - but lo and behold, when I opened it on my desktop, the forms appeared exactly as normal. However, I've since tried this 'save as' technique with my credit card statement and I still get a blank piece of paper with a blue square and white question mark when I open the desktop copy.
    Thanks for your help and patience. I really appreciate it.
    Aileen

  • Problems with DVD Player 3.0.1 in G4/466

    Problems with DVD Player in G4/466
    Yes, I've a g4/466 with two disks. In the first there's system 9.2.2 and the DVD player goes perfect. In the second I've system 10.2 and the 9.2, and the DVD Player (3.0.1) on the system 10 begins to jump in the dock, but stop and nothing happens, I can't open it...
    There's any way to reinstal it form system disks???
    Or any download to check the error?
    Thanks

    1. Try using Pacifist to extract it from your Mac OS X 10.2 installation disks, and then run the combo updater for your version of Mac OS X and any applicable DVD Player updates.
    2. Open the Console application in the /Applications/Utilities/ folder and look for lines relating to the DVD Player.
    (18543)

  • Problem with installation of Adobe Flash Player on mac

        Hi, i have a macintosh with OsX Yosemite 10.10.2 and i can't update the software to te last version. The download always stop at 20-30%. It's not a problem of my internet connection. I tried to uninstall e reinstall flash player, but i have the same problem, with the difference that now i neither have the software... What can i do? Thank you!

    Hi,
    Ok.  So I found this and it worked:
    1.  Re: Flash download freezes at 25%. What will help?
           Jeromie Clark     Mar 18, 2015 5:00 PM  (in response to Geri J)   
    Please use the offline installer:
    http://fpdownload.macromedia.com/pub/flashplayer/latest/help/install_flash_player_osx.dmg
    Download the install package from this link.  Double-click to open it from your downloads folder; when you see the red "install" folder, right-click it and select "Show Package Contents"; click on the  "Contents" folder; then click on the "Resources" folder; then double-click on the "Adobe Flash Player.pkg" file. The installation will start.  It worked for me.... FINALLY!! I hope it also works for you.

  • Problem with Safari and Flash Player

    Hi, I've done a quick search and can't find an answer, however since updating from Lion to Mountain Lion I've had problems with my (2011) Macbook Pro whilst in Safari, following a Genuis bar visit last week we managed to narrow it down to a flash player problem and uninstalled and reinstalled flash was told that should the problems persist (we couldn't get the computer to repeat it's beahviour in store) then to re-install OSX, now I've done this but still getting the same problem, screen not refreashing so parts of previous page or pop still showing over top of new page and Computer getting VERY hot (to the point of almost burning. Now I've had a look on Adobe website and they recommend running 10.3 rather than 11.4 and I managed to download it from them however Safari blocks it as it's out of date, also on my iMac running Mountain Lion Flash appears to be blocking internet access, internet fails when attempting to use a website that needs flash, but works fine when not using it.  Anyone got any ideas on a work around?

    Try this...
    Quit Safari.
    Open System Preferences > Flash Player then select the Advanced tab. Click: Delete All
    Relaunch Safari.
    From the Safari menu bar click Safari > Reset Safari
    Select:  Clear History  (also empties the cache)
    Deselect the remaining boxes then click Reset.
    Quit and relaunch Safari. Try a Flash based video.

Maybe you are looking for

  • How can I activate my paid license (Adobe Acrobat 9 Standard) on my new laptop?

    A few years ago, I bought Adobe Acrobat 9 Standard and loaded it on my Sony Vaio laptop (Windows 7). This laptop is now dying and I loaded Adobe Acrobat 9 Standard on my new Lenovo laptop (Windows 8) - BUT IT WOULDN'T ACKNOWLEDGE MY LICENSE KEY. Beca

  • How can I make a video like this in iMovie?

    I want to help my friend create a video with her spoken word poem, and I'm pretty proficient at making videos. But I've never worked solely with text before. If anybody could help, that would be awesome. Thank you! I'm fairly new to iMovie, I used Po

  • Any test web sites to insure browser/Flash player/other is adequate for all Captivate content

    My prior subject header was a little confusing, so I hope it's okay I start over again and state more clearly what I need. I have hundreds of users accessing Adobe Captivate 5.5 training.  Many users have no trouble viewing the content.  SOME users h

  • BOE XI v3.1 Custom Installation

    Running a Custom installation of BOE XI v3.1 is forcing the use of MySQL as our CMS database. One of the first installation screens has us choosing "Custom" or "New" installation. But there is no possibility of choosing an existing database server wi

  • IDOC Interface Error

    Hi Experts, I am getting the same error: and from the forums I came to know that we need to use the IDOC name in the Interface mapping. I used the modified IDOC structure(External Definition) in mapping, but when I select the original interface in In