uni-app直播开发教程

news2024/10/6 18:33:12

第三方平台选型:腾讯、阿里、即构、声网

由于即构直播平台支持uni-app故本文章选用的是即构sdk版讲解

一、效果

二、sdk集成

     1、  首先注册即构平台账号,然后对照即构官网一步步集成

主要分为sdk插件集成与JS 封装层集成这两部分,具体步骤请移步官网查看。

uni-app实时音视频示例源码下载 - 开发者中心 - ZEGO即构科技

   

   2、调试,即构官网提供了pc网页直播推流地址,如下

    推拉流基础功能

         需要到控制台获取自己创建的AppIDRoomID、UserID、Token、StreamID,填入其中,app直播端也需要填写一样的appid.有关app部分下一步再讲。需要注意的是,直播端与观众端的AppIDRoomID、StreamID三个需要一致才可看到对方的直播。

  

3、app端代码

需要修改 appSign、AppID,修改成自己的。

<template>
	<view class="colum_layout">
		<!-- 状态栏 -->
		<view class="title" style="width: 100%;height: 70rpx;background-color: black;"></view>
		<!-- <zego-local-view style="height: 300rpx;width: 400rpx;position: absolute;display: flex;z-index:999"></zego-local-view> -->

		<!-- 拉流布局 -->
		<view class="live_parent" @click="hide_edit">
			<zego-remote-view class="live_play" :streamID="playStreamID" :viewMode="AspectFit=1">
			</zego-remote-view>
		</view>

		<!-- 在线人数 -->
		<view class="onlines">
			<text class="user_name">昵称:医生</text>
			<!-- @click="loginOut" -->
			<view class="onlineMd">
				<text class="onlineTag">在线</text>
				<text class="online_num">{{online}}</text>
				<image @click="closed" style="width: 40rpx;height: 40rpx; margin-right: 40rpx;" src="/static/cha.png">
				</image>
			</view>
		</view>

		<!-- 消息列表 -->
		<view :class="isShowKeyboad?'msg_list_height':'msg_list_low'">
			<scroll-view scroll-y="true" class="list-content" show-scrollbar="false" :enhanced="true" :bounces="false"
				:scroll-with-animation="true" :scroll-top="commentScrollTop">
				<view class="list-item" id="commentContent" v-for="(item,index) in msg" :key="index">
					<!-- item.fromUser.userName -->
					<text class="person_title">{{item.fromUser.userName}}</text>
					<!-- item.message -->
					<text class="content_body">{{item.message}}</text>
				</view>
			</scroll-view>
		</view>

		<!-- 消息输入 -->
		<view class="enter_input" v-if="isShowKeyboad">
			<textarea class="input_reply_msg" maxlength="50" :show-confirm-bar="false" v-model="msg_enter" auto-height
				focus='true' placeholder="请输入消息" @input="inputHandle" />
			<text class="send_msg" @click="sendMsg">发送</text>
		</view>

		<!-- 消息反馈模块 -->
		<view class="interaction" v-if="!isShowKeyboad">
			<!-- <view> -->
			<!-- <zego-local-view class="push_live"></zego-local-view> -->
			<!-- </view> -->
			<text class="input_msg" @click="inputMsg">说点什么吧...</text>
			<!-- <text class="like_click" @click="likeClick">点赞</text> -->
			<likeButton :throttle="100" :large="2" :site="[60, 160]"
				style="display: flex;position: fixed;bottom: 32rpx;right: 30rpx;">
			</likeButton>

		</view>
	</view>
</template>

<script>
	// 导入权限工具类
	import permision from "@/pages/permission.js";
	// 导入直播引擎
	import ZegoExpressEngine from '@/components/zego-ZegoExpressUniApp-JS/lib/ZegoExpressEngine';
	// 导入推流布局组件
	import ZegoLocalView from '@/components/zego-ZegoExpressUniApp-JS/zego-view/ZegoLocalView';
	// 导入拉流布局组件
	import ZegoRemoteView from '@/components/zego-ZegoExpressUniApp-JS/zego-view/ZegoRemoteView';

	//点赞按钮
	import likeButton from '@/components/like-button/like-button.vue';

	export default {
		components: {
			ZegoLocalView: ZegoLocalView,
			ZegoRemoteView: ZegoRemoteView,
			ZegoExpressEngine,
			likeButton
		},
		data() {
			return {
				title: 'Hello',
				isShowKeyboad: false,
				msg_enter: "",
				engine: undefined,
				playStreamID: 'streamID123',
				msg: [],
				commentScrollTop: 999999, //评论区滚动高度
				roomID: 'mghome123', //房间id
				userID: '222222', //用户id
				userName: '医生', //用户名
				online: 0, //在线用户数
			}
		},

		onLoad: function(option) { //option为object类型,会序列化上个页面传递的参数
			console.log("=====打印出上个页面传递的参数=="); //打印出上个页面传递的参数。

			this.userID = Math.floor(Math.random(10000) * 10000) + ""; //用户id
			this.userName = option.usName; //用户名
		},


		//返回键
		onBackPress() {
			console.log("===onBackPress===");
			this.loginOut();

		},

		created() {
			this.playStreamID = 'streamID123';
		},

		onReady() {
			this.playStreamID = 'streamID123';

			var that = this;
			this.initZegoExpressEngine();


		},
		
		//隐藏
		onHide() {
			that.logoutRoom(that.roomID);
		},

		mounted() {

		},

		methods: {
			async initZegoExpressEngine() {
				var that = this;

				console.log("==mounted==");
				//Android 权限请求
				if (uni.getSystemInfoSync().platform === "android") {
					await permision.requestAndroidPermission(
						"android.permission.RECORD_AUDIO"
					);
					await permision.requestAndroidPermission(
						"android.permission.CAMERA"
					);
				}


				//异步按顺序执行
				new Promise(res => {
					that.createEngine(); //创建视频流引擎

					setTimeout(() => {
						console.log("===mogu===");
						res();

					}, 100);

				}).then(res => {
					console.log("===mogu11===");

					//登录房间
					that.loginRoom(that.roomID, that.userID, that.userName);

				}).then(res => {
					console.log("===mogu22===");

					that.addListeners(); //添加监听

				});
			},

			//关闭页面
			closed() {
				this.loginOut();
			},

			//登出sasaa
			loginOut() {
				var that = this;
				that.engine.stopPlayingStream(that.playStreamID);

				that.logoutRoom(that.roomID);

				ZegoExpressEngine.destroyEngine(res => {

				});

				uni.reLaunch({
					url: '/pages/login/login'
				})
				// plus.runtime.quit();
			},

			//发送消息
			sendMsg: function(e) {
				var that = this;
				// console.log("====发送消息====" + JSON.stringify(this.engine));

				if (this.msg_enter == '' || this.msg_enter.length == 0) {
					uni.showToast({
						title: '输入不能为空',
						icon: "error",
						duration: 2000
					});
					return 1;
				}

				let msgConn = [{
					"sendTime": 1687763213632,
					"message": "" + this.msg_enter,
					"messageID": 1,
					"fromUser": {
						"userID": this.userID,
						"userName": this.userName
					}
				}];

				that.msgListDeal(msgConn);

				// 发送广播消息,每个登录房间的用户都会通过 IMRecvBroadcastMessage 回调事件收到此消息
				this.engine.sendBroadcastMessage('mghome123', "" + this.$data.msg_enter).then((
					result) => {
					// 获取消息发送结果
					console.log("====按钮发送====" + JSON.stringify(result));

					that.msg_enter = '';

					//隐藏软键盘方法
					that.hide_edit();

				})

			},

			// 接收消息
			receiverMsg: function(e) {
				var that = this;
				this.engine.on("IMRecvBroadcastMessage", (mghome, messageList) => {

					console.log("==1111==" + JSON.stringify(that.$data.msg));

					that.msgListDeal(messageList);

					console.log("==2222==" + JSON.stringify(that.$data.msg));

				});

				this.engine.on('IMRecvBarrageMessage', (mghome, messageList) => {
					console.log("===received barrage message==" + JSON.stringify(messageList))
				});

				// this.engine.on('IMRecvCustomCommand', (mghome, fromUser, command) => {
				//       console.log("("===received custom command=="+JSON.stringify(messageList)) 
				// })
			},

			//消息列表显示处理e
			msgListDeal: function(messageList) {
				var that = this;

				if (that.$data.msg.length >= 10) { //只显示最新10条消息
					that.$data.msg.shift();
				}

				that.$data.msg.push(...messageList); //新消息添加

				setTimeout(() => {
					this.commentScrollTop = this.commentScrollTop + 1;
				}, 100);

			},

			//键盘监听
			keyBoardHeightListener: function(e) {
				uni.onKeyboardHeightChange(res => {
					if (res.height == '0') { //隐藏键盘
						this.$data.isShowKeyboad = false;
					}

				})
			},

			//输入消息监听
			inputHandle(e) {

				this.$data.msg_enter = e.detail.value;

				console.log("==输入消息监听===" + e.detail.value)
			},

			// 键盘弹出
			inputMsg() {
				this.$data.isShowKeyboad = true;
				// console.log("===键盘弹出===");

			},


			//隐藏键盘
			hide_edit(e) {

				console.log("===隐藏软键盘方法===");
				this.$data.isShowKeyboad = false;
				uni.hideKeyboard() //隐藏软键盘方法

			},

			//创建引擎 
			async createEngine() {
				// 采用通用场景
				const profile = {
					appID: ,//换成自己的appid
					// AppSign 仅满足简单的鉴权需求,如果需要升级为更加安全的鉴权方式,请参考[如何从 AppSign 鉴权升级为 Token 鉴权](https://doc-zh.zego.im/faq/token_upgrade?product=ExpressVideo&platform=all)
					// AppSign 可通过[控制台](https://console.zego.im/dashboard)获取,格式为 @"39011cbxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
					appSign: '',//换成自己的appSign
					scenario: 0
				};

				this.engine = await ZegoExpressEngine.createEngineWithProfile(
					profile
				);


				console.log("==创建引擎==" + JSON.stringify(this.engine));

				//设置分辨率
				let config = {
					encodeWidth: 360,
					encodeHeight: 640
				}
				ZegoExpressEngine.instance().setVideoConfig(config);

			},

			//登录房间
			async loginRoom(roomID, userID, userName) {

				this.logoutRoom(roomID);

				let roomConfig = {};
				// 只有传入 “isUserStatusNotify” 参数取值为 “true” 的 ZegoRoomConfig,才能收到 onRoomUserUpdate 回调。
				roomConfig.isUserStatusNotify = true;
				// 登录房间
				// 开始登录房间
				this.engine.loginRoom(roomID, {
					'userID': userID,
					'userName': userName
				}, roomConfig);

				this.receiverMsg(); //接收消息监听
			},

			//登出房间
			logoutRoom(roomID) {

				this.engine.logoutRoom(roomID);
			},

			//推流
			async likeClick() {

				// #需要使用$nextTick延时调用,否则没有效果

				console.log("==推流==");

				/** 1. 创建美颜环境 */
				// await this.engine.startEffectsEnv();

				/** 开关美颜效果 */
				// await this.engine.enableEffectsBeauty(true);

				//js部分:
				/** 开始预览 */

				// ZegoExpressEngine.instance().startPreview();

				/** 开始推流  APP-PULL stream无值, Web有值,为MediaStream*/
				// const stream = await ZegoExpressEngine.instance().startPublishingStream("streamID123");

				// 推流视频流监听
				// ZegoExpressEngine.instance().on("publisherStateUpdate", (streamID, state, errorCode, extendedData) => {
				// 调用推流接口成功后,当推流器状态发生变更,如出现网络中断导致推流异常等情况,SDK在重试推流的同时,会通过该回调通知
				//....
				// });
			},

			//房间监听
			addListeners() {
				console.log("=======房间监听======");
				var that = this;

				// 以下为常用的房间相关回调
				that.engine.on('roomStateUpdate', (roomID, state, errorCode,
					extendedData) => {
					// 房间状态更新回调,登录房间后,当房间连接状态发生变更(如出现房间断开,登录认证失败等情况),SDK会通过该回调通知
					console.log("==房间状态更新回调==" + JSON.stringify(roomID));
				});;

				that.engine.on('roomUserUpdate', (roomID, updateType, userList) => {
					// 用户状态更新,登录房间后,当房间内有用户新增或删除时,SDK会通过该回调通知
					console.log("==用户状态更新==" + JSON.stringify(userList));

					if (updateType == 0) {
						that.online = that.online + userList.length;
					} else {

						if (that.online >= userList.length) {
							that.online = that.online - userList.length;
						}

						console.log("==用户状态更新==" + that.online);
					}

				});

				that.engine.on('roomStreamUpdate', (roomID, updateType, streamList) => {
					// 流状态更新,登录房间后,当房间内有用户新推送或删除音视频流时,SDK会通过该回调通知
					// 开始拉流
					if (streamList.length > 0) {

						if (streamList[0].streamID != '') {
							that.playStreamID = streamList[0].streamID;
							const streamss = that.engine.startPlayingStream(streamList[0]
								.streamID);
							console.log("==流状态更新==" + JSON.stringify(streamList[0].streamID));


						}

					}

				});

			},

			recycleData: function() {

				var that = this;

				//异步按顺序执行
				// new Promise(res => {
				// 	console.log("===mogu===");
				// 	// setTimeout(() => {
				// 	// 	res();
				// 	// }, 100);
				// 	/** 停止本地预览 */
				// 	// that.engine.stopPreview();
				// 	/** 停止推流 */
				// 	// that.engine.stopPublishingStream();
				// 	/** 停止拉流 */
				// 	that.engine.stopPlayingStream(that.playStreamID);
				// 	/** 退出房间 */
				// 	that.engine.logoutRoom(that.roomID);
				// 	/** 销毁引擎 */
				// 	ZegoExpressEngine.destroyEngine();
				// 	//移除键盘高度监听
				// 	uni.offKeyboardHeightChange(res => {
				// 	});
				// 	console.log("===销毁引擎==="+that.playStreamID+"=="+that.roomID);

				// });

			}

		},


		onUnload() {

			this.recycleData();
			// console.log("===销毁引擎===");
		}


	}
</script>

<style>
	.page {
		display: flex;
		flex-direction: column;
		height: 100%;
		background: transparent
	}

	.colum_layout {
		flex: 1;
		height: 100px;
	}


	.play_screen {
		display: flex;
		height: 100vh;
		width: 100vh;
		flex-direction: column;
		justify-content: flex-end;
	}

	/* 在线人数模块 */
	.onlines {
		height: 90rpx;
		width: 750rpx;
		background: transparent;
		position: absolute;
		top: 90rpx;
		align-items: center;
		flex-direction: row;
		justify-content: space-between;
	}

	/*  */
	.user_name {
		height: 70rpx;
		background-color: #09c2fa;
		margin-left: 30rpx;
		padding-top: 20rpx;
		padding-left: 40rpx;
		padding-right: 40rpx;
		border-radius: 30rpx;
		align-items: center;
		text-align: center;
		font-size: 29rpx;
		color: #fff;
		background-color: rgba(128, 128, 128, 0.2);
	}

	/* 在线模块	 */
	.onlineMd {
		background: transparent;
		margin-right: 40rpx;
		flex-direction: row;
		align-items: center;
	}

	/*在线标记*/
	.onlineTag {
		color: white;
		margin-right: 8rpx;
		font-size: 28rpx;
	}


	/* 在线用户数 */
	.online_num {
		width: 80rpx;
		background-color: red;
		height: 80rpx;
		margin-right: 40rpx;
		border-radius: 40rpx;
		align-items: center;
		text-align: center;
		padding-top: 25rpx;
		font-size: 28rpx;
		background-color: rgba(128, 128, 128, 0.2);
		color: #fff;
	}

	/* 直播父布局 */
	.live_parent {
		flex: 1;
		height: 100px;
		position: sticky;
	}

	/* 直播组件 */
	.live_play {
		flex: 1;
		position: relative;
		height: 100px;
		z-index: -1
	}

	/* 拉流 */
	.push_live {
		height: 300rpx;
		width: 400rpx;
		position: absolute;
		bottom: 100rpx;
		display: flex;
		z-index: 999
	}

	/* 消息列表 */
	.list-content {
		max-height: 300px;
		padding-bottom: 30rpx;
	}

	/* 键盘未弹起消息布局 */
	.msg_list_low {
		position: absolute;
		width: 420rpx;
		height: 600rpx;
		background-color: red;
		background: transparent;
		bottom: 160rpx;
		justify-content: flex-end;
	}

	/* 键盘弹起消息布局 */
	.msg_list_height {
		position: absolute;
		width: 420rpx;
		/* 	height: 600rpx; */
		background: transparent;
		bottom: 300rpx;
		max-height: 600rpx;
		justify-content: flex-end;
	}

	/* 水平内容 */
	.list-item {
		background-color: yellow;
		margin-top: 20rpx;
		margin-left: 20rpx;
		border-radius: 10rpx;
		flex-direction: row;
		background: transparent;
		background-color: rgba(128, 128, 128, 0.1);
		padding: 10rpx;

	}


	.person_title {
		margin-left: 5rpx;
		color: #09c2fa;
		margin-right: 10rpx;
		font-size: 28rpx;
	}

	.content_body {
		font-size: 28rpx;
		width: 344rpx;
		color: #fcfcfc;
		padding-right: 10rpx;
	}

	/*  */


	/* 消息输入按钮模块 */
	.enter_input {
		width: 750rpx;
		position: absolute;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		bottom: 120rpx;
		align-items: center;
		background-color: white;
		border: transparent;
	}

	/* 消息输入框 */
	.input_reply_msg {
		border: transparent;
		flex: 1;
		min-height: 66rpx;
		padding-top: 10rpx;
		padding-bottom: 10rpx;
		background-color: #f0f0f0;
		margin-left: 10rpx;
		padding-left: 20rpx;
		border-radius: 40rpx;
		margin-right: 30rpx;
	}


	/* 发送消息 */
	.send_msg {
		width: 100rpx;
		height: 58rpx;
		font-size: 28rpx;
		text-align: center;
		margin-right: 30rpx;
		padding-top: 13rpx;
		background-color: #FF9999;
		border-radius: 30rpx;
		color: white;
		margin-top: 15rpx;
		margin-bottom: 15rpx;
	}

	/* 底部浮动布局 */
	.interaction {
		background: transparent;
		background-color: transparent;
		position: fixed;
		bottom: 20rpx;
		display: flex;
		flex: 1;
		width: 750rpx;
		flex-direction: row;
		justify-content: space-between;
	}

	/* 点击输入消息 */
	.input_msg {
		width: 320rpx;
		margin-left: 30rpx;
		height: 78rpx;
		background-color: rgba(128, 128, 128, 0.3);
		border-radius: 40rpx;
		color: #999999;
		padding-top: 20rpx;
		text-align: left;
		padding-left: 30rpx;
	}

	.like_click {
		height: 70rpx;
		width: 160rpx;
		display: flex;
		background-color: #06c6ad;
		padding-top: 20rpx;
		color: white;
		font-weight: 600;
		border-radius: 20rpx;
		font-size: 28rpx;
		margin-right: 40rpx;
		text-align: center;
	}
</style>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/745051.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

SLAM算法知识荟萃

文章目录 SLAM自动驾驶八股四元数在表示空间旋转时的优势是什么&#xff1f;介绍自动驾驶系统介绍回环检测介绍词袋模型 手撕对极约束使用OpenCV找到四边形的边界介绍卡尔曼滤波推导卡尔曼增益 介绍PnPPnP求解最少需要几个点PnP的误差来源 求解线性方程 AxbSVD和QR方法哪个快介…

The 2022 ICPC Asia Xian Regional Contest(C/E/F/G/J/L)

原题链接&#xff1a;Dashboard - The 2022 ICPC Asia Xian Regional Contest - Codeforces 目录 J. Strange Sum F. Hotel C. Clone Ranran G. Perfect Word E. Find Maximum L. Tree J. Strange Sum 题意&#xff1a;思路&#xff1a;当我们选择in时&#xff0c;我们则可以…

Django_获取api接口的传参

目录 当参数为form-data 或者x-www-form-urlencoded类型时&#xff0c;使用request.POST获取到参数 当参数为raw类型时&#xff0c;使用request.body获取到参数&#xff0c;获取的参数需要经过处理才能使用 源码等资料获取方法 当参数为form-data 或者x-www-form-urlencoded…

UE4 关闭steamvr自启动

在我们打开项目时&#xff0c;如果安装过steamvr会自动启动&#xff0c;因为steamvr插件是默认启用的&#xff0c;所以把引擎目录下的steamvr插件默认启动改为false就可以了 用记事本打开SteamVR.uplugin文件 把true改成false

Redshift有哪些硬件要求?不同项目的电脑配置推荐

当谈到使用 Redshift 这样的软件时&#xff0c;项目类型有很多种——从简单的低多边形资产到大片的整个城市景观。很难推荐一种适合所有需求的硬件配置。 因此&#xff0c;我们将介绍 Redshift 的一些常见项目类型&#xff0c;为每个特定项目级别提供硬件建议。通过将硬件与您的…

互联网医院平台定制|互联网医疗平台开发

互联网医院系统是指通过互联网技术与医疗服务相结合的一种新型医疗模式。相比传统医院&#xff0c;互联网医院系统具有许多功能优势&#xff0c;为患者和医生提供了更便捷、高效的医疗服务。以下是互联网医院系统的一些功能优势&#xff1a;   在线挂号与预约&#xff1a;互联…

Tomcat关闭日志输出

一般在部署Tomcat后&#xff0c;运行久了&#xff0c;catalina.out文件会越来越大&#xff0c;对系统的稳定造成了一定的影响。可通过修改conf/logging.properties日志配置文件来屏蔽掉这部分的日志信息。那么Tomcat怎么关闭日志输出 一、 linux 系统 1、直接修改catalina.sh…

虚拟化容器化与docker

虚拟化容器化与docker 基本概念虚拟化分类虚拟化实现主机虚拟化实现容器虚拟化实现命名空间namespace空间隔离 控制组群cgroup资源隔离 LXC(Linux Container) docker与虚拟机 基本概念 物理机&#xff1a; 实际的服务器或者计算机。相对于虚拟机而言的对实体计算机的称呼。物理…

Linux基础(一)Linux基础命令、vi/vim编辑器

目录 虚拟机快照 Linux命令 基础格式 ls命令 cd-pwd命令 创建目录mkdir命令 文件操作命令&#xff1a;touch、cat、more 文件操作命令&#xff1a;cp、mv、rm 查找命令&#xff1a;which、find grep、wc和管道符 echo、tail和重定向符 vi\vim编辑器 下载VM ware works…

低粉高播放!30万粉竟打造900万播放的B站恰饭

截至2023年第一季度&#xff0c;B站官方发布的财报显示&#xff0c;平台日均活跃用户达9370万&#xff0c;月均活跃用户3.15亿&#xff0c;用户的增长离不开UP主&#xff0c;UP主是构建B站内容多样性不可或缺的存在。 在B站14周年庆典上&#xff0c;陈睿就曾表示&#xff0c;2…

送你一瓶好运喷雾,2023BAT大厂最新Java热门面试题及答案总结

毕业后就在腾讯的高级程序员&#xff0c;由于种种原因&#xff0c;离职出来了。趁着金三银四的求职季&#xff0c;互联网大厂小厂面试了一圈&#xff0c;感觉都不太好&#xff0c; 最后只 收到了京东的录用通知。 简单分析了一下&#xff1a;一面二面hr面都挂过&#xff0c; 原…

智能轮廓仪在汽车行业(零部件)的应用

在汽车领域里的空调&#xff0c;发动机&#xff0c;车内循环系统&#xff0c;油料供给和制动系统中&#xff0c;多会引入螺杆类产品&#xff0c;其主要用于紧固密封连接。螺杆制造工艺的好坏直接关系到其部件的性能和使用寿命&#xff0c;因此需要对螺杆的形状和尺寸进行质量管…

MySQL 第六天作业 备份与还原以及操作索引和视图

一、备份与还原 创建数据库、表以及插入数据 CREATE DATABASE booksDB;use booksDB;CREATE TABLE books(bk_id INT NOT NULL PRIMARY KEY,bk_title VARCHAR(50) NOT NULL,copyright YEAR NOT NULL);INSERT INTO booksVALUES (11078, Learning MySQL, 2010),(11033, Study Ht…

postgrep 9.4 断电后启动不了

journalctl -xe1、问题1&#xff1a;pg_ctl: another server might be running pg_ctl: another server might be running 解决方法&#xff1a;删除原来没有删除的pid文件 rm /opt/PostgreSQL/9.4/data/postmaster.pid 2、问题2 postgres文件丢失 - Unit postgresql-9.4.ser…

在3dMax中保存或使用Corona渲染时发生崩溃?

尝试在3ds Max中保存、打开、合并或渲染文件时&#xff0c;Corona渲染引擎3ds Max崩溃。 使用Corona渲染时&#xff0c;在“虚拟帧缓冲区(VFB)”窗口打开时&#xff0c;会发生更多情况。 此外&#xff0c;渲染时可能会显示警告消息&#xff0c;显示以下Corona错误&#xff1a; …

DataSparkle为非洲数字经济研究提供数据支撑,助力中非合作

7月1日,在第三届中非经贸博览会举办期间,中非经贸合作研究院在中非经贸合作智库研讨会上发布了《非洲数字经济发展指数与中非数字经济合作报告(2023)》(以下简称《报告》)。《报告》系统分析了非洲数字经济的发展情况,并深入解读了中非数字经济合作的现状与机遇。传音移动互联旗…

深入剖析 JavaScript 数组和字符串的各种操作技巧

&#x1f642;博主&#xff1a;小猫娃来啦 &#x1f642;文章核心&#xff1a;深入剖析 JavaScript 数组和字符串的各种操作技巧 近日总结了一下js数组和字符串相关操作方法&#xff0c;今天输出一篇博客&#xff0c;进行前端有关数组字符串相关操作方法的汇总&#xff0c;以后…

为何学习嵌入式系统?嵌入式系统未来的优势是什么?

学习嵌入式系统有许多好处&#xff0c;并且它在未来有许多优势。以下是其中的一些原因&#xff1a; 广泛应用&#xff1a;嵌入式系统广泛应用于智能手机、汽车、家电、医疗设备、工业控制系统等各种设备和系统中。学习嵌入式系统可以让你参与开发和设计这些领域中的创新产品和技…

三分钟为你解析英文音频转文字软件哪个好

你是否曾经听过一段有趣的英语录音&#xff0c;但又不想花费时间手动将其转化为文字&#xff1f;现在&#xff0c;有许多英文音频转文字软件可供您选择&#xff0c;但哪一个才是适合自己的呢&#xff1f;在这篇文章中&#xff0c;我们将探讨英文音频转文字软件哪个好&#xff0…

小程序如何进行分包详细介绍

微信小程序开发过程中&#xff0c;随着业务不断迭代&#xff0c;程序包的体积越来越大&#xff0c;使用分包加载是开发者必须面对的问题。 正常情况下&#xff0c;小程序首次启动时&#xff0c;会将整个代码包下载下来&#xff0c;所以如果代码包过大&#xff0c;会影响小程序…