顯示具有 FMS 標籤的文章。 顯示所有文章
顯示具有 FMS 標籤的文章。 顯示所有文章

2010-08-15

在 Win7 console 啟動 FMS

在 Win7 上安裝 FMS 3.5.1 接著安裝 3.5.3 update
用「開始」的工具列啟動 FMS 卻發生沒有啟動的情況, 不知道是否是權限問題 -.-

後來決定用 console (命令列) 來啟動:

  • 在桌面放一個命令列的捷徑
  • 在命令列的捷徑圖示上按滑鼠右鍵,選「以系統管理員身份執行」
  • 啟動 FMS 用「>net start FMS」
  • 停止 FMS 用「>net stop FMS」
  • 啟動 FMSAdmin 用「>net start FMSAdmin」
  • 停止 FMSAdmin 用「>net stop FMSAdmin」

2010-06-17

使用 Adobe AIR 建立 RTMP Proxy

在此使用 Adobe AIR 建立 RTMP Proxy 的目的是去查看 RTMP 傳送的內容。雖然 Adobe 已經釋出 RTMP Specification,但是在 Flash Player 10.0.32.18 後還是有變動(註)。
注意事項:
A) Fla 檔記得使用 Flash CS5 開 AIR 2。
B) 在桌面建立個空的 rtmp_proxy 目錄,用來存放執行時的資料存檔。
C) 在 Flash Media Server,開個名為「test」的 Application,並啟動 Server。
D) 先執行 RTMPProxy 再執行 VideoTest,
E) 跑一下子就關掉 VideoTest,否則檔案會越來越多,硬碟可能會爆。

以下是 兩個 Document Classes 的內容,Fla 就不附了:

2009-12-24

Flash Media Server 加上 JSON 功能

1) 到 http://www.json.org/ 找 ActionScript 1 的版本
2) 修改其中 JSON.error 的部份, 存成 JSON.asc
3) 將檔案放到 /scriptlib 或 application目錄
4) 在 main.asc 裡用「load( "JSON.asc" );」

修改後的 code:
/*
Copyright (c) 2005 JSON.org

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The Software shall be used for Good, not Evil.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

/*
Ported to Actionscript May 2005 by Trannie Carter ,
wwww.designvox.com

Ported to Actionscript 1 May 2006 by Malte Ubl ,
http://joose-js.blogspot.com

2006-11-18: Fixed assumption that an empty string evaluates to false in boolean
context that is wrong in Flash 8 an later.

2007-04-08: Fixed bad behavior with switch statements when publishing to Flash 6 from Flash MX.
Report and Patch by Dan Wich


Updated 2007-04-08

USAGE:
var o = JSON.parse(jsonStr);
var s = JSON.stringify(obj);

// If there is an error, the method calls _root.debug("Error message...")
// Override JSON.error for the desired behaviour

*/

JSON = new Object();
// shinder.lin modified 2009-12-24
JSON.error = function(msg) {
JSON.error_occured = true;
trace(msg);
}

JSON.stringify = function (arg) {
var c, i, l, s = '', v;
JSON.error_occured = false;

switch (typeof arg) {
case 'object':
if (arg) {
if (arg instanceof Array) {
for (i = 0; i < arg.length; ++i) {
v = JSON.stringify(arg[i]);
if (s != '') {
s += ',';
}
s += v;
}
return '[' + s + ']';
} else if (typeof arg.toString != 'undefined') {
for (i in arg) {
v = arg[i];
if (typeof v != 'undefined' && typeof v != 'function') {
v = JSON.stringify(v);
if (s != '') {
s += ',';
}
s += JSON.stringify(i) + ':' + v;
}
}
return '{' + s + '}';
}
}
return 'null';
case 'number':
return isFinite(arg) ? String(arg) : 'null';
case 'string':
l = arg.length;
s = '"';
for (i = 0; i < l; i += 1) {
c = arg.charAt(i);
if (c >= ' ') {
if (c == '\\' || c == '"') {
s += '\\';
}
s += c;
} else {
switch (c) {
case '\b':
s += '\\b';
break;
case '\f':
s += '\\f';
break;
case '\n':
s += '\\n';
break;
case '\r':
s += '\\r';
break;
case '\t':
s += '\\t';
break;
default:
c = c.charCodeAt();
s += '\\u00' + Math.floor(c / 16).toString(16) +
(c % 16).toString(16);
}
}
}
return s + '"';
case 'boolean':
return String(arg);
default:
return 'null';
}
}



JSON.parse = function (text) {
var at = 0;
var ch = ' ';
JSON.error_occured = false;


function error(m) {
JSON.error("JSONError: "+m)
}

function next() {
ch = text.charAt(at);
at += 1;
return ch;
}

function white() {
while (!JSON.error_occured && ch != null) {
if (ch <= ' ') {
next();
} else if (ch == '/') {
next();
switch (ch) {
case '/':
while (!JSON.error_occured && next() != null && ch != '\n' && ch != '\r') {}
break;
case '*':
next();
while (true) {
if (ch) {
if (ch == '*') {
if (next() == '/') {
next();
break;
}
} else {
next();
}
} else {
error("Unterminated comment");
}
}
break;
default:
error("Syntax error");
}
} else {
break;
}
}
}

function str() {
var i, s = '', t, u;
var outer = false;

if (ch == '"') {
while (!JSON.error_occured && next() != null) {
if (ch == '"') {
next();
return s;
} else if (ch == '\\') {
next();
switch (ch) {
case 'b':
s += '\b';
break;
case 'f':
s += '\f';
break;
case 'n':
s += '\n';
break;
case 'r':
s += '\r';
break;
case 't':
s += '\t';
break;
case 'u':
u = 0;
for (i = 0; i < 4; i += 1) {
t = parseInt(next(), 16);
if (!isFinite(t)) {
outer = true;
break;
}
u = u * 16 + t;
}
if(outer) {
outer = false;
break;
}
s += String.fromCharCode(u);
break;
default:
s += ch;
}
} else {
s += ch;
}
}
}
error("Bad string");
}

function arr() {
var a = [];

if (ch == '[') {
next();
white();
if (ch == ']') {
next();
return a;
}
while (!JSON.error_occured && ch != null) {
a.push(value());
white();
if (ch == ']') {
next();
return a;
} else if (ch != ',') {
break;
}
next();
white();
}
}
error("Bad array");
}

function obj() {
var k, o = {};

if (ch == '{') {
next();
white();
if (ch == '}') {
next();
return o;
}
while (!JSON.error_occured && ch != null) {
k = str();
white();
if (ch != ':') {
break;
}
next();
o[k] = value();
white();
if (ch == '}') {
next();
return o;
} else if (ch != ',') {
break;
}
next();
white();
}
}
error("Bad object");
}

function num() {
var n = '', v;

if (ch == '-') {
n = '-';
next();
}
while (!JSON.error_occured && ch >= '0' && ch <= '9') {
n += ch;
next();
}
if (ch == '.') {
n += '.';
next();
while (!JSON.error_occured && ch >= '0' && ch <= '9') {
n += ch;
next();
}
}
if (ch == 'e' | ch == 'E') {
n += ch;
next();
if (ch == '-' || ch == '+') {
n += ch;
next();
}
while (!JSON.error_occured && ch >= '0' && ch <= '9') {
n += ch;
next();
}
}
v = Number(n);
if (!isFinite(v)) {
error("Bad number");
}
return v;
}

function word() {
switch (ch) {
case 't':
if (next() == 'r' && next() == 'u' &&
next() == 'e') {
next();
return true;
}
break;
case 'f':
if (next() == 'a' && next() == 'l' &&
next() == 's' && next() == 'e') {
next();
return false;
}
break;
case 'n':
if (next() == 'u' && next() == 'l' &&
next() == 'l') {
next();
return null;
}
break;
}
error("Syntax error");
}

function value() {
white();
switch (ch) {
case '{':
return obj();
case '[':
return arr();
case '"':
return str();
case '-':
return num();
default:
return ch >= '0' && ch <= '9' ? num() : word();
}
}

return value();
}

2007-09-06

Adobe 公開預覽 Flash Media Server 3

FMS3 大概 2008 第一季會開賣
官方消息
支援 H.264 和 AAC
支援 Flash Lite 3
伺服端依然使用 AS1, 客戶端不限 AS1 ~ AS3
詳情請看 fms3 faq

FB 留言