Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Latest commit

 

History

History
43 lines (36 loc) · 1.29 KB

README.md

File metadata and controls

43 lines (36 loc) · 1.29 KB

TiRemoteControl

This module makes your titanium applications to extend AV-related functions of iOS.

  • You can handle events of earphone's remote-control. (play, pause, nextTrack and so on.)

  • You can show some information of playing track to a locked screen and etc.

  • Update : Added albumArtwork (using URL) to lockscreen info. (@Kosso)

How to Use

var Control = require('net.hoyohoyo.tiremotecontrol');

Control.setNowPlayingInfo({
  artist: 'someone',
  title: 'Happy Birthday to You',
  albumTitle: 'unknown',
  albumArtworkLocal: true,                          // true for LOCAL IMAGE false for REMOTE IMAGE
  albumArtwork : 'appicon.png',                     // LOCAL IMAGE - Image Name (eg: 'appicon.png') inside resources folder 
                                                    // REMOTE IMAGE - URL (eg: http://an.image.url)
});

Control.addEventListener('remotecontrol', function(e) {
  Ti.API.debug('remote control event was fired!');
  switch (e.subtype) {
    case Control.REMOTE_CONTROL_PLAY:
      break;
    case Control.REMOTE_CONTROL_PAUSE:
      break;
    case Control.REMOTE_CONTROL_STOP:
      break;
    case Control.REMOTE_CONTROL_PLAY_PAUSE:
      break;
    case Control.REMOTE_CONTROL_PREV:
      break;
    case Control.REMOTE_CONTROL_NEXT:
      break;
  }
});