GithubHelp home page GithubHelp logo

agoraio / agora-miniapp-tutorial Goto Github PK

View Code? Open in Web Editor NEW
103.0 56.0 44.0 304 KB

Hello world for Agora SDK running in https://en.wikipedia.org/wiki/WeChat#WeChat_Mini_Program

JavaScript 100.00%
agora rtc video audio weixin wechat wechat-mini-program hello-world

agora-miniapp-tutorial's Introduction

Agora Miniapp Tutorial

其他语言版本:简体中文

Introduction

Built upon the Agora Miniapp SDK, the Agora Miniapp Sample App is an open-source demo that integrates video chat and live broadcast into your Wechat Mini Application.

With this sample app, you can:

  • Integrate the Agora Miniapp SDK
  • Join a channel
  • Push your local stream to the channel
  • Subscribe to remote streams in the same channel
  • Leave a channel

Preparing the Developer Environment

  1. Ensure that you have installed the WeChat Developer Tool.
  2. Ensure that you have a wechat OpenPlatform account that supports live-pusher and live-player. Only certified corporate accounts in certain industry have access to these two components. For details, click here .
  3. Ensure that you have granted access to the following domains in your OpenPlatform account:

Running the App

  1. Create a developer account at Agora.io, create a new project and obtain an App ID, and enable the App Certificate.

  2. Download this project.

  3. Fill in the App ID in config.js in the utils folder of this project:

     const APPID = 'abcdefg'
    
  4. Contact [email protected] to abtain the Agora Miniapp SDK, and rename the SDK to "agora-miniapp-sdk.js".

  5. Save the "agora-miniapp-sdk.js" under the lib folder of this project.

  6. Start the WeChat Developer Tool and import this project.

  7. Enter a channel name and join a channel. Invite your friend to join in the same channel and you will be able to see each other.

About the Token/Dynamic Key

If you have enabled the App Certificate, you will need to generate the Token/Dynamic Key at the server for authentication purposes. Use it in the following method:

	//...
	client.join(<your key/access token here>, channel, uid, () => {
	//...

See Token or Dynamic Key for generating the Token or Key at the server.

Feedback

If you have any problems or suggestions regarding the sample projects, feel free to file an issue.

Related resources

  • Check our FAQ to see if your issue has been recorded.
  • Dive into Agora SDK Samples to see more tutorials
  • Take a look at Agora Use Case for more complicated real use case
  • Repositories managed by developer communities can be found at Agora Community
  • If you encounter problems during integration, feel free to ask questions in Stack Overflow

License

The sample projects are under the MIT license.

agora-miniapp-tutorial's People

Contributors

digitallysavvy avatar lemon-chen avatar matrixbirds avatar menthays avatar plutoless avatar qinzhen001 avatar shellgrace avatar williamdxz 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

agora-miniapp-tutorial's Issues

v1.1.3版本客户端初始化失败

在微信上配置了服务器域名
image

错误信息如下:

  • Inner error, request timeout
["Sat Nov 10 2018 14:27:27 GMT+0800 (**标准时间) [DEBUG]: ", "From choose server", {
	"data": {
		"reason": "Inner error, request timeout",
		"code": 500
	},
	"statusCode": 200,
	"header": {
		"Server": "nginx/1.4.6 (Ubuntu)",
		"Access-Control-Allow-Origin": "*",
		"Connection": "keep-alive",
		"Content-Type": "application/json; charset=utf-8",
		"Date": "Sat, 10 Nov 2018 06:27:27 GMT",
		"X-Powered-By": "Express",
		"Content-Length": "52",
		"Access-Control-Allow-Headers": "X-Requested-With,content-type",
		"Access-Control-Allow-Methods": "GET, POST, OPTIONS, PUT, PATCH, DELETE",
		"Etag": "W/\"34-lZwxwkNgNxU5H/3GS68MkyBsamQ\""
	},
	"errMsg": "request:ok"
}]
  • choose server fail
["Sat Nov 10 2018 14:27:27 GMT+0800 (**标准时间) [DEBUG]: ", "Report succcess: ", {
	"uri": 8001,
	"miniappSession": null,
	"miniappJoinChooseServer": {
		"header": {
			"sid": "9F2A3E31C7E8454D8B1FAFD0EF6BA859",
			"cname": "1000",
			"cid": null,
			"lts": 1541831247196,
			"ip": null,
			"uid": 385882,
			"success": false,
			"elapse": 10594,
			"peer": null
		},
		"csurl": "https://miniapp-2.agoraio.cn/appcenter/1-1-1/getWorkerManager/",
		"ec": "{\"code\":901,\"reason\":\"choose server fail\"}",
		"details": "{\"seq\":3}"
	},
	"miniappConnectWebSocket": null,
	"miniappJoin": null,
	"miniappPublish": null,
	"miniappUnpublish": null,
	"miniappSubscribe": null,
	"miniappUnsubscribe": null,
	"miniappLeave": null,
	"miniappServerEvent": null,
	"miniappPusherState": null,
	"miniappPlayerState": null
}]

如何集成sdk

您好,没有lib文件夹,sdk的js文件应该放在哪里呢?

小程序推流失败

小程序最新版本,应该是兼容问题,一部分手机是正常的,但是客户反馈推流失败

img_v2_06f79635-7dd6-4ce8-b650-b578ca957a9g

没有声音 也看不到对方

使用demo 说明 更换了appid 和token 加入频道成功了,但是看不到对方,也听不到任何声音,是为什么

miniapp service is not enabled for this AppID

输入房间名进入meeting界面后会出现该错误“miniapp service is not enabled for this AppID”,我是还没有申请live-plaer和live-pusher这两个的情况下测试,请问有可能是这个原因吗?还是其它原因导致?

小程序使G711版本

在小程序中使用sdk2.5.5版本,因为要使用特殊格式G711u,我是用2.5.5版本,加入房间所获得的url为空,导致房间一直加入不了,然后采取重连,url还是为空,请问如何解决?

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.