Skip to content

Commit

Permalink
Solved: when scrubber is at the end and play is hit audio starts from…
Browse files Browse the repository at this point in the history
… beginning
  • Loading branch information
rahulmaddineni authored and peterbsmyth committed Oct 3, 2016
1 parent 0d7f6fe commit cc8ede7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion demo/pow.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/player.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
</style>

<div class="player">
<p class="message"></p>
<div class="controls">
<svg id="playButton" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 41.999 41.999"><path d="M36.068 20.176l-29-20C6.761-0.035 6.363-0.057 6.035 0.114 5.706 0.287 5.5 0.627 5.5 0.999v40c0 0.372 0.206 0.713 0.535 0.886 0.146 0.076 0.306 0.114 0.465 0.114 0.199 0 0.397-0.06 0.568-0.177l29-20c0.271-0.187 0.432-0.494 0.432-0.823S36.338 20.363 36.068 20.176z"/></svg>
<div class="track">
Expand Down
3 changes: 3 additions & 0 deletions src/pow.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@

Player.prototype.play = function( position ) {
this.connect();
if(this.position === this.buffer.duration){
this.position = 0;
}
this.position = typeof position === 'number' ? position : this.position || 0;
this.startTime = this.ac.currentTime - ( this.position || 0 );
this.source.start(this.ac.currentTime, this.position);
Expand Down

0 comments on commit cc8ede7

Please sign in to comment.