From 9d77ae11dc471d066667cc5cc874377aefe33fb9 Mon Sep 17 00:00:00 2001 From: Phil Date: Thu, 28 Nov 2013 17:49:38 +1000 Subject: [PATCH] Added repeat button to seek to start --- src/app/listen/listen.tpl.html | 3 +++ src/components/directives/ngAudio.js | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/app/listen/listen.tpl.html b/src/app/listen/listen.tpl.html index fae870ed..4e561441 100644 --- a/src/app/listen/listen.tpl.html +++ b/src/app/listen/listen.tpl.html @@ -25,6 +25,9 @@

Site: {{model.audioRecording.siteId}}, + diff --git a/src/components/directives/ngAudio.js b/src/components/directives/ngAudio.js index f2d5adf6..ed76ecab 100644 --- a/src/components/directives/ngAudio.js +++ b/src/components/directives/ngAudio.js @@ -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) { @@ -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); @@ -79,6 +84,7 @@ bawds.directive('ngAudio', ['$parse', function ($parse) { 'loadedmetadata': updateState, 'loadstart': updateState, 'mozaudioavailable': undefined, + 'tostart' : updateState, 'pause': updateState, 'play': updateState, 'playing': updateState,