添加视频模块

This commit is contained in:
bobobobo
2026-01-12 22:21:27 +08:00
parent 13af9eb303
commit ac67fa30f4
3 changed files with 60 additions and 42 deletions

View File

@@ -104,6 +104,7 @@
rpxToPxRatio.value = sysInfo.windowWidth / 750
})
// 向外暴露方法
defineExpose({
updateScroll
@@ -203,3 +204,4 @@
height: calc(var(--status-bar-height) + 44px);
}
</style>

View File

@@ -550,6 +550,8 @@
clearAudioEffectSet()
clearBeautyPanelSet()
uni.$summaryData = summaryData.value
console.warn(` 退出直播 imDataEndLive`);
endLive({
success: () => {
console.warn(` 退出直播 imDataEndLive`);
@@ -568,48 +570,59 @@
};
const startLive = async () => {
console.log('点击开始直播')
const data = {
coverUrl: coverURL.value,
roomName: liveTitle.value,
groupId: groupId.value
}
const res = await imAddLive(data)
const cbb = await imDataStartLive(res.data.roomId)
console.log(cbb)
return
createLive({
liveInfo: {
liveID: uni?.$liveID,
liveName: liveTitle.value,
coverURL: coverURL.value,
isSeatEnabled: true,
seatMode: 'APPLY',
maxSeatCount: 0,
isPublicVisible: liveMode.value === '公开',
keepOwnerOnSeat: true,
seatLayoutTemplateID: templateLayout.value,
},
success: () => {
const params = {
cursor: "", // 首次拉起传空不能是null),然后根据回调数据的cursor确认是否拉完
count: 20, // 分页拉取的个数
};
fetchLiveList(params);
// try {
// console.log('点击开始直播')
// const data = {
// coverUrl: coverURL.value,
// roomName: liveTitle.value,
// groupId: groupId.value
// }
// const roomData = await imAddLive(data)
// const res = await imDataStartLive(roomData.data.roomId)
// console.log(res)
// const params = {
// cursor: "", // 首次拉起传空不能是null),然后根据回调数据的cursor确认是否拉完
// count: 20, // 分页拉取的个数
// };
// fetchLiveList(params);
// openLocalCamera({ isFront: isFrontCamera.value });
// openLocalMicrophone();
// setLocalVideoMuteImage();
// isStartLive.value = true;
// } catch (err) {
// console.log(err, '====22')
// }
openLocalCamera({ isFront: isFrontCamera.value });
openLocalMicrophone();
setLocalVideoMuteImage();
},
fail: (errCode, errMsg) => {
console.log(errCode, '=====111====')
console.log(errMsg, '=====222====')
uni.showToast({
title: '创建直播间失败',
});
},
});
isStartLive.value = true;
createLive({
liveInfo: {
liveID: uni?.$liveID,
liveName: liveTitle.value,
coverURL: coverURL.value,
isSeatEnabled: true,
seatMode: 'APPLY',
maxSeatCount: 0,
isPublicVisible: liveMode.value === '公开',
keepOwnerOnSeat: true,
seatLayoutTemplateID: templateLayout.value,
},
success: () => {
const params = {
cursor: "", // 首次拉起传空不能是null),然后根据回调数据的cursor确认是否拉完
count: 20, // 分页拉取的个数
};
fetchLiveList(params);
openLocalCamera({ isFront: isFrontCamera.value });
openLocalMicrophone();
setLocalVideoMuteImage();
},
fail: (errCode, errMsg) => {
uni.showToast({
title: '创建直播间失败',
});
},
});
isStartLive.value = true;
};
const ShowAnchorViewClickPanel = (userInfo) => {

View File

@@ -94,6 +94,7 @@
</template>
<script setup lang="ts">
import { imDataEndLive } from '@/api/tui-kit'
import { onLoad } from '@dcloudio/uni-app';
import { ref, onMounted, computed, onUnmounted, watch, nextTick } from 'vue';
import UserInfoPanel from '@/uni_modules/tuikit-atomic-x/components/LiveStreamView/UserInfoPanel.nvue';
@@ -434,9 +435,11 @@
if ((uni.$localGuestStatus === 'CONNECTED' && index === 1) || (uni.$localGuestStatus !== 'CONNECTED' && index === 0)) {
leaveLive({
success: () => {
// imDataEndLive(liveID.value)
uni.$liveID = ''
uni.redirectTo({
url: `/pages/livelist/index`,
url: `/pages/discover/livelist/index`,
delta: 1,
animationType: 'pop-out',
animationDuration: 300,