Skip to content

Commit

Permalink
fixes play() error
Browse files Browse the repository at this point in the history
  • Loading branch information
rzhekova committed Nov 15, 2018
1 parent ab9a501 commit 26a9d19
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 43 deletions.
5 changes: 1 addition & 4 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
<head>
<meta charset="utf-8" />

<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<!--
manifest.json provides metadata used when your web app is added to the
Expand Down
52 changes: 17 additions & 35 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -175,39 +175,21 @@ input[type="range"]::-moz-range-thumb {
padding: 0;
}

/*
input[type="range"]::-ms-track {
height: 8.4px;
cursor: pointer;
animation: 0.2s;
background: transparent;
border-color: transparent;
border-width: 16px 0;
color: transparent;
}
input[type="range"]::-ms-fill-lower {
background: grey;
border: 0.2px solid #010101;
border-radius: 2.6px;
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
}
input[type="range"]::-ms-fill-upper {
background: #3071a9;
border: 0.2px solid #010101;
border-radius: 2.6px;
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
}
input[type="range"]::-ms-thumb {
border: 2px solid #000000;
height: 20px;
width: 20px;
border-radius: 50%px;
background: #ffffff;
cursor: pointer;
}
input[type="range"]:focus::-ms-fill-lower {
background: #3071a9;
@media all and (max-width: 500px) {
.podcast-description {
width: 480px;
margin: 15px;
}

.audio-player {
padding: 0;
width: 480px;
margin: 10px 20px;
padding-bottom: 10px;
}

ul {
width: 80%;
margin: 0 auto;
}
}
input[type="range"]:focus::-ms-fill-upper {
background: #367ebd;
} */
11 changes: 7 additions & 4 deletions src/components/PodcastField.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class PodcastField extends PureComponent {
show: {},
episodes: [],
track_id: "",
previousEpisodeIndex: 0,
// previousEpisodeIndex: 0,
currentEpisodeIndex: 0,
isPlaying: false,
hasPlayed: true,
Expand Down Expand Up @@ -90,7 +90,7 @@ class PodcastField extends PureComponent {
player.src = `https://api.spreaker.com/v2/episodes/${nextTrackId}/play`;
this.play();
this.setState({
previousEpisodeIndex: currentEpisodeIndex,
// previousEpisodeIndex: currentEpisodeIndex,
currentEpisodeIndex: ++currentEpisodeIndex,
track_id: nextTrackId
});
Expand All @@ -113,7 +113,7 @@ class PodcastField extends PureComponent {
this.play();

this.setState({
previousEpisodeIndex: currentEpisodeIndex,
// previousEpisodeIndex: currentEpisodeIndex,
currentEpisodeIndex: --currentEpisodeIndex,
track_id: prevTrackId
});
Expand All @@ -135,9 +135,12 @@ class PodcastField extends PureComponent {
});
}

setTimeout(function() {
player.play();
}, 150);

utils.handleProgress();
utils.handleVolume();
player.play();
this.setState({ isPlaying: true });

player.onended = () => {
Expand Down

0 comments on commit 26a9d19

Please sign in to comment.