Skip to content

On KeyUp Control Volume & Progress #65

@enesyurtlu

Description

@enesyurtlu

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");
    }
});`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions