Addon for FireFox and Chrome browsers. It allow to drive online media players (like music.yandex.ru, youtube, bandcamp & etc.). FoxHorn fetures:
- hotkeys
- builtin support for any site which use
<audio>
/<video>
tags orAudio
js object. - user can customise list of 'online player' sites, by add site & player type
Currently addon is under development, and not presented in browser markets. But you can install it manually from sources, see instructions for Firefox and Chrome.
See options page of extension. Now it has only list of 'enabled' sites. For example:
domain:music.yandex.ru yamusic
domain:www.youtube.com default
#domain:example.com default
disabled due strange behaviour in firefox
MediaPlayPause
- Toggle play/pauseMediaNextTrack
- Next track (not all players support)MediaPrevTrack
- Previous track (not all players support)
Currently supported players:
- music.yandex.ru
- youtube (through 'default' player)
- vk.com
See options page. Example player:
foxhorn_player = new class {
// declare player features:
// F_PROGRESS_EVENT - player can invoke foxhorn.playerProgress(),
// when this feauture is not supported, plugin
// will invoke this.getProgress() every second
features: new Set([foxhorn.F_PROGRESS_EVENT])
// lifecycle methods
open: () => api.onEvent("update", foxhorn.playerProgress),
close: () => api.offEvent("update", foxhorn.playerProgress),
// toggle play/pause
play: () => api.isPlaying()? api.pause() : api.play(),
next: api.next,
prev: api.prev,
// return player progress as float between 0 - 1, be careful this may be called often
getProgress: api.getProgress,
// true only when playing, false otherwize (include paused)
isPlaying: api.isPlaying,
// mean that player has any playable media, when false - any non lifecycle
// method will not been called
hasMedia: () => !!api.getTrack(),
getTrack: () => {
let ct = api.getTrack();
return {
id:"track",
title: ct.title,
position: ct.duration * api.getProgress(),
duration: ct.duration // number of track length in milliseconds
};
}
});