Red5-Screenshare应用转小程序时屏幕边框模糊

Red5-Screenshare screen frames blurred when screenshare application is converted to applet

我已将 Red5-Screenshare 应用程序(在下面的 link 中找到)转换为 JApplet;

https://code.google.com/p/red5-screenshare/

我刚刚从 JApplet 扩展了 ScreenShare.java class。然后我删除了 main() 方法并在 ScreenShare.java class.

中放置了以下小程序 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>

注意:我正在按照此 link 上的建议在页面上为小程序嵌入 JNLP https://docs.oracle.com/javase/tutorial/deployment/deploymentInDepth/embeddingJNLPFileInWebPage.html

当我在浏览器中 运行 JApplet 时,屏幕共享流看起来很模糊,如下图所示。但是,当我 运行 来自 eclipse 的相同 JApplet 时,流根本不模糊!

知道我哪里做错了吗?

BBB 中的 SessionManager 现在在 scala 中提供,因此您可以看到方法的签名 here 并创建一个 java class 来实现它们。然后将导入更改为您的class,它将构建。

在将屏幕宽度和高度参数更改为 sWidth 和 sHeight 后,我​​修复了 red5-screenshare 小程序。因为小程序将其 canvas 宽度和高度视为屏幕尺寸,导致屏幕捕获模糊。