Git Product home page Git Product logo

egret-target-wxgame's People

Contributors

eos3tion avatar lijianegret avatar quietrain avatar runinspring avatar wanderwang avatar yanghanggit 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

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

egret-target-wxgame's Issues

微信小游戏在预加载声音的时候可能卡住

            var audio = new Audio(url);
            audio.addEventListener("canplaythrough", onAudioLoaded);
            audio.addEventListener("error", onAudioError);
            var ua = navigator.userAgent.toLowerCase();
            if (ua.indexOf("firefox") >= 0) {
                audio.autoplay = !0;
                audio.muted = true;
            }
            // audio.load();     wxgame没有此接口
            this.originAudio = audio;
            if (HtmlSound.clearAudios[this.url]) {
                delete HtmlSound.clearAudios[this.url];
            }
            HtmlSound.$recycle(this.url, audio);
            function onAudioLoaded() {
                removeListeners();
                if (ua.indexOf("firefox") >= 0) {
                    audio.pause();
                    audio.muted = false;
                }
                self.loaded = true;
                self.dispatchEventWith(egret.Event.COMPLETE);
            }
            function onAudioError() {
                removeListeners();
                self.dispatchEventWith(egret.IOErrorEvent.IO_ERROR);
            }

有一定的概率出现onAudioLoaded和onAudioError回调均不触发的情况

could not find name "wx"

RT.
您安装的最新引擎版本为 5.2.8
当前项目使用版本为 5.1.7
您可以执行 egret upgrade 命令升级项目
您正在使用白鹭编译器 5.1.7 版本
正在编译项目...
Error D:/Egret/egret-target-wxgame-1.1.7/demos/openDataContext/openDataContext/src/Main.ts (53,31): Cannot find name 'wx'.
Error D:/Egret/egret-target-wxgame-1.1.7/demos/openDataContext/openDataContext/src/Main.ts (165,13): Cannot find name 'wx'.
项目共计编译耗时:4.286秒
编译项目失败

WebSocket connectByUrl 收不到回调

版本egret-wxgame-support-1.3.5

有关代码:egret.wxgame.js 第2116行:
WXSocket.prototype.connectByUrl = function (url) { this.socketTask = wx.connectSocket({ url: url }); this._bindEvent(); };
现象:
我在微信小游戏里面调用WebSocket.connectByUrl("wss://192.168.70.209:8001")。收不到任何事件(包括连接成功和错误)。
我在上面的代码里面,给wx.connectSocket的参数传入success,failed,complete函数来调试。
结果success函数和complete函数都被调用到了。而且居然是在执行 this._bindEvent();之前被调用到。
而对外事件绑定的socketTask的那些回调还没有被设置进去。

解决方案:
请修复一下,设置一个标志,如果还没有执行到this._bindEvent(),则使用success和failed函数来调用onOpen和onError。

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.