1***@qq.com
1***@qq.com
  • 发布:2021-09-01 18:24
  • 更新:2023-07-18 14:08
  • 阅读:493

【报Bug】uni-app中使用5+的原生界面控件的livepusher

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10 家庭中文版20H2

HBuilderX类型: 正式

HBuilderX版本号: 3.2.3

手机系统: Android

手机系统版本号: Android 7.1.1

手机机型: 一体机

页面类型: vue

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

点击开始推流按钮后,过几秒直接闪退

预期结果:

点击推流按钮开始推流

实际结果:

点击开始推流按钮后,过几秒直接闪退

bug描述:

<template>  
	<view>  
		<text>hello-uni</text>  
		<button type="default" @click="startPusher">开始推流</button>  
	</view>  
</template>  
  
<script>  
	var pusher = null;  
	export default {  
		data() {  
			return {  
  
			};  
		},  
		onReady() {  
			const currentWebview = this.$mp.page.$getAppWebview();  
			console.log("ready")  
			pusher = plus.video.createLivePusher("livepusher", {    
			    url:‘’,//填一个推流地址    
			    top:'100px',    
			    left:'0px',    
			    width: '100%',    
			    height: '300px',    
			    position: 'static',  
				muted:false,  
				mode:"SD",  
				enableCamera:true,  
				aspect:"3:4"  
			});    
			currentWebview.append(pusher);  
			pusher.addEventListener('statechange', function(e) {  
				console.log(e)  
				// console.log('statechange: ' + JSON.stringify(e));  
			}, false);  
			// 监听网络状态变化事件  
			pusher.addEventListener('netstatus', function(e) {  
				console.log('netstatus: ' + JSON.stringify(e));  
			}, false);  
			// 监听错误事件  
			pusher.addEventListener('error', function(e) {  
				console.log('error: ' + JSON.stringify(e));  
			}, false);  
		},  
		onLoad() {  
			  
		},  
		methods: {  
			// 开始推流  
			startPusher() {  
				console.log("进入")  
				pusher.start(function() {  
					console.log("开始了")  
				}, function(e) {  
					console.log(e)  
				}); //推流开启  
			},  
		}  
	}  
</script>  
  
<style lang="scss">  
  
</style>
2021-09-01 18:24 负责人:无 分享
已邀请:
小嗨嗨

小嗨嗨

请问解决了吗

要回复问题请先登录注册