Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
eslotsys-game-nuxt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
毛线
eslotsys-game-nuxt
Commits
d6939211
Commit
d6939211
authored
Jul 29, 2023
by
毛线
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
声音控制
parent
9d824ac1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
3 deletions
+14
-3
index.vue
components/common/audio/index.vue
+2
-0
menu.vue
components/common/menu.vue
+1
-1
WebRTCPlayer.vue
pages/index/game/components/WebRTCPlayer.vue
+9
-0
keyboard.vue
pages/index/game/components/keyboard.vue
+1
-1
jswebrtc.min.js
utils/jswebrtc.min.js
+1
-1
No files found.
components/common/audio/index.vue
View file @
d6939211
...
...
@@ -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
...
...
components/common/menu.vue
View file @
d6939211
...
...
@@ -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"
/>
...
...
pages/index/game/components/WebRTCPlayer.vue
View file @
d6939211
...
...
@@ -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
// 初始化播放器
...
...
pages/index/game/components/keyboard.vue
View file @
d6939211
...
...
@@ -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>
<!-- 自动下注 -->
...
...
utils/jswebrtc.min.js
View file @
d6939211
...
...
@@ -245,7 +245,7 @@ JSWebrtc.Player = function() {
this
.
autoplay
=
!!
options
.
autoplay
||
false
;
this
.
paused
=
true
;
if
(
this
.
autoplay
)
this
.
options
.
video
.
muted
=
tru
e
;
this
.
options
.
video
.
muted
=
fals
e
;
this
.
startLoading
()
};
Player
.
prototype
.
startLoading
=
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment