playing/viewing file from a url
I have looked over the url tutorials in the java tutorials, and i was wondering if it is possible to play a file from a url. for instance. have a videoplayer, and give it a file to play that is a url. i didn't test the below code but it was an idea of what i was thinking, just modified how to display a webcam.
i am basically looking for a way to play or stream a video file from one computer to another, thought this might work. if not anyone can point me to a better way. thanks.
also would like to do the same thing with sound and images if possible
try{
//CaptureDeviceInfo device = getMyWebCam();
MediaLocator ml = url?//device.getLocator();
player = Manager.createRealizedPlayer(ml);
player.start();
Component videoScreen = player.getVisualComponent();
pnVideo.setLayout(new BorderLayout());
if(player !=null && videoScreen !=null){
pnVideo.add(videoScreen);
System.out.println("added visual component");
pnVideo.add(player.getControlPanelComponent(), BorderLayout.SOUTH);
}
}catch(Exception e){
JOptionPane.showMessageDialog(null,"You have not connected your webcam");
System.out.println(e);
}
Message was edited by:
developprograms

