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
2e3c52fc
Commit
2e3c52fc
authored
Jul 31, 2023
by
毛线
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
临时解决视频播放问题
parent
cee8066b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
6 deletions
+19
-6
WebRTCPlayer.vue
components/common/WebRTCPlayer.vue
+12
-2
index.vue
components/common/audio/index.vue
+0
-2
tab.vue
components/dialog/user-dialog/tab.vue
+1
-1
index.vue
pages/index/game/index.vue
+1
-1
audio.js
store/audio.js
+5
-0
No files found.
components/common/WebRTCPlayer.vue
View file @
2e3c52fc
<
template
>
<video
ref=
"jswebrtc"
style=
"width: 100%;height: 100%;object-fit: fill;"
playsinline
@
click=
"(e) => handler().click(e)"
/>
<video
ref=
"jswebrtc"
:controls=
"!videoPlay"
style=
"width: 100%;height: 100%;object-fit: fill;"
playsinline
@
click=
"(e) => handler().click(e)"
/>
</
template
>
<
script
>
import
JSWebrtc
from
'@/utils/jswebrtc.min.js'
import
{
mapState
}
from
'vuex'
import
{
mapState
,
mapMutations
}
from
'vuex'
export
default
{
name
:
"WebRTCPlayer"
,
props
:
{
...
...
@@ -23,6 +23,9 @@ export default {
...
mapState
([
'zoom'
,
]),
...
mapState
(
'audio'
,
[
'videoPlay'
,
]),
...
mapState
(
'audio'
,
[
'volumeMachine'
]),
...
...
@@ -31,6 +34,9 @@ export default {
volumeMachine
(
value
)
{
this
.
$refs
.
jswebrtc
.
volume
=
this
.
volumeMachine
/
100
},
videoPlay
()
{
this
.
$refs
.
jswebrtc
.
play
()
},
},
mounted
()
{
this
.
$watch
(
'videoSrc'
,
()
=>
{
...
...
@@ -48,6 +54,9 @@ export default {
}
},
methods
:
{
...
mapMutations
(
'audio'
,
[
'SetVideoPlay'
,
]),
/**
* 初始化播放器并播放
* 两种调用方式
...
...
@@ -83,6 +92,7 @@ export default {
handler
()
{
return
{
click
:
(
e
)
=>
{
this
.
SetVideoPlay
()
const
{
zoom
}
=
this
const
video
=
this
.
$refs
.
jswebrtc
const
{
offsetWidth
,
offsetHeight
}
=
video
// 组件宽高
...
...
components/common/audio/index.vue
View file @
2e3c52fc
...
...
@@ -54,8 +54,6 @@ export default {
volumeMachine
()
{},
volumeBg
(
value
)
{
this
.
bgAudio
.
volume
=
value
/
100
this
.
bgAudio
.
volume
=
'0'
alert
(
'背景音乐设置1'
+
value
)
},
volumeButton
(
value
)
{
this
.
uiClickAudio
.
volume
=
value
/
100
...
...
components/dialog/user-dialog/tab.vue
View file @
2e3c52fc
...
...
@@ -5,7 +5,7 @@
<img
v-if=
"tabIndex === index"
class=
"tab-img"
src=
"https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/second/Rounded%20Rectangle%2019.png"
alt=
""
>
<img
v-else
class=
"tab-img"
src=
"https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/second/last_game%20%E6%8B%B7%E8%B4%9D%202.png"
alt=
""
>
<div
class=
"text"
>
{{
text
}}
</div>
<div
v-if=
"index === 0"
class=
"version"
>
{{
`1.0.00
6
`
}}
</div>
<div
v-if=
"index === 0"
class=
"version"
>
{{
`1.0.00
7
`
}}
</div>
</div>
</div>
</div>
...
...
pages/index/game/index.vue
View file @
2e3c52fc
...
...
@@ -13,7 +13,7 @@
</div>
<!-- 右侧的直播区域 -->
<div
v-if=
"device"
class=
"right-player"
>
<
!--
<RightPlayer
:device=
"device"
/>
--
>
<
RightPlayer
:device=
"device"
/
>
</div>
</div>
<!-- 音量控制,临时 -->
...
...
store/audio.js
View file @
2e3c52fc
...
...
@@ -6,6 +6,7 @@ export const state = () => ({
volumeMachine
:
100
,
// 机器音量
volumeBg
:
100
,
// 背景音量
volumeButton
:
100
,
// 按钮音量
videoPlay
:
false
,
// 是否曾经播放过
})
export
const
mutations
=
{
...
...
@@ -16,6 +17,7 @@ export const mutations = {
state
.
play
=
new
Date
().
getTime
()
state
.
uiClickType
=
type
state
.
uiClick
=
new
Date
().
getTime
()
state
.
videoPlay
=
true
},
// 设置静音
SetMute
:
(
state
,
data
)
=>
{
...
...
@@ -36,4 +38,7 @@ export const mutations = {
state
.
volumeButton
=
+
data
localStorage
.
setItem
(
'volumeButton'
,
data
)
},
SetVideoPlay
:
(
state
,
data
)
=>
{
state
.
videoPlay
=
true
},
}
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