Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.

Commit a926e81

Browse files
committed
[Wave] Fixed player bug
no refs. The floating player and the player on posts didn't start new audio nor pause already playing audio.
1 parent 7c2e314 commit a926e81

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

Diff for: assets/built/main.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: assets/built/main.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: assets/built/screen.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: assets/js/main.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function player() {
2929
var playerSpeed = 1;
3030
var speedButton = jQuery('.player-speed');
3131

32-
jQuery('.post-feed').on('click', '.js-play', function () {
32+
jQuery('.site').on('click', '.js-play', function () {
3333
var clicked = jQuery(this);
3434

3535
if (clicked.hasClass('post-play')) {
@@ -68,14 +68,15 @@ function player() {
6868
});
6969

7070
playerAudio.on('timeupdate', function () {
71+
const duration = isNaN(playerAudio[0].duration) ? 0 : playerAudio[0].duration;
7172
timeDuration.text(
72-
new Date(playerAudio[0].duration * 1000).toISOString().substr(11, 8)
73+
new Date(duration * 1000).toISOString().substring(11, 19)
7374
);
7475
playerAudio[0].addEventListener('timeupdate', function (e) {
7576
timeCurrent.text(
7677
new Date(e.target.currentTime * 1000)
7778
.toISOString()
78-
.substr(11, 8)
79+
.substring(11, 19)
7980
);
8081
playerProgress.css(
8182
'width',

0 commit comments

Comments
 (0)