Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

音量が100%以上にできるように #4469

Merged
merged 2 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/components/Main/MainView/QallView/AudioTrack.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,40 @@
}>()
const audioElement = useTemplateRef<HTMLMediaElement>('audioElement')
const volume = ref(1)
const audioContext = new AudioContext()
const gainNode = audioContext.createGain()
gainNode.gain.value = 1

Check warning on line 12 in src/components/Main/MainView/QallView/AudioTrack.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/AudioTrack.vue#L10-L12

Added lines #L10 - L12 were not covered by tests

watchEffect(() => {
if (audioElement.value) {
audioElement.value.volume = volume.value
gainNode.gain.value = volume.value

Check warning on line 16 in src/components/Main/MainView/QallView/AudioTrack.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/AudioTrack.vue#L16

Added line #L16 was not covered by tests
}
})

onMounted(() => {
if (audioElement.value) {
// chromeだと一回要素に入れないと上手く再生してくれない
trackInfo.trackPublication?.track?.attach(audioElement.value)
if (trackInfo.trackPublication?.track?.mediaStream) {
audioContext
.createMediaStreamSource(trackInfo.trackPublication?.track?.mediaStream)
.connect(gainNode)
.connect(audioContext.destination)
audioElement.value.muted = true
}

Check warning on line 30 in src/components/Main/MainView/QallView/AudioTrack.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/AudioTrack.vue#L24-L30

Added lines #L24 - L30 were not covered by tests
}
})

onUnmounted(() => {
if (audioElement.value) {
trackInfo.trackPublication?.track?.detach(audioElement.value)
audioContext.close()

Check warning on line 37 in src/components/Main/MainView/QallView/AudioTrack.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/AudioTrack.vue#L37

Added line #L37 was not covered by tests
}
})
</script>

<template>
<div>{{ trackInfo.participantIdentity }}</div>
<audio :id="trackInfo.trackPublication?.trackSid" ref="audioElement"></audio>
<input v-model="volume" type="range" min="0" max="1" step="0.01" />
<input v-model="volume" type="range" min="0" max="3" step="0.01" />

Check warning on line 45 in src/components/Main/MainView/QallView/AudioTrack.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/AudioTrack.vue#L45

Added line #L45 was not covered by tests
</template>
2 changes: 1 addition & 1 deletion src/components/Main/MainView/QallView/DanmakuContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ onMounted(() => {
.danmakuContainer {
pointer-events: none;
width: 100%;
height: 100%; /* 適切な高さを設定 */
height: 100%;
position: absolute;
bottom: 0;
left: 0;
Expand Down
55 changes: 33 additions & 22 deletions src/components/Main/MainView/QallView/QallMessageView.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<template>
<div :class="$style.container">
<div
:class="$style.container"
:data-is-not-messages-show="$boolAttr(!isMessageShow)"

Check warning on line 4 in src/components/Main/MainView/QallView/QallMessageView.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/QallMessageView.vue#L2-L4

Added lines #L2 - L4 were not covered by tests
>
<scroll-loading-bar
:class="$style.loadingBar"
:show="isLoading && isMessageShow"
/>
<transition name="fade-bottom" mode="out-in">
<messages-scroller
v-show="isMessageShow"
v-if="isMessageShow"

Check warning on line 12 in src/components/Main/MainView/QallView/QallMessageView.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/QallMessageView.vue#L12

Added line #L12 was not covered by tests
ref="scrollerEle"
:message-ids="messageIds"
:is-reached-end="isReachedEnd"
Expand All @@ -31,26 +34,28 @@
</template>
</messages-scroller>
</transition>
<FormButton
label="メッセージを表示"
@click="
() => {
if (isMessageShow) {
isMessageShow = false
toNewMessage('smooth')
} else {
isMessageShow = true
nextTick(() => toNewMessage())
<div :class="$style.uiElement">
<FormButton
label="メッセージを表示"
@click="

Check warning on line 40 in src/components/Main/MainView/QallView/QallMessageView.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/QallMessageView.vue#L37-L40

Added lines #L37 - L40 were not covered by tests
() => {
if (isMessageShow) {
isMessageShow = false
toNewMessage('smooth')
} else {
isMessageShow = true
nextTick(() => toNewMessage())
}
}
}
"
/>
<message-input
:channel-id="channelId"
:typing-users="typingUsers"
:show-to-new-message-button="showToNewMessageButton"
@click-to-new-message-button="toNewMessage"
/>
"
/>
<message-input
:channel-id="channelId"
:typing-users="typingUsers"
:show-to-new-message-button="showToNewMessageButton"
@click-to-new-message-button="toNewMessage"
/>
</div>

Check warning on line 58 in src/components/Main/MainView/QallView/QallMessageView.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/QallMessageView.vue#L51-L58

Added lines #L51 - L58 were not covered by tests
</div>
</template>

Expand Down Expand Up @@ -122,8 +127,11 @@
flex-direction: column;
justify-content: end;
position: relative;
height: 100%;
width: 100%;
height: 100%;
&[data-is-not-messages-show] {
pointer-events: none;
}
}

.loadingBar {
Expand All @@ -146,4 +154,7 @@
margin: 4px 0;
contain: content;
}
.uiElement {
pointer-events: all;
}
</style>
36 changes: 8 additions & 28 deletions src/components/Main/MainView/QallView/ScreenShareComponent.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<script setup lang="ts">
import { onMounted, onUnmounted, ref, useTemplateRef, watchEffect } from 'vue'

Check warning on line 2 in src/components/Main/MainView/QallView/ScreenShareComponent.vue

View workflow job for this annotation

GitHub Actions / run lint

'ref' is defined but never used

Check warning on line 2 in src/components/Main/MainView/QallView/ScreenShareComponent.vue

View workflow job for this annotation

GitHub Actions / run lint

'watchEffect' is defined but never used
import { useQall } from '/@/composables/qall/useQall'
import type { TrackInfo } from '/@/composables/qall/useLiveKitSDK'
import AudioTrack from './AudioTrack.vue'
import VideoTrack from './VideoTrack.vue'

Check warning on line 6 in src/components/Main/MainView/QallView/ScreenShareComponent.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/ScreenShareComponent.vue#L5-L6

Added lines #L5 - L6 were not covered by tests

const { trackInfo, audioTrackInfo, participantIdentity } = defineProps<{
trackInfo: TrackInfo
Expand All @@ -12,25 +14,16 @@
const { removeVideoTrack } = useQall()

const videoElement = useTemplateRef<HTMLVideoElement>('videoElement')
const audioElement = useTemplateRef<HTMLAudioElement>('audioElement')
const volume = ref(1)
watchEffect(() => {
if (audioElement.value) {
audioElement.value.volume = volume.value
}
})

onMounted(() => {
if (videoElement.value && audioElement.value) {
if (videoElement.value) {

Check warning on line 19 in src/components/Main/MainView/QallView/ScreenShareComponent.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/ScreenShareComponent.vue#L19

Added line #L19 was not covered by tests
trackInfo.trackPublication?.track?.attach(videoElement.value)
audioTrackInfo?.trackPublication?.track?.attach(audioElement.value)
}
})

onUnmounted(() => {
if (videoElement.value && audioElement.value) {
if (videoElement.value) {

Check warning on line 25 in src/components/Main/MainView/QallView/ScreenShareComponent.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/ScreenShareComponent.vue#L25

Added line #L25 was not covered by tests
trackInfo.trackPublication?.track?.detach(videoElement.value)
audioTrackInfo?.trackPublication?.track?.detach(audioElement.value)
}
})
</script>
Expand All @@ -40,24 +33,11 @@
<div>
<p>{{ participantIdentity }}</p>
</div>
<video
v-if="trackInfo.trackPublication"
:id="trackInfo.trackPublication.trackSid"
ref="videoElement"
:class="$style.video"
></video>
<audio
<VideoTrack v-if="trackInfo.trackPublication" :track-info="trackInfo" />
<AudioTrack

Check warning on line 37 in src/components/Main/MainView/QallView/ScreenShareComponent.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/ScreenShareComponent.vue#L36-L37

Added lines #L36 - L37 were not covered by tests
v-if="audioTrackInfo?.trackPublication"
:id="audioTrackInfo.trackPublication.trackSid"
ref="audioElement"
></audio>
<input v-model="volume" type="range" min="0" max="1" step="0.01" />
<button
v-if="!trackInfo.isRemote && trackInfo.trackPublication"
@click="removeVideoTrack(trackInfo.trackPublication)"
>
Remove Screen Share
</button>
:track-info="audioTrackInfo"
/>

Check warning on line 40 in src/components/Main/MainView/QallView/ScreenShareComponent.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/QallView/ScreenShareComponent.vue#L39-L40

Added lines #L39 - L40 were not covered by tests
</div>
</template>

Expand Down
20 changes: 19 additions & 1 deletion src/views/Settings/QallTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@
<p v-else>デバイスが取得できませんでした。</p>
</div>
</section>
<section :class="$style.element">
<h3 :class="$style.heading">出力デバイス</h3>
<div>
<form-selector
v-if="!fetchFailed && audioOutputDevices.length"
v-model="state.audioOutputDeviceId"
:options="audioOutputDeviceOptions"
/>
<p v-else>デバイスが取得できませんでした。</p>
</div>
</section>

Check warning on line 81 in src/views/Settings/QallTab.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Settings/QallTab.vue#L71-L81

Added lines #L71 - L81 were not covered by tests
<section :class="$style.element">
<h3 :class="$style.heading">マスターボリューム</h3>
<form-range-with-value
Expand Down Expand Up @@ -199,7 +210,7 @@

const formatNoiseGateThreshold = (v: number) => `${v}dB`

const { fetchFailed, audioInputDevices } = useDevicesInfo()
const { fetchFailed, audioInputDevices, audioOutputDevices } = useDevicesInfo()

Check warning on line 213 in src/views/Settings/QallTab.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Settings/QallTab.vue#L213

Added line #L213 was not covered by tests

const audioInputDeviceOptions = computed(() =>
audioInputDevices.value.map(d => ({
Expand All @@ -208,6 +219,13 @@
}))
)

const audioOutputDeviceOptions = computed(() =>
audioOutputDevices.value.map(d => ({
key: d.label,
value: d.deviceId
}))
)

Check warning on line 227 in src/views/Settings/QallTab.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Settings/QallTab.vue#L222-L227

Added lines #L222 - L227 were not covered by tests

const voiceOptions = useVoices()
</script>

Expand Down
Loading