Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
arsnova-click-v2-frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
ARSnova
arsnova-click-v2-frontend
Commits
4ad94e6c
Commit
4ad94e6c
authored
Nov 15, 2019
by
Christopher Fullarton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes console error when setting null values as volume for the quiz sound
parent
89563042
Pipeline
#33459
passed with stages
in 15 minutes and 13 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
sound-manager.component.ts
...uiz/quiz-manager/sound-manager/sound-manager.component.ts
+1
-1
audio-player.component.ts
src/app/shared/audio-player/audio-player.component.ts
+3
-3
No files found.
src/app/quiz/quiz-manager/sound-manager/sound-manager.component.ts
View file @
4ad94e6c
...
...
@@ -176,7 +176,7 @@ export class SoundManagerComponent implements OnInit, OnDestroy {
if
(
isPlatformBrowser
(
this
.
platformId
))
{
const
audioElements
=
document
.
getElementsByTagName
(
'
audio
'
);
for
(
let
i
=
0
;
i
<
audioElements
.
length
;
i
++
)
{
(
<
HTMLAudioElement
>
audioElements
.
item
(
i
)).
volume
=
(
this
.
config
.
volumeConfig
[
target
]
||
60
)
/
100
;
(
<
HTMLAudioElement
>
audioElements
.
item
(
i
)).
volume
=
(
parseInt
(
String
(
this
.
config
.
volumeConfig
[
target
]),
10
)
||
60
)
/
100
;
}
}
}
...
...
src/app/shared/audio-player/audio-player.component.ts
View file @
4ad94e6c
...
...
@@ -40,7 +40,7 @@ export class AudioPlayerComponent implements AfterViewInit, OnDestroy {
this
.
_original_volume
=
value
;
this
.
_volume
=
this
.
_original_volume
;
if
(
this
.
audioElement
)
{
this
.
audioElement
.
volume
=
parseInt
(
this
.
_volume
,
1
0
)
/
100
;
this
.
audioElement
.
volume
=
(
parseInt
(
this
.
_volume
,
10
)
||
0
)
/
100
;
}
}
...
...
@@ -81,7 +81,7 @@ export class AudioPlayerComponent implements AfterViewInit, OnDestroy {
set
volume
(
value
:
string
)
{
this
.
_volume
=
value
;
this
.
volumeChange
.
emit
(
this
.
volume
);
this
.
audioElement
.
volume
=
parseInt
(
this
.
volume
,
1
0
)
/
100
;
this
.
audioElement
.
volume
=
(
parseInt
(
this
.
_volume
,
10
)
||
0
)
/
100
;
}
private
_isPlaying
=
false
;
...
...
@@ -123,7 +123,7 @@ export class AudioPlayerComponent implements AfterViewInit, OnDestroy {
}
public
ngAfterViewInit
():
void
{
this
.
audioElement
.
volume
=
parseInt
(
this
.
_volume
,
1
0
)
/
100
;
this
.
audioElement
.
volume
=
(
parseInt
(
this
.
_volume
,
10
)
||
0
)
/
100
;
}
public
ngOnDestroy
():
void
{
...
...
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