зеркало из https://github.com/mozilla/pjs.git
A plugins/examples/jmfplayer/src/main/web/tilego3.avi
A plugins/examples/jmfplayer/src/main/java/jmfplayer/JMFPlayer.java A plugins/examples/jmfplayer/src/main/web/test01.html R plugins/examples/MediaPlayer/JMPlayer.java R plugins/examples/MediaPlayer/samples/test.html R plugins/examples/MediaPlayer/samples/tilego3.avi - Move mediaplayer example to jmfplayer M plugins/examples/index.html - Add mediaplayer example M plugins/netbeans/build.xml M plugins/netbeans/pluglet.properties - require new property jdkhome.nospaces M plugins/release/build.xml - marching toward binary distribution M plugins/netbeans/nbproject/build-impl.xml M plugins/netbeans/nbproject/genfiles.properties M plugins/netbeans/nbproject/project.properties M plugins/netbeans/nbproject/project.xml - IDE changes
This commit is contained in:
Родитель
0ebb5c74e7
Коммит
b51060f085
|
@ -12,13 +12,25 @@
|
|||
<li><p><a href="simple/src/main/web/index.html">Simple Pluglet</a>
|
||||
</p></li>
|
||||
|
||||
<li><p>Java Media Framework Plugin Examples</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><p><a href="jmfplayer/src/main/web/test01.html">Example 01</a>
|
||||
</p></li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<hr>
|
||||
<!-- Created: Fri Mar 16 14:12:07 Eastern Standard Time 2007 -->
|
||||
<!-- hhmts start -->
|
||||
Last modified: Fri Mar 16 14:13:01 Eastern Standard Time 2007
|
||||
Last modified: Mon Mar 19 23:29:38 Eastern Standard Time 2007
|
||||
<!-- hhmts end -->
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,141 @@
|
|||
package jmfplayer;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Frame;
|
||||
import java.awt.Panel;
|
||||
import java.awt.print.PrinterJob;
|
||||
import java.io.InputStream;
|
||||
import javax.media.ControllerEvent;
|
||||
import javax.media.ControllerListener;
|
||||
import javax.media.MediaLocator;
|
||||
import javax.media.PrefetchCompleteEvent;
|
||||
import javax.media.RealizeCompleteEvent;
|
||||
import javax.media.bean.playerbean.MediaPlayer;
|
||||
import org.mozilla.pluglet.Pluglet;
|
||||
import org.mozilla.pluglet.PlugletFactory;
|
||||
import org.mozilla.pluglet.PlugletStreamListener;
|
||||
import org.mozilla.pluglet.mozilla.PlugletManager;
|
||||
import org.mozilla.pluglet.mozilla.PlugletPeer;
|
||||
import org.mozilla.pluglet.mozilla.PlugletStreamInfo;
|
||||
import org.mozilla.pluglet.mozilla.PlugletTagInfo2;
|
||||
|
||||
|
||||
public class JMFPlayer implements PlugletFactory {
|
||||
public JMFPlayer() {
|
||||
}
|
||||
public Pluglet createPluglet(String mimeType) {
|
||||
Pluglet player = null;
|
||||
try {
|
||||
player = new Player();
|
||||
}
|
||||
catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return player;
|
||||
}
|
||||
public void initialize(String plugletPath, PlugletManager manager) {
|
||||
}
|
||||
public void shutdown() {
|
||||
}
|
||||
}
|
||||
|
||||
class Player implements Pluglet, ControllerListener {
|
||||
Dimension defaultSize;
|
||||
Frame frm;
|
||||
int w, h;
|
||||
MediaPlayer player = null;
|
||||
Panel panel;
|
||||
|
||||
public synchronized void controllerUpdate(ControllerEvent ce) {
|
||||
if(ce instanceof RealizeCompleteEvent) {
|
||||
player.prefetch();
|
||||
}
|
||||
if(ce instanceof PrefetchCompleteEvent) {
|
||||
Dimension dim = player.getPreferredSize();
|
||||
frm.pack();
|
||||
panel.setSize(dim);
|
||||
frm.setSize(defaultSize);
|
||||
player.start();
|
||||
frm.show();
|
||||
}
|
||||
}
|
||||
public Player() {
|
||||
}
|
||||
public void initialize(PlugletPeer peer) {
|
||||
PlugletTagInfo2 info = (PlugletTagInfo2)peer.getTagInfo();
|
||||
w = info.getWidth();
|
||||
h = info.getHeight();
|
||||
defaultSize = new Dimension(w, h);
|
||||
}
|
||||
public boolean playFile(String url) {
|
||||
player.setMediaLocator(new MediaLocator(url));
|
||||
if(player.getPlayer() == null) {
|
||||
return false;
|
||||
} else {
|
||||
player.addControllerListener(this);
|
||||
player.realize();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public void start() {
|
||||
player = new MediaPlayer();
|
||||
panel = new Panel();
|
||||
panel.add(player);
|
||||
}
|
||||
public void stop() {
|
||||
player.stop();
|
||||
player.close();
|
||||
}
|
||||
public void destroy() {
|
||||
}
|
||||
public PlugletStreamListener newStream() {
|
||||
JMFPlayerStreamListener listener = new JMFPlayerStreamListener();
|
||||
listener.setPlayer(this);
|
||||
return listener;
|
||||
}
|
||||
public void setWindow(Frame frame) {
|
||||
if(frame == null) {
|
||||
return;
|
||||
}
|
||||
frame.setSize(defaultSize);
|
||||
frame.setLayout(new BorderLayout());
|
||||
frame.add(panel);
|
||||
frm = frame;
|
||||
}
|
||||
public void print(PrinterJob printerJob) {
|
||||
}
|
||||
}
|
||||
|
||||
class JMFPlayerStreamListener implements PlugletStreamListener {
|
||||
Player jmp;
|
||||
|
||||
public JMFPlayerStreamListener() {
|
||||
}
|
||||
public void onStartBinding(PlugletStreamInfo streamInfo) {
|
||||
if(!jmp.playFile(streamInfo.getURL())) {
|
||||
System.out.println("Error starting player.");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
public void setPlayer(Player jmp) {
|
||||
this.jmp = jmp;
|
||||
}
|
||||
public void onDataAvailable(PlugletStreamInfo streamInfo, InputStream input,int length) {
|
||||
}
|
||||
public void onFileAvailable(PlugletStreamInfo plugletInfo, String fileName) {
|
||||
}
|
||||
public void onStopBinding(PlugletStreamInfo plugletInfo,int status) {
|
||||
}
|
||||
public int getStreamType() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<html>
|
||||
<head><title>video/avi 3</title></head>
|
||||
<body>
|
||||
<EMBED type="video/avi" name=JMPlayer SRC="tilego3.avi" width=400 height=400>
|
||||
</body>
|
||||
</html>
|
Двоичный файл не отображается.
|
@ -142,6 +142,7 @@
|
|||
<condition property="preconditions.met">
|
||||
<and>
|
||||
<available file="${browser.bin.dir}/${so.prefix}xpcom.${so.extension}" />
|
||||
<available file="${jdkhome.nospaces}/jre/bin/${so.prefix}java.${so.extension}" />
|
||||
</and>
|
||||
</condition>
|
||||
|
||||
|
@ -153,19 +154,22 @@
|
|||
<fail unless="preconditions.met">
|
||||
|
||||
Conditions for compilation have not been met.
|
||||
|
||||
Have you verified that the property browser.bin.dir has been set
|
||||
to the binary directory of the host browser in the webclient.properties
|
||||
to the binary directory of the host browser in the pluglet.properties
|
||||
file? The current value of this property is:
|
||||
${browser.bin.dir} and this directory must contain the file
|
||||
${so.prefix}xpcom.${so.extension}.
|
||||
|
||||
Have you verified that the property jdkhome.nospaces has been set
|
||||
to the installation of the JDK, in the pluglet.properties file,
|
||||
and that the path to this directory
|
||||
has no spaces? The current value of this property is:
|
||||
${jdkhome.nospaces}.
|
||||
</fail>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="edburns">
|
||||
<echo message="edburns path: ${myenv.Path}" />
|
||||
</target>
|
||||
|
||||
<target name="-post-init">
|
||||
<antcall target="copy.binaries" />
|
||||
</target>
|
||||
|
@ -183,7 +187,7 @@ ${so.prefix}xpcom.${so.extension}.
|
|||
</delete>
|
||||
</target>
|
||||
|
||||
<target name="run" depends="-init-check,-post-init">
|
||||
<target name="run" depends="-init-check,-pre-init,-post-init">
|
||||
|
||||
<exec os="SunOS" dir="${browser.bin.dir}" executable="firefox"
|
||||
failonerror="yes">
|
||||
|
@ -197,23 +201,17 @@ ${so.prefix}xpcom.${so.extension}.
|
|||
failonerror="yes">
|
||||
<arg value="file://${basedir}/../examples/index.html" />
|
||||
</exec>
|
||||
<!--
|
||||
<exec os="Windows 2000" dir="${browser.bin.dir}"
|
||||
executable="${browser.bin.dir}/firefox.exe"
|
||||
newenvironment="true"
|
||||
failonerror="yes">
|
||||
-->
|
||||
<exec os="Windows 2000" dir="${browser.bin.dir}"
|
||||
executable="${browser.bin.dir}/firefox.exe"
|
||||
failonerror="yes">
|
||||
<env key="PATH"
|
||||
path="${myenv.Path}:${browser.bin.dir}:${browser.bin.dir}/components"
|
||||
path="${jdkhome.nospaces}/jre/bin/client"
|
||||
/>
|
||||
<env key="Path"
|
||||
path="${myenv.Path}:${browser.bin.dir}:${browser.bin.dir}/components"
|
||||
path="${jdkhome.nospaces}/jre/bin/client"
|
||||
/>
|
||||
<env key="path"
|
||||
path="${myenv.Path}:${browser.bin.dir}:${browser.bin.dir}/components"
|
||||
path="${jdkhome.nospaces}/jre/bin/client"
|
||||
/>
|
||||
<env key="CLASSPATH"
|
||||
path="${run.classpath}"
|
||||
|
@ -235,23 +233,42 @@ ${so.prefix}xpcom.${so.extension}.
|
|||
</target>
|
||||
|
||||
<target name="-post-compile">
|
||||
<echo message="${build.classes.dir}" />
|
||||
<jar jarfile="${build.dir}/SimplePluglet.jar">
|
||||
<manifest>
|
||||
<attribute name="MIMEDescription" value="application/x-simple-pluglet"/>
|
||||
<attribute name="Pluglet-Class" value="simple.SimplePluglet"/>
|
||||
</manifest>
|
||||
<fileset dir="${build.classes.dir}">
|
||||
<include name="simple/**/*.*" />
|
||||
</fileset>
|
||||
</jar>
|
||||
<delete>
|
||||
<fileset dir="${build.classes.dir}">
|
||||
<include name="simple/**/*.*" />
|
||||
</fileset>
|
||||
</delete>
|
||||
<!-- SimplePluglet -->
|
||||
<jar jarfile="${build.dir}/SimplePluglet.jar">
|
||||
<manifest>
|
||||
<attribute name="MIMEDescription" value="application/x-simple-pluglet"/>
|
||||
<attribute name="Pluglet-Class" value="simple.SimplePluglet"/>
|
||||
</manifest>
|
||||
<fileset dir="${build.classes.dir}">
|
||||
<include name="simple/**/*.*" />
|
||||
</fileset>
|
||||
</jar>
|
||||
<delete>
|
||||
<fileset dir="${build.classes.dir}">
|
||||
<include name="simple/**/*.*" />
|
||||
</fileset>
|
||||
</delete>
|
||||
<copy todir="${browser.bin.dir}/plugins"
|
||||
file="${build.dir}/SimplePluglet.jar" />
|
||||
|
||||
<!-- JMFPlayer -->
|
||||
<jar jarfile="${build.dir}/jmfplayer.jar">
|
||||
<manifest>
|
||||
<attribute name="MIMEDescription" value="video/avi"/>
|
||||
<attribute name="Pluglet-Class" value="jmfplayer.JMFPlayer"/>
|
||||
</manifest>
|
||||
|
||||
<fileset dir="${build.classes.dir}">
|
||||
<include name="jmfplayer/**/*.*" />
|
||||
</fileset>
|
||||
</jar>
|
||||
<delete>
|
||||
<fileset dir="${build.classes.dir}">
|
||||
<include name="jmfplayer/**/*.*" />
|
||||
</fileset>
|
||||
</delete>
|
||||
<copy todir="${browser.bin.dir}/plugins"
|
||||
file="${build.dir}/SimplePluglet.jar" />
|
||||
file="${build.dir}/jmfplayer.jar" />
|
||||
</target>
|
||||
|
||||
<target name="-do-jar-with-manifest" />
|
||||
|
|
|
@ -67,6 +67,7 @@ is divided into following sections:
|
|||
<or>
|
||||
<available file="${src.EmptyMainClass.dir}"/>
|
||||
<available file="${src.java.dir}"/>
|
||||
<available file="${src.java2.dir}"/>
|
||||
</or>
|
||||
</condition>
|
||||
<condition property="netbeans.home+have.tests">
|
||||
|
@ -96,6 +97,7 @@ is divided into following sections:
|
|||
<target name="-init-check" depends="-pre-init,-init-private,-init-user,-init-project,-do-init">
|
||||
<fail unless="src.EmptyMainClass.dir">Must set src.EmptyMainClass.dir</fail>
|
||||
<fail unless="src.java.dir">Must set src.java.dir</fail>
|
||||
<fail unless="src.java2.dir">Must set src.java2.dir</fail>
|
||||
<fail unless="build.dir">Must set build.dir</fail>
|
||||
<fail unless="dist.dir">Must set dist.dir</fail>
|
||||
<fail unless="build.classes.dir">Must set build.classes.dir</fail>
|
||||
|
@ -116,7 +118,7 @@ is divided into following sections:
|
|||
</target>
|
||||
<target name="-init-macrodef-javac">
|
||||
<macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
|
||||
<attribute name="srcdir" default="${src.EmptyMainClass.dir}:${src.java.dir}"/>
|
||||
<attribute name="srcdir" default="${src.EmptyMainClass.dir}:${src.java.dir}:${src.java2.dir}"/>
|
||||
<attribute name="destdir" default="${build.classes.dir}"/>
|
||||
<attribute name="classpath" default="${javac.classpath}"/>
|
||||
<attribute name="debug" default="${javac.debug}"/>
|
||||
|
@ -243,6 +245,7 @@ is divided into following sections:
|
|||
<copy todir="${build.classes.dir}">
|
||||
<fileset dir="${src.EmptyMainClass.dir}" excludes="${build.classes.excludes}"/>
|
||||
<fileset dir="${src.java.dir}" excludes="${build.classes.excludes}"/>
|
||||
<fileset dir="${src.java2.dir}" excludes="${build.classes.excludes}"/>
|
||||
</copy>
|
||||
</target>
|
||||
<target name="-post-compile">
|
||||
|
@ -394,11 +397,14 @@ is divided into following sections:
|
|||
<sourcepath>
|
||||
<pathelement location="${src.EmptyMainClass.dir}"/>
|
||||
<pathelement location="${src.java.dir}"/>
|
||||
<pathelement location="${src.java2.dir}"/>
|
||||
</sourcepath>
|
||||
<packageset dir="${src.EmptyMainClass.dir}" includes="*/**"/>
|
||||
<packageset dir="${src.java.dir}" includes="*/**"/>
|
||||
<packageset dir="${src.java2.dir}" includes="*/**"/>
|
||||
<fileset dir="${src.EmptyMainClass.dir}" includes="*.java"/>
|
||||
<fileset dir="${src.java.dir}" includes="*.java"/>
|
||||
<fileset dir="${src.java2.dir}" includes="*.java"/>
|
||||
</javadoc>
|
||||
</target>
|
||||
<target name="-javadoc-browse" if="netbeans.home" unless="no.javadoc.preview" depends="init,-javadoc-build">
|
||||
|
|
|
@ -3,6 +3,6 @@ build.xml.script.CRC32=4cc13411
|
|||
build.xml.stylesheet.CRC32=240b97a2
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=59b0de98
|
||||
nbproject/build-impl.xml.script.CRC32=5b6a971b
|
||||
nbproject/build-impl.xml.data.CRC32=88453c61
|
||||
nbproject/build-impl.xml.script.CRC32=cc42387b
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=20b9345e
|
||||
|
|
|
@ -18,6 +18,8 @@ dist.jar=${dist.dir}/pluglet.jar
|
|||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
file.reference.examples-EmptyMainClass=../examples/EmptyMainClass
|
||||
file.reference.main-java=../examples/simple/src/main/java
|
||||
file.reference.main-java-1=../examples/jmf-player/src/main/java
|
||||
file.reference.main-java-2=../examples/jmfplayer/src/main/java
|
||||
file.reference.pluglet-1_1_a1.jar=../lib/pluglet-1_1_a1.jar
|
||||
jar.compress=false
|
||||
javac.classpath=\
|
||||
|
@ -59,3 +61,4 @@ run.test.classpath=\
|
|||
${build.test.classes.dir}
|
||||
src.EmptyMainClass.dir=${file.reference.examples-EmptyMainClass}
|
||||
src.java.dir=${file.reference.main-java}
|
||||
src.java2.dir=${file.reference.main-java-2}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
<source-roots>
|
||||
<root id="src.EmptyMainClass.dir" name="EmptyMainClass"/>
|
||||
<root id="src.java.dir" name="SimplePluglet"/>
|
||||
<root id="src.java2.dir" name="jmfplayer"/>
|
||||
</source-roots>
|
||||
<test-roots/>
|
||||
</data>
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
bin.artifacts.pattern=${so.prefix}plugletjni.${so.extension},components/${so.prefix}pluglet.${so.extension},components/pluglet.xpt,plugins/np${so.prefix}pluglet.${so.extension},plugins/SimplePluglet.jar
|
||||
bin.artifacts.pattern=${so.prefix}plugletjni.${so.extension},components/${so.prefix}pluglet.${so.extension},components/pluglet.xpt,plugins/np${so.prefix}pluglet.${so.extension},plugins/SimplePluglet.jar,plugins/jmfplayer.jar
|
||||
#debug.jvm.args=-Xdebug -Xrunjdwp:transport=dt_shmem,address=jdbconn,server=y,suspend=y
|
||||
|
||||
#Make this point to the bin directory of your XULRUNNER installation
|
||||
browser.bin.dir=C:\\Projects\\chaff\\pluglet-1-1-alpha-1\\ff1509
|
||||
#Make this point at your JDKHOME without spaces
|
||||
jdkhome.nospaces=C:\\PROGRA~1\\Java\\jdk1.6.0
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
<property name="dist.classes" value="${moz.dist}/classes" />
|
||||
<property name="javadoc.private" value="false"/>
|
||||
<property name="javadoc.protected" value="true"/>
|
||||
<property name="dist.jar" value="${dist.home}/lib/${name}-${version}.jar"/>
|
||||
|
||||
<target name="release">
|
||||
|
||||
|
@ -62,13 +61,34 @@
|
|||
<antcall target="compile.all" />
|
||||
<antcall target="build.dist.jar" />
|
||||
<antcall target="copy.binaries" />
|
||||
<!--
|
||||
<antcall target="copy.test.src" />
|
||||
<antcall target="copy.core.src" />
|
||||
<antcall target="copy.build.support" />
|
||||
<antcall target="build.javadocs" />
|
||||
<antcall target="build.zip" />
|
||||
-->
|
||||
</target>
|
||||
|
||||
<target name="workarea.release">
|
||||
|
||||
<antcall target="release">
|
||||
<param name="dist.home" value="${basedir}/.." />
|
||||
</antcall>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="workarea.clean">
|
||||
|
||||
<property name="workarea.dist" value="${basedir}/.." />
|
||||
<delete dir="${workarea.dist}/lib" />
|
||||
<delete dir="${workarea.dist}/bin" />
|
||||
<delete dir="${workarea.dist}/javadocs" />
|
||||
|
||||
|
||||
</target>
|
||||
|
||||
|
||||
<target name="build.zip">
|
||||
<condition property="platform" value="win32">
|
||||
<and>
|
||||
|
@ -139,6 +159,9 @@
|
|||
|
||||
|
||||
<target name="uptodate">
|
||||
<property name="dist.jar"
|
||||
value="${dist.home}/lib/${name}-${version}.jar"/>
|
||||
|
||||
<uptodate property="core.java.classes.uptodate"
|
||||
targetfile="${dist.jar}">
|
||||
<srcfiles dir="${dist.classes}" />
|
||||
|
@ -156,6 +179,8 @@
|
|||
</target>
|
||||
|
||||
<target name="build.dist.jar">
|
||||
<property name="dist.jar"
|
||||
value="${dist.home}/lib/${name}-${version}.jar"/>
|
||||
<jar jarfile="${dist.jar}" >
|
||||
<manifest>
|
||||
<attribute name="Specification-Title" value="${Name}"/>
|
||||
|
|
Загрузка…
Ссылка в новой задаче