Commit d6939211 authored by 毛线's avatar 毛线

声音控制

parent 9d824ac1
......@@ -68,6 +68,8 @@ export default {
this.bgAudio.src = 'https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/sound/Innovation.mp3' // 背景音乐
this.bgAudio.loop = true
this.uiClickAudio.src = 'https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/sound/ui_click.mp3' // 通用ui点击音乐
this.bgAudio.volume = this.volumeBg / 100
this.uiClickAudio.volume = this.volumeButton / 100
},
playBgAudio() {
const { mute } = this
......
......@@ -2,7 +2,7 @@
<div>
<div class="layout-menu">
<div class="menu-item">
<img class="btn" src="https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/ic_menu_01.png" alt="" @click="$refs.audioSettingDialog.show()">
<img v-audio class="btn" src="https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/ic_menu_01.png" alt="" @click="$refs.audioSettingDialog.show()">
</div>
</div>
<AudioSettingDialog ref="audioSettingDialog" />
......
......@@ -23,6 +23,14 @@ export default {
...mapState([
'zoom',
]),
...mapState('audio', [
'volumeMachine'
]),
},
watch: {
volumeMachine(value) {
this.$refs.jswebrtc.volume = this.volumeMachine / 100
},
},
mounted() {
this.$watch('videoSrc', () => {
......@@ -54,6 +62,7 @@ export default {
}
// 获取承载元素dom
this.$refs.jswebrtc.volume = this.volumeMachine / 100
const videoDom = this.$refs.jswebrtc
// 初始化播放器
......
......@@ -39,7 +39,7 @@
</div>
<!-- play -->
<div class="play-btn btn" @click="click().play()">
<div v-audio class="play-btn btn" @click="click().play()">
<img v-audio v-if="playBtn.buttonImgN" :src="playBtn.buttonImgN | img" alt="">
</div>
<!-- 自动下注 -->
......
......@@ -245,7 +245,7 @@ JSWebrtc.Player = function() {
this.autoplay = !!options.autoplay || false;
this.paused = true;
if (this.autoplay)
this.options.video.muted = true;
this.options.video.muted = false;
this.startLoading()
};
Player.prototype.startLoading = function() {
......
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