angular-soundmanager2 icon indicating copy to clipboard operation
angular-soundmanager2 copied to clipboard

On KeyUp Control Volume & Progress

Open enesyurtlu opened this issue 8 years ago • 0 comments

I want to volume down and up via keyboard control. And made this.

PS: Don't forget to inject "angularPlayer" to your controller.

Demo: http://play.mixboxx.com/

` $scope.setProgress = function (progress) { var playing = soundManager.getSoundById(angularPlayer.getCurrentTrack()); if (progress == "increase") { playing.setPosition(playing.position + 5000); } else { playing.setPosition(playing.position - 5000); } };

$document.bind('keyup', function (e) {
    if (e.keyCode == 40) {
        angularPlayer.adjustVolume(false);
    } else if (e.keyCode == 38) {
        angularPlayer.adjustVolume(true);
    } else if (e.keyCode == 37) {
        $scope.setProgress("decrease");
    } else if (e.keyCode == 39) {
        $scope.setProgress("increase");
    }
});`

enesyurtlu avatar Feb 22 '17 02:02 enesyurtlu