Skip to content

Commit

Permalink
fix: dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
tanguyantoine committed Oct 12, 2020
1 parent 77121ee commit a003519
Show file tree
Hide file tree
Showing 6 changed files with 3,034 additions and 88 deletions.
7 changes: 4 additions & 3 deletions lib/constants.android.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var react_native_1 = require('react-native');
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// @ts-ignore
var react_native_1 = require("react-native");
var NativeMusicControl = react_native_1.NativeModules.MusicControlManager;
var STATE_PLAYING = NativeMusicControl.STATE_PLAYING;
var STATE_PAUSED = NativeMusicControl.STATE_PAUSED;
Expand Down
7 changes: 4 additions & 3 deletions lib/constants.ios.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var react_native_1 = require('react-native');
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// @ts-ignore
var react_native_1 = require("react-native");
var NativeMusicControl = react_native_1.NativeModules.MusicControlManager;
var STATE_PLAYING = NativeMusicControl.STATE_PLAYING;
var STATE_PAUSED = NativeMusicControl.STATE_PAUSED;
Expand Down
4 changes: 0 additions & 4 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/**
* @providesModule MusicControl
*/
import { Command } from './types';
declare const MusicControl: {
STATE_PLAYING: any;
Expand All @@ -14,7 +11,6 @@ declare const MusicControl: {
RATING_4_STARS: any;
RATING_5_STARS: any;
RATING_PERCENTAGE: any;
setNotificationIds: (notificationId: number, channelId: String) => void;
enableBackgroundMode: (enable: boolean) => void;
setNowPlaying: (info: any) => void;
setPlayback: (info: any) => void;
Expand Down
31 changes: 11 additions & 20 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
'use strict';
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @providesModule MusicControl
*/
var __importDefault =
(this && this.__importDefault) ||
function (mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, '__esModule', { value: true });
var react_native_1 = require('react-native');
// @ts-ignore
var resolveAssetSource_1 = __importDefault(require('react-native/Libraries/Image/resolveAssetSource'));
var react_native_1 = require("react-native");
// @ts-ignore
var resolveAssetSource_1 = __importDefault(require("react-native/Libraries/Image/resolveAssetSource"));
// @ts-ignore
var constants_1 = __importDefault(require('./constants'));
var constants_1 = __importDefault(require("./constants"));
var NativeMusicControl = react_native_1.NativeModules.MusicControlManager;
var handlers = {};
var listenerOfNativeMusicControl = null;
Expand All @@ -32,11 +31,6 @@ var MusicControl = {
enableBackgroundMode: function (enable) {
NativeMusicControl.enableBackgroundMode(enable);
},
setNotificationIds: function (notificationId, channelId) {
if (IS_ANDROID) {
NativeMusicControl.setNotificationIds(notificationId, channelId);
}
},
setNowPlaying: function (info) {
// Check if we have an android asset from react style image require
if (info.artwork) {
Expand All @@ -55,9 +49,7 @@ var MusicControl = {
NativeMusicControl.resetNowPlaying();
},
enableControl: function (controlName, enable, options) {
if (options === void 0) {
options = {};
}
if (options === void 0) { options = {}; }
NativeMusicControl.enableControl(controlName, enable, options || {});
},
handleCommand: function (commandName, value) {
Expand All @@ -70,8 +62,7 @@ var MusicControl = {
if (!listenerOfNativeMusicControl) {
listenerOfNativeMusicControl = (IS_ANDROID
? react_native_1.DeviceEventEmitter
: new react_native_1.NativeEventEmitter(NativeMusicControl)
).addListener('RNMusicControlEvent', function (event) {
: new react_native_1.NativeEventEmitter(NativeMusicControl)).addListener('RNMusicControlEvent', function (event) {
MusicControl.handleCommand(event.name, event.value);
});
}
Expand Down
40 changes: 20 additions & 20 deletions lib/types.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Command;
(function (Command) {
Command['play'] = 'play';
Command['pause'] = 'pause';
Command['stop'] = 'stop';
Command['nextTrack'] = 'nextTrack';
Command['previousTrack'] = 'previousTrack';
Command['seekForward'] = 'seekForward';
Command['seekBackward'] = 'seekBackward';
Command['seek'] = 'seek';
Command['volume'] = 'volume';
Command['setRating'] = 'setRating';
Command['togglePlayPause'] = 'togglePlayPause';
Command['enableLanguageOption'] = 'enableLanguageOption';
Command['disableLanguageOption'] = 'disableLanguageOption';
Command['skipForward'] = 'skipForward';
Command['skipBackward'] = 'skipBackward';
Command['changePlaybackPosition'] = 'changePlaybackPosition';
Command['closeNotification'] = 'closeNotification';
})((Command = exports.Command || (exports.Command = {})));
Command["play"] = "play";
Command["pause"] = "pause";
Command["stop"] = "stop";
Command["nextTrack"] = "nextTrack";
Command["previousTrack"] = "previousTrack";
Command["seekForward"] = "seekForward";
Command["seekBackward"] = "seekBackward";
Command["seek"] = "seek";
Command["volume"] = "volume";
Command["setRating"] = "setRating";
Command["togglePlayPause"] = "togglePlayPause";
Command["enableLanguageOption"] = "enableLanguageOption";
Command["disableLanguageOption"] = "disableLanguageOption";
Command["skipForward"] = "skipForward";
Command["skipBackward"] = "skipBackward";
Command["changePlaybackPosition"] = "changePlaybackPosition";
Command["closeNotification"] = "closeNotification";
})(Command = exports.Command || (exports.Command = {}));
Loading

0 comments on commit a003519

Please sign in to comment.