Project Configuration

Last updated: 2019-11-01 11:16:56

PDF

Overview

Thank you for using Tencent Cloud Game Multimedia Engine (GME) SDK. This document provides project configuration that makes it easy for H5 developers to debug and access the APIs for GME.

Platforms Supported by H5 SDK

Operating System Browser/Webview Version Notes
iOS Safari 11.1.2 Since bugs still emerge occasionally in Apple Safari, we recommend that you restrain from developing iOS products with H5 SDK before Apple fixes the bugs.
Android TBS (The default Webview of WeChat and Mobile QQ) 43600 The default built-in browser kernel in WeChat and Mobile QQ is TBS.
Chrome 60+ H264 should be supported
Mac Chrome 47+ -
Safari 11+ -
Windows(PC) Chrome 52+ -
QQ Browser 10.2 -

SDK Preparation

You can obtain the SDK by the following steps:

  1. Download applicable Demo and SDK from Download Guide.
  2. Locate the SDK resource for H5 on the page.
  3. Click Download.

Preparations

1. Open ports

If you have configured a firewall for your network, make sure you've opened the following ports:

Protocol Port
TCP 8687
UDP 8000, 8800, and 443

Introduce SDK using CDN.

2. Introduce WebRTCAPI.min.js

html
<script src="https://sqimg.qq.com/expert_qq/webrtc/3.0/WebRTCAPI.min.js"></script>

3. Configure H5 authentication

Download the program

Download the authBuffer program sample, which can sign the authentication information for the specified sdkappid.

Modify as required

Go to the signdemo directory and modify the config.js file: Open the config.js file, delete the default configuration, and call the appidMap function in the place where the code is deleted. The parameters are the SDKAppid applied in Tencent Cloud backend and the corresponding authentication key.

const AuthBufferConfig = function () {
    this.appidMap = {};
    this.appidMap["1400089356"] = "1cfbfd2a1a03a53e";
};
// Replace 1400089356 with the sdkAppid applied in Tencent Cloud backend, and replace 1cfbfd2a1a03a53e with the authentication key corresponding to the sdkAppid

AuthKey must correspond to your sdkAppid.

Install and run npm package

Go to the directory where the authBuffer program sample resides, and execute the following statement to install the dependencies:

npm i

Then, execute the script "node index.js" to run the signature service.

As the async syntax is used, make sure your node is above version 8. Execute "node -v" in the command line to view the version.

Test

You can input the following command in the command line for test (make sure there is the curl command in the system):

// Generate userSig:
curl "http://127.0.0.1:10005/" --data "sdkappid=1400089356&roomid=1234123&openid=1234567"

Return sample

After executing the signature program, the signature program will return the authentication information, and the reference sample is as follows:

{"userSig":"AqhHE7QHLFYPfV/zfyrdRYHfuUn6eOA8g/J6GMjVy//Shr5ByJPTi8hzR2KyXMvn","errorCode":0}