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

add playing status on video feed. #45

Open
martinorob opened this issue Oct 8, 2017 · 0 comments
Open

add playing status on video feed. #45

martinorob opened this issue Oct 8, 2017 · 0 comments

Comments

@martinorob
Copy link

Hi to all,
i wann add the playing status of iTunes on the "Now Playing" video feed.

i have tried this but don't work..
any suggestion?

Thanks

ITunesPlatform.prototype.writeMediaInformationFiles = function(){
  var papds = this.primaryAccessory.getService(HomeKitMediaTypes.PlaybackDeviceService);
#####
var statu = papds.getCharacteristic(HomeKitMediaTypes.PlaybackState).value;
####
  var name = papds.getCharacteristic(HomeKitMediaTypes.MediaItemName).value;
  var album = papds.getCharacteristic(HomeKitMediaTypes.MediaItemAlbumName).value;
  var artist = papds.getCharacteristic(HomeKitMediaTypes.MediaItemArtist).value;
  var duration = papds.getCharacteristic(HomeKitMediaTypes.MediaItemDuration).value;
  var position = papds.getCharacteristic(HomeKitMediaTypes.MediaCurrentPosition).value;
  var pbsize = 50;
  var progressBar = '-'.repeat(Math.floor(pbsize*position/duration)) + '|' + '-'.repeat(Math.ceil(pbsize*(duration-position)/duration)-1);

  try {
    fs.writeFileSync(
      "/tmp/homebridge-itunes-nowplaying.txt",
      wrap(50)(status + '\n\n' + name + '\n\n' + album + '\n\n' + artist) + '\n\n' + this._hhmmss(position) + ' ' + progressBar + ' ' + this._hhmmss(duration - position)
    );
  } catch(e){
    debug(e);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant