Comunidad de diseño web y desarrollo en internet online

Ayuda con JMF

Citar            
MensajeEscrito el 08 Dic 2011 06:49 pm
Estoy tratando de utilizar un player para reproducir una fuente multimedia de la web en mi programa, el código que utilizo es el siguiente:

package primerplayer;
import java.io.IOException;
import java.net.MalformedURLException;
import javax.media.*;
import java.awt.*;
import java.net.URL;
import javax.swing.*;
/**
*
* @author santiago
*/
public class PrimerPlayer extends JFrame {
private Player player = null;
private Component componenteControl = null;
private Component componenteVisual = null;
Container contenedor;
public PrimerPlayer() throws MalformedURLException, NoPlayerException, IOException{
super("Demostración de reproducción de una fuente monomedia");
contenedor = getContentPane();
contenedor.setLayout(new FlowLayout());
abrirContenido();
}
private void abrirContenido() throws MalformedURLException, IOException, NoPlayerException{
URL url = null;
url= new URL("http://upload.wikimedia.org/wikipedia/commons/f/fd/Schola_Gregoriana-Antiphona_et_Magnificat.ogg");
player = Manager.createPlayer(url);
componenteControl = player.getControlPanelComponent();
componenteVisual = player.getVisualComponent();
contenedor.add(componenteVisual);
contenedor.add(componenteControl);
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws MalformedURLException, NoPlayerException, IOException {
// TODO code application logic here
PrimerPlayer primerplayer = new PrimerPlayer();
primerplayer.setDefaultCloseOperation(EXIT_ON_CLOSE);
}
}

Cuando ejecuto el programa me dice:

Exception in thread "main" javax.media.NoPlayerException: Cannot find a Player for :http://upload.wikimedia.org/wikipedia/commons/f/fd/Schola_Gregoriana-Antiphona_et_Magnificat.ogg

Alguien sabe que tengo mal en el código?

Por Santicomputer

9 de clabLevel



 

firefox
Citar            
MensajeEscrito el 08 Dic 2011 07:12 pm
Nadie respondió mi pregunta entonces me respondo a mí mísmo,

ya encontré el problema, creo que está en la URL, me ayudó mucho este tutorial:
http://www.apuntes.delibertad.com/java/reproducir-video-en-java/

Por Santicomputer

9 de clabLevel



 

firefox
Citar            
MensajeEscrito el 09 Dic 2011 12:10 am
Este foro es de JavaScript, no de Java.

Por DriverOp

Claber

2510 de clabLevel



 

opera

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.