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
Model registry
Operate
Environments
Monitor
Incidents
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
JocelynDelalande
funkwhale
Commits
13eddbfc
Verified
Commit
13eddbfc
authored
7 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Fixed #46: better handling of HTTP errors when fetching audio file
parent
a4e31cdb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG
+1
-0
1 addition, 0 deletions
CHANGELOG
front/src/audio/index.js
+6
-1
6 additions, 1 deletion
front/src/audio/index.js
front/src/audio/queue.js
+5
-2
5 additions, 2 deletions
front/src/audio/queue.js
with
12 additions
and
3 deletions
CHANGELOG
+
1
−
0
View file @
13eddbfc
...
...
@@ -6,6 +6,7 @@ Changelog
------------------
- Import: can now specify search template when querying import sources (#45)
- Player: better handling of errors when fetching the audio file (#46)
0.2.4 (2017-12-14)
...
...
This diff is collapsed.
Click to expand it.
front/src/audio/index.js
+
6
−
1
View file @
13eddbfc
...
...
@@ -26,6 +26,7 @@ class Audio {
if
(
options
.
onEnded
)
{
this
.
onEnded
=
options
.
onEnded
}
this
.
onError
=
options
.
onError
this
.
state
=
{
preload
:
preload
,
...
...
@@ -60,8 +61,12 @@ class Audio {
init
(
src
,
options
=
{})
{
if
(
!
src
)
throw
Error
(
'
src must be required
'
)
this
.
state
.
startLoad
=
true
if
(
this
.
state
.
tried
==
=
this
.
state
.
try
)
{
if
(
this
.
state
.
tried
>
=
this
.
state
.
try
)
{
this
.
state
.
failed
=
true
logger
.
default
.
error
(
'
Cannot fetch audio
'
,
src
)
if
(
this
.
onError
)
{
this
.
onError
(
src
)
}
return
}
this
.
$Audio
=
new
window
.
Audio
(
src
)
...
...
This diff is collapsed.
Click to expand it.
front/src/audio/queue.js
+
5
−
2
View file @
13eddbfc
...
...
@@ -140,7 +140,6 @@ class Queue {
}
else
{
index
=
index
||
this
.
tracks
.
length
}
console
.
log
(
'
INDEEEEEX
'
,
index
)
tracks
.
forEach
((
t
)
=>
{
self
.
append
(
t
,
index
,
true
)
index
+=
1
...
...
@@ -243,7 +242,11 @@ class Queue {
rate
:
1
,
loop
:
false
,
volume
:
this
.
state
.
volume
,
onEnded
:
this
.
handleAudioEnded
.
bind
(
this
)
onEnded
:
this
.
handleAudioEnded
.
bind
(
this
),
onError
:
function
(
src
)
{
self
.
errored
=
true
self
.
next
()
}
})
this
.
audio
=
audio
audio
.
updateHook
(
'
playState
'
,
function
(
e
)
{
...
...
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