李勇
c264e630 1 parent f1fa1f49 master ... 20170922-1 20171019-1 20171120-1w dev letv-20170426 ly20170622 ly20170622-2 ly20170622-3 ly20170627-2 ly20170706-1 ly20170708-2 ly20170708-3 ly20170710-1 ly20170717-1 ly20170719-1 ly20170723-1 ly20170724-2 ly20170726-1 ly20170731-1 ly20170731-2 ly20170801-2 ly20170802-1 ly20170818-1 ly20170818-2 ly20170820-1 ly20170821-1 ly20170824-1 ly20170829-1 ly20170925-1 ly20170926-1 ly20170927-1 ly20170929-1 ly20171011-1 ly20171013-1 ly20171013-2 ly20171016-1 ly20171021-1 ly20171023-1 ly20171024-1w ly20171025-1w ly20171026-1w ly20171027-1w ly20171030-1 ly20171030-2w ly20171107-1 ly20171110-1w ly20171113-1w ly20171204-1w ly20171208-1w ly20171211-1w ly20171211-2w ly20171214-1w mcuClientBranch mcuClientBranch20170228 webRtc-dev 1.7.0 v2.38.13.20171216 v2.38.11.20171214 v2.38.3.201712011 v2.38.1.201712011 v2.36.11.20171204 v2.36.8.20171206 v2.36.4.20171201 v2.35.11.20171130 v2.34.16.20171128 v2.34.5.20171127 v2.33.6.20171123 v2.32.1.20171123 v2.31.12.20171122 v2.31.10.20171122 v2.30.5.20171117 v2.30.2.20171117 v2.29.5.20171114 v2.28.1.20171110 v2.27.11.20171109 v2.26.9.20171107 v2.26.6.20171103 v2.26.2.20171102 v2.25.7.20171031 v2.25.6.20171031 v2.25.0.20171030 v2.24.2.20171030 v2.23.0.20171030 v2.22.7.20171026 v2.20.5.20171023 v2.20.0.20171021 v2.19.8.20171020 v2.18.14.20171020 v2.18.10.20171019 v2.17.11.20171014 v2.16.8.20171012 v2.16.5.20171012 v2.15.5.20171001 v2.15.3.20170929 v2.14.5.20170927 v2.13.5.20170927 v2.12.14.20170927 v2.12.8.20170926 v2.12.6.20170925 v2.11.13.20170925 v2.10.7.20170921 v2.10.6.20170921 v2.10.5.20170920 v2.10.4.20170920 v2.9.3.20170919 v2.8.17.20170918 v2.8.8.20170917 v2.8.2.20170916 v2.6.2.20170915 v2.5.12.20170915 v2.5.6.20170914 v2.5.5.20170914 v2.4.4.20170908 v2.4.2.20170908 v2.4.0.20170907 v2.3.6.20170907 v2.2.16.20170905 v2.1.22.20170904 v1.84.0.20170912 v1.83.2.20170831 v1.82.11.20170829 v1.81.19.20170828 v1.80.2.20170824 v1.79.6.20170822 v1.79.5.20170821 v1.79.4.20170821 v1.79.3.20170821 v1.78.4.20170820 v1.77.4.20170819 v1.76.2.20170818 v1.75.0.20170815 v1.74.0.20170814 v1.73.2.20170814 v1.73.1.20170814 v1.71.0.20170813 v1.70.5.20170812 v1.68.2.20170812 v1.66.1.20170809 v1.65.25.20170808 v1.65.24.20170806 v1.63.1.20170731 v1.62.3.20170731 v1.61.0.20170729 v1.60.0.20170729 v1.59.0.20170729 v1.58.0.20170729 v1.57.0.20170727 v1.56.1.20170727 v1.56.0.20170727 v1.52.1.20170726 v1.51.0.20170724 v1.50.7.20170724 v1.49.1.20170724 v1.48.2.20170723 v1.46.1.20170722 v1.45.1.20170717 v1.43.1.20170711 v1.42.1.20170708 v1.41.0.20170708 v1.40.0.20170706 v1.39.2.20170706 v1.39.1.20170705 v1.38.4.20170629 v1.37.5.20170627 v1.37.2.20170622 v1.36.7.20170620 v1.36.4.20170620 v1.36.1.20170619 v1.35.4.20170619 v1.34.2.20170615 v1.33.2.20170615 v1.32.1.20170614 v1.31.11.20170613 v1.30.20.20170607 v1.30.7.20170606 v1.30.6.20170606 v1.30.5.20170605 v1.30.3.20170602 v1.29.8.20170601 v1.28.0.201705031 v1.27.16.201705027 v1.27.14.201705027 v1.27.10.201705026 v1.25.2.201705025 v1.23.5.201705023 v1.23.4.201705018 v1.21.1.201705017 v1.20.1.201705015 v1.19.1.201705012 v1.19.0.201705011 v1.18.0.201705010 v1.16.1.201705010 v1.15.2.20170507 v1.14.1.20170505 v1.13.0.20170504 v1.11.3.20170504 v1.10.2.20170428 v1.10.0.20170427 v1.9.20.20170426 v1.9.19.20170425 v1.9.18.20170425 v1.9.17.20170421 v1.9.16.20170420 v1.9.15.20170420 v1.9.11.20170419 v1.9.6.20170418 v1.9.4.20170417 v.1.9.2.20170413 v.1.9.0.20170411 v.1.8.22.20170411 v.1.8.19.20170411 v.1.8.16.20170410 v.1.8.13.20170409 v.1.8.10.20170407 v.1.8.9.20170407 v1.8.8.20170406 v.1.8.7.20170405-1 v.1.8.6.20170401-2 v.1.8.5.20170331-1 v.1.8.3.20170329-4 v1.8.1.20170321 mcuClient20170302 mcuClient_v1.8.0.20170314 修复音视频channel占用问题

1.Sass.js增加两个接口

/3m/api/meeting/joinParams.do 请求入会前信息
/3m/api/meeting/detail.do 入会成功后所有详细信息

2.MCUClientEngine 公开外部调用接口
此 diff 太大无法显示。
Copyright © 2011, Paul Vorbach. All rights reserved.
Copyright © 2009, Jeff Mott. All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
* Neither the name Crypto-JS nor the names of its contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
... ...
**enc** provides crypto character encoding utilities.
... ...
var charenc = {
// UTF-8 encoding
utf8: {
// Convert a string to a byte array
stringToBytes: function(str) {
return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
},
// Convert a byte array to a string
bytesToString: function(bytes) {
return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
}
},
// Binary encoding
bin: {
// Convert a string to a byte array
stringToBytes: function(str) {
for (var bytes = [], i = 0; i < str.length; i++)
bytes.push(str.charCodeAt(i) & 0xFF);
return bytes;
},
// Convert a byte array to a string
bytesToString: function(bytes) {
for (var str = [], i = 0; i < bytes.length; i++)
str.push(String.fromCharCode(bytes[i]));
return str.join('');
}
}
};
module.exports = charenc;
... ...
{
"_args": [
[
"charenc@~0.0.1",
"D:\\work\\McuClient\\node_modules\\md5"
]
],
"_from": "charenc@>=0.0.1 <0.1.0",
"_id": "charenc@0.0.2",
"_inCache": true,
"_installable": true,
"_location": "/charenc",
"_nodeVersion": "4.4.5",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/charenc-0.0.2.tgz_1482450158427_0.9801697849761695"
},
"_npmUser": {
"email": "paul@vorba.ch",
"name": "pvorb"
},
"_npmVersion": "3.9.3",
"_phantomChildren": {},
"_requested": {
"name": "charenc",
"raw": "charenc@~0.0.1",
"rawSpec": "~0.0.1",
"scope": null,
"spec": ">=0.0.1 <0.1.0",
"type": "range"
},
"_requiredBy": [
"/md5"
],
"_resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz",
"_shasum": "c0a1d2f3a7092e03774bfa83f14c0fc5790a8667",
"_shrinkwrap": null,
"_spec": "charenc@~0.0.1",
"_where": "D:\\work\\McuClient\\node_modules\\md5",
"author": {
"email": "paul@vorb.de",
"name": "Paul Vorbach",
"url": "http://vorb.de"
},
"bugs": {
"url": "https://github.com/pvorb/node-charenc/issues"
},
"dependencies": {},
"description": "character encoding utilities",
"devDependencies": {},
"directories": {},
"dist": {
"shasum": "c0a1d2f3a7092e03774bfa83f14c0fc5790a8667",
"tarball": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz"
},
"engines": {
"node": "*"
},
"gitHead": "01d66efb429d0cb242b2dd5af2ce338554fd3e54",
"homepage": "https://github.com/pvorb/node-charenc#readme",
"license": "BSD-3-Clause",
"main": "charenc.js",
"maintainers": [
{
"email": "paul@vorb.de",
"name": "pvorb"
}
],
"name": "charenc",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/pvorb/node-charenc.git"
},
"scripts": {},
"tags": [
"utf8",
"binary",
"byte",
"string"
],
"version": "0.0.2"
}
... ...
Copyright © 2011, Paul Vorbach. All rights reserved.
Copyright © 2009, Jeff Mott. All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
* Neither the name Crypto-JS nor the names of its contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
... ...
**crypt** provides utilities for encryption and hashing
... ...
(function() {
var base64map
= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
crypt = {
// Bit-wise rotation left
rotl: function(n, b) {
return (n << b) | (n >>> (32 - b));
},
// Bit-wise rotation right
rotr: function(n, b) {
return (n << (32 - b)) | (n >>> b);
},
// Swap big-endian to little-endian and vice versa
endian: function(n) {
// If number given, swap endian
if (n.constructor == Number) {
return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
}
// Else, assume array and swap all items
for (var i = 0; i < n.length; i++)
n[i] = crypt.endian(n[i]);
return n;
},
// Generate an array of any length of random bytes
randomBytes: function(n) {
for (var bytes = []; n > 0; n--)
bytes.push(Math.floor(Math.random() * 256));
return bytes;
},
// Convert a byte array to big-endian 32-bit words
bytesToWords: function(bytes) {
for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)
words[b >>> 5] |= bytes[i] << (24 - b % 32);
return words;
},
// Convert big-endian 32-bit words to a byte array
wordsToBytes: function(words) {
for (var bytes = [], b = 0; b < words.length * 32; b += 8)
bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
return bytes;
},
// Convert a byte array to a hex string
bytesToHex: function(bytes) {
for (var hex = [], i = 0; i < bytes.length; i++) {
hex.push((bytes[i] >>> 4).toString(16));
hex.push((bytes[i] & 0xF).toString(16));
}
return hex.join('');
},
// Convert a hex string to a byte array
hexToBytes: function(hex) {
for (var bytes = [], c = 0; c < hex.length; c += 2)
bytes.push(parseInt(hex.substr(c, 2), 16));
return bytes;
},
// Convert a byte array to a base-64 string
bytesToBase64: function(bytes) {
for (var base64 = [], i = 0; i < bytes.length; i += 3) {
var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
for (var j = 0; j < 4; j++)
if (i * 8 + j * 6 <= bytes.length * 8)
base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));
else
base64.push('=');
}
return base64.join('');
},
// Convert a base-64 string to a byte array
base64ToBytes: function(base64) {
// Remove non-base-64 characters
base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');
for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
imod4 = ++i % 4) {
if (imod4 == 0) continue;
bytes.push(((base64map.indexOf(base64.charAt(i - 1))
& (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))
| (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));
}
return bytes;
}
};
module.exports = crypt;
})();
... ...
{
"_args": [
[
"crypt@~0.0.1",
"D:\\work\\McuClient\\node_modules\\md5"
]
],
"_from": "crypt@>=0.0.1 <0.1.0",
"_id": "crypt@0.0.2",
"_inCache": true,
"_installable": true,
"_location": "/crypt",
"_nodeVersion": "4.4.5",
"_npmOperationalInternal": {
"host": "packages-18-east.internal.npmjs.com",
"tmp": "tmp/crypt-0.0.2.tgz_1482450046585_0.08984375675208867"
},
"_npmUser": {
"email": "paul@vorba.ch",
"name": "pvorb"
},
"_npmVersion": "3.9.3",
"_phantomChildren": {},
"_requested": {
"name": "crypt",
"raw": "crypt@~0.0.1",
"rawSpec": "~0.0.1",
"scope": null,
"spec": ">=0.0.1 <0.1.0",
"type": "range"
},
"_requiredBy": [
"/md5"
],
"_resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz",
"_shasum": "88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b",
"_shrinkwrap": null,
"_spec": "crypt@~0.0.1",
"_where": "D:\\work\\McuClient\\node_modules\\md5",
"author": {
"email": "paul@vorb.de",
"name": "Paul Vorbach",
"url": "http://vorb.de"
},
"bugs": {
"url": "https://github.com/pvorb/node-crypt/issues"
},
"dependencies": {},
"description": "utilities for encryption and hashing",
"devDependencies": {},
"directories": {},
"dist": {
"shasum": "88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b",
"tarball": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz"
},
"engines": {
"node": "*"
},
"gitHead": "b275e2cde03cab40206dbb2a551b781f51feca3f",
"homepage": "https://github.com/pvorb/node-crypt#readme",
"license": "BSD-3-Clause",
"main": "crypt.js",
"maintainers": [
{
"email": "paul@vorb.de",
"name": "pvorb"
}
],
"name": "crypt",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/pvorb/node-crypt.git"
},
"scripts": {},
"tags": [
"hash",
"security"
],
"version": "0.0.2"
}
... ...
sudo: false
language: node_js
node_js:
- node
env:
global:
- secure: du27W3wTgZ3G183axW7w0I01lOIurx8kilMH9p45VMfNXCu8lo6FLtLIQZxJ1FYMoJLQ1yfJTu2G0rq39SotDfJumsk6tF7BjTY/HKCocZaHqCMgw0W2bcylb5kMAdLhBNPlzejpPoWa1x1axbAHNFOLQNVosG/Bavu3/kuIIps=
- secure: Ax/5aekM40o67NuTkvQqx1DhfP86ZlHTtKbv5yI+WFmbjD3FQM8b8G1J/o7doaBDev7Mp+1zDJOK2pFGtt+JGRl0lM2JUmLh6yh/b28obXyei5iuUkqzKJLfKZHMbY5QW/1i4DUM+zSXe6Kava0qnqYg5wBBnrF6gLdsVsCGNQk=
... ...
ui: tape
browsers:
- name: chrome
version: 39..latest
- name: firefox
version: 34..latest
- name: safari
version: 5..latest
- name: microsoftedge
version: latest
- name: ie
version: 8..latest
- name: android
version: 5.0..latest
... ...
The MIT License (MIT)
Copyright (c) Feross Aboukhadijeh
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 above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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.
... ...
# is-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][npm-url]
#### Determine if an object is a [`Buffer`](http://nodejs.org/api/buffer.html) (including the [browserify Buffer](https://github.com/feross/buffer))
[![saucelabs][saucelabs-image]][saucelabs-url]
[travis-image]: https://img.shields.io/travis/feross/is-buffer/master.svg
[travis-url]: https://travis-ci.org/feross/is-buffer
[npm-image]: https://img.shields.io/npm/v/is-buffer.svg
[npm-url]: https://npmjs.org/package/is-buffer
[downloads-image]: https://img.shields.io/npm/dm/is-buffer.svg
[saucelabs-image]: https://saucelabs.com/browser-matrix/is-buffer.svg
[saucelabs-url]: https://saucelabs.com/u/is-buffer
## Why not use `Buffer.isBuffer`?
This module lets you check if an object is a `Buffer` without using `Buffer.isBuffer` (which includes the whole [buffer](https://github.com/feross/buffer) module in [browserify](http://browserify.org/)).
It's future-proof and works in node too!
## install
```bash
npm install is-buffer
```
## usage
```js
var isBuffer = require('is-buffer')
isBuffer(new Buffer(4)) // true
isBuffer(undefined) // false
isBuffer(null) // false
isBuffer('') // false
isBuffer(true) // false
isBuffer(false) // false
isBuffer(0) // false
isBuffer(1) // false
isBuffer(1.0) // false
isBuffer('string') // false
isBuffer({}) // false
isBuffer(function foo () {}) // false
```
## license
MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org).
... ...
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
// The _isBuffer check is for Safari 5-7 support, because it's missing
// Object.prototype.constructor. Remove this eventually
module.exports = function (obj) {
return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
}
function isBuffer (obj) {
return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
}
// For Node v0.10 support. Remove this eventually.
function isSlowBuffer (obj) {
return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
}
... ...
{
"_args": [
[
"is-buffer@~1.1.1",
"D:\\work\\McuClient\\node_modules\\md5"
]
],
"_from": "is-buffer@>=1.1.1 <1.2.0",
"_id": "is-buffer@1.1.4",
"_inCache": true,
"_installable": true,
"_location": "/is-buffer",
"_nodeVersion": "0.10.46",
"_npmOperationalInternal": {
"host": "packages-16-east.internal.npmjs.com",
"tmp": "tmp/is-buffer-1.1.4.tgz_1470267365943_0.6724087686743587"
},
"_npmUser": {
"email": "feross@feross.org",
"name": "feross"
},
"_npmVersion": "2.15.1",
"_phantomChildren": {},
"_requested": {
"name": "is-buffer",
"raw": "is-buffer@~1.1.1",
"rawSpec": "~1.1.1",
"scope": null,
"spec": ">=1.1.1 <1.2.0",
"type": "range"
},
"_requiredBy": [
"/md5"
],
"_resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.4.tgz",
"_shasum": "cfc86ccd5dc5a52fa80489111c6920c457e2d98b",
"_shrinkwrap": null,
"_spec": "is-buffer@~1.1.1",
"_where": "D:\\work\\McuClient\\node_modules\\md5",
"author": {
"email": "feross@feross.org",
"name": "Feross Aboukhadijeh",
"url": "http://feross.org/"
},
"bugs": {
"url": "https://github.com/feross/is-buffer/issues"
},
"dependencies": {},
"description": "Determine if an object is a Buffer",
"devDependencies": {
"standard": "^7.0.0",
"tape": "^4.0.0",
"zuul": "^3.0.0"
},
"directories": {},
"dist": {
"shasum": "cfc86ccd5dc5a52fa80489111c6920c457e2d98b",
"tarball": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.4.tgz"
},
"gitHead": "fd1a429f6ab8092f2e39cb5cc7175b5d9a986c31",
"homepage": "https://github.com/feross/is-buffer#readme",
"keywords": [
"buffer",
"buffers",
"type",
"core buffer",
"browser buffer",
"browserify",
"typed array",
"uint32array",
"int16array",
"int32array",
"float32array",
"float64array",
"browser",
"arraybuffer",
"dataview"
],
"license": "MIT",
"main": "index.js",
"maintainers": [
{
"email": "feross@feross.org",
"name": "feross"
}
],
"name": "is-buffer",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/feross/is-buffer.git"
},
"scripts": {
"test": "standard && npm run test-node && npm run test-browser",
"test-browser": "zuul -- test/*.js",
"test-browser-local": "zuul --local -- test/*.js",
"test-node": "tape test/*.js"
},
"testling": {
"files": "test/*.js"
},
"version": "1.1.4"
}
... ...
var buffer = require('buffer')
var isBuffer = require('../')
var test = require('tape')
test('is-buffer', function (t) {
t.equal(isBuffer(new Buffer(4)), true, 'new Buffer(4)')
t.equal(isBuffer(buffer.SlowBuffer(100)), true, 'SlowBuffer(100)')
t.equal(isBuffer(undefined), false, 'undefined')
t.equal(isBuffer(null), false, 'null')
t.equal(isBuffer(''), false, 'empty string')
t.equal(isBuffer(true), false, 'true')
t.equal(isBuffer(false), false, 'false')
t.equal(isBuffer(0), false, '0')
t.equal(isBuffer(1), false, '1')
t.equal(isBuffer(1.0), false, '1.0')
t.equal(isBuffer('string'), false, 'string')
t.equal(isBuffer({}), false, '{}')
t.equal(isBuffer([]), false, '[]')
t.equal(isBuffer(function foo () {}), false, 'function foo () {}')
t.equal(isBuffer({ isBuffer: null }), false, '{ isBuffer: null }')
t.equal(isBuffer({ isBuffer: function () { throw new Error() } }), false, '{ isBuffer: function () { throw new Error() } }')
t.end()
})
... ...
node_modules/mocha
... ...
language: node_js
node_js:
- 0.6
- 0.8
\ No newline at end of file
... ...
Copyright © 2011-2012, Paul Vorbach.
Copyright © 2009, Jeff Mott.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
* Neither the name Crypto-JS nor the names of its contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
... ...
# MD5
[![build status](https://secure.travis-ci.org/pvorb/node-md5.png)](http://travis-ci.org/pvorb/node-md5)
a JavaScript function for hashing messages with MD5.
## Installation
You can use this package on the server side as well as the client side.
### [Node.js](http://nodejs.org/):
~~~
npm install md5
~~~
## API
~~~ javascript
md5(message)
~~~
* `message` -- `String` or `Buffer`
* returns `String`
## Usage
~~~ javascript
var md5 = require('md5');
console.log(md5('message'));
~~~
This will print the following
~~~
78e731027d8fd50ed642340b7c9a63b3
~~~
It supports buffers, too
~~~ javascript
var fs = require('fs');
var md5 = require('md5');
fs.readFile('example.txt', function(err, buf) {
console.log(md5(buf));
});
~~~
## Versions
Before version 2.0.0 there were two packages called md5 on npm, one lowercase,
one uppercase (the one you're looking at). As of version 2.0.0, all new versions
of this module will go to lowercase [md5](https://www.npmjs.com/package/md5) on
npm. To use the correct version, users of this module will have to change their
code from `require('MD5')` to `require('md5')` if they want to use versions >=
2.0.0.
## Bugs and Issues
If you encounter any bugs or issues, feel free to open an issue at
[github](https://github.com/pvorb/node-md5/issues).
## Credits
This package is based on the work of Jeff Mott, who did a pure JS implementation
of the MD5 algorithm that was published by Ronald L. Rivest in 1991. I needed a
npm package of the algorithm, so I used Jeff’s implementation for this package.
The original implementation can be found in the
[CryptoJS](http://code.google.com/p/crypto-js/) project.
## License
~~~
Copyright © 2011-2015, Paul Vorbach.
Copyright © 2009, Jeff Mott.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
* Neither the name Crypto-JS nor the names of its contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
~~~
... ...
(function(){
var crypt = require('crypt'),
utf8 = require('charenc').utf8,
isBuffer = require('is-buffer'),
bin = require('charenc').bin,
// The core
md5 = function (message, options) {
// Convert to byte array
if (message.constructor == String)
if (options && options.encoding === 'binary')
message = bin.stringToBytes(message);
else
message = utf8.stringToBytes(message);
else if (isBuffer(message))
message = Array.prototype.slice.call(message, 0);
else if (!Array.isArray(message))
message = message.toString();
// else, assume byte array already
var m = crypt.bytesToWords(message),
l = message.length * 8,
a = 1732584193,
b = -271733879,
c = -1732584194,
d = 271733878;
// Swap endian
for (var i = 0; i < m.length; i++) {
m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |
((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;
}
// Padding
m[l >>> 5] |= 0x80 << (l % 32);
m[(((l + 64) >>> 9) << 4) + 14] = l;
// Method shortcuts
var FF = md5._ff,
GG = md5._gg,
HH = md5._hh,
II = md5._ii;
for (var i = 0; i < m.length; i += 16) {
var aa = a,
bb = b,
cc = c,
dd = d;
a = FF(a, b, c, d, m[i+ 0], 7, -680876936);
d = FF(d, a, b, c, m[i+ 1], 12, -389564586);
c = FF(c, d, a, b, m[i+ 2], 17, 606105819);
b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);
a = FF(a, b, c, d, m[i+ 4], 7, -176418897);
d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);
c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);
b = FF(b, c, d, a, m[i+ 7], 22, -45705983);
a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);
d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);
c = FF(c, d, a, b, m[i+10], 17, -42063);
b = FF(b, c, d, a, m[i+11], 22, -1990404162);
a = FF(a, b, c, d, m[i+12], 7, 1804603682);
d = FF(d, a, b, c, m[i+13], 12, -40341101);
c = FF(c, d, a, b, m[i+14], 17, -1502002290);
b = FF(b, c, d, a, m[i+15], 22, 1236535329);
a = GG(a, b, c, d, m[i+ 1], 5, -165796510);
d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);
c = GG(c, d, a, b, m[i+11], 14, 643717713);
b = GG(b, c, d, a, m[i+ 0], 20, -373897302);
a = GG(a, b, c, d, m[i+ 5], 5, -701558691);
d = GG(d, a, b, c, m[i+10], 9, 38016083);
c = GG(c, d, a, b, m[i+15], 14, -660478335);
b = GG(b, c, d, a, m[i+ 4], 20, -405537848);
a = GG(a, b, c, d, m[i+ 9], 5, 568446438);
d = GG(d, a, b, c, m[i+14], 9, -1019803690);
c = GG(c, d, a, b, m[i+ 3], 14, -187363961);
b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);
a = GG(a, b, c, d, m[i+13], 5, -1444681467);
d = GG(d, a, b, c, m[i+ 2], 9, -51403784);
c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);
b = GG(b, c, d, a, m[i+12], 20, -1926607734);
a = HH(a, b, c, d, m[i+ 5], 4, -378558);
d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);
c = HH(c, d, a, b, m[i+11], 16, 1839030562);
b = HH(b, c, d, a, m[i+14], 23, -35309556);
a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);
d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);
c = HH(c, d, a, b, m[i+ 7], 16, -155497632);
b = HH(b, c, d, a, m[i+10], 23, -1094730640);
a = HH(a, b, c, d, m[i+13], 4, 681279174);
d = HH(d, a, b, c, m[i+ 0], 11, -358537222);
c = HH(c, d, a, b, m[i+ 3], 16, -722521979);
b = HH(b, c, d, a, m[i+ 6], 23, 76029189);
a = HH(a, b, c, d, m[i+ 9], 4, -640364487);
d = HH(d, a, b, c, m[i+12], 11, -421815835);
c = HH(c, d, a, b, m[i+15], 16, 530742520);
b = HH(b, c, d, a, m[i+ 2], 23, -995338651);
a = II(a, b, c, d, m[i+ 0], 6, -198630844);
d = II(d, a, b, c, m[i+ 7], 10, 1126891415);
c = II(c, d, a, b, m[i+14], 15, -1416354905);
b = II(b, c, d, a, m[i+ 5], 21, -57434055);
a = II(a, b, c, d, m[i+12], 6, 1700485571);
d = II(d, a, b, c, m[i+ 3], 10, -1894986606);
c = II(c, d, a, b, m[i+10], 15, -1051523);
b = II(b, c, d, a, m[i+ 1], 21, -2054922799);
a = II(a, b, c, d, m[i+ 8], 6, 1873313359);
d = II(d, a, b, c, m[i+15], 10, -30611744);
c = II(c, d, a, b, m[i+ 6], 15, -1560198380);
b = II(b, c, d, a, m[i+13], 21, 1309151649);
a = II(a, b, c, d, m[i+ 4], 6, -145523070);
d = II(d, a, b, c, m[i+11], 10, -1120210379);
c = II(c, d, a, b, m[i+ 2], 15, 718787259);
b = II(b, c, d, a, m[i+ 9], 21, -343485551);
a = (a + aa) >>> 0;
b = (b + bb) >>> 0;
c = (c + cc) >>> 0;
d = (d + dd) >>> 0;
}
return crypt.endian([a, b, c, d]);
};
// Auxiliary functions
md5._ff = function (a, b, c, d, x, s, t) {
var n = a + (b & c | ~b & d) + (x >>> 0) + t;
return ((n << s) | (n >>> (32 - s))) + b;
};
md5._gg = function (a, b, c, d, x, s, t) {
var n = a + (b & d | c & ~d) + (x >>> 0) + t;
return ((n << s) | (n >>> (32 - s))) + b;
};
md5._hh = function (a, b, c, d, x, s, t) {
var n = a + (b ^ c ^ d) + (x >>> 0) + t;
return ((n << s) | (n >>> (32 - s))) + b;
};
md5._ii = function (a, b, c, d, x, s, t) {
var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
return ((n << s) | (n >>> (32 - s))) + b;
};
// Package private blocksize
md5._blocksize = 16;
md5._digestsize = 16;
module.exports = function (message, options) {
if (message === undefined || message === null)
throw new Error('Illegal argument ' + message);
var digestbytes = crypt.wordsToBytes(md5(message, options));
return options && options.asBytes ? digestbytes :
options && options.asString ? bin.bytesToString(digestbytes) :
crypt.bytesToHex(digestbytes);
};
})();
... ...
{
"_args": [
[
"md5",
"D:\\work\\McuClient"
]
],
"_from": "md5@latest",
"_id": "md5@2.2.1",
"_inCache": true,
"_installable": true,
"_location": "/md5",
"_nodeVersion": "4.4.5",
"_npmOperationalInternal": {
"host": "packages-16-east.internal.npmjs.com",
"tmp": "tmp/md5-2.2.1.tgz_1472679629604_0.48944878415204585"
},
"_npmUser": {
"email": "paul@vorba.ch",
"name": "pvorb"
},
"_npmVersion": "3.9.3",
"_phantomChildren": {},
"_requested": {
"name": "md5",
"raw": "md5",
"rawSpec": "",
"scope": null,
"spec": "latest",
"type": "tag"
},
"_requiredBy": [
"#USER"
],
"_resolved": "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz",
"_shasum": "53ab38d5fe3c8891ba465329ea23fac0540126f9",
"_shrinkwrap": null,
"_spec": "md5",
"_where": "D:\\work\\McuClient",
"author": {
"email": "paul@vorba.ch",
"name": "Paul Vorbach",
"url": "http://paul.vorba.ch"
},
"bugs": {
"url": "https://github.com/pvorb/node-md5/issues"
},
"contributors": [
{
"name": "salba"
}
],
"dependencies": {
"charenc": "~0.0.1",
"crypt": "~0.0.1",
"is-buffer": "~1.1.1"
},
"description": "js function for hashing messages with MD5",
"devDependencies": {
"mocha": "~2.3.4"
},
"directories": {},
"dist": {
"shasum": "53ab38d5fe3c8891ba465329ea23fac0540126f9",
"tarball": "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz"
},
"gitHead": "5536a25dbe856b25d9963fd47da5eb4e1bca4250",
"homepage": "https://github.com/pvorb/node-md5#readme",
"license": "BSD-3-Clause",
"main": "md5.js",
"maintainers": [
{
"email": "coolaj86@gmail.com",
"name": "coolaj86"
},
{
"email": "paul@vorba.ch",
"name": "pvorb"
}
],
"name": "md5",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/pvorb/node-md5.git"
},
"scripts": {
"test": "mocha"
},
"tags": [
"md5",
"hash",
"encryption",
"message digest"
],
"version": "2.2.1"
}
... ...
var md5 = require('./md5.js');
var assert = require('assert');
describe('md5', function () {
it('should throw an error for `undefined`', function() {
assert.throws(function() {
md5(undefined);
});
});
it('should throw an error for `null`', function() {
assert.throws(function() {
md5(null);
});
});
it('should return the expected MD5 hash for "message"', function() {
assert.equal('78e731027d8fd50ed642340b7c9a63b3', md5('message'));
});
it('should not return the same hash for random numbers twice', function() {
var msg1 = Math.floor((Math.random() * 100000) + 1) + (new Date).getTime();
var msg2 = Math.floor((Math.random() * 100000) + 1) + (new Date).getTime();
if (msg1 !== msg2) {
assert.notEqual(md5(msg1), md5(msg2));
} else {
assert.equal(md5(msg1), md5(msg1));
}
});
it('should support Node.js Buffers', function() {
var buffer = new Buffer('message áßäöü', 'utf8');
assert.equal(md5(buffer), md5('message áßäöü'));
})
it('should be able to use a binary encoded string', function() {
var hash1 = md5('abc', { asString: true });
var hash2 = md5(hash1 + 'a', { asString: true, encoding : 'binary' });
var hash3 = md5(hash1 + 'a', { encoding : 'binary' });
assert.equal(hash3, '131f0ac52813044f5110e4aec638c169');
});
});
... ...
... ... @@ -5,100 +5,177 @@ import MessageTypes from 'MessageTypes';
import Loger from 'Loger';
import ConferApe from 'apes/ConferApe';
import ChatApe from 'apes/ChatApe';
import VideoChat from 'apes/VideoApe';
import VideoApe from 'apes/VideoApe';
import DocApe from 'apes/DocApe';
import WhiteBoardApe from 'apes/WhiteBoardApe';
import EngineUtils from "EngineUtils";
import GlobalConfig from 'GlobalConfig';
let loger = Loger.getLoger('MessageEntrance');
let _sdkInfo={"version":"v1.0.0","author":"www.3mang.com"};
let _confInfo={};//存储入会数据
let info={"version":"v1.0.0","author":"3mang"};
let confInfo={};
let sass;
let mcu ;
let confer_ape;
let chat_ape;
let video_ape;
let doc_ape;
let wb_ape;
let _sass;
let _mcu ;
let _confer_ape;
let _chat_ape;
let _video_ape;
let _doc_ape;
let _wb_ape;
export default class MessageEntrance extends Emiter {
constructor() {
super();
this.info=info;
// 应用层会议信息
confInfo = {};
//sdk 信息
this.sdkInfo=_sdkInfo;
loger.log(this.sdkInfo);
// Sass平台层
sass = Sass;
sass.on('*', (type, data) => this._emit(type, data));
sass.on(sass.SUCCESS, this._h5SassSuccessHandler.bind(this));
_sass = Sass;
_sass.on('*', (type, data) => this._emit(type, data));
_sass.on(_sass.SUCCESS, this._h5SassSuccessHandler.bind(this));
_sass.on(_sass.CLASS_INIT_SUCCESS, this._h5SassInitSuccessHandler.bind(this));
_sass.on(_sass.CLASS_INIT_FAILED, this._h5SassInitFailedHandler.bind(this));
_sass.on(_sass.CLASS_GET_MEETING_PARAM,this._h5SassGetMeetingParaSuccessHandler);
// 底层MCU消息层
mcu = Mcu;
mcu.on('*', (type, data) => this._emit(type, data));
mcu.on(MessageTypes.CONFERENCE_JOIN_SUCCESS, this._conferenceJoinSuccessHandler.bind(this));
_mcu = Mcu;
_mcu.on('*', (type, data) => this._emit(type, data));
_mcu.on(MessageTypes.CLASS_JOIN_SUCCESS, this._conferenceJoinSuccessHandler.bind(this));
// 注册所有应用Ape
confer_ape = new ConferApe();
confer_ape.on('*', (type, data) => this._emit(type, data));
confer_ape.on(MessageTypes.DOC_SWITCH, this.docSwitchHandler.bind(this));
_confer_ape = new ConferApe();
_confer_ape.on('*', (type, data) => this._emit(type, data));
_confer_ape.on(MessageTypes.DOC_SWITCH, this.docSwitchHandler.bind(this));
chat_ape = new ChatApe();
chat_ape.on('*', (type, data) => this._emit(type, data));
_chat_ape = new ChatApe();
_chat_ape.on('*', (type, data) => this._emit(type, data));
video_ape = new VideoChat();
video_ape.on('*', (type, data) => this._emit(type, data));
_video_ape = new VideoApe();
_video_ape.on('*', (type, data) => this._emit(type, data));
doc_ape = new DocApe();
doc_ape.on('*', (type, data) => this._emit(type, data));
doc_ape.on(MessageTypes.DOC_UPDATE, this.docUpdateHandler.bind(this));
_doc_ape = new DocApe();
_doc_ape.on('*', (type, data) => this._emit(type, data));
_doc_ape.on(MessageTypes.DOC_UPDATE, this.docUpdateHandler.bind(this));
doc_ape.on(MessageTypes.DOC_DEL, this.docDeleteHandler.bind(this));
_doc_ape.on(MessageTypes.DOC_DEL, this.docDeleteHandler.bind(this));
wb_ape = new WhiteBoardApe();
wb_ape.on('*', (type, data) => this._emit(type, data));
wb_ape.on(MessageTypes.ANNO_UPDATE, this.annoUpdateHandler.bind(this));
_wb_ape = new WhiteBoardApe();
_wb_ape.on('*', (type, data) => this._emit(type, data));
_wb_ape.on(MessageTypes.ANNO_UPDATE, this.annoUpdateHandler.bind(this));
this.on(MessageTypes.DOC_SHOW, this.docShowHandler.bind(this));
this.sendChatMsg=this._sendChatMsg;
//公开外部调用的方法
this.init=this._init;
this.joinClass=this._joinClass;
this.sendChatMsg=this._sendChatMsg;
this.setDebugData=this._setDebugData;
}
//初始化,根据课堂号和角色类型获取登录验证时需要的基本信息
_init(_param) {
//{"meetingNumber":"1653304953","portal":"112.126.80.182:80","userRole":"normal","userId":0}
//判断传入的参数是否存在
if(_param===null||EngineUtils.isEmptyObject(_param)){
loger.log('init初始化失败',MessageTypes.ERROR_PARAM);
this._emit(MessageTypes.CLASS_INIT_FAILED,MessageTypes.ERROR_PARAM);
return ;
}
//判断必要的参数字段值
if(_param.meetingNumber===null||isNaN(_param.meetingNumber)||_param.portal===null){
this._emit(MessageTypes.CLASS_INIT_FAILED,MessageTypes.ERROR_PARAM);
return ;
}
loger.log('_init',_param);
//保存参数
GlobalConfig.confId=_param.meetingNumber;
GlobalConfig.portal=_param.portal;
GlobalConfig.userRole=_param.userRole||"normal";
GlobalConfig.userId=_param.userId||"0";
//获取课堂校验信息
if(_sass){
//_sass.sassGetJoinParams(_param);
_sass.sassGetJoinParams(GlobalConfig.getConfInfo());
}
}
// 进入会议
_joinClass(_confInfo) {
confInfo = _confInfo||{};
if(confInfo===null||EngineUtils.isEmptyObject(confInfo)){
loger.log('不能进入会议,传递的参数不对.',_confInfo);
_joinClass(_param) {
//{"userName":"名字","password":""}
if(_param===null||EngineUtils.isEmptyObject(_param)){
this._emit(MessageTypes.CLASS_JOIN_FAILED,MessageTypes.ERROR_PARAM);
loger.log('不能进入会议,传递的参数不对.',_param);
return ;
}
if(sass){
sass.sassChecking(_confInfo);
//判断userName
if(_param.userName===null){
loger.log('不能进入会议,传递的参数不对.名字不能为空');
this._emit(MessageTypes.CLASS_JOIN_FAILED,MessageTypes.ERROR_PARAM);
return ;
}
GlobalConfig.userName=_param.userName;
GlobalConfig.password=_param.password||"";
//开始校验
if(_sass){
// _sass.sassChecking(_confInfo);
_sass.sassChecking(GlobalConfig.getConfInfo());
}
}
// 离开会议
leaveClass() {
if(mcu){
mcu.leaveMCU();
if(_mcu){
_mcu.leaveMCU();
}
}
// 用meetingNumber向SASS平台获取入会验证信息成功
_h5SassInitSuccessHandler(_data) {
//{"siteId":"h5test","passwordRequired":true,"md5":"de399d5540b3da2fbc1eb0a770d4fd66","code":0,"msType":1}
if(_data){
GlobalConfig.md5=_data.md5||"";//这个暂时用假数据,后台接口写完就有数据了
GlobalConfig.msType=_data.msType||1;
GlobalConfig.nopassword=_data.passwordRequired||false;
GlobalConfig.siteId=_data.siteId;
}
loger.log('向SASS平台获取入会验证信息成功.');
this._emit(MessageTypes.CLASS_INIT_SUCCESS,_data);
}
// 用meetingNumber向SASS平台获取入会验证信息失败
_h5SassInitFailedHandler() {
loger.log('向SASS平台获取入会验证信息失败.');
this._emit(MessageTypes.CLASS_INIT_FAILED);
}
//使用固定的假数据
_setDebugData(_data){
loger.log("setDebugData "+_data);
GlobalConfig.setDebugData(_data);
}
// 通过SASS平台验证
_h5SassSuccessHandler() {
loger.log('加入底层MCU会议.'+confInfo.toString());
if(mcu){
mcu.joinMCU(confInfo);
_h5SassSuccessHandler(_data) {
loger.log('加入底层MCU会议.');
if(_mcu){
//_mcu.joinMCU(_confInfo);
_mcu.joinMCU(GlobalConfig.getConfInfo());
}
}
//获取会议所有参数
_h5SassGetMeetingParaSuccessHandler(_data){
loger.log('获取getMeetingParam完成.');
GlobalConfig.meetingParam=_data;
loger.log(_data);
}
// MCU 会议成功
_conferenceJoinSuccessHandler() {
if(sass){
sass.getClassDetail();//会议信息
sass.getMeetingParm();//会议参数大全
loger.log('MCU 会议成功.');
if(_sass){
_sass.getClassDetail();//会议信息
_sass.getMeetingParam();//会议参数大全
}
}
// 参会处理
... ... @@ -109,27 +186,22 @@ export default class MessageEntrance extends Emiter {
};
this._emit(msg.type, msg);
}
// 发送聊天消息
/* _sendChatMsg(to, msg) {
if (chat_ape) {
chat_ape.sendChatMsg(to, msg);
}
}*/
_sendChatMsg(_messageInfo) {
if(_messageInfo===null||EngineUtils.isEmptyObject(_messageInfo)){
loger.log('sendChatMsg 传递的参数不对',_messageInfo);
return ;
}
if (chat_ape) {
chat_ape.sendChatMsg(_messageInfo);
if (_chat_ape) {
_chat_ape.sendChatMsg(_messageInfo);
}
}
// 白板笔记更新
annoUpdateHandler(annoInfo) {
const activeDocId = confer_ape.activeDocId;
const docItem = doc_ape.docList[activeDocId];
const activeDocId = _confer_ape.activeDocId;
const docItem = _doc_ape.docList[activeDocId];
if (docItem && annoInfo.id == docItem.wbid) {
this._emit(MessageTypes.DOC_ANNO, annoInfo);
}
... ... @@ -138,22 +210,20 @@ export default class MessageEntrance extends Emiter {
// 文档变更-笔记处理
docShowHandler(docItem) {
loger.log('Doc Show ->' + docItem.id + '|' + docItem.curPageNo);
const annoInfo = wb_ape.annoInfos[docItem.wbid];
const annoInfo = _wb_ape.annoInfos[docItem.wbid];
if (annoInfo) {
this._emit(MessageTypes.DOC_ANNO, annoInfo);
} else {
this._emit(MessageTypes.DOC_ANNO);
}
}
// 文档切换
docSwitchHandler() {
const activeDocId = confer_ape.activeDocId;
const activeDocId = _confer_ape.activeDocId;
loger.log('Switch Doc Active -> ' + activeDocId);
const docItem = doc_ape.docList[activeDocId];
const docItem = _doc_ape.docList[activeDocId];
if (docItem) {
this._emit(MessageTypes.DOC_SHOW, docItem);
}
... ... @@ -161,17 +231,16 @@ export default class MessageEntrance extends Emiter {
// 文档变更
docUpdateHandler(docItem) {
loger.log('Doc UpdateId ->' + docItem.id + '| activeDocId ->' + confer_ape.activeDocId);
if (docItem.id == confer_ape.activeDocId) {
loger.log('Doc UpdateId ->' + docItem.id + '| activeDocId ->' + _confer_ape.activeDocId);
if (docItem.id == _confer_ape.activeDocId) {
this._emit(MessageTypes.DOC_SHOW, docItem);
}
}
//文档删除
docDeleteHandler(docItem){
if (docItem.id == confer_ape.activeDocId) {
if (docItem.id == _confer_ape.activeDocId) {
this._emit(MessageTypes.DOC_DEL, docItem);
}
}
}
//MessageEntrance.MessageTypes = MessageTypes;
... ...
... ... @@ -96,8 +96,11 @@ class EverSocket extends Emiter {
_onOpen() {
loger.log('WebSocket建立成功', this.wsURL);
//启动心跳,检查socket链接状态
//this.pingTimer = window.setInterval(this._sendPingHandler.bind(this), EverSocket.PING_INTERVAL);
//this.pongTimer = window.setInterval(this._checkPongHandler.bind(this), EverSocket.PONG_INTERVAL);
this._setConnected();
}
... ...
/*
* 全局数据管理
* */
import Loger from 'Loger';
let loger = Loger.getLoger('GlobalConfig');
class GlobalConfig {
constructor () {
console.log(new.target);
}
toString () {
return super.toString() + ',' + this.z;
static setDebugData (_deBugData){
this.isDebug=true;
this.deBugData=_deBugData;
}
static getConfInfo (){
if(this.isDebug){
static getConfigInfo() {
console.log('static method'+this.z);
}
get z() {
return 4;
}
set z(value) {
console.log(value);
//这几个属性是sass验证完成之后返回的,启动MCU的时候需要
this .deBugData.MCUServerIP=this.MCUServerIP;
this .deBugData.MCUServerPort=this.MCUServerPort;
this .deBugData.maxVideoChannels=this.maxVideoChannels;
this .deBugData.maxAudioChannels=this.maxAudioChannels;
this .deBugData.maxMediaChannels=this.maxMediaChannels;
return this .deBugData;
}else {
return{
"siteId": this.siteId,
"confId": this.confId,
"h5Module": this.h5Module,
"nodeId": this.nodeId,
"topNodeID":this.topNodeID,
"userRole": this.userRole,
"role": this.role,
"isHost": this.isHost,
"classRole": this.classRole,
"userId": this.userId,
"userName": this.userName,
"password": this.password,
"userType": this.userType,
"nopassword": this.nopassword,
"md5": this.md5,
"msType": this.msType,
"portal": this.portal,
"mcuDelay":this.mcuDelay,
"MCUServerIP": this.MCUServerIP,
"MCUServerPort":this.MCUServerPort,
"maxVideoChannels": this.maxVideoChannels,
"maxAudioChannels": this.maxAudioChannels,
"maxMediaChannels": this.maxMediaChannels
}
}
}
}
GlobalConfig.siteId="gust";
GlobalConfig.confId=1653304953;//课堂号=classId=meetingNumber 之后统一修改为classId
GlobalConfig.nodeId=1483947664;//随机生成
GlobalConfig.topNodeID=101;//现在固定值,还不知道是做什么用
GlobalConfig.userRole="normal";
GlobalConfig.role=1;
GlobalConfig.isHost=false;
GlobalConfig.classRole=0;
GlobalConfig.userId=0;
GlobalConfig.userName="";
GlobalConfig.password="";
GlobalConfig.userType=8;
GlobalConfig.h5Module=0;
GlobalConfig.nopassword=false;
GlobalConfig.md5="";
GlobalConfig.msType=1;
GlobalConfig.mcuDelay=3000;
GlobalConfig.portal="112.126.80.182:80";
GlobalConfig.ip="112.126.80.182";
GlobalConfig.port="80";
GlobalConfig.MCUServerIP="114.215.195.70";
GlobalConfig.MCUServerPort=9003;
GlobalConfig.maxVideoChannels=1;
GlobalConfig.maxAudioChannels=1;
GlobalConfig.maxMediaChannels=2;
GlobalConfig.isDebug=false;
GlobalConfig.deBugData={};
GlobalConfig.meetingParam={};
export default GlobalConfig;
... ...
... ... @@ -15,17 +15,17 @@
class Loger {
constructor(info) {
this.info = info || '';
this.sdkInfo = info || '';
this.id = this.initId();
}
initId() {
const infoType = this.info.constructor.name.toLowerCase();
const infoType = this.sdkInfo.constructor.name.toLowerCase();
if (infoType === 'string') {
return this.info;
return this.sdkInfo;
}
if (infoType === 'object') {
return this.info.mid || '';
return this.sdkInfo.mid || '';
}
return '';
}
... ...
... ... @@ -15,34 +15,51 @@
function MessageTypes() {}
MessageTypes.CONFERENCE_SHOW_USERNAME = 'show.name.input';
MessageTypes.CONFERENCE_SHOW_ILLEGAL = 'illegal.user';
MessageTypes.CONFERENCE_SHOW_USERNAME_PASSWORD = 'show.name.pasword.input';
MessageTypes.CONFERENCE_SHOW_WRONG_PASSWORD = 'password.wrong';
MessageTypes.CONFERENCE_JOIN_FAILED = 'join.conference.failed';
MessageTypes.CONFERENCE_JOIN_SUCCESS = 'join.conference.success';
MessageTypes.CONFERENCE_JOIN_FULL = 'full.capacity';
MessageTypes.CONFERENCE_EXIT = 'conference.exit';
MessageTypes.CONFERENCE_JOIN_CONFILICT = 'have.been.logged.elsewhere';
MessageTypes.CONFERENCE_SHOW_DETAIL = 'class_detail.message';
MessageTypes.CONFERENCE_SHOW_ROSTER_NUM = 'roster_num.message';
//--------------------事件相关的定义--------------------------------------
//初始化相关事件定义
MessageTypes.CLASS_INIT_SUCCESS='class.init.success';//初始化成功
MessageTypes.CLASS_INIT_FAILED='class.init.failed';//初始化失败
MessageTypes.NET_ERROR = 'net_error';
MessageTypes.PRO_ERROR = 'pro_error';
//加入会议相关事件定义
MessageTypes.CLASS_JOIN_FAILED = 'join.class.failed';
MessageTypes.CLASS_JOIN_SUCCESS = 'join.class.success';
//会议信息和操作事件定义
MessageTypes.CLASS_SHOW_DETAIL = 'class_detail.message';
MessageTypes.CLASS_SHOW_ROSTER_NUM = 'roster_num.message';
MessageTypes.CLASS_EXIT = 'class.exit';
//聊天模块事件定义
MessageTypes.CHAT_RECEIVE = 'chat.message';
//视频模块事件定义
MessageTypes.VIDEO_SHOW = 'video.message';
//文档模块事件定义
MessageTypes.DOC_SHOW = 'document.message';
MessageTypes.DOC_SWITCH = 'document.switch';
MessageTypes.DOC_UPDATE = 'document.update';
MessageTypes.DOC_DEL='document.delete';
MessageTypes.DOC_ANNO = 'document.anno';
MessageTypes.CHAT_RECEIVE = 'chat.message';
MessageTypes.DOC_ANNO = 'document.anno';//笔记
//笔记事件定义
MessageTypes.ANNO_UPDATE = 'anno_update';
MessageTypes.AUDIO_SHOW='audio.message';
//错误事件定义
MessageTypes.NET_ERROR = 'net_error';
MessageTypes.PRO_ERROR = 'pro_error';//协议异常
//---------------错误消息定义-------------------------------------------------
MessageTypes.ERROR_NET='网络异常';
MessageTypes.ERROR_PARAM='参数不正确';
MessageTypes.ERROR_CLASS_JOIN_FULL = 'class.join,full';//人数已满
MessageTypes.ERROR_CLASS_JOIN_CONFILICT = 'class.join.conflict';//已经在其它地方登陆
MessageTypes.ERROR_CLASS_PASSWORD_WRONG = 'class.password.wrong';//密码错误
MessageTypes.ERROR_CLASS_MD5_WRONG = 'class.md5.wrong';//MD5验证失败
MessageTypes.ERROR_CLASS_PROTOCOL_WRONG = 'class.protocol.wrong';//协议异常
export default MessageTypes;
... ...
import Emiter from 'Emiter';
import Loger from 'Loger';
import MessageTypes from 'MessageTypes';
import GlobalConfig from 'GlobalConfig';
import MD5 from "md5";
// 日志对象
const loger = Loger.getLoger('Sass');
let confInfo = {};
let initInfo={};
class Sass extends Emiter {
constructor() {
super();
}
// Sass校验
sassChecking(_confInfo) {
loger.log('发起Sass校验', _confInfo);
confInfo = _confInfo;
//Sass 接口
//----1.校验之前的接口-----
//sassGetJoinParams 获取课堂校验信息 let url = `http://${_initInfo.portal}/3m/api/meeting/joinParams.do?meetingNumber=${_initInfo.confId}&userID=${_initInfo.userId}`;
//-----2.开始校验,如果有密码先校验密码,否则直接开始MD5验证-----
//sendPWDChecking入会密码校验 let url = `http://${confInfo.portal}/3m/getCheckMeetinig.do?siteId=${confInfo.siteId}&classId=${confInfo.confId}&password=${confInfo.password}`;
//sendMD5Checking MD5校验(发起入会) let url = `http://${confInfo.portal}/3m/meeting/md5CheckMeeting.do?siteId=${confInfo.siteId}&meetingNumber=${confInfo.confId}&userId=${confInfo.userId}&userName=${confInfo.userName}&userType=${confInfo.userType}&nopassword=${confInfo.nopassword}&md5=${confInfo.md5}`;
//----3.验证完成后获取------
//getClassDetail 获取会议详情 let url = `http://${confInfo.portal}/3m/meeting/getClassH5.do?classNumber=${confInfo.confId}`;
//getMeetingParam 获取会议最全参数集合 let url = `http://${confInfo.portal}/3m/api/meeting/detail.do?meetingNumber=${confInfo.confId}&timestamp=${timestamp}&authId=${authId}`;
//Sass获取课堂校验信息
sassGetJoinParams(_initInfo) {
loger.log('Sass获取课堂校验信息', _initInfo);
/* 获取用于加入课堂的参数
/3m/api/meeting/joinParams.do
参数 (application/x-www-form-urlencoded):
名称 类型 可选 默认值 说明
meetingNumber String 否 null 课堂号
userID String 是 0 用户id
返回 (application/json):
名称 类型 说明
code int 0 正常
1 课堂号必填
2 无效的课堂号
3 没有对应的站点
4 站点已过期
siteId String 站点号
passwordRequired Boolean 是否需要输入密码
md5 String 用于后续加入课堂验证
msType int 媒体服务器类型
*/
let url = `http://${_initInfo.portal}/3m/api/meeting/joinParams.do?meetingNumber=${_initInfo.confId}&userID=${_initInfo.userId}`;
loger.log('Sass获取课堂校验信息.', url);
fetch(url, {
timeout: 5000
})
.then(ret => {
if (ret.ok) {
return ret.json();
} else {
loger.error(`Sass获取课堂校验信息-网络异常.状态码:${ret.status}`);
this._emit(Sass.CLASS_INIT_FAILED);
throw '';
}
})
.then(ret => {
if (ret.code === 0) {
loger.log('Sass获取课堂校验信息完成');
this._emit(Sass.CLASS_INIT_SUCCESS,ret);
} else {
loger.warn('Sass获取课堂校验信息失败.');
this._emit(Sass.CLASS_INIT_FAILED);
}
})
.catch(err => {
loger.error(`Sass获取课堂校验信息异常.状态码:${err}`);
this._emit(Sass.CLASS_INIT_FAILED,err);
});
}
// Sass校验开始
sassChecking(_param) {
loger.log('发起Sass校验', _param);
confInfo = _param;
// 密码校验
if (confInfo.nopassword === 'true') {
return this.sendPWDChecking();
}
// MD5校验
this.sendMD5Checking();
}
// 入会校验
// 入会密码校验
sendPWDChecking() {
let url = `http://${confInfo.portal}/3m/getCheckMeetinig.do?siteId=${confInfo.siteId}&classId=${confInfo.confId}&password=${confInfo.password}`;
loger.log('会议密码校验', url);
fetch(url, {
timeout: 5000
... ... @@ -44,7 +109,7 @@ class Sass extends Emiter {
.then(ret => {
if (ret === 'false') {
loger.error(`会议密码校验-失败.`);
return this._emit(MessageTypes.CONFERENCE_SHOW_WRONG_PASSWORD);
return this._emit(MessageTypes.CLASS_JOIN_FAILED,MessageTypes.ERROR_CLASS_PASSWORD_WRONG);
}
if (ret === 'true') {
loger.log(`会议密码校验-成功.`);
... ... @@ -52,7 +117,7 @@ class Sass extends Emiter {
return
}
loger.error(`会议密码校验-协议异常.`);
this._emit(MessageTypes.PRO_ERROR);
this._emit(MessageTypes.CLASS_JOIN_FAILED,MessageTypes.ERROR_CLASS_PROTOCOL_WRONG);
})
.catch(err => {
loger.error(`会议密码校验-异常.状态码:${err}`);
... ... @@ -63,9 +128,7 @@ class Sass extends Emiter {
// 发起入会
sendMD5Checking() {
let url = `http://${confInfo.portal}/3m/meeting/md5CheckMeeting.do?siteId=${confInfo.siteId}&meetingNumber=${confInfo.confId}&userId=${confInfo.userId}&userName=${confInfo.userName}&userType=${confInfo.userType}&nopassword=${confInfo.nopassword}&md5=${confInfo.md5}`;
loger.log('H5SassMD5校验', url);
fetch(url, {
timeout: 5000
})
... ... @@ -84,17 +147,24 @@ class Sass extends Emiter {
let server = ret.h5_mcu_list.split(";")[0];
confInfo.MCUServerIP = server.split(":")[0];
confInfo.MCUServerPort = server.split(":")[1];
GlobalConfig.MCUServerIP=confInfo.MCUServerIP;
GlobalConfig.MCUServerPort=confInfo.MCUServerPort;
}
console.log(ret);
confInfo.maxVideoChannels = ret.maxVideoChannels;
confInfo.maxAudioChannels = ret.maxAudioChannels;
confInfo.maxMediaChannels = confInfo.maxVideoChannels + confInfo.maxAudioChannels;
loger.log('H5Sass校验完成');
this._emit(Sass.SUCCESS);
GlobalConfig.maxVideoChannels=confInfo.maxVideoChannels;
GlobalConfig.maxAudioChannels=confInfo.maxAudioChannels;
GlobalConfig.maxMediaChannels=confInfo.maxMediaChannels;
loger.log('H5Sass校验完成');
console.log(ret);
this._emit(Sass.SUCCESS,ret);
} else {
loger.log('H5SassMD5校验-失败.');
this._emit(MessageTypes.CONFERENCE_JOIN_FAILED);
this._emit(MessageTypes.CLASS_JOIN_FAILED,MessageTypes.ERROR_CLASS_MD5_WRONG);
}
})
.catch(err => {
... ... @@ -106,9 +176,7 @@ class Sass extends Emiter {
// 获取会议详情
getClassDetail() {
let url = `http://${confInfo.portal}/3m/meeting/getClassH5.do?classNumber=${confInfo.confId}`;
loger.log('H5Sass获取Class详情.', url);
fetch(url, {
timeout: 5000
})
... ... @@ -124,7 +192,7 @@ class Sass extends Emiter {
.then(ret => {
if (ret.errorCode === 0) {
loger.log('H5Sass获取Class详情完成');
this._emit(MessageTypes.CONFERENCE_SHOW_DETAIL, ret);
this._emit(MessageTypes.CLASS_SHOW_DETAIL, ret);
} else {
loger.warn('H5Sass获取Class详情失败.');
this._emit(MessageTypes.NET_ERROR);
... ... @@ -136,43 +204,59 @@ class Sass extends Emiter {
});
}
getMeetingParm(){
console.log("getMeetingParm------------------------");
//http://112.126.80.182/3m/meeting/getMeetingParam.do?meetingNumber=1653304953
//let url = `http://${confInfo.portal}/3m/meeting/getClassH5.do?classNumber=${confInfo.confId}`;
let url = `http://${confInfo.portal}/3m/meeting/getMeetingParam.do?meetingNumber=${confInfo.confId}&device=flashplayer`;
loger.log('H5Sass获取MeetingParam.', url);
getMeetingParam(){
/*
参数 (application/x-www-form-urlencoded):
名称 类型 可选 默认值 说明
meetingNumber String 否 null 课堂号
timestamp String 否 null 时间戳
authId String 否 null 验证信息 md5(meetingNumber + timestamp)
返回 (application/json):
名称 类型 说明
code int 0 正常
1 课堂号必填
2 无效的课堂号
3 没有对应的站点
4 站点已过期
siteId String 站点号
meetingNumber String 课堂号
*/
var timestamp=new Date().getTime();
var authId=MD5(confInfo.confId+""+timestamp);//课堂号+时间戳 的字符串,转成MD5
let url = `http://${confInfo.portal}/3m/api/meeting/detail.do?meetingNumber=${confInfo.confId}&timestamp=${timestamp}&authId=${authId}`;
loger.log('H5Sass获取getMeetingParam ', url);
fetch(url, {
timeout: 5000,
mode: 'no-cors'
timeout: 5000
})
.then(ret => {
if (ret.ok) {
return ret.json();
} else {
loger.error(`H5Sass获取MeetingParam-网络异常.状态码:${ret.status}`);
loger.error(`H5Sass获取getMeetingParam-网络异常.状态码:${ret.status}`);
this._emit(MessageTypes.NET_ERROR);
throw '';
}
})
.then(ret => {
if (ret.errorCode === 0) {
loger.log('H5Sass获取MeetingParam完成');
this._emit(MessageTypes.CONFERENCE_SHOW_DETAIL, ret);
if (ret.code === 0) {
loger.log('H5Sass获取getMeetingParam完成');
this._emit(Sass.CLASS_GET_MEETING_PARAM, ret);
} else {
loger.warn('H5Sass获取MeetingParam失败.');
loger.warn('H5Sass获取getMeetingParam失败.');
this._emit(MessageTypes.NET_ERROR);
}
})
.catch(err => {
loger.error(`H5Sass获取MeetingParam异常.状态码:${err}`);
loger.error(`H5Sass获取getMeetingParam异常.状态码:${err}`);
this._emit(MessageTypes.NET_ERROR);
});
}
}
Sass.prototype.SUCCESS = Sass.SUCCESS = 'h5sass.success';
Sass.prototype.CLASS_INIT_SUCCESS = Sass.CLASS_INIT_SUCCESS = 'sass.class.init.success';
Sass.prototype.CLASS_INIT_FAILED = Sass.CLASS_INIT_FAILED = 'sass.class.init.failed';
Sass.prototype.CLASS_GET_MEETING_PARAM= Sass.CLASS_GET_MEETING_PARAM = 'class_getMeetingParam.message';
export default new Sass;
... ...
... ... @@ -51,7 +51,7 @@ export default class Ape extends Emiter {
// 监听底层MCU会议
this.mcu = mcu;
this.mcu.on(MessageTypes.CONFERENCE_JOIN_SUCCESS, this._mcuConferenceJoinSuccessHandler.bind(this));
this.mcu.on(MessageTypes.CLASS_JOIN_SUCCESS, this._mcuConferenceJoinSuccessHandler.bind(this));
this.mcu.registerApe(this);
}
... ...
... ... @@ -38,9 +38,9 @@ class ChatApe extends Ape {
this.on(pdu.RCPDU_CHAT_SEND_DATA_REQUEST, this.chatMsgIncomingHandler.bind(this));
}
chatMsgIncomingHandler(pdu) {
}
//chatMsgIncomingHandler(pdu) {
//
//}
sendChatMsg(_messageInfo) {
if(this._confInfo===null||EngineUtils.isEmptyObject(this._confInfo)){
... ... @@ -51,14 +51,16 @@ class ChatApe extends Ape {
// to, message
loger.log('发送聊天消息.', _messageInfo.to, _messageInfo.message);
let chatSendPdu = new pdu['RCChatSendDataRequestPdu'];
chatSendPdu.type = pdu.RCPDU_CHAT_SEND_DATA_REQUEST;
chatSendPdu.initiator = this._confInfo.nodeId;//发起人
chatSendPdu.peer = _messageInfo.to;//发送给谁,公聊的时候是0,私聊的时候是指定的用户id
chatSendPdu.peer = parseInt(_messageInfo.to);//发送给谁,公聊的时候是0,私聊的时候是指定的用户id
chatSendPdu.isPublic = true;
chatSendPdu.userData = this._rCArrayBufferUtil.strToUint8Array("h5" + _messageInfo.message);
chatSendPdu.fromName = this._rCArrayBufferUtil.strToUint8Array("h5" + this._confInfo.userName);
chatSendPdu.fromRole = this._confInfo.classRole;
if (!(chatSendPdu.isPublic || 0 === chatSendPdu.peer)) {
this.send(chatSendPdu);
} else {
... ... @@ -76,7 +78,7 @@ class ChatApe extends Ape {
chatMsg.fromName = this._rCArrayBufferUtil.uint8ArrayToStr(chatReceivePdu.fromName, 2);
chatMsg.fromRole = chatReceivePdu.fromRole;
loger.log('接聊天消息.', chatMsg);
loger.log('接聊天消息.', chatMsg);
this._emit(MessageTypes.CHAT_RECEIVE, chatMsg);
}
... ...
... ... @@ -135,12 +135,12 @@ class ConferApe extends Ape {
this.emitRosterChange();
// 自己退出
if (nodeId == this._confInfo.nodeId) {
this._emit(MessageTypes.CONFERENCE_EXIT);
this._emit(MessageTypes.CLASS_EXIT);
}
}
emitRosterChange() {
this._emit(MessageTypes.CONFERENCE_SHOW_ROSTER_NUM, Object.keys(this.rosters).length);
this._emit(MessageTypes.CLASS_SHOW_ROSTER_NUM, Object.keys(this.rosters).length);
}
}
... ...
... ... @@ -11,6 +11,7 @@ import ApeConsts from 'apes/ApeConsts';
import ConferApe from 'apes/ConferApe';
import ArrayBufferUtil from 'libs/ArrayBufferUtil';
import Base64 from 'base64-js';
//import GlobalConfig from 'GlobalConfig';
let loger = Loger.getLoger('MCU');
... ... @@ -33,7 +34,7 @@ class MCU extends Emiter {
loger.log('MCU-发送加入会议请求.');
const confInfo = this.confInfo;
// 刷新nodeId
// 创建刷新nodeId
confInfo.nodeId = parseInt(Date.now() / 1000);
var joinRequestPdu = new pdu['RCConferenceJoinRequestPdu'];
... ... @@ -50,13 +51,13 @@ class MCU extends Emiter {
let pduMsg = pdu.create_connect_provider_request_pdu(
joinRequestPdu.type,
confInfo.nodeId,
confInfo.confId,
confInfo.nodeId,
confInfo.confId,
0,
ApeConsts.BROADCAST_CHANNEL_ID,
true,
PduConsts.DP_TOP,
confInfo.topNodeID,
confInfo.topNodeID,
PduConsts.SEG_ONCE
);
... ... @@ -83,11 +84,13 @@ class MCU extends Emiter {
switch (pduResultCode) {
case PduConsts.RET_SUCCESS:
this._updateMCUConfInfoDesc(joinConfPdu.get("confDesc"));
this._emit(MessageTypes.CONFERENCE_JOIN_SUCCESS, this.confInfo);
this._emit(MessageTypes.CLASS_JOIN_SUCCESS, this.confInfo);
break;
case PduConsts.RET_FULL_CAPACITY:
this._emit(MessageTypes.CONFERENCE_JOIN_FULL);
this._emit(MessageTypes.CLASS_JOIN_FAILED,MessageTypes.ERROR_CLASS_JOIN_FULL);
//this._emit(MessageTypes.CLASS_JOIN_FULL);
break;
default:
loger.warn('JoinConfPdu-未知类型-等待处理.', pduResultCode);
}
... ... @@ -155,7 +158,7 @@ class MCU extends Emiter {
let conferenceRecord = {}; //RCConferenceRecord_T
conferenceRecord._conference_id = this.confInfo.confId;
conferenceRecord._top_node_id = this.confInfo.topNodeID;
conferenceRecord._top_node_id =this.confInfo.topNodeID;
this.mcuConfInfo = {}; //RCMeetingInfo_T
this.mcuConfInfo.self = nodeInfoRecordPdu;
... ... @@ -165,7 +168,7 @@ class MCU extends Emiter {
this.confInfo.mcuConfInfo = this.mcuConfInfo;
//开启EverSocket
this._everSocket.begin(this.confInfo.MCUServerIP, this.confInfo.MCUServerPort);
this._everSocket.begin(this.confInfo.MCUServerIP,this.confInfo.MCUServerPort);
}
}
... ...