Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
atruskie committed Nov 28, 2013
2 parents 7e37a70 + 9d77ae1 commit 2a224ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/listen/listen.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ <h4 class="center-block">Site: {{model.audioRecording.siteId}}, <span class="hin
</a>
</div>
<div class="btn-group">
<button class="btn btn-default" ng-click="model.audioElement.tostart()">
<span class="glyphicon glyphicon-repeat"></span>
</button>
<button class="btn btn-default" ng-click="model.audioElement.pause()">
<span class="glyphicon glyphicon-pause"></span>
</button>
Expand Down
6 changes: 6 additions & 0 deletions src/components/directives/ngAudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ bawds.directive('ngAudio', ['$parse', function ($parse) {
function pause() {
element.pause();
}

function tostart() {
element.currentTime = 0;
}

var propertiesToUpdate = ['duration', 'src', 'currentSrc', 'volume'];
function updateObject(src, dest) {
Expand All @@ -43,6 +47,7 @@ bawds.directive('ngAudio', ['$parse', function ($parse) {

target.play = target.play || play;
target.pause = target.pause || pause;
target.tostart = target.tostart || tostart;

target.currentState = event && event.type || 'unknown';
updateObject(element ,target);
Expand Down Expand Up @@ -79,6 +84,7 @@ bawds.directive('ngAudio', ['$parse', function ($parse) {
'loadedmetadata': updateState,
'loadstart': updateState,
'mozaudioavailable': undefined,
'tostart' : updateState,
'pause': updateState,
'play': updateState,
'playing': updateState,
Expand Down

0 comments on commit 2a224ec

Please sign in to comment.