-
Notifications
You must be signed in to change notification settings - Fork 639
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mpris integration / media key support on linux
Grabs patched dbus & then rebuilds it for NW 0.12.3. Currently doesn't support all of the mpris features registered due to a bug in the player Should support all features once the bug is fixed :)
- Loading branch information
1 parent
03315c2
commit 64335f4
Showing
6 changed files
with
85 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
"use strict"; | ||
|
||
var gui = require("nw.gui"); | ||
|
||
app.factory("mprisService", function($rootScope, $log, $timeout, $window, $state) { | ||
if("linux" !== process.platform) { | ||
return false; | ||
} | ||
|
||
var Player = require("mpris-service"); | ||
|
||
var mprisPlayer = Player({ | ||
name: "soundnode", | ||
identity: "Soundnode Player", | ||
supportedUriSchemes: ["http", "file"], | ||
supportedMimeTypes: ["audio/mpeg", "application/ogg"], | ||
supportedInterfaces: ["player"] | ||
}); | ||
|
||
mprisPlayer.on("raise", function() { | ||
gui.Window.get().show(); | ||
}); | ||
|
||
mprisPlayer.canControl = true; | ||
|
||
mprisPlayer.canSeek = false; | ||
|
||
// Export Functions | ||
mprisPlayer.play = function(length, artwork, title, artist) { | ||
mprisPlayer.metadata = { | ||
"mpris:trackid": mprisPlayer.objectPath("track/0"), | ||
"mpris:length": length, | ||
"mpris:artUrl": artwork, | ||
"xesam:title": title, | ||
"xesam:album": "", | ||
"xesam:artist": artist | ||
}; | ||
|
||
mprisPlayer.playbackStatus = "Playing"; | ||
}; | ||
|
||
mprisPlayer.pause = function() { | ||
mprisPlayer.playbackStatus = "Paused"; | ||
}; | ||
|
||
return mprisPlayer; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters