0

我必须在独立的 adobe flash 播放器中播放冲击波文件,而不是在网络浏览器中,并且冲击波文件也包含 xml 文件作为其中的内容。欢迎所有建议

4

2 回答 2

0
import java.io.File;
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

public class ReadHtml implements Runnable {
    private static String flashFileName = "";
    private static String flashXmlName = "";
    private static String flashString = "";
    private static String flashPlayer = "flashplayer_11_sa";
    private static String htmlFilePath = "";

    public final static void main(String[] args) throws Exception {
        File file = new File("D:/.../index.html");
        Document doc = null;
        Element link = null;
        if (file.exists()) {
            htmlFilePath = file.getParent();
            doc = Jsoup.parse(file, "UTF-8", "");
            link = doc.select("embed").first();
        }
        flashXmlName = link.attr("flashvars");
        flashFileName = link.attr("src");
        flashString = flashFileName + "?" + flashXmlName;
        flashString = htmlFilePath + File.separator + flashString;

        Thread CmdThread = new Thread(new ReadHtml());
        CmdThread.start();
    }
    @Override
    public void run() {
        try {
            final String[] cmdArray = { flashPlayer, flashString };
            final Process process = Runtime.getRuntime().exec(cmdArray);
            process.waitFor();
        } catch (IOException | InterruptedException e) {
            e.printStackTrace();
        }
    }
}
于 2013-11-13T10:55:30.537 回答
0

谷歌刚刚启动了一个名为“Swiffy”的新谷歌实验室项目。它将 Flash SWF 文件转换为 HTML5。

它允许您在没有 Flash 播放器的设备(即:iPhone 和 iPad)上重复使用 Flash 内容。

来源:http ://www.webpronews.com/convert-swf-files-to-html5-with-swiffy-2011-06

于 2013-11-12T07:05:59.013 回答