直播调试

master
gongfuxiang 2025-10-27 21:29:50 +08:00
parent d465df1aca
commit 2ea23fe662
5 changed files with 109 additions and 65 deletions

View File

@ -9,6 +9,11 @@
"usingComponents" : true,
"nvueCompiler" : "uni-app",
"compilerVersion" : 3,
"safearea": {
"bottom": {
"offset": "none"
}
},
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
@ -187,18 +192,19 @@
}
},
"__usePrivacyCheck__" : true,
"plugins" : {}
"plugins" : {
// 线->->线 https://mp.weixin.qq.com/wxopen/plugindevdoc?appid=wx50b5593e81dd937a
// "routePlan" : {
// "version" : "1.0.19",
// "provider" : "wx50b5593e81dd937a"
// },
// ->-> https://mp.weixin.qq.com/wxopen/pluginbasicprofile?action=intro&appid=wx2b03c6e691cd7370
// "live-player-plugin" : {
// "version" : "1.3.5",
// "provider" : "wx2b03c6e691cd7370"
// }
}
},
// 线->->线 https://mp.weixin.qq.com/wxopen/plugindevdoc?appid=wx50b5593e81dd937a
// "routePlan" : {
// "version" : "1.0.19",
// "provider" : "wx50b5593e81dd937a"
// },
// ->-> https://mp.weixin.qq.com/wxopen/pluginbasicprofile?action=intro&appid=wx2b03c6e691cd7370
// "live-player-plugin" : {
// "version" : "1.3.5",
// "provider" : "wx2b03c6e691cd7370"
// }
"mp-alipay" : {
"usingComponents" : true,
"appid" : "2021001173639600"

View File

@ -2121,8 +2121,15 @@
"transparentTitle": "auto",
"titlePenetrate": "YES",
// #endif
"disableScroll": true,
"enablePullDownRefresh": false,
"navigationBarTitleText": ""
"navigationBarTitleText": "",
"app-plus": {
"bounce": {
"top": "none",
"bottom": "none"
}
}
}
},
{
@ -2135,8 +2142,15 @@
"transparentTitle": "auto",
"titlePenetrate": "YES",
// #endif
"disableScroll": true,
"enablePullDownRefresh": false,
"navigationBarTitleText": ""
"navigationBarTitleText": "",
"app-plus": {
"bounce": {
"top": "none",
"bottom": "none"
}
}
}
}
]

View File

@ -289,6 +289,14 @@
<!-- 公共 -->
<component-common ref="common" :propIsGrayscale="plugins_mourning_data_is_app"></component-common>
</block>
<!-- <view class="margin-top-xxxxl padding-top-xxxxl padding-bottom-xxxxl tc">
<navigator data-value="/pages/plugins/live/push/push" @tap="url_event"></navigator>
<view class="margin-top-lg">
<navigator data-value="/pages/plugins/live/pull/pull" @tap="url_event"></navigator>
</view>
</view> -->
</view>
</template>
<script>

View File

@ -1,33 +1,39 @@
<template>
<view>
<live-player
src="rtmp://live-pull.shopxo.vip/68f764013572f9240ca7ce6c/shopxo"
mode="live"
autoplay
@statechange="statechange"
@error="error"
style="width: 400px; height: 525px;"
/>
<view :class="theme_view">
<video class="wh-auto ht dis-block" :is-live="true" src="rtmp://live-pull.shopxo.vip/68f764013572f9240ca7ce6c/shopxo"
@error="video_error_callback"
:autoplay="autoplay"
:controls="controls"
:show-fullscreen-btn="show_fullscreen_btn"
:enable-play-gesture="false"
></video>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
statechange(e){
console.log('live-player code:', e.detail.code)
const app = getApp();
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
//
autoplay: true,
//
controls: false,
//
show_fullscreen_btn: false,
}
},
error(e){
console.error('live-player error:', e.detail.errMsg)
methods: {
//
video_error_callback: function(e) {
uni.showModal({
content: e.target.errMsg,
showCancel: false
})
}
}
}
}
</script>
<style>
</style>

View File

@ -1,37 +1,51 @@
<template>
<view>
<live-pusher id='livePusher' ref="livePusher" class="livePusher" url="rtmp://live-push.shopxo.vip/68f764013572f9240ca7ce6c/shopxo"
mode="SD" :muted="true" :enable-camera="true" :auto-focus="true" :beauty="1" whiteness="2"
aspect="9:16" @statechange="statechange" @netstatus="netstatus" @error = "error"
<live-pusher
id='livePusher'
ref="livePusher"
class="livePusher"
:url="url"
mode="SD"
:muted="false"
:enable-camera="true"
:auto-focus="true"
:beauty="1"
whiteness="2"
aspect="9:16"
@statechange="statechange"
@netstatus="netstatus"
@error = "error"
style="width: 100%;height: 500px;"
></live-pusher>
<view class="margin-top-xxxxl padding-top-xxxxl">
<button class="btn" @click="start"></button>
<button class="btn" @click="pause"></button>
<button class="btn" @click="resume">resume</button>
<button class="btn" @click="stop"></button>
<button class="btn" @click="snapshot"></button>
<button class="btn" @click="startPreview"></button>
<button class="btn" @click="stopPreview"></button>
<button class="btn" @click="switchCamera"></button>
</view>
<button class="btn" @click="start"></button>
<button class="btn" @click="pause"></button>
<button class="btn" @click="resume">resume</button>
<button class="btn" @click="stop"></button>
<button class="btn" @click="snapshot"></button>
<button class="btn" @click="startPreview"></button>
<button class="btn" @click="stopPreview"></button>
<button class="btn" @click="switchCamera"></button>
</view>
</template>
<script>
export default {
data() {
export default {
data() {
return {
context: null
}
},
onReady() {
// onReady onLoad
context: null,
url: "rtmp://live-push.shopxo.vip/68f764013572f9240ca7ce6c/shopxo"
}
},
onReady() {
// onReady onLoad
var self = this;
setTimeout(function() {
self.context = uni.createLivePusherContext("livePusher", self);
}, 2000);
},
methods: {
statechange(e) {
},
methods: {
statechange(e) {
console.log("statechange:" + JSON.stringify(e));
},
netstatus(e) {
@ -41,7 +55,6 @@
console.log("error:" + JSON.stringify(e));
},
start: function() {
console.log(this.context)
this.context.start({
success: (a) => {
console.log("livePusher.start:" + JSON.stringify(a));
@ -104,9 +117,6 @@
}
});
}
}
}
}
}
</script>
<style>
</style>