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

<script src="http://jfx.sfbay.sun.com/hudson/job/javafx1.0/label=macosx-universal/776/artifact/build/macosx-universal/release/javaws/dtfx.js"></script> <script> javafx( { archive: "http://blogs.sun.com/octav/resource/SimpleVideoPlayer.jar", width: 530, height: 305, code: "simplevideoplayer.Main", name: "SimpleVideoPlayer" } ); </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
   }
}
Comments:

Hey Octavian,m
Can you send it to me?
Thanks,
Thom

Posted by Thom on November 12, 2008 at 10:23 AM PST #

Sure, I'll send you the NetBeans project.

Posted by Octavian Tanase on November 12, 2008 at 12: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 06:10 AM PST #

Post a Comment:
Comments are closed for this entry.
About

octav

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today