Giter VIP home page Giter VIP logo

web-im's Introduction

环信 WebIM sdk

测试环信WebIM请访问:https://webim.easemob.com

更多关于环信的开发文档请见:https://docs.easemob.com

QA

Q: IE8下总是提示拒绝访问

A: 请确保自己的demo地址是否通过web服务,以http协议访问

原因见: XDomainRequest

XDomainRequest为了确保安全构建,采用了多种方法。
- 安全协议源必须匹配请求的URL。(http到http,https到https)。如果不匹配,请求会报“拒绝访问”的错误。

no such file or directory, scandir 'node_modules/node-sass/vendor'

npm rebuild node-sass is the official solution. Deleting your node_modules and running npm install will also do the trick.

sass/node-sass#1579

web-im's People

Contributors

alexgreenbar avatar bryant1410 avatar chunjin-li avatar daasiri avatar davidyangss avatar easezy avatar easonjim avatar h001erolee avatar hq-610 avatar jerrywu12 avatar jervisliu avatar jijiezh avatar letian0805 avatar pppkiller avatar renyy avatar shannonllj avatar stliu avatar sunylt avatar wcy123 avatar wind108369 avatar wk3368 avatar wytheme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

web-im's Issues

WebSocket is already in CLOSING or CLOSED state.

为什么报错还没想明白 ?有没有遇到这个问题的人?求指点

`            /** PrivateFunction: _onIdle
             *  _Private_ function called by `Strophe.Connection._onIdle`
             *
             *  sends all queued stanzas
             */
            _onIdle: function () {
                var data = this._conn._data;
                if (data.length > 0 && !this._conn.paused) {
                    for (var i = 0; i < data.length; i++) {
                        if (data[i] !== null) {
                            var stanza, rawStanza;
                            if (data[i] === "restart") {
                                stanza = this._buildStream().tree();
                            } else {
                                stanza = data[i];
                            }
                            rawStanza = Strophe.serialize(stanza);
                            this._conn.xmlOutput(stanza);
                            this._conn.rawOutput(rawStanza);
                            this.socket.send(rawStanza);
                        }
                    }
                    this._conn._data = `[];`
                }
            },

显示文件大小

传文件的时候 把文件大小传过去,方便没下载之前先看到文件大小。与客户端保持一致功能。

h5源码问题

我下载下来的h5版本的源码 竟然是只有打包之后的代码 这让我怎么看

关于webim文档中发送图片消息问题

由于ios端接受图片消息需要提供图片的size: width 和 height,而web端的文档中并未提供这两个参数,导致ios端在收到图片消息会自动奔溃。求解决

规范提示信息

检查所有Demo.api.Notify. 普通提示用Demo.api.NotitySuccess,错误提示才用Demo.api.NotifyError

NPM安装包BUG

在文件:src/connection.js 第681行语法错误

//webrtc需要强制心跳,加个默认为false的参数 向下兼容
connection.prototype.heartBeat = function (forcing = false) {}

web端接受语音消息问题

问一下,为啥通过语音回调接口返给我的是.amr文件而不是.mp3文件,我看到options header中有'Accept': 'audio/mp3',但最后得到的音频并不是mp3啊,求解决?

webimdemo版本问题

文档中中的简单版,纯html+js,在哪里,怎么简单版跟完整版都是一个地址,不会react.

1.4分支如何添加上传视频功能

image
这个可以上传音频,传视频提示不支持MP4格式,也没有找到官网的详细教程,希望可以解答 一下

我看了一下websdk-1.4.13.js 里面并没有对视频上传做处理
websdk-1.4.13.js
image

websdk 使用npm方式require引入 报错

报错提示

Cannot read property 'prototype' of undefined
    at Object.eval (connection.js?d419:24)

但是全局是存在该属性的,不是undefined

Strophe.Request.prototype
Object {getResponse: function, _newXHR: function}

webim 使用 accessToken 登录问题

conn.open({
    user: username,
    // pwd: password,
    appKey: appkey,
    accessToken: accessToken
  })

accessToken 是通过 REST API 获取到的管理员 token,在 open 的时候提示“登录失败,请输入正确的用户名和密码”。如果把 accessToken 去掉就可以登录成功,请问这是什么原因。望解答,谢谢!

Do we support IE at all?

This syntax connection.prototype.heartBeat = function (forcing = false) of default parameter is not supported by IE at all. Is IE a supported browser at all?

It is line 681 of sdk/src/connection.js

提高页面性能

现有的机制是登录就创建所有的好友/群组/群的chatwindow,性能有问题。需要改成动态创建。

webim建群,群名称显示的是群ID

该问题描述如下,客户端在设置了群组title的情况下,没有等待设置成功的返回,就试图去获取群组的详情,所以一定概率会出现群组title没有生效的情况

看看客户端能不能等待设置的结果后,再进行获取用户加入的群组

可以出一个vue版本么

webIM可以出一个vue 版本么,可以基于官方vue-cli做一个。
功能多少不重要,只要能跑起来

使用es6和webpack打包,config配置和setJid问题

问题1 使用es6和webpack打包,config配置项的使用问题

代码如下:

import WebIM from 'easemob-websdk'
import config from '../constants/WebIMConfig'
WebIM.config = config

connection.js 中此处会报 undefined错误,因为config在connection.js之后才设置

  if (WebIM && WebIM.config.isDebug) {
        Strophe.Connection.prototype.rawOutput = function (data) {
            console.log('%c ' + WebIM.utils.ts() + '[send] ' + data, "background-color: #e2f7da");
        }
    }

如果把import config提到import WebIM上方,则在connection.js中依然是重新创建了WebIM空对象,因为

var WebIM = window.WebIM || {};

问题2 setJid not a function

因为不想在页面中直接引入strophe.js,所以采用

var Strophe = require('strophe.js').Strophe;

但sdk中提供的strophe版本中报了setJid not a function,我想应该是es6语法对prototype中jid变量和其set get方法冲突导致的,我看了strophe.js最新版本1.2.14, setJid和getJid两个方法已经不存在了,因此使用了最新的版本,同时将

        stropheConn.setJid(data)

修改为

        stropheConn.jid = data;
        stropheConn.authzid = Strophe.getBareJidFromJid(stropheConn.jid);
        stropheConn.authcid = Strophe.getNodeFromJid(stropheConn.jid);

不知道这样是不是能够保证功能正常

以上是在使用中发现的2个小问题

isMultiLoginSessions:true 问题

设置isMultiLoginSessions:true
然后执行yarn run dev 查看demo
登录两个标签,第二个标签打开后,第一个标签则显示:你已下线
请问,怎么才能实现:支持同一账号最多8个标签页登录 的效果

npm + webpack 打包, 全部使用require引入的改进建议

先说结果 , 可使用以下格式引入了
require('mylib/huanxin/webim.config.js')
require('mylib/huanxin/strophe-1.2.8.js')
require('easemob-websdk')

改动部分:
webim.config.js 改为 如下格式
var WebIM = window.WebIM || {};
WebIM.config = { ... }
window.WebIM = WebIM

strophe-1.2.8.js
第 23行, 添加: if(window.Strophe) return; 防止重复

从 第 5698 行:
改为如下: (即 注释掉requirejs和seajs兼容部分, 并call一下window)
/* jshint ignore:start */
if (callback) {
// if (typeof define === 'function' && define.amd) {
// //For backwards compatability
// var n_callback = callback;
// if (typeof requirejs === 'function') {
// requirejs(["strophe"], function (o) {
// n_callback(o.Strophe, o.$build, o.$msg, o.$iq, o.$pres);
// });
// } else {
// require(["strophe"], function (o) {
// n_callback(o.Strophe, o.$build, o.$msg, o.$iq, o.$pres);
// });
// }
// } else {
return callback(Strophe, $build, $msg, $iq, $pres);
// }
}
}).call(window, function (Strophe, build, msg, iq, pres) {
window.Strophe = Strophe;
window.$build = build;
window.$msg = msg;
window.$iq = iq;
window.$pres = pres;
});

请问为什么克隆在本地服务器上跑不起来?

$ npm run dev

[email protected] dev D:\git_repository\webrtc_Demo\web-im
cross-env NODE_ENV=develop node build/dev-server.js

D:\git_repository\webrtc_Demo\web-im
D:\git_repository\webrtc_Demo\web-im\node_modules\webpack\lib\webpack.js:19
throw new WebpackOptionsValidationError(webpackOptionsValidationErrors);
^

WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.

  • configuration.resolve.extensions[0] should not be empty.
    at webpack (D:\git_repository\webrtc_Demo\web-im\node_modules\webpack\lib\webpack.js:19:9)
    at Object. (D:\git_repository\webrtc_Demo\web-im\build\dev-server.js:5:22)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "D:\Program Files\nodejs\node.exe" "C:\Users\Feeling123\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "dev"
npm ERR! node v6.9.5
npm ERR! npm v4.1.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] dev: cross-env NODE_ENV=develop node build/dev-server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script 'cross-env NODE_ENV=develop node build/dev-server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the webim package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cross-env NODE_ENV=develop node build/dev-server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs webim
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls webim
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! D:\git_repository\webrtc_Demo\web-im\npm-debug.log

log方法未定义,导致有时调用无法返回结果

web-im/sdk/src/connection.js
第1889行

在浏览器环境中运行时,log方法不存在,导致之后的回调无法执行。

建议发布的版本中去掉log相关的代码,或加入开关控制,在打包release版本时去掉日志记录。

sdk 依赖有问题

我用npm install easemob-websdk 装好之后发现sdk依赖 crypto-js 和 underscore
然而sdk的package.json里没有写这些依赖,
我看到2.0的分支里面在 demo/ 的 package.json 里面又有这两个依赖,显然写错地方了
demo里面又用了lodash,lodash又在哪里引入的,一脸懵逼。
underscore 只用到了一个clone方法,而lodash里面也有,建议都改成lodash

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.