我已经将Red5-Screenshare应用程序(在下面的链接中找到)转换为JApplet。
https://code.google.com/p/red5-screenshare/
我刚刚从JApplet扩展了ScreenShare.java类。然后,我删除了main()方法,并在ScreenShare.java类中的applet init()方法之后。
public void init()
{
instance = new ScreenShare();
instance.host = getParameter("host");
instance.app = getParameter("app");
instance.port = Integer.parseInt(getParameter("port"));
instance.publishName = getParameter("stream");
instance.codec = getParameter("codec");
try {
instance.frameRate = Integer.parseInt(getParameter("framerate"));
instance.maxWidth = Integer.parseInt(getParameter("width"));
instance.maxHeight = Integer.parseInt(getParameter("height"));
logger.debug(instance.maxWidth +","+instance.maxHeight);
} catch (Exception e) {logger.debug(e.getMessage());}
System.out.println("User home " + System.getProperty("user.home"));
System.out.println("User Dir " + System.getProperty("user.dir"));
logger.debug("host: " + instance.host + ", app: " + instance.app + ", port: " + instance.port + ", publish: " + instance.publishName);
instance.createWindow();
}
这是此小程序的JNLP文件的样子
<jnlp href="screenshare_applet.jar">
<information>
<title>Red5 ScreenShare</title>
<vendor>Dele Olajide</vendor>
<homepage>http://code.google.com/p/red5screnshare/</homepage>
<description>Red5 ScreenShare</description>
<description kind='short'>An Open Source Screen Share Java application for Adobe Flash using Red5</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<!-- Application Resources -->
<j2se version="1.6+" />
<jar href="screenshare_applet.jar"/>
</resources>
<applet-desc
name="Red5 ScreenShare"
main-class='org.redfire.screen.ScreenShare'
width="500"
height="440">
<param name="host" value="localhost"/>
<param name="app" value="screenshare"/>
<param name="port" value="1935"/>
<param name="stream" value="screen_share"/>
<param name="codec" value="flashsv2"/>
<param name="framerate" value="15"/>
<param name="width" value="960"/>
<param name="height" value="600"/>
</applet-desc>
</jnlp>
注意:我按照此链接的建议在页面上嵌入JNLP小程序。
https://docs.oracle.com/javase/tutorial/deployment/deploymentInDepth/embeddingJNLPFileInWebPage.html
当我在浏览器中运行JApplet时,屏幕共享流看上去很模糊,如下图所示。但是,当我从Eclipse运行相同的JApplet时,流完全不会模糊!
知道我在哪里做错了吗?
最佳答案
现在在scala中提供了BBB中的SessionManager,因此您可以看到方法here的签名并创建一个实现它们的Java类。然后将导入更改为您的类,它将生成。