添加视频模块
This commit is contained in:
@@ -104,6 +104,7 @@
|
|||||||
rpxToPxRatio.value = sysInfo.windowWidth / 750
|
rpxToPxRatio.value = sysInfo.windowWidth / 750
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// 向外暴露方法
|
// 向外暴露方法
|
||||||
defineExpose({
|
defineExpose({
|
||||||
updateScroll
|
updateScroll
|
||||||
@@ -203,3 +204,4 @@
|
|||||||
height: calc(var(--status-bar-height) + 44px);
|
height: calc(var(--status-bar-height) + 44px);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -550,6 +550,8 @@
|
|||||||
clearAudioEffectSet()
|
clearAudioEffectSet()
|
||||||
clearBeautyPanelSet()
|
clearBeautyPanelSet()
|
||||||
uni.$summaryData = summaryData.value
|
uni.$summaryData = summaryData.value
|
||||||
|
console.warn(` 退出直播 imDataEndLive`);
|
||||||
|
|
||||||
endLive({
|
endLive({
|
||||||
success: () => {
|
success: () => {
|
||||||
console.warn(` 退出直播 imDataEndLive`);
|
console.warn(` 退出直播 imDataEndLive`);
|
||||||
@@ -568,48 +570,59 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const startLive = async () => {
|
const startLive = async () => {
|
||||||
console.log('点击开始直播')
|
// try {
|
||||||
const data = {
|
// console.log('点击开始直播')
|
||||||
coverUrl: coverURL.value,
|
// const data = {
|
||||||
roomName: liveTitle.value,
|
// coverUrl: coverURL.value,
|
||||||
groupId: groupId.value
|
// roomName: liveTitle.value,
|
||||||
}
|
// groupId: groupId.value
|
||||||
const res = await imAddLive(data)
|
// }
|
||||||
const cbb = await imDataStartLive(res.data.roomId)
|
// const roomData = await imAddLive(data)
|
||||||
console.log(cbb)
|
// const res = await imDataStartLive(roomData.data.roomId)
|
||||||
return
|
// console.log(res)
|
||||||
createLive({
|
// const params = {
|
||||||
liveInfo: {
|
// cursor: "", // 首次拉起传空(不能是null),然后根据回调数据的cursor确认是否拉完
|
||||||
liveID: uni?.$liveID,
|
// count: 20, // 分页拉取的个数
|
||||||
liveName: liveTitle.value,
|
// };
|
||||||
coverURL: coverURL.value,
|
// fetchLiveList(params);
|
||||||
isSeatEnabled: true,
|
// openLocalCamera({ isFront: isFrontCamera.value });
|
||||||
seatMode: 'APPLY',
|
// openLocalMicrophone();
|
||||||
maxSeatCount: 0,
|
// setLocalVideoMuteImage();
|
||||||
isPublicVisible: liveMode.value === '公开',
|
// isStartLive.value = true;
|
||||||
keepOwnerOnSeat: true,
|
// } catch (err) {
|
||||||
seatLayoutTemplateID: templateLayout.value,
|
// console.log(err, '====22')
|
||||||
},
|
// }
|
||||||
success: () => {
|
|
||||||
const params = {
|
|
||||||
cursor: "", // 首次拉起传空(不能是null),然后根据回调数据的cursor确认是否拉完
|
|
||||||
count: 20, // 分页拉取的个数
|
|
||||||
};
|
|
||||||
fetchLiveList(params);
|
|
||||||
|
|
||||||
openLocalCamera({ isFront: isFrontCamera.value });
|
createLive({
|
||||||
openLocalMicrophone();
|
liveInfo: {
|
||||||
setLocalVideoMuteImage();
|
liveID: uni?.$liveID,
|
||||||
},
|
liveName: liveTitle.value,
|
||||||
fail: (errCode, errMsg) => {
|
coverURL: coverURL.value,
|
||||||
console.log(errCode, '=====111====')
|
isSeatEnabled: true,
|
||||||
console.log(errMsg, '=====222====')
|
seatMode: 'APPLY',
|
||||||
uni.showToast({
|
maxSeatCount: 0,
|
||||||
title: '创建直播间失败',
|
isPublicVisible: liveMode.value === '公开',
|
||||||
});
|
keepOwnerOnSeat: true,
|
||||||
},
|
seatLayoutTemplateID: templateLayout.value,
|
||||||
});
|
},
|
||||||
isStartLive.value = true;
|
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) => {
|
const ShowAnchorViewClickPanel = (userInfo) => {
|
||||||
|
|||||||
@@ -94,6 +94,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { imDataEndLive } from '@/api/tui-kit'
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
import { ref, onMounted, computed, onUnmounted, watch, nextTick } from 'vue';
|
import { ref, onMounted, computed, onUnmounted, watch, nextTick } from 'vue';
|
||||||
import UserInfoPanel from '@/uni_modules/tuikit-atomic-x/components/LiveStreamView/UserInfoPanel.nvue';
|
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)) {
|
if ((uni.$localGuestStatus === 'CONNECTED' && index === 1) || (uni.$localGuestStatus !== 'CONNECTED' && index === 0)) {
|
||||||
leaveLive({
|
leaveLive({
|
||||||
success: () => {
|
success: () => {
|
||||||
|
// imDataEndLive(liveID.value)
|
||||||
|
|
||||||
uni.$liveID = ''
|
uni.$liveID = ''
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: `/pages/livelist/index`,
|
url: `/pages/discover/livelist/index`,
|
||||||
delta: 1,
|
delta: 1,
|
||||||
animationType: 'pop-out',
|
animationType: 'pop-out',
|
||||||
animationDuration: 300,
|
animationDuration: 300,
|
||||||
|
|||||||
Reference in New Issue
Block a user