android 组件180,【报Bug】App-Android 组件live-pusher推流成功后播放器拉流画面被旋转180度,FPS为20以下...

/pages/push/push_config.vue (直播设置页)

@change="orientationChange">

:active-color="activeColor" @change="devicePositionChange">

{{form.beauty}} 级

{{form.whiteness}} 级

export default {

data() {

return {

activeColor: "#2979ff",

mode_select: [{

value: 'SD',

name: '标清'

},

{

value: 'HD',

name: '高清'

},

{

value: 'FHD',

name: '超清'

}

],

orientation_select: [{

value: 'vertical',

name: '垂直方向'

},

{

value: 'horizontal',

name: '水平方向'

}

],

devicePosition_select: [{

value: 'front',

name: '前置摄像'

},

{

value: 'back',

name: '后置摄像'

}

],

witch_select: [{

value: true,

name: '开启'

},

{

value: false,

name: '关闭'

}

],

form: {

push_url: 'rtmp://vpush.qdd88.cn/live/621FD133-889D-1707-CF0E-83A8A715D412?auth_key=1604793600-0-0-a23b8d96c6223cf29f001b461758bd53', // 推流地址

mode: 'FHD', // 视频模式

autoFocus: true, // 自动对焦

zoom: true, // 远近焦距

beauty: 30, // 美颜级别 0-100

whiteness: 30, // 美白级别 0-100

orientation: 'vertical', // 画面方向

devicePosition: 'front' // 摄像方向

}

}

},

computed: {

// 获取当前选项列表下标

getCurrent() {

return (select_name, form_name) => {

let select_object = this[select_name]

let active_value = this['form'][form_name]

if (select_object && active_value) {

for (let i in this[select_name]) {

if (select_object[i]['value'] == active_value) {

return i

}

}

return 0

}

}

}

},

methods: {

modeChange(index) {

let value = this.mode_select[index]['value']

if (value)

this.$set(this.form, 'mode', value)

},

orientationChange(index) {

let value = this.orientation_select[index]['value']

if (value)

this.$set(this.form, 'orientation', value)

},

devicePositionChange(index) {

let value = this.devicePosition_select[index]['value']

if (value)

this.$set(this.form, 'devicePosition', value)

},

launchPusher() {

let query = '?'

let params = this.form

for (let key in params) {

query += `${key}=${params[key]}&`

}

query = query.replace(/&$/, '')

uni.navigateTo({

url: './push_weex' + query

})

}

}

}

/pages/push/push.nvue (推流界面页)

:orientation="orientation" :muted="muted" :beauty="beauty" :whiteness="whiteness" :remote-mirror="remoteMirror"

:auto-focus="autoFocus" :zoom="zoom" :style="{height: windowHeight}" @statechange="statechange" @netstatus="netstatus"

@error="error">

export default {

data() {

return {

url: '',

enableCamera: true,

pusher: null,

isPushing: false,

windowHeight: '0px',

orientation: 'vertical',

devicePosition: 'front',

mode: 'FHD',

muted: false,

beauty: 0,

whiteness: 0,

zoom: true,

autoFocus: true,

remoteMirror: true

};

},

onLoad(options) {

this.url = options.push_url

this.orientation = options.orientation

this.devicePosition = options.devicePosition

this.mode = options.mode

this.beauty = options.beauty / 10

this.whiteness = options.whiteness / 10

this.zoom = options.zoom

this.autoFocus = options.autoFocus

},

onReady() {

this.windowHeight = uni.getSystemInfoSync().windowHeight + 'px';

this.pusher = uni.createLivePusherContext('livePusher', this);

this.pusher.startPreview()

uni.$on('onStart', this.onStart)

uni.$on('onSwitchCamera', this.onSwitchCamera)

uni.$on('onMuted', this.onMuted)

},

methods: {

onStart() {

this.isPushing = !this.isPushing

if (this.isPushing) {

this.pusher.start()

} else {

this.pusher.pause()

}

},

onSwitchCamera() {

this.pusher.switchCamera()

},

onMuted() {

this.muted = !this.muted

},

statechange(e) {

console.log("statechange:" + JSON.stringify(e));

},

netstatus(e) {

console.log("netstatus:" + JSON.stringify(e));

},

error(e) {

console.log("error:" + JSON.stringify(e));

}

}

};

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值