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

在直播行业如火如荼的当下,越来越多的企业选择发展自己的直播平台,或者希望在原有的app中上架音视频、直播功能。开发一个直播功能难易程度如何呢? 直播难:要想把直播从零开始做出来,技术难度还是很高的,因为直播中运用到的技术难点非常之多,视频/音频处理,图形处理,视频/音频压缩,CDN分发,即时通讯等技术,每一项技术都非常专业。 直播易:好在当下各个领域的大牛,已经封装好了许多牛逼的框架,我们只需要用别人写好的框架,就能快速的搭建一个直播app,也就是传说中的站在大牛肩膀上编程。 如何才能简单便利的搭建一个直播平台呢?以下用开发者在 FinClip 小程序中实现视频通话及互动直播等功能举例:
准备开发环境
1、请确保本地已安装微信开发者工具
2、请确保有一个支持 live-pusher 和 live-player 组件的微信公众平台账号。只有特定行业的认证企业账号才可使用这两个组件。详情查看FinClip文档中心:媒体组件 | 小程序开发帮助中心_小程序常见问题_小程序介绍-FinClip
3、请确保在微信公众平台账号的开发设置中,给予以下域名请求权限:
wss://miniapp.agoraio.cn
4、若使用的是1.1.2 BETA后的版本,则需要额外添加以下域名
运行示例程序
- 在 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, () => { //... |
边栏推荐
- mongodb 4. X binding multiple IP startup errors
- Day_ 08 smart health project - mobile terminal development - physical examination appointment
- Find the number of nodes in the widest layer of a binary tree
- 279.完全平方数
- Linked Storage
- sklearn sklearn中classification_report&精确度/召回率/F1值
- haas506 2.0开发教程-hota(仅支持2.2以上版本)
- Plot+seaborn+folium: a visual exploration of Abbey's rental housing data
- For non dpdk kvm1.0 machines, set init Maxrxbuffers changed from 256 to 1024 to improve packet receiving capacity
- C语言去除字符串尾部的换行(或其他字符)
猜你喜欢

如何实现与FDA保持邮件通信安全加密?

射频内容学习

开源生态|超实用开源License基础知识扫盲帖(下)

Machine learning 3-ridge regression, Lasso, variable selection technique

Day_ 11 smart communication health project - graphic report and poi Report

C # database reports errors. Let's have a look

Docker实战 -- 部署Redis集群与部署微服务项目

Jour 13 Projet de santé mentale - chapitre 13

haas506 2.0開發教程-高級組件庫-modem.sms(僅支持2.2以上版本)
百度URL參數之LINK?URL參數加密解密研究(代碼實例)
随机推荐
Linked Storage
sklearn sklearn中classification_report&精确度/召回率/F1值
Day_ 12 smart health project jasperreports
The softing datafeed OPC suite stores Siemens PLC data in an Oracle Database
There are so many code comments! I laughed
Given a node of a binary tree, return the successor node of the node
Synchronous switching power supply reduces EMI layout dv/dt di/dt
Link of Baidu URL parameter? Research on URL parameter encryption and decryption (code example)
C# wpf 通过绑定实现控件动态加载
Day_13 傳智健康項目-第13章
Leetcode topic resolution single number
Day_ 07 smart communication health project FreeMarker
C language obtains second, millisecond, subtle and nanosecond timestamps
快速认识 WebAssembly
How to query fields separated by commas in MySQL as query criteria - find_ in_ Set() function
Day_ 04 smart health project - appointment management - package management
Illuminate\support\collection de duplication unique list de duplication
C Advanced Learning -- Reflection
Docker practice - redis cluster deployment and micro service deployment project
C# wpf 附加属性实现界面上定义装饰器