∮Ω奧米加空間∮»技術文件區»【原創】關於 Flash 網頁播放的方案
| 作者 |
主題 |
dc
管理員

性別:男
來自:瓦肯星
發表總數:11721
註冊時間:2002-05-07 16:32 |
(第 1 篇) 【原創】關於 Flash 網頁播放的方案
Adobe 宣布 2020 年將不再更新和維護 Flash,Flash 也被各大瀏覽器停用且逐漸被 Html5 所取代,提出的方案有很多但是越複雜的 flash 沒有普通的方式一鍵轉換。
會突然找方案是因為 【音樂CD】島嶼漫遊-台灣音樂地圖 內附的 CDPLUS ,裡面的 Flash 是編譯成執行檔的 MUZIMAP.EXE 使用 Adobe Flash Player 10

目前最強的 Flash 反編譯工具非 JPEXS Free Flash Decompiler 莫屬
官方介紹可以看這裡
https://github.com/jindrapetrik/jpexs-decompiler/wiki
基於 java 各大平台皆可以使用
Windows 要使用的話到這裡下載最新版本 15
https://github.com/jindrapetrik/jpexs-decompiler/releases/tag/version15.0.0
ffdec_15.0.0_setup.exe
還需要安裝 Java
https://java.com/zh-TW/download/
Windows 專用的 64 位元 Java
jre-8u321-windows-x64.exe
將 MUZIMAP.EXE 全部的素材導出花費 01:23:48.508
可以直接將 exe 轉成 swf ,如果要轉 fla 的話必須先轉成 gfx 再由 gfx 轉成 fla
但是 swf 現在要在網頁上播放的話困難重重,找了很多個都跟版本支援度有關。
2022/02/11 新增 https://ruffle.rs/
ruffle is a Flash Player emulator built in the Rust programming language.
上傳到 https://ruffle.rs/demo/ 測試功能很完美~只有播放歌曲的文字沒出來而已~其他一切正常
我是使用 sugarhosts web hosting
所以下載 Website Self Hosted https://github.com/ruffle-rs/ruffle/releases/download/nightly-2022-02-11/ruffle-nightly-2022_02_11-web-selfhosted.zip
上傳到主機解壓縮使用,之後到後台加上 application/wasm
SugarHosts cPanel -> ADVANCED -> MIME Types -> add
=MIME Type=
application/wasm
=Extension(s)=
wasm
建立 ttt.html
| 代碼: | <html>
<head>
<title>MUZIMAP omega.idv.tw</title><meta charset="utf-8"/>
</head>
<body>
<div id="container"></div>
<script>
window.RufflePlayer = window.RufflePlayer || {};
window.addEventListener("DOMContentLoaded", () => {
let ruffle = window.RufflePlayer.newest();
let player = ruffle.createPlayer();
let container = document.getElementById("container");
container.appendChild(player);
player.style.width = "1280px";
player.style.height = "720px";
player.load("MUZIMAP.swf").then(() => {
console.info("Ruffle successfully loaded the file");
}).catch((e) => {
console.error(`Ruffle failed to load the file: ${e}`);
});
});
</script>
<script src="ruffle/ruffle.js"></script>
手機網路太慢螢幕太小不適合看,還沒下載完就按下播放的話不會開成全螢幕,等 30 秒~1分鐘下載完成才按下播放的話會開成全螢幕
</body>
</html>
|
如果沒有加 <div id="container"></div>
這一行 container.appendChild(player);
會報錯誤
Uncaught TypeError: Cannot read properties of null (reading 'appendChild')
at ttt.html:13:19
範例可以看這裡,但載入 103MB 的 swf 檔有點久
https://www.omega.idv.tw/file/MUZIMAP.php
手機網路太慢螢幕太小不適合看,還沒下載完就按下播放的話不會開成全螢幕,等 30 秒~1分鐘下載完成才按下播放的話會開成全螢幕
目前最方便的方案是 swf2js
https://swf2js.com/en/index.html
github 在這
https://github.com/swf2js/swf2js
使用方式也很簡單
<script type="text/javascript" src="swf2js.js"></script>
<script type="text/javascript">
swf2js.load('SET SWF PATH');
</script>
不過純文字的捲軸頁字擠在一起與音效播放會一直跳歌,至少可以看到原貌。
要完整支援的話可能需要依靠這個商業方案,他是用模擬的方式並串流到使用者的瀏覽器
https://www.puffin.com/flash-store
這個工具最高只支援到 9
Zoë tool from CreateJS. This tool is part of a JavaScript library package that is altogether supported by Adobe, Microsoft, and Mozilla. Zoë is a stand-alone tool for converting .swf animations to sprite sheets that can be used in HTML5 Canvas. This tool works great as it auto-detects your asset dimensions, maintains the same frame labels, and it supports nested graphics.
https://www.createjs.com/zoe
這個只支援動畫
Fanvas
https://github.com/Tencent/Fanvas
暂时不支持声音,请导出动画后使用js添加声音。
swf含有未支持的其他tag。
暂时不支持链接和代码。
暂时不支持按钮。
暂时不支持文字,请把文字打散(ctrl+b),变成矢量图。
這個沒使用過
https://github.com/lightspark/lightspark
已停止的專案
https://github.com/videojs/video-js-swf
A free, open source Flash player
https://lightspark.github.io/
GNU Gnash is the GNU Flash movie player
https://www.gnu.org/software/gnash/
本帖由dc最後編輯於2022-02-12 00:15
Your mind to my mind,
your thought to my thought |
| 發表時間:2022-02-05 10:06 |
|
dc
管理員

性別:男
來自:瓦肯星
發表總數:11721
註冊時間:2002-05-07 16:32 |
(第 2 篇)
搭配 Adobe Animate 轉 HTML5 的方案
Annie2x / AnnieJS
https://gitee.com/flash2x/AnnieJS
討論區
http://ask.annie2x.com/
須取的授權碼才能發佈
免费时间段: 工作日20:00--24:00 周末全天
FLA EXPORTER
需購買授權才能發佈,先使用預覽觀看過無法達成需求,所以直接放棄
http://www.fla-exporter.com/features
Your mind to my mind,
your thought to my thought |
| 發表時間:2022-02-06 11:03 |
|
|
所有時間均為GMT+8, 現在是2026-05-30 18:54 |
|