jaruba / wcjs-player

Node Player made for WebChimera.js (libVLC wrapper)
http://webchimera.org/
GNU Lesser General Public License v2.1
178 stars 46 forks source link

`addPlaylist()` results in `cannot set property "setting" of undefined` #74

Closed erikyuzwa closed 8 years ago

erikyuzwa commented 8 years ago

Hi, Just trying to use WebChimera in an Electron app and running into this issue.

var wjs = require('wcjs-player'); // valid object
var wcjsPrebuilt = require('wcjs-prebuilt); // valid object
var player = new wjs('#player1').addPlayer({
  autoplay: true,
 wcjs: wcjsPrebuilt
});

console.info(player); // object looks ok in the console
player.addPlaylist('http://archive.org/download/CartoonClassics/Krazy_Kat_-_Keeping_Up_With_Krazy.mp4'); // results in the error

https://github.com/jaruba/wcjs-player/blob/master/index.js#L633

All I can think of is to maybe use item instead of this.itemCount()-1 since we're working with the current item vs. the last item in the playlist Array? I'm not sure what L632 and L633 are for (sorry!)

player.version = v6.0.1

Any ideas? thanks a lot. :bow:

jaruba commented 8 years ago

If it's windows, see this issue comment: https://github.com/jaruba/wcjs-player/issues/72#issuecomment-240388653

What Electron version? (you should also try older electron versions)

erikyuzwa commented 8 years ago

thanks - on a quick skim it does look relevant. I'm using v1.3.5 of Electron. In case that's the issue, what release do you recommend for WebChimera?

erikyuzwa commented 8 years ago

sweet, that worked - still with v1.3.5 of Electron

// in the main.js of your Electron app
let chimeraPath;
if (process.platform === 'win32') {
  chimeraPath = require('path').join(__dirname, 'node_modules/wcjs-prebuilt/bin');
  process.env['VLC_PLUGIN_PATH'] = chimeraPath;
}
jaruba commented 8 years ago

awesome ;)