Commit 158480d2 by qlintonger xeno

删除内容+1

parent 0bde9e33
...@@ -93,7 +93,7 @@ export class Agora { ...@@ -93,7 +93,7 @@ export class Agora {
if (canProceed) { if (canProceed) {
console.log('创建音视频轨道成功!', this.data.localTracks) console.log('创建音视频轨道成功!', this.data.localTracks)
if (this.data.localTracks.videoTrack) { if (this.data.localTracks.videoTrack) {
this.data.localTracks.videoTrack.play(this.localPlayerId, {fit: 'contain', mirror: 'false'}) this.data.localTracks.videoTrack.play(this.localPlayerId, {fit: 'contain', mirror: 'true'})
} }
console.log('开始播放本地媒体') console.log('开始播放本地媒体')
await this.AgoraClient.publish(Object.values(this.data.localTracks)); await this.AgoraClient.publish(Object.values(this.data.localTracks));
...@@ -119,7 +119,7 @@ export class Agora { ...@@ -119,7 +119,7 @@ export class Agora {
if (v) { if (v) {
try { try {
const screenAudioTrack = await AgoraRTC.createScreenVideoTrack({}, 'disable'); const screenAudioTrack = await AgoraRTC.createScreenVideoTrack({}, 'disable');
screenAudioTrack.play(this.localPlayerId, {fit: 'contain', mirror: 'false'}); screenAudioTrack.play(this.localPlayerId, {fit: 'contain', mirror: 'true'});
await this.AgoraClient.publish(screenAudioTrack); await this.AgoraClient.publish(screenAudioTrack);
webrtcStates.value.currentUsingCameraName = ''; webrtcStates.value.currentUsingCameraName = '';
screenAudioTrack.on('track-ended', async () => { screenAudioTrack.on('track-ended', async () => {
...@@ -141,7 +141,7 @@ export class Agora { ...@@ -141,7 +141,7 @@ export class Agora {
} else { } else {
this.data.localTracks.videoTrack = await AgoraRTC.createCameraVideoTrack(); this.data.localTracks.videoTrack = await AgoraRTC.createCameraVideoTrack();
webrtcStates.value.currentUsingCameraName = this.data.localTracks.videoTrack._deviceName; webrtcStates.value.currentUsingCameraName = this.data.localTracks.videoTrack._deviceName;
this.data.localTracks.videoTrack.play(this.localPlayerId, {fit: 'contain', mirror: 'false'}) this.data.localTracks.videoTrack.play(this.localPlayerId, {fit: 'contain', mirror: 'true'})
await this.AgoraClient.publish(this.data.localTracks.videoTrack); await this.AgoraClient.publish(this.data.localTracks.videoTrack);
} }
} }
...@@ -158,7 +158,7 @@ export class Agora { ...@@ -158,7 +158,7 @@ export class Agora {
this.data.localTracks.videoTrack = await AgoraRTC.createCameraVideoTrack(); this.data.localTracks.videoTrack = await AgoraRTC.createCameraVideoTrack();
webrtcStates.value.currentUsingCameraName = this.data.localTracks.videoTrack._deviceName; webrtcStates.value.currentUsingCameraName = this.data.localTracks.videoTrack._deviceName;
await this.AgoraClient.publish(this.data.localTracks.videoTrack); await this.AgoraClient.publish(this.data.localTracks.videoTrack);
this.data.localTracks.videoTrack.play(this.localPlayerId, {fit: 'contain', mirror: 'false'}) this.data.localTracks.videoTrack.play(this.localPlayerId, {fit: 'contain', mirror: 'true'})
} }
} }
......
<template> <template>
<div :id="ps.isSelf ? 'LocalVideo' : `RemoteVideo${ps.id}`" class="relative h-full video-cont bg-fill-bg1" ref="remoteVideoRef"> <div :id="ps.isSelf ? 'LocalVideo' : `RemoteVideo${ps.id}`" data-self="vc" class="relative h-full video-cont bg-fill-bg1" ref="remoteVideoRef">
<template v-if="isVideoVisible"> <template v-if="isVideoVisible">
<div class="absolute flex justify-between items-center p-1 top-0 left-0 w-full z-10"> <div class="absolute flex justify-between items-center p-1 top-0 left-0 w-full z-10">
<div class="text-xs px-2 rounded-sm leading-5 bg-primary-disable text-primary" v-if="userDataForThis.userCallGroup == 1"> <div class="text-xs px-2 rounded-sm leading-5 bg-primary-disable text-primary" v-if="userDataForThis.userCallGroup == 1">
...@@ -80,7 +80,7 @@ const remoteVideoRef = ref() ...@@ -80,7 +80,7 @@ const remoteVideoRef = ref()
const isVideoVisible = ref(false) const isVideoVisible = ref(false)
const checkVideoExists = () => { const checkVideoExists = () => {
const video = remoteVideoRef.value.querySelector('video') const video = remoteVideoRef.value.querySelector('video')
isVideoVisible.value = video ? true : false isVideoVisible.value = !!video
} }
const observer = new MutationObserver(checkVideoExists) const observer = new MutationObserver(checkVideoExists)
onMounted(function () { onMounted(function () {
...@@ -100,7 +100,7 @@ onUnmounted(() => { ...@@ -100,7 +100,7 @@ onUnmounted(() => {
}) })
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
:deep(.video-cont video) { :deep([data-self='vc'] video), :deep(.agora_video_player) {
transform: none !important; transform: none !important;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment