Package javax.media

Examples of javax.media.MediaLocator


  if (url.indexOf(":") < 0) {
      prUsage();
      System.exit(0);
  }

  MediaLocator ml;

  if ((ml = new MediaLocator(url)) == null) {
      System.err.println("Cannot build media locator from: " + url);
      System.exit(0);
  }

  FrameAccess fa = new FrameAccess();
View Full Code Here


    {
        URL url = null;

        //  Check if arg is a valid url
        try {
            return new MediaLocator(
                new URL(arg) );
        } catch( MalformedURLException e ) {}

        //  Check if arg + doc base is a valid url
        try {
            return new MediaLocator(
                new URL( applet.getDocumentBase(), arg) );
        } catch( MalformedURLException e ) {}

        return new MediaLocator(arg);
    }
View Full Code Here

    public static MediaLocator appArgToMediaLocator(String arg) {
        URL url = null;

        //  Check if arg is a valid url
        try {
            return new MediaLocator(
                new URL(arg) );
        } catch( MalformedURLException e ) {}

        // Check if it is a file name
        try {
            return new MediaLocator(
                fileToURL(arg) );
        }
        catch( MalformedURLException e ) {}
        catch( IOException e ) {}

        // Default MediaLocator
        return new MediaLocator(arg);
    }
View Full Code Here

        if((media = getParameter("MEDIA")) == null) {
            System.err.println("Error: MEDIA parameter not specified");
            return;
        }

        MediaLocator locator
            = Utility.appletArgToMediaLocator(this, media);

        try {
            initialize(locator);
        }
View Full Code Here

        if(args.length == 0) {
            System.err.println("Media parameter not specified");
            return;
        }

        MediaLocator locator
            = Utility.appArgToMediaLocator(args[0]);

        try {
            driver.initialize(locator);
        }
View Full Code Here

      int rc = chooser.showOpenDialog(SimpleMixer.this);

      if (rc == JFileChooser.APPROVE_OPTION) {
    mediaFile = chooser.getSelectedFile();
    if (mediaFile != null) {
        MediaLocator ml = null;
        String filePath = null
        try {
      filePath = mediaFile.getCanonicalPath();
        } catch (IOException ex) {
      JOptionPane.showMessageDialog(
View Full Code Here

     * Otherwise it returns a string with the reason why the setup failed.
     */
    public synchronized String start( String filename, Vector targets) {
  String result;

  locator= new MediaLocator( filename);
 
  // Create a processor for the specified media locator
  // and program it to output JPEG/RTP
  result = createProcessor();
  if (result != null) {
View Full Code Here

    public static void main(String args[]) {
        Vector slaveMedia = new Vector();

        //  Build the list of slave media
        for(int i = 1; i < args.length; i++) {
            MediaLocator locator
                = Utility.appArgToMediaLocator(args[i]);

            slaveMedia.addElement(locator);
        }
View Full Code Here

        for(int i = 0; ; i++) {
            String param = "SLAVE" + i;
            String media = getParameter(param);
            if(media == null) break;

            MediaLocator locator
                = Utility.appletArgToMediaLocator(this, media);

            slaveMedia.addElement(locator);
        }
View Full Code Here

    private void loadSlaves() {
        for(int i = 0, n = slaveMedia.size(); i < n; i++) {
            try {
                Player slave;

                MediaLocator locator =
                    (MediaLocator)slaveMedia.elementAt(i);

                //  Create the Slave Player
                slave = Manager.createPlayer(locator);
View Full Code Here

TOP

Related Classes of javax.media.MediaLocator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.