amfUtils.js
function encodeAMF3Cmd(opt) {
    var data = amf0EncodeOne(opt.cmd);

    if (rtmpCmdDecode[opt.cmd]) {
        rtmpCmdDecode[opt.cmd].forEach(function (n) {
            if (opt.hasOwnProperty(n))
                data = Buffer.concat([data, amf3EncodeOne(opt[n])]);
        });
    } else {
        console.log('Unknown command', opt);
    }
    return data
}
function encodeAMF3Cmd(opt) {
    var data = amf0EncodeOne(opt.cmd);

    if (rtmpCmdDecode[opt.cmd]) {
        rtmpCmdDecode[opt.cmd].forEach(function (n) {
            if (opt.hasOwnProperty(n))
                data = Buffer.concat([data, amf3EncodeOne(opt[n])]);
        });
    } else {
        console.log('Unknown command', opt);
    }
    return data
}
function encodeAMF3Cmd ( opt ) { var data = amf0EncodeOne ( opt . cmd ) ; if ( rtmpCmdDecode [ opt . cmd ] ) { rtmpCmdDecode [ opt . cmd ] . forEach ( function ( n ) { if ( opt . hasOwnProperty ( n ) ) data = Buffer . concat ( [ data , amf3EncodeOne ( opt [ n ] ) ] ) ; } ) ; } else { console . log ( 'Unknown command' , opt ) ; } return data }
Encode AMF3 Command
@param opt
@returns {*}
Encode AMF3 Command