npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gme-electron-sdk

v2.1.3

Published

gme electron sdk

Downloads

21

Readme

Gme on Electron

跑通 DEMO

步骤1:创建新的应用

  1. 登录 游戏多媒体引擎控制台,选择【新建应用】。
  2. 输入应用名称,例如TestGme,开启需要的服务,单击【确定】。

步骤2:下载 SDK 和 Demo 源码

1、进入gme官网下载demo示例源码 Sample Project 下载,如下图所示:

选择【Electron】 平台/引擎中的【Sample Project下载】进行下载

步骤3:配置 Demo 工程文件

1、使用步骤1创建应用申请的appid及appkey 填充demo工程根目录下的demo.js 文件的对应信息 //用户信息 appid: "", authKey: "",

步骤4:编译运行

Windows 平台

  1. 下载最新版本的 Node.js 安装包,如果您的电脑是64位操作系统,请选择 Windows Installer (.msi) 64-bit,32位操作系统请选择 Windows Installer (.msi) 32-bit。
  2. 在命令行窗口切换到demo工程根目录下执行如下命令,安装依赖库
    $ npm install
  3. 待 npm 的依赖包都安装完成后,运行如下命令,即可运行起 Electron Demo。
    $ npm start

参考文档

https://cloud.tencent.com/document/product/607/18739

快速集成

step1. 通过npm下载gme sdk库

$ npm install gme-electron-sdk@latest --save

step2. 对接基本功能函数

//1、引入库
const { GmeContext } = require('gme-electron-sdk');
const {
     ITMG_MAIN_EVENT_TYPE,
     ITMG_ROOM_TYPE,
     ITMG_EVENT_ID_USER_UPDATE
 } = require('gme-electron-sdk/gmesdk/GmeType');
 
//2、构建 GmeContext
this.gmeContext = new GmeContext();

//3、 初始化 Gmesdk
initialize() {
	 this.initialized = true;
	 this.gmeContext.Init(this.appid, this.userId);
},

//4、注册回调

mounted: function () {
    setInterval(function () {
		//设置触发事件回调
        gmeContext.Poll();
    }, 50);

    gmeContext.SetTMGDelegate(this);
  },

//5、进房
enterRoom() {
	if (this.userId === null || this.userId === "" || this.roomId === null || this.roomId === "") {
		this.notify('房间号或用户号不能为空!', 'warning', '警告');
		return;
	}
	let userSig = this.gmeContext.GenAuthBuffer(this.appid, this.roomId, this.userId, this.authKey)
	this.gmeContext.EnterRoom(this.roomId, this.roomType, userSig);
},

//6、退房
exitRoom() {
	if (!this.inRoom) {
			return;
	}
	this.resetUI();
	this.gmeContext.ExitRoom();
},
		
//7、开启音频麦克风
onEnableMic() {
			this.gmeContext.EnableMic(this.micEnabled);
	},

//8、开启音频扬声器
onEnableSpeaker() {
			this.gmeContext.EnableSpeaker(this.speakerEnabled);
	},

//8、找个DOM结点,作为视频显示的view
findVideoView(uid, streamtype) {
    let key = uid + String(streamtype);
    var userVideoEl = document.getElementById(key);
    if (!userVideoEl) {
    userVideoEl = document.createElement('div');
    userVideoEl.id = key;
    userVideoEl.classList.add('video_view');
    document.querySelector("#video_wrap").appendChild(userVideoEl);
    }
    return userVideoEl;
},