Comments (8)
Have you set the option before or after .play()? Because it works fine, if I set it before playing. Probably does not apply after playing the track.
from mplayer.
from mplayer.
Look at my last solution! Not this one!
Ok I don't know why it worked at first or if I got confused with other tests. Now it was also broken for me. Anyways...
The problem it seems is that the varargs do not work. Due to this the length of the argument is always 0/undefined so the length check fails everytime.
My Solution (dirty fix):
Pass the arguments as an array:
.setOptions(['loop 0','speed 2'])//multiple args
.setOptions('loop 0')//single arg
And modify the line with 'set_property' in the setOptions function inside the index.js to:
this.player.cmd('set_property', value);//[key, value] old code
Beware that the changes might get overwritten by npm after an other installations. So copy the mplayer folder into the project root and use the following instead:
require('./mplayer'); //for local module
This solution is not really elegant compared to the one of noodny's, but it ain't broken for me.
Maybe he could tell us why it does not work anymore. Could be a problem with lodash, but its just a bad guess.
I also tried to set 'loop 0' after the start of the track and it works as long as it is still playing!
I hope this works for you!
from mplayer.
I figured the problem out, but I am at university without my laptop today. So I cant test it in Node. I coded in an online Js editor with my phone. So if you want the fix how it should have been in the first place wait until my new post! (in approximately 7h) π
from mplayer.
from mplayer.
Solution
Replace the setOptions function with the following. Now the function should work as expected!
setOptions: function(options) {
if(options && Object.keys(options).length) {
Object.keys(options).forEach(function(key) {
this.player.cmd('set_property', [key, options[key]]);
}.bind(this));
}
}
from mplayer.
I want to set the volume before executing player.openPlaylist()
. Is this the same issue we are talking about in this issue? The only way for setting the volume seems to be after invoking openPlaylist
with a timeout of 1000ms. There must be another way?
from mplayer.
It should probably work with this fix, because every function that sets any option uses setOption.
You can probably use openPlaylist(playlistfile, {volume:40})
to set the volume.
A more patched version of the player can be found at Technici4n/mplayer.
As long as noodny does not merge any pull requests.
from mplayer.
Related Issues (17)
- No README
- Next / Previous Track HOT 1
- setOptions({speed:1.xx}) doesn't seem to work HOT 1
- Error volumen control HOT 1
- openURL
- Windows: You are my hero!
- Changing the volume and playing a track seems to emit two track stopped events when tracks ends! HOT 1
- How to configure the binary location? HOT 1
- Stuttering playback when accessing files from NAS remote share HOT 1
- EventEmitter setmaxlisteners options needed
- Video volume is not working
- Timechange on Raspberry pi HOT 5
- Feature request: error event HOT 1
- Stop command sometime fail
- complete example? HOT 3
- openFile once paused seems to invert playing status
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mplayer.