Java Reference
In-Depth Information
2. The next code segment shows you how to use the MediaController class
defined earlier:
def w = 800;
def h = 600;
def maxW = w * 0.8;
def maxH = h * 0.7;
var scene:Scene;
def mediaSource = "http://mirror.bigbuckbunny.de/peach/bigbuckbun-
ny_movies/big_buck_bunny_480p_h264.mov";
def video = MediaView {
layoutX:(w - maxW)/2 layoutY:(h-maxH)/2
mediaPlayer:MediaPlayer {media:Media{source:mediaSource}}
fitWidth:maxW fitHeight:maxH
}
def controls = MediaController {
mediaPlayer: video.mediaPlayer
showReflection:true
layoutX: (w - 200)/2 layoutY:video.fitHeight + 50
}
When we place variable video and the instance of MediaController in a scene and
execute the application, we get a screen as shown in the next screenshot:
 
Search WWH ::




Custom Search