Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added getVolume() and setVolume(). #12

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/libvlc.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ exports.initialize = function(paths) {
libvlc_get_compiler: ['string', []],
libvlc_get_changeset: ['string', []],
libvlc_free: ['void', ['pointer']],
libvlc_event_attach: ['int32', ['pointer', 'int32', 'pointer', ref.types.Object]],
libvlc_event_detach: ['void', ['pointer', 'int32', 'pointer', ref.types.Object]],
libvlc_event_attach: ['int32', ['pointer', 'int32', 'pointer', 'pointer']],
libvlc_event_detach: ['void', ['pointer', 'int32', 'pointer', 'pointer']],
libvlc_event_type_name: ['string', ['int32']],
libvlc_module_description_list_release: ['void', [ModuleDescriptionPtr]],
libvlc_audio_filter_list_get: [ModuleDescriptionPtr, ['pointer']],
Expand Down
12 changes: 12 additions & 0 deletions lib/mediaplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,18 @@ var MediaPlayer = module.exports = function (parent) {
lib.libvlc_media_player_stop(self.instance);
};

// getVolume() and setVolume added 8/May/16 by https://github.com/aallan

this.setVolume = function (vol) {
lib.libvlc_audio_set_volume(self.instance, vol);
};

this.getVolume = function () {
return lib.libvlc_audio_set_volume(self.instance);
}

// end of changes

var _on = this.on;
this.on = function (e, cb) {
var tmp;
Expand Down
6 changes: 5 additions & 1 deletion vlc.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ var VLC = function (args) {
Media = require('./lib/media');
VLM = require('./lib/vlm');
}


if(!args) {
args = [];
}

var mediaplayer, vlm;
var released = false;

Expand Down