diff --git a/src/app/listen/_listen.scss b/src/app/listen/_listen.scss index ff9b49d7..6056912c 100644 --- a/src/app/listen/_listen.scss +++ b/src/app/listen/_listen.scss @@ -1,3 +1,17 @@ +#chunkInfo>span:nth-child(2) { + text-align: right; + + input[type="range"] { + width: 300px; + } + + &>span { + width: 40px; + display: inline-block; + } +} + + .position { & span { margin-left: 10px; diff --git a/src/app/listen/listen.js b/src/app/listen/listen.js index 1edac256..7995d079 100644 --- a/src/app/listen/listen.js +++ b/src/app/listen/listen.js @@ -2,6 +2,7 @@ angular.module('bawApp.listen', ['decipher.tags', 'ui.bootstrap.typeahead']) .controller('ListenCtrl', ['$scope', '$resource', + '$location', '$routeParams', '$route', 'conf.paths', @@ -29,8 +30,8 @@ angular.module('bawApp.listen', ['decipher.tags', 'ui.bootstrap.typeahead']) * @param Taggings */ function ListenCtrl( - $scope, $resource, $routeParams, $route, paths, constants, $url, AudioRecording, Media, AudioEvent, Tag, - Taggings) { + $scope, $resource, $location, $routeParams, $route, paths, constants, $url, + AudioRecording, Media, AudioEvent, Tag, Taggings) { var CHUNK_DURATION_SECONDS = constants.listen.chunkDurationSeconds; function getMediaParameters(format) { @@ -147,6 +148,11 @@ angular.module('bawApp.listen', ['decipher.tags', 'ui.bootstrap.typeahead']) function audioRecordingGetSuccess() { // no-op // if an audioRecording 'model' is ever created, this is where we would transform the returned data + + // set up jumpto vars + var maxMinutes = Math.floor(parseFloat($scope.model.audioRecording.durationSeconds) / 60); + $scope.jumpToMax = maxMinutes; + $scope.jumpToMinute = Math.floor( parseFloat($routeParams.start) / 60); }, function audioRecordingGetFailure() { console.error("retrieval of audioRecording json failed"); @@ -310,6 +316,27 @@ angular.module('bawApp.listen', ['decipher.tags', 'ui.bootstrap.typeahead']) throw "Invalid link type specified in createNavigationHref"; }; + $scope.jumpTo = function() { + var maxEnd = Math.floor($scope.model.audioRecording.durationSeconds), + seconds = $scope.jumpToMinute * 60; + if (seconds < 0) { + seconds = 0; + } + if (seconds > (maxEnd - CHUNK_DURATION_SECONDS)) { + seconds = (maxEnd - CHUNK_DURATION_SECONDS); + } + + var url = $url.formatUri( + paths.site.ngRoutes.listen, + { + recordingId: recordingId, + start: seconds, + end: seconds + CHUNK_DURATION_SECONDS + }); + + $location.url(url); + }; + $scope.clearSelected = function () { $scope.model.audioEvents.forEach(function (value, key) { value.selected = false; diff --git a/src/app/listen/listen.tpl.html b/src/app/listen/listen.tpl.html index b1275762..7b926946 100644 --- a/src/app/listen/listen.tpl.html +++ b/src/app/listen/listen.tpl.html @@ -4,8 +4,21 @@
-

Site: {{model.audioRecording.siteId}}, {{absoluteDateChunkStart() | moment:"format":"dddd, MMMM Do YYYY, HH:mm:ss ZZ"}} +

+ + Site: {{model.audioRecording.siteId}}, + {{absoluteDateChunkStart() | moment:"format":"dddd, MMMM Do YYYY, HH:mm:ss ZZ"}} + + + Jump to minute: + + {{jumpToMinute}} + +

+ The recording started on {{model.audioRecording.recordedDate | moment:"format":"MMMM Do YYYY, HH:mm:ss ZZ"}} + and is {{model.audioRecording.durationSeconds | formatTimeSpan}} long. + @@ -212,8 +225,8 @@

Timeline

Stats