Message to developers
Here is a demonstration of the power of the JavaFX platform. We are still fixing some issues, so the clip will only play if you are within Sun's internal network an it will only play on the Mac since the clip is encoded as mp4.
Media player - written in JavaFX Script
Below is the code of the JavaFX applet that creates the video player. This sample is bundled with NetBeans 6.5, the upcoming distribution that has support for JavaFX Script.package simplevideoplayer;
import javafx.stage.Stage;
import javafx.scene.Scene;
import com.sun.fxmediacomponent.*;
import javafx.scene.Group;
def mediaUrl:String =
"http://sun.edgeboss.net/download/sun/09b01806/09b01806_00.mp4";
println("using mediaUrl = {mediaUrl}");
var vidWidth = 512;
var vidHeight = 288;
var fullWidth = 700;
var fullHeight = 400;
var mediaBox:MediaComponent = MediaComponent {
// set the media and make the component visible
mediaSourceURL : bind mediaUrl
visible:true
// the position and size of the media on screen
mediaX: (fullWidth-vidWidth)/2 // center
mediaY: (fullHeight-vidHeight)/2 // center
mediaViewWidth : vidWidth
mediaViewHeight: vidHeight
mediaVisible: true
// determines if the control bar is visible at all
controlBarVisible: true
// determines if the control bar is below the media or on top
staticControlBar: false
// the position of the scroll bar.
//leave as the defaults to have it be below the media
//controlBarX: -1
//controlBarY: -1
// set the size for full screen.
fullScreenWidth: fullWidth
fullScreenHeight: fullHeight
// make the movie play as soon as it's loaded
mediaPlayerAutoPlay: true
// set the volume
volume: 0.5
};
Stage {
title: "Simple Media Player"
scene: Scene{
width: fullWidth
height: fullHeight
content: mediaBox
}
}
Hey Octavian,m
Can you send it to me?
Thanks,
Thom
Posted by Thom on November 12, 2008 at 06:23 PM PST #
Sure, I'll send you the NetBeans project.
Posted by Octavian Tanase on November 12, 2008 at 08:19 PM PST #
FLV movies work both on Mac and Windows.
You can find something to your liking at http://blip.tv, find a video, then click on the "files and links" to expand the box, then snag the flv format URL.
Here is the link for a movie about wild dogs :-)
http://blip.tv/file/get/Wildcaster-GreetHarassAndSwim253.flv
Posted by Dave on January 13, 2009 at 02:10 PM PST #