Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arthur Brugière
funkwhale
Commits
75a1d749
Commit
75a1d749
authored
3 years ago
by
rrrnld
Committed by
Georg Krause
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Stop all other tracks when loading a new track
parent
6340aad8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/changelog.d/1291.bugfix
+1
-0
1 addition, 0 deletions
changes/changelog.d/1291.bugfix
front/src/components/audio/Player.vue
+14
-17
14 additions, 17 deletions
front/src/components/audio/Player.vue
with
15 additions
and
17 deletions
changes/changelog.d/1291.bugfix
0 → 100644
+
1
−
0
View file @
75a1d749
Fix tracks playing in the background without the ability to control them (#1213) (#1387)
This diff is collapsed.
Click to expand it.
front/src/components/audio/Player.vue
+
14
−
17
View file @
75a1d749
...
...
@@ -304,21 +304,15 @@ export default {
toggleMute
:
"
player/toggleMute
"
,
}),
async
getTrackData
(
trackData
)
{
let
data
=
null
if
(
!
trackData
.
uploads
.
length
||
trackData
.
uploads
.
length
===
0
)
{
// we don't have upload informations for this track, we need to fetch it
await
axios
.
get
(
`tracks/
${
trackData
.
id
}
/`
).
then
((
response
)
=>
{
data
=
response
.
data
},
error
=>
{
data
=
null
})
}
else
{
return
trackData
}
if
(
data
===
null
)
{
return
}
return
data
// use previously fetched trackData
if
(
trackData
.
uploads
.
length
)
return
trackData
// we don't have any information for this track, we need to fetch it
return
axios
.
get
(
`tracks/
${
trackData
.
id
}
/`
)
.
then
(
response
=>
response
.
data
,
err
=>
null
)
},
shuffle
()
{
let
disabled
=
this
.
queue
.
tracks
.
length
===
0
...
...
@@ -611,8 +605,11 @@ export default {
async
loadSound
(
newValue
,
oldValue
)
{
let
trackData
=
newValue
let
oldSound
=
this
.
currentSound
// stop all other sounds!
// we do this here (before the track has loaded) to get a predictable
// song order.
Howler
.
stop
()
if
(
oldSound
&&
trackData
!==
oldValue
)
{
oldSound
.
stop
(
this
.
soundId
)
this
.
soundId
=
null
}
if
(
!
trackData
)
{
...
...
@@ -620,7 +617,7 @@ export default {
}
if
(
!
this
.
isShuffling
&&
trackData
!=
oldValue
)
{
trackData
=
await
this
.
getTrackData
(
trackData
)
if
(
trackData
==
=
null
)
{
if
(
trackData
==
null
)
{
this
.
handleError
({})
}
this
.
currentSound
=
this
.
getSound
(
trackData
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment