页:1
Adobe AMF 版本 0
Adobe 的动作信件格式 v0
• Adobe AMF 第3版
Adobe 的动作信件格式 v3
* * 部分内容 宇航员实验室广播套件
另见:
- @rtmp (英语) - Adobe的实时通讯协议(RTMP)
- @flv (英语) - Adobe的闪光视频格式(FLV)
📝 阿尔法质量
此库是新建的, 目前无法保证兼容性 释放(β, semver 0.0.x).
安装
npm i @astronautlabs/amf
使用量
import { AMF0, AMF3 } from '@astronautlabs/amf';
// Encode AMF values
let encoded : Uint8Array;
encoded = AMF0.Value.any(123).serialize();
encoded = AMF0.Value.any(false).serialize();
encoded = AMF0.Value.any(null).serialize();
encoded = AMF0.Value.any({ hello: 'world' }).serialize();
encoded = AMF0.Value.any([ 1, 2, "types", "are", "good" ]).serialize();
// Be specific about types
encoded = AMF3.Value.vector(Int32Array.from([0,1,2,3]));
// Transparent passthrough of existing AMF values
encoded = AMF3.Value.object({
foo: 123,
bar: AMF3.Value.dictionary({
baz: 321,
fizz: 'hello'
})
})
// Decode values (from Uint8Array/Buffer)
let decoded : AMF0.Value = AMF0.Value.deserialize(encoded);