Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
scrm-wx-merchant-activity
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e5ad7f26
authored
Sep 27, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复音频没加载完点击直播后会播放音频BUG
1 parent
be651b29
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
src/utils/audio.js
src/views/crowdfunding/index.vue
src/utils/audio.js
View file @
e5ad7f2
export
function
Audio
(
url
,
callBack
)
{
export
function
Audio
(
url
,
callBack
)
{
// this.IsIOS = false
// this.IsIOS = false
this
.
IsIOS
=
window
.
$IsIOS
this
.
IsIOS
=
window
.
$IsIOS
this
.
audioContext
=
new
(
window
.
AudioContext
||
window
.
webkitAudioContext
||
window
.
mozAudioContext
)()
this
.
audioContext
=
new
(
window
.
AudioContext
||
window
.
webkitAudioContext
||
window
.
mozAudioContext
)()
...
@@ -8,7 +8,7 @@ export function Audio(url, callBack) {
...
@@ -8,7 +8,7 @@ export function Audio(url, callBack) {
this
.
toggleBGM
=
function
(
off
)
{
this
.
toggleBGM
=
function
(
off
)
{
if
(
typeof
this
.
sourceNode
==
'object'
&&
!
this
.
IsIOS
)
{
if
(
typeof
this
.
sourceNode
==
'object'
&&
!
this
.
IsIOS
)
{
if
(
this
.
isPlayingBGM
||
off
)
{
if
(
this
.
isPlayingBGM
||
off
)
{
this
.
sourceNode
.
stop
()
this
.
sourceNode
&&
this
.
sourceNode
.
stop
()
this
.
isPlayingBGM
=
false
this
.
isPlayingBGM
=
false
console
.
log
(
'暂停——————————————'
,
this
.
sourceNode
)
console
.
log
(
'暂停——————————————'
,
this
.
sourceNode
)
}
else
this
.
_playSourceNode
()
}
else
this
.
_playSourceNode
()
...
@@ -20,7 +20,7 @@ export function Audio(url, callBack) {
...
@@ -20,7 +20,7 @@ export function Audio(url, callBack) {
this
.
stopVideo
=
function
()
{
this
.
stopVideo
=
function
()
{
if
(
typeof
this
.
sourceNode
==
'object'
&&
!
this
.
IsIOS
)
{
if
(
typeof
this
.
sourceNode
==
'object'
&&
!
this
.
IsIOS
)
{
if
(
this
.
isPlayingBGM
)
{
if
(
this
.
isPlayingBGM
)
{
this
.
sourceNode
.
stop
()
this
.
sourceNode
&&
this
.
sourceNode
.
stop
()
this
.
isPlayingBGM
=
false
this
.
isPlayingBGM
=
false
console
.
log
(
'暂停——————————————'
,
this
.
sourceNode
)
console
.
log
(
'暂停——————————————'
,
this
.
sourceNode
)
}
}
...
...
src/views/crowdfunding/index.vue
View file @
e5ad7f2
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
Attach a file
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 post a comment