当前位置:网站首页>小程序中实现视频通话及互动直播功能
小程序中实现视频通话及互动直播功能
2022-06-26 04:15:00 【Finbird】
最近,新东方在线旗下直播间东方甄选以双语带货、寓教于乐等特色火速出圈。被东方甄选直播“圈粉”的人直呼,“躲过了薇娅、李佳琦,却没躲过董宇辉”。近年来,视频、直播电商高速增长,主要原因是视频、直播内容能够承载较图文内容更为丰富的信息、用户接受度更高。随着直播渗透率不断加深,已经与娱乐、学习、购物、工作等越来越多场景融合在一起。在互联网发展的下半场,随着头部互联网平台的布局与垂直领域应用的发展,直播行业将迎来更多元化的应用场景,潜在用户规模将继续扩大。

在直播行业如火如荼的当下,越来越多的企业选择发展自己的直播平台,或者希望在原有的app中上架音视频、直播功能。开发一个直播功能难易程度如何呢?
直播难:要想把直播从零开始做出来,技术难度还是很高的,因为直播中运用到的技术难点非常之多,视频/音频处理,图形处理,视频/音频压缩,CDN分发,即时通讯等技术,每一项技术都非常专业。
直播易:好在当下各个领域的大牛,已经封装好了许多牛逼的框架,我们只需要用别人写好的框架,就能快速的搭建一个直播app,也就是传说中的站在大牛肩膀上编程。
如何才能简单便利的搭建一个直播平台呢?以下用开发者在 FinClip 小程序中实现视频通话及互动直播等功能举例:
准备开发环境
1、请确保本地已安装微信开发者工具
2、请确保有一个支持 live-pusher 和 live-player 组件的微信公众平台账号。只有特定行业的认证企业账号才可使用这两个组件。详情查看FinClip文档中心:https://www.finclip.com/mop/document/develop/component/media.html#live-pusher
3、请确保在微信公众平台账号的开发设置中,给予以下域名请求权限:
- https://miniapp.agoraio.cn
- https://uni-webcollector.agora.io
- wss://miniapp.agoraio.cn
4、若使用的是1.1.2 BETA后的版本,则需要额外添加以下域名
- https://miniapp-1.agoraio.cn
- https://miniapp-2.agoraio.cn
- https://miniapp-3.agoraio.cn
- https://miniapp-4.agoraio.cn
运行示例程序
在 FinClip 与 Agora.io 注册账号,并创建自己的测试项目,获取 App ID。如需获取 Token 或 Channel Key,请启用 App Certificate
下载本页示例程序
打开 utils 文件夹,在 config.js 文件中填入获取到的 App ID:
const APPID = 'abcdefg'下载 Agora Miniapp SDK,并将 SDK 重新命名为 “mini-app-sdk-production.js"
将更名后的 "mini-app-sdk-production.js" 文件保存在本示例程序的 lib 文件夹下
启动微信开发者工具并导入该示例程序
输入频道名,加入频道。邀请你的朋友加入同一个频道,就可以开始视频互通了。
声网的 Native SDK 可以直接与小程序互通。
关于 Token/Dynamic Key
如果启用了 App Certificate,还需要在服务端生成 Token 或 Dynamic Key 用于鉴权。将生成的 Token 或 Dynamic Key 填入如下方法中:
//... client.join(<your key/access token here>, channel, uid, () => { //...关于如何生成 Token 或 Dynamic Key 详见 Token 或 Dynamic Key。
边栏推荐
- Webrtc series - 6-connections tailoring for network transmission
- College C language final exam · multiple choice questions · summary notes of mistakes and difficulties
- mysql自带的性能测试工具mysqlslap执行压力测试
- What are the advantages and risks of paper gold investment
- (15) Blender source code analysis flash window display menu function
- Unity移动端游戏性能优化简谱之 以引擎模块为划分的CPU耗时调优
- 1. foundation closing
- [Qunhui] command line acme SH automatically apply for domain name certificate
- Knowledge of functions
- How to solve the problem that iterative semi supervised training is difficult to implement in ASR training? RTC dev Meetup
猜你喜欢

Matplotlib multi line chart, dot scatter chart

How does virtual box virtual machine software accelerate the network speed in the virtual system?

Wechat applet is bound to a dynamic array to implement a custom radio box (after clicking the button, disable the button and enable other buttons)

matplotlib折线图,文字显示,win10

1. foundation closing

Conditional variables for thread synchronization

Capture packets (Wireshark)

Etcd watch principle

第 4 篇:绘制四边形

What's wrong with connecting MySQL database with eclipse and then the words in the figure appear
随机推荐
Using jsup to extract images from interfaces
Force buckle 515 Find the maximum value in each tree row
VHDL设计
Redis cache data consistency solution analysis
Threejs专用天空盒素材,五种天空盒素材免费下载
Getter actual combat geTx tool class encapsulation -getutils
[Qunhui] Internet access + custom port
(15) Blender source code analysis flash window display menu function
35岁程序员炒Luna 千万资产3天归零,网友:和赌博一样
在出海获客这件事上,数字广告投放之外,广告主还能怎么玩儿?
Threejs special sky box materials, five kinds of sky box materials are downloaded for free
Mutex of thread synchronization (mutex)
matplotlib多条折线图,点散图
Yolov5 improvements: replace the backbone
Etcd watch principle
BSC 及HT 等链的NFT 创造及绑定图片教程
线程同步之条件变量
College C language final exam · multiple choice questions · summary notes of mistakes and difficulties
线程同步之互斥量(互斥锁)
MapReduce execution principle record