f1u77y / web-media-controller Goto Github PK
View Code? Open in Web Editor NEWAllows controlling media player on different sites with Media Player widget on your desktop
License: The Unlicense
Allows controlling media player on different sites with Media Player widget on your desktop
License: The Unlicense
Controls do still work and I get the current position, but do not get track length, artist, or track name. I'm not sure when this stopped working, rolling back to previous versions of this addon doesn't seem to fix the problem. Other sites (Youtube and Soundcloud) still work as expected.
OS: Arch Linux
Native: wmc-mpris from web-media-controller-mpris-git AUR package, r96.d56d02a
Browser: Firefox 69
Can someone please test the deezer connector? It doesn't work for me - I see the "Stopped" sign in the extension indicator..
After changes made in 033e6de there's no need to call the BaseConnector.observe
function in the connector constructor. But this is still described in CONTRIBUTING.md.
I think removing the "Setup an observer..." section is not a best solution. Probably, we could list different ways to listen track info changes instead.
Also, the last section ("Lint your code") is quite hard to read. The first paragraph could be splitted:
Run npx grunt eslint:target
to check if your code conforms to the project code style.
npx grunt eslint:fix
might fix some errors for you automatically. Please make sure
npx grunt eslint:target
reports no errors before sumbitting pull request.
Please don't disable eslint
rules in files. The one exception is scripts located
in src/inject
: they could use website internals (which of course might not conform
to this project code style), so feel free to disable some rules in these scripts
(see src/inject/vk.js
for example). Warnings reported by eslint
could be
discussed. Errors could also be discussed but only if you're absolutely sure
you need to break some rule to implement a feature or fix some bug.
I'd also ask you to set up your editor or IDE to work with EditorConfig.
It could save some time for both of us.
Run `npx grunt eslint:target` to check if your code conforms to the project code style.
`npx grunt eslint:fix` might fix some errors for you automatically. Please make sure
`npx grunt eslint:target` reports no errors before sumbitting pull request.
Please don't disable `eslint` rules in files. The one exception is scripts located
in `src/inject`: they could use website internals (which of course might not conform
to this project code style), so feel free to disable some rules in these scripts
(see `src/inject/vk.js` for example). Warnings reported by `eslint` could be
discussed. Errors could also be discussed but only if you're absolutely sure
you need to break some rule to implement a feature or fix some bug.
I'd also ask you to set up your editor or IDE to work with [EditorConfig](https://editorconfig.org/).
It could save some time for both of us.
This is a minor change, but it improves readability a little.
@f1u77y What do you think?
Hey,
I'm writing a script using https://github.com/acrisci/playerctl (https://github.com/pavouk/lgi bindings to be precise) that unifies keybindings for the currently active player either (usually either mpv, the browser or mpd (with https://github.com/natsukagami/mpd-mpris).
I noticed that no matter if there is a tab with a supported website playing something or not, web-media-controller sets the all following properties to true
anyway:
TBH, it doesn't make sense to me. The only property my script can use now in order not to try to control web-media-controller only when it actually plays something is using PlaybackStatus
which is set to Stopped
when nothing is playing. This is not very accurate IMO..
Сломалось сегодня, подозреваю что после автоапдейта на версию 0.10.0.
Linux, Firefox 69.0.2 (64-bit), Debian Sid.
wmc-mpris собран и установлен ручками, переустановить пробовал, не помогло.
Куда копать, где логи смотреть? :)
The link to the extension on Mozilla Add-ons is broken -- it appears as though the extension was removed.
I'd like to write one so new users will be able to contribute new connectors as I did. I was wondering if you have any specific details you'd like to include. I'm planning on explaining this mostly through my own experience while assuming the reader knows at least a little bit JavaScript.
Since the invidious connector was merged, I've learned that there are several public invidious instances. A list is available here: https://github.com/omarroth/invidious/wiki/Invidious-Instances
Users (myself included) could have wished to make the connector work for them in their preferred instance.
I was wondering, do you think web-media-controller could dynamically or via a user preference set a hostname for which the connector will work with? If not, perhaps we can at least update the list of hostnames for this connector from time to time according to the list?
Hey,
While trying to test a new connector I'd like to contribute when ready, I've encountered this error from npx grunt build:firefox
when trying to test it:
Loading "Gruntfile.js" tasks...ERROR
>> TypeError: entry.isFile is not a function
Warning: Task "build:firefox" not found. Use --force to continue.
Aborted due to warnings.
Could there have been an update to fs
module that introduced a change in the API? Perhaps package-lock.json
should be committed to the repository as well so these changes could be tracked (I'm not sure if this suggestion is right).
When one of metadata getters breaks (e.g. due to change of website layout), the whole trackInfo
getter breaks too (like in #36). Of course it shouldn't be like this.
Some dependencies are actually not for development, e.g. bootstrap
, jquery
. Should we list them in the dependencies
section of the package.json
file?
Apparently, the Yandex music team changed something on their website and now double triggering occurs on the forward / back buttons. What can I do to fix this?
I would like to contribute a connector for https://invidio.us, it should be very similar to YouTube's. I get this error when running npx grunt build
:
Running "build" task
Running "copy:undefined" (copy) task
Verifying property copy.undefined exists in config...ERROR
>> Unable to process task.
Warning: Required config property "copy.undefined" missing. Use --force to continue.
Aborted due to warnings.
I couldn't find any solution when searching the web for this error. I've worked around it though for my tests with Firefox by using npx grunt build:firefox
instead.
I still thought you should know so you'll be able to fix the Gruntfile.js
accordingly.
When there is - in youtube videoID mpris:trackid is not being returned with playerctl metadata.
Example: https://www.youtube.com/watch?v=zuJV-DAv_wE
Currently there is partial support: play/pause works, but next/previous do not. I'm pretty sure this is because the css selectors are different from YouTube proper, .next-button
and .previous-button
instead of .ytp-next-button
and .ytp-previous-button
respectively.
I started implementing it based on the soundcloud connector, but I don't know how to write the observer
import BaseConnector from 'content/base-connector';
import Utils from 'content/utils';
new class extends BaseConnector {
constructor() {
super();
this.name = 'BandCamp';
this.prefix = '/com/bandcamp';
this.artistSelector = '#band-name-location .title';
this.titleSelector = '.title-section .title';
this.currentTimeSelector = '.time .secondaryTexgt .time_elapsed';
this.lengthSelector = '.time .secondaryTexgt .time_total';
this.playButtonSelector = '.playbutton';
this.prevButtonSelector = '.prev_cell .prevbutton';
this.nextButtonSelector = '.next_cell .nextbutton';
this.artSelector = '#tralbumArt .popupImage';
//Utils.query('.playControls .playControls__inner').then((elem) => this.observe(elem));
}
get playbackStatus() {
return Utils.query(this.playButtonSelector).then((elem) => (elem.classList.contains('playing') ? 'playing' : 'paused'));
}
getArtistTrack() {
const artistTrack = {
artist: document.querySelector(this.artistSelector).textContent.trim(),
track: document.querySelector(this.titleSelector).textContent.trim(),
};
const match = /(.+)\s[-–—:]\s(.+)/.exec(artistTrack.track);
if (match && ! /.*#\d+.*/.test(match[1])) {
return { artist: match[1], track: match[2] };
}
return artistTrack;
}
get artist() {
return this.getArtistTrack().artist;
}
get title() {
return this.getArtistTrack().track;
}
get artUrl() {
return super.artUrl.then((url)
}
}();
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.