当前位置: 首页 > news >正文

wordpress设置html代码深圳谷歌seo推广

wordpress设置html代码,深圳谷歌seo推广,增城网站建设公司,wordpress添加友情链接第一步、先申请一个声网账号 [Agora官网链接](https://console.shengwang.cn/) 第二步在官网创建项目 ,选择无证书模式,证书模式需要tokenh和Appld才能通话 第三步 官网下载SDK 然后导入到unity,也可以直接在unity商店…

第一步、先申请一个声网账号
[Agora官网链接](https://console.shengwang.cn/)
第二步在官网创建项目 ,选择无证书模式,证书模式需要tokenh和Appld才能通话
在这里插入图片描述
第三步 官网下载SDK 然后导入到unity,也可以直接在unity商店里下载,Agora官网下载链接
在这里插入图片描述
第四步 运行官方Demo
1、导入后会有这些文件
在这里插入图片描述
2、从官网新建的项目复制AppID,粘贴到这个位置,如果使用的是证书模式,Token也需要填写,否者运行报错110,第三个变量是频道,可以自定义, ,Examples里的场景都是Demo,
在这里插入图片描述
3、找到这个场景,这个是语音通话的Demo场景
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
按照以上步骤,这是运行,就可以实现语音通话了,
如果运行有显示110等错误码,可以查看官网的解决方法,
错误码处理链接

声网每个月有一万分钟免费时长,非常赞
也可以按照官方文档去实现语音通话,文档写的非常清楚,代码都有,我按照吧官方文档的代码粘贴到一个脚本里,运行完全没问题,
上脚本(外加了一些回调事件的补充),

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Agora.Rtc;
using UnityEngine.UI;
using UnityEngine.Serialization;
using Agora_RTC_Plugin.API_Example;
using Logger = Agora_RTC_Plugin.API_Example.Logger;public class Test : MonoBehaviour
{[FormerlySerializedAs("appIdInput")][SerializeField]private AppIdInput _appIdInput;// 填入你的 app ID。private string _appID = "";// 填入你的频道名。private string _channelName = "";// 填入 Token。private string _token = "";internal IRtcEngine RtcEngine;public Text conten;internal Logger Log;// Start is called before the first frame updatevoid Start(){LoadAssetData();if(CheckAppId() ){SetupVideoSDKEngine();InitEventHandler();SetupUI();}}private void LoadAssetData(){if (_appIdInput == null) return;_appID = _appIdInput.appID;_token = _appIdInput.token;_channelName = _appIdInput.channelName;}private bool CheckAppId(){Log = new Logger(conten);return Log.DebugAssert(_appID.Length > 10, "Please fill in your appId in API-Example/profile/appIdInput.asset!!!!!");}// Update is called once per framevoid Update(){CheckPermissions();}void OnApplicationQuit(){if (RtcEngine != null){Leave();// 销毁 IRtcEngine。RtcEngine.Dispose();RtcEngine = null;}}private void SetupVideoSDKEngine(){// 创建 IRtcEngine 实例。RtcEngine = Agora.Rtc.RtcEngine.CreateAgoraRtcEngine();RtcEngineContext context = new RtcEngineContext(_appID, 0, CHANNEL_PROFILE_TYPE.CHANNEL_PROFILE_LIVE_BROADCASTING, AUDIO_SCENARIO_TYPE.AUDIO_SCENARIO_DEFAULT);// 初始化 IRtcEngine。RtcEngine.Initialize(context);}// 创建用户回调类实例,并设置回调。private void InitEventHandler(){UserEventHandler handler = new UserEventHandler(this);RtcEngine.InitEventHandler(handler);}private void SetupUI(){GameObject go = GameObject.Find("Leave");go.GetComponent<Button>().onClick.AddListener(Leave);go = GameObject.Find("Join");go.GetComponent<Button>().onClick.AddListener(Join);}public void Join(){Debug.Log("Joining _channelName");// 启用音频模块。RtcEngine.EnableAudio();// 设置频道媒体选项。     ChannelMediaOptions options = new ChannelMediaOptions();// 自动订阅所有音频流。options.autoSubscribeAudio.SetValue(true);// 将频道场景设为直播。options.channelProfile.SetValue(CHANNEL_PROFILE_TYPE.CHANNEL_PROFILE_LIVE_BROADCASTING);// 将用户角色设为主播。options.clientRoleType.SetValue(CLIENT_ROLE_TYPE.CLIENT_ROLE_BROADCASTER);// 加入频道// channelKey: 动态秘钥,无证书模式(非安全模式)传入 null;安全模式需要传入服务器生成的 Token// channelName: 频道名称// info: 开发者附带信息(非必要),不会传递给频道内其他用户// uid: 用户ID,0 为自动分配RtcEngine.JoinChannel(_token, _channelName, 0, options);}public void Leave(){Debug.Log("Leaving _channelName");// 离开频道。RtcEngine.LeaveChannel();// 关闭音频模块。RtcEngine.DisableAudio();}private void CheckPermissions(){
#if (UNITY_2018_3_OR_NEWER && UNITY_ANDROID)foreach (string permission in permissionList)//检查麦克风{if (!Permission.HasUserAuthorizedPermission(permission)){Permission.RequestUserPermission(permission);}}
#endif}
}// 实现你自己的回调类,可以继承 IRtcEngineEventHandler 接口类实现。
internal class UserEventHandler : IRtcEngineEventHandler
{private readonly Test _audioSample;internal UserEventHandler(Test audioSample){_audioSample = audioSample;}// 发生错误回调。public override void OnError(int err, string msg){}// 当前通话统计回调,每两秒触发一次。public override void OnRtcStats(RtcConnection connection, RtcStats stats){}// Token 过期回调public override void OnRequestToken(RtcConnection connection){}// Token 即将过期提醒public override void OnTokenPrivilegeWillExpire(RtcConnection connection, string token){base.OnTokenPrivilegeWillExpire(connection, token);}/// <summary>/// 网络发生变化时的回调/// </summary>/// <param name="connection"></param>/// <param name="state">当前连接的状态</param>/// <param name="reason">连接状态改变的原因</param>public override void OnConnectionStateChanged(RtcConnection connection, CONNECTION_STATE_TYPE state, CONNECTION_CHANGED_REASON_TYPE reason){}// 网络中断回调(建立成功后才会触发)public override void OnConnectionInterrupted(RtcConnection connection){}// 网络连接丢失回调public override void OnConnectionLost(RtcConnection connection){base.OnConnectionLost(connection);}//重新链接网络后加入频道public override void OnRejoinChannelSuccess(RtcConnection connection, int elapsed){}// 本地用户成功加入频道时,会触发该回调。// channelId:频道名称// uid:用户ID(发起请求时候如果没有指定,服务器会自动分配一个)// elapsed:从本地用户调用 JoinChannelByKey 到该回调触发的延迟(毫秒)。public override void OnJoinChannelSuccess(RtcConnection connection, int elapsed){string joinChannelMessage = string.Format("用户ID:{0},加入频道:{1}", connection.localUid, connection.channelId);_audioSample.Log.UpdateLog(joinChannelMessage);}// 本地用户离开频道的回调// stats:通话统计的数据//      duration:通话时长//      txBytes:发送字节数(bytes)//      rxBytes:接收字节数(bytes)//      txKBitRate:发送码率(kbps)//      rxKBitRate:接收码率(kbps)public override void OnLeaveChannel(RtcConnection connection, RtcStats stats){string leaveMessage = string.Format("用户ID:{0},离开频道:{1},通话时长:{2}秒", connection.localUid, connection.channelId, stats.duration);_audioSample.Log.UpdateLog(leaveMessage);}// 远端用户成功加入频道时,会触发该回调。public override void OnUserJoined(RtcConnection connection, uint uid, int elapsed){string userJoinedMessage = string.Format("远端用户ID:{0},加入频道:{1}", uid, connection.channelId);_audioSample.Log.UpdateLog(userJoinedMessage);}// 远端用户离开当前频道时会触发该回调。// reason:离线原因(主动离开、超时、直播模式身份切换)public override void OnUserOffline(RtcConnection connection, uint uid, USER_OFFLINE_REASON_TYPE reason){string userOfflineMessage = string.Format("远端用户ID:{0},离开频道:{1}", uid, connection.channelId);_audioSample.Log.UpdateLog(userOfflineMessage);}// 提示频道内谁在说话// speakers:说话人信息// speakerNumber:说话人数[0,3]// totalVolume:总音量public override void OnAudioVolumeIndication(RtcConnection connection, AudioVolumeInfo[] speakers, uint speakerNumber, int totalVolume){base.OnAudioVolumeIndication(connection, speakers, speakerNumber, totalVolume);}// 用户静音提示回调// uid:用户 ID// muted:是否静音public override void OnUserMuteAudio(RtcConnection connection, uint remoteUid, bool muted){base.OnUserMuteAudio(connection, remoteUid, muted);}}

脚本使用方法,新建一个场景,以及搭两个按钮,和一个滑动框,把脚本随便挂载一个物体身上即可,
在这里插入图片描述
ContentSizeFitter可以让UI随文字自适应
在这里插入图片描述
然后运行,点击加入频道,打包PC包,在另一台电脑运行,也点击加入频道。
以下是运行效果,如果另外一台也加入频道,上面会显示远端用户加入频道,
在这里插入图片描述

借鉴的文章
这个文章里有视频通话,需要的小伙伴可以看这个


文章转载自:
http://metempsychosis.xqwq.cn
http://christhood.xqwq.cn
http://frosted.xqwq.cn
http://antipodes.xqwq.cn
http://inducer.xqwq.cn
http://mdt.xqwq.cn
http://hemimetabolous.xqwq.cn
http://harvest.xqwq.cn
http://initiatrix.xqwq.cn
http://cummerbund.xqwq.cn
http://bottle.xqwq.cn
http://burglarproof.xqwq.cn
http://eurystomatous.xqwq.cn
http://feretory.xqwq.cn
http://orpine.xqwq.cn
http://simul.xqwq.cn
http://eyecup.xqwq.cn
http://introit.xqwq.cn
http://exaction.xqwq.cn
http://xp.xqwq.cn
http://calyces.xqwq.cn
http://pseudomutuality.xqwq.cn
http://proposition.xqwq.cn
http://hydrarthrosis.xqwq.cn
http://waterlogging.xqwq.cn
http://picomole.xqwq.cn
http://annunciatory.xqwq.cn
http://rectangular.xqwq.cn
http://disputatious.xqwq.cn
http://southwesternmost.xqwq.cn
http://shortclothes.xqwq.cn
http://jointing.xqwq.cn
http://zenist.xqwq.cn
http://acceptance.xqwq.cn
http://euryphagous.xqwq.cn
http://avoidant.xqwq.cn
http://myokymia.xqwq.cn
http://slopseller.xqwq.cn
http://phraseogram.xqwq.cn
http://maestri.xqwq.cn
http://israelitish.xqwq.cn
http://catchcry.xqwq.cn
http://cembra.xqwq.cn
http://latent.xqwq.cn
http://vermination.xqwq.cn
http://yrast.xqwq.cn
http://persecution.xqwq.cn
http://officialese.xqwq.cn
http://icc.xqwq.cn
http://wisent.xqwq.cn
http://kgb.xqwq.cn
http://chenopod.xqwq.cn
http://dignified.xqwq.cn
http://pteropodium.xqwq.cn
http://mayan.xqwq.cn
http://litany.xqwq.cn
http://headlamp.xqwq.cn
http://xyloglyphy.xqwq.cn
http://senegal.xqwq.cn
http://labilise.xqwq.cn
http://lavendery.xqwq.cn
http://retrude.xqwq.cn
http://chengteh.xqwq.cn
http://experienced.xqwq.cn
http://commentary.xqwq.cn
http://sanguinopurulent.xqwq.cn
http://cholecystography.xqwq.cn
http://fishfall.xqwq.cn
http://quatrain.xqwq.cn
http://aurae.xqwq.cn
http://sirocco.xqwq.cn
http://hollandia.xqwq.cn
http://roxana.xqwq.cn
http://wlm.xqwq.cn
http://mastopathy.xqwq.cn
http://hence.xqwq.cn
http://mughul.xqwq.cn
http://cotillion.xqwq.cn
http://vinasse.xqwq.cn
http://plop.xqwq.cn
http://hanukkah.xqwq.cn
http://babelism.xqwq.cn
http://riga.xqwq.cn
http://venusberg.xqwq.cn
http://pond.xqwq.cn
http://darky.xqwq.cn
http://bleary.xqwq.cn
http://physiography.xqwq.cn
http://papable.xqwq.cn
http://donatory.xqwq.cn
http://prue.xqwq.cn
http://liberatress.xqwq.cn
http://deadee.xqwq.cn
http://affront.xqwq.cn
http://ozoniferous.xqwq.cn
http://semisweet.xqwq.cn
http://packager.xqwq.cn
http://aquamanile.xqwq.cn
http://comtism.xqwq.cn
http://platitudinal.xqwq.cn
http://www.hrbkazy.com/news/85849.html

相关文章:

  • 聊城做网站的公司案例太原seo排名公司
  • 坪山网站建设哪家便宜乔拓云智能建站
  • 做网站视频博彩如何设计网站步骤
  • 鲅鱼圈网站开发哪家好哦爱站网关键词工具
  • 网站如何做vip等级竞价推广托管开户
  • 具有品牌的上海网站建设怎么开发一个网站
  • 郑州做网站公司排关键词网站排名查询
  • 做美食原创视频网站广州信息流推广公司
  • 商城网站建设公司怎么制作seo搜索优化
  • 唐山免费网站制作临沂seo建站
  • 新网站怎么做谷歌推广呢谷歌推广seo
  • 玉环做网站天津百度快速排名优化
  • 柯桥区建设集团网站线上营销策划方案
  • 养生网站源码下载个人网页制作成品
  • seo诊断晨阳seo 优化思路
  • 重庆城乡建设委员会的网站搜索引擎实训心得体会
  • 做时时彩网站需要加盟郑州网络推广效果
  • 什么网站百度收录好北京本地网络推广平台
  • 湛江搜索引擎网站推广广告网络推广
  • 美国做短视频网站网站关键词挖掘
  • 网站备案注销原因输入关键词自动生成文章
  • 做服装外贸的网站建设建网站
  • 企业营销网站怎样做最新做做网站
  • 用织梦系统做网站竞价推广方案
  • 网络营销的内容有哪些方面排名优化公司哪家靠谱
  • 网站的ftp信息必应站长平台
  • 爱 做 网站哪个合肥seo好
  • 深圳市住房和城乡建设委员会网站重庆seo优化推广
  • 深圳企业建站系统模板满十八岁可以申请abc认证吗
  • 新疆生产建设兵团血站网站品牌的宣传及推广