@jellybrick/mpris-service 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.dockerignore ADDED
@@ -0,0 +1 @@
1
+ node_modules
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="DiscordProjectSettings">
4
+ <option name="show" value="ASK" />
5
+ <option name="description" value="" />
6
+ </component>
7
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="JavaScriptLibraryMappings">
4
+ <includedPredefinedLibrary name="Node.js Core" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/mpris-service.iml" filepath="$PROJECT_DIR$/.idea/mpris-service.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
7
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
+ </content>
9
+ <orderEntry type="inheritedJdk" />
10
+ <orderEntry type="sourceFolder" forTests="false" />
11
+ </component>
12
+ </module>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
package/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ language: minimal
2
+ sudo: required
3
+ dist: focal
4
+ services:
5
+ - docker
6
+ before_install:
7
+ - docker build -t mpris-service-test .
8
+ script:
9
+ - docker run -it mpris-service-test
package/Dockerfile ADDED
@@ -0,0 +1,31 @@
1
+ FROM ubuntu:20.04
2
+
3
+ WORKDIR /app
4
+
5
+ RUN echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup
6
+ RUN echo 'APT::Acquire::Retries "5";' > /etc/apt/apt.conf.d/80retry
7
+
8
+ RUN export DEBIAN_FRONTEND=noninteractive; \
9
+ export DEBCONF_NONINTERACTIVE_SEEN=true; \
10
+ echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \
11
+ echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections; \
12
+ apt update && apt install -y --no-install-recommends \
13
+ build-essential \
14
+ curl \
15
+ ca-certificates \
16
+ git \
17
+ python2 \
18
+ dbus
19
+
20
+ ADD package.json /app
21
+
22
+ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash && \
23
+ . /root/.nvm/nvm.sh && \
24
+ for v in v6.17.1 v14.16.0; do \
25
+ nvm install $v; \
26
+ done ; \
27
+ npm install
28
+
29
+ ADD . /app
30
+
31
+ CMD [ "make", "test" ]
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 emersion
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
package/Makefile ADDED
@@ -0,0 +1,14 @@
1
+ .PHONY: docker-test test
2
+
3
+ docker-test:
4
+ docker build -t mpris-service-test .
5
+ docker run -it mpris-service-test
6
+
7
+ test:
8
+ . /root/.nvm/nvm.sh ; \
9
+ for v in v6.17.1 v14.16.0 ; do \
10
+ nvm use $$v ; \
11
+ PYTHON=python2 npm install ; \
12
+ PYTHON=python2 npm rebuild ; \
13
+ dbus-run-session npm run test ; \
14
+ done
package/README.md ADDED
@@ -0,0 +1,129 @@
1
+ # mpris-service
2
+
3
+ [![Build Status](https://travis-ci.org/dbusjs/mpris-service.svg?branch=master)](https://travis-ci.org/dbusjs/mpris-service)
4
+
5
+ Node.js implementation for the MPRIS D-Bus Interface Specification to create a mediaplayer service.
6
+
7
+ [Documentation](http://specifications.freedesktop.org/mpris-spec/latest/)
8
+
9
+ [Chat](https://discord.gg/UdbXHVX)
10
+
11
+ ```js
12
+ var Player = require('mpris-service');
13
+
14
+ var player = new Player({
15
+ name: 'nodejs',
16
+ identity: 'Node.js media player',
17
+ supportedUriSchemes: ['file'],
18
+ supportedMimeTypes: ['audio/mpeg', 'application/ogg'],
19
+ supportedInterfaces: ['player']
20
+ });
21
+ ```
22
+
23
+ Implemented interfaces:
24
+ * [`org.mpris.MediaPlayer2`](http://specifications.freedesktop.org/mpris-spec/latest/Media_Player.html)
25
+ * [`org.mpris.MediaPlayer2.Player`](http://specifications.freedesktop.org/mpris-spec/latest/Player_Interface.html)
26
+ * [`org.mpris.MediaPlayer2.TrackList`](http://specifications.freedesktop.org/mpris-spec/latest/Track_List_Interface.html)
27
+ * [`org.mpris.MediaPlayer2.Playlists`](http://specifications.freedesktop.org/mpris-spec/latest/Playlists_Interface.html)
28
+
29
+ Examples are available in [`examples/`](https://github.com/dbusjs/mpris-service/tree/master/examples).
30
+
31
+ ## Default interface
32
+
33
+ ```js
34
+ player.on('quit', function () {
35
+ process.exit();
36
+ });
37
+ ```
38
+
39
+ Events:
40
+ * `raise`
41
+ * `quit`
42
+ * `fullscreen`
43
+
44
+ Properties:
45
+ * `identity`
46
+ * `name`
47
+ * `supportedUriSchemes`
48
+ * `supportedMimeTypes`
49
+ * `desktopEntry`
50
+
51
+ ## Player
52
+
53
+ ```js
54
+ // See http://www.freedesktop.org/wiki/Specifications/mpris-spec/metadata/
55
+ player.metadata = {
56
+ 'mpris:trackid': player.objectPath('track/0'),
57
+ 'mpris:length': 60 * 1000 * 1000, // In microseconds
58
+ 'mpris:artUrl': 'https://pbs.twimg.com/profile_images/378800000822867536/3f5a00acf72df93528b6bb7cd0a4fd0c.jpeg',
59
+ 'xesam:title': 'Best song',
60
+ 'xesam:album': 'Best album',
61
+ 'xesam:artist': ['Best singer']
62
+ };
63
+
64
+ player.playbackStatus = 'Playing';
65
+ ```
66
+
67
+ See `examples/player.js`.
68
+
69
+ Events:
70
+ * `next`
71
+ * `previous`
72
+ * `pause`
73
+ * `playpause`
74
+ * `stop`
75
+ * `play`
76
+ * `seek`
77
+ * `open`
78
+ * `loopStatus`
79
+ * `rate`
80
+ * `shuffle`
81
+ * `volume`
82
+
83
+ Properties:
84
+ * `playbackStatus`
85
+ * `loopStatus`
86
+ * `rate`
87
+ * `shuffle`
88
+ * `volume`
89
+ * `metadata`
90
+ * `minimumRate`
91
+ * `maximumRate`
92
+ * `canGoNext`
93
+ * `canGoPrevious`
94
+ * `canPlay`
95
+ * `canPause`
96
+ * `canSeek`
97
+ * `canControl`
98
+
99
+ Methods:
100
+ * `seeked(position)`
101
+ * `getPosition()` (should be overridden to return the current position)
102
+
103
+ ## TrackList
104
+
105
+ Events:
106
+ * `addTrack`
107
+ * `removeTrack`
108
+ * `goTo`
109
+
110
+ Properties:
111
+ * `tracks`
112
+ * `canEditTracks`
113
+
114
+ Methods:
115
+ * `addTrack(track)`
116
+ * `removeTrack(trackId)`
117
+
118
+ ## Playlists
119
+
120
+ Events:
121
+ * `activatePlaylist`
122
+
123
+ Properties:
124
+ * `playlists`
125
+ * `activePlaylist`
126
+
127
+ Methods:
128
+ * `setPlaylists(playlists)`
129
+ * `setActivePlaylist(playlistId)`
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ const constants = {
4
+ PLAYBACK_STATUS_PLAYING: 'Playing',
5
+ PLAYBACK_STATUS_PAUSED: 'Paused',
6
+ PLAYBACK_STATUS_STOPPED: 'Stopped',
7
+ LOOP_STATUS_NONE: 'None',
8
+ LOOP_STATUS_TRACK: 'Track',
9
+ LOOP_STATUS_PLAYLIST: 'Playlist'
10
+ };
11
+ const playbackStatuses = [constants.PLAYBACK_STATUS_PLAYING, constants.PLAYBACK_STATUS_PAUSED, constants.PLAYBACK_STATUS_STOPPED];
12
+ const loopStatuses = [constants.LOOP_STATUS_NONE, constants.LOOP_STATUS_PLAYLIST, constants.LOOP_STATUS_TRACK];
13
+ constants.isLoopStatusValid = function (value) {
14
+ return loopStatuses.includes(value);
15
+ };
16
+ constants.isPlaybackStatusValid = function (value) {
17
+ return playbackStatuses.includes(value);
18
+ };
19
+ module.exports = constants;
20
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","names":["constants","PLAYBACK_STATUS_PLAYING","PLAYBACK_STATUS_PAUSED","PLAYBACK_STATUS_STOPPED","LOOP_STATUS_NONE","LOOP_STATUS_TRACK","LOOP_STATUS_PLAYLIST","playbackStatuses","loopStatuses","isLoopStatusValid","value","includes","isPlaybackStatusValid","module","exports"],"sourceRoot":"../src/","sources":["constants.js"],"sourcesContent":["const constants = {\n PLAYBACK_STATUS_PLAYING: 'Playing',\n PLAYBACK_STATUS_PAUSED: 'Paused',\n PLAYBACK_STATUS_STOPPED: 'Stopped',\n\n LOOP_STATUS_NONE: 'None',\n LOOP_STATUS_TRACK: 'Track',\n LOOP_STATUS_PLAYLIST: 'Playlist'\n};\n\nconst playbackStatuses = [\n constants.PLAYBACK_STATUS_PLAYING,\n constants.PLAYBACK_STATUS_PAUSED,\n constants.PLAYBACK_STATUS_STOPPED\n];\n\nconst loopStatuses = [\n constants.LOOP_STATUS_NONE,\n constants.LOOP_STATUS_PLAYLIST,\n constants.LOOP_STATUS_TRACK\n];\n\nconstants.isLoopStatusValid = function(value) {\n return loopStatuses.includes(value);\n};\n\nconstants.isPlaybackStatusValid = function(value) {\n return playbackStatuses.includes(value);\n};\n\nmodule.exports = constants;\n"],"mappings":";;AAAA,MAAMA,SAAS,GAAG;EAChBC,uBAAuB,EAAE,SAAS;EAClCC,sBAAsB,EAAE,QAAQ;EAChCC,uBAAuB,EAAE,SAAS;EAElCC,gBAAgB,EAAE,MAAM;EACxBC,iBAAiB,EAAE,OAAO;EAC1BC,oBAAoB,EAAE;AACxB,CAAC;AAED,MAAMC,gBAAgB,GAAG,CACvBP,SAAS,CAACC,uBAAuB,EACjCD,SAAS,CAACE,sBAAsB,EAChCF,SAAS,CAACG,uBAAuB,CAClC;AAED,MAAMK,YAAY,GAAG,CACnBR,SAAS,CAACI,gBAAgB,EAC1BJ,SAAS,CAACM,oBAAoB,EAC9BN,SAAS,CAACK,iBAAiB,CAC5B;AAEDL,SAAS,CAACS,iBAAiB,GAAG,UAASC,KAAK,EAAE;EAC5C,OAAOF,YAAY,CAACG,QAAQ,CAACD,KAAK,CAAC;AACrC,CAAC;AAEDV,SAAS,CAACY,qBAAqB,GAAG,UAASF,KAAK,EAAE;EAChD,OAAOH,gBAAgB,CAACI,QAAQ,CAACD,KAAK,CAAC;AACzC,CAAC;AAEDG,MAAM,CAACC,OAAO,GAAGd,SAAS"}