Update text.md

explanation of how StopOthers work - was bit unclear have to console.log audio, current to see the diff.
pull/4605/head
Robert Balejik 6 years ago committed by GitHub
parent aa3dcc06d6
commit 3c603ddddc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -22,3 +22,6 @@ function stopOthers() {
current = audio; current = audio;
} }
``` ```
``I was bit confused about this lesson - have to console.log(current - audio) to see difference.`` I press Play for 1st time (current is set to corresponding audio tag, e.g current = "Danube waltz").
Then I cick play on other track (audio = Mars) which, triggers "stopOthers" function. That checks if there's some track playing (current is "set" - not null) ``and now the part that was bit magic at 1st`` and whether the 'active' audio tag (Mars) I just clicked !== current (currently playing Waltz).
The statement is true => currently playing Waltz is paused, "active" Mars starts playing and current = "Mars".

Loading…
Cancel
Save