Package javax.media

Examples of javax.media.MediaLocator


    }
   
    logger.fine("Creating processor");
    try
    {
      processor = Manager.createProcessor(new MediaLocator(url));
    } catch (IOException e)
    {
      throw new WizardStepException(e);
     
    } catch (NoProcessorException e)
View Full Code Here


    {
      String url = config.destUrl;
     
      logger.fine("Dest url: " + url);

      MediaLocator m = new MediaLocator(url);

      destDataSink = Manager.createDataSink(destDataSource, m);
      destDataSink.open();
      destDataSink.start();
     
View Full Code Here

        add(jLabel1, gridBagConstraints);

    }// </editor-fold>//GEN-END:initComponents

    private void buttonChooseCaptureDeviceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonChooseCaptureDeviceActionPerformed
    MediaLocator locator = CaptureDeviceBrowser.run(null); // TODO: correct parent frame
    if (locator != null)
    {
      textFieldURL.setText(locator.toExternalForm());
    }
     
    }//GEN-LAST:event_buttonChooseCaptureDeviceActionPerformed
View Full Code Here

 
  @Override
  public boolean doPlayerRealize()
  {

    MediaLocator locator = getSource().getLocator();
   
    // workaround because JMF does not like relative file URLs.
    if (locator.getProtocol().equals("file"))
    {  final String newUrl = URLUtils.createAbsoluteFileUrl(locator.toExternalForm());
      if (newUrl != null)
      {
        final MediaLocator newSource = new MediaLocator(newUrl);
        if (!locator.toExternalForm().equals(newSource.toExternalForm()))
        {
          logger.warning("Changing file URL to absolute, from " + locator.toExternalForm() + " to " + newSource);
          locator = newSource;
        }
      }
View Full Code Here

//     // TODO: this is hard-coded, there must be a better way.
//   }
  
   private InputStream getInputStream(String urlStr, Format outputFormat, ContentDescriptor outputContentDescriptor) throws Exception
   {
     final ProcessorModel processorModel = new ProcessorModel(new MediaLocator(urlStr), outputFormat == null ? null : new Format[]{outputFormat}, outputContentDescriptor);
    
    final Processor processor = Manager.createRealizedProcessor(processorModel);
 
    final DataSource ds = processor.getDataOutput();
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) {
            logger.warning("Error: MEDIA parameter not specified");
            return;
        }

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

        try {
          // initialize will open a new window.
            // initialize(locator);
View Full Code Here

        if(args.length == 0) {
            logger.severe("Media parameter not specified");
            return;
        }

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

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

        IOException,
        NoPlayerException
    {
  int index = getAvailableTrack();

  MediaLocator ml = Utility.appArgToMediaLocator(fileName);
  if (ml == null) {
      throw new IllegalArgumentException("Bad media file name");
  }
  // Increment up front so that if listeners act in response
  // to event generated below, they will get correct number
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.