mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 07:58:45 +03:00
Add mediaplayer
as a new browser.type
This commit is contained in:
parent
b52a7ea268
commit
de4978e8d9
@ -152,6 +152,7 @@ const BrowserType = Object.freeze({
|
||||
EMAIL: 'email',
|
||||
FETCHER: 'fetcher',
|
||||
INAPP: 'inapp',
|
||||
MEDIAPLAYER: 'mediaplayer',
|
||||
MODULE: 'module'
|
||||
});
|
||||
|
||||
|
@ -156,6 +156,7 @@ const BrowserType = Object.freeze({
|
||||
EMAIL: 'email',
|
||||
FETCHER: 'fetcher',
|
||||
INAPP: 'inapp',
|
||||
MEDIAPLAYER: 'mediaplayer',
|
||||
MODULE: 'module'
|
||||
});
|
||||
|
||||
@ -228,6 +229,7 @@ const Vendor = Object.freeze({
|
||||
PALM: 'Palm',
|
||||
PANASONIC: 'Panasonic',
|
||||
PEBBLE: 'Pebble',
|
||||
PICO: 'Pico',
|
||||
POLYTRON: 'Polytron',
|
||||
REALME: 'Realme',
|
||||
RIM: 'RIM',
|
||||
@ -325,6 +327,7 @@ const OS = Object.freeze({
|
||||
PALM: 'Palm',
|
||||
PC_BSD: 'PC-BSD',
|
||||
PCLINUXOS: 'PCLinuxOS',
|
||||
PICO: 'Pico',
|
||||
PLAN9: 'Plan9',
|
||||
PLAYSTATION: 'PlayStation',
|
||||
QNX: 'QNX',
|
||||
|
@ -19,6 +19,7 @@ const CLI = 'cli';
|
||||
const EMAIL = 'email';
|
||||
const FETCHER = 'fetcher';
|
||||
const INAPP = 'inapp';
|
||||
const MEDIAPLAYER = 'mediaplayer';
|
||||
const MODULE = 'module';
|
||||
|
||||
//////////////////////
|
||||
@ -221,13 +222,13 @@ const MediaPlayers = Object.freeze({
|
||||
|
||||
/(apple(?:coremedia|))\/([\w\._]+)/i, // Generic Apple CoreMedia
|
||||
/(coremedia) v([\w\._]+)/i
|
||||
], [NAME, VERSION], [
|
||||
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i // Aqualung/Lyssna/BSPlayer
|
||||
], [NAME, VERSION], [
|
||||
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(ares|ossproxy)\s([\w\.-]+)/i // Ares/OSSProxy
|
||||
], [NAME, VERSION], [
|
||||
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/([\w\.-]+)/i,
|
||||
// Audacious/AudiMusicStream/Amarok/BASS/OpenCORE/Dalvik/GnomeMplayer/MoC
|
||||
@ -235,90 +236,90 @@ const MediaPlayers = Object.freeze({
|
||||
/(clementine|music player daemon)\s([\w\.-]+)/i, // Clementine/MPD
|
||||
/(lg player|nexplayer)\s([\d\.]+)/i,
|
||||
/player\/(nexplayer|lg player)\s([\w\.-]+)/i // NexPlayer/LG Player
|
||||
], [NAME, VERSION], [
|
||||
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
/(nexplayer)\s([\w\.-]+)/i // Nexplayer
|
||||
], [NAME, VERSION], [
|
||||
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(flrp)\/([\w\.-]+)/i // Flip Player
|
||||
], [[NAME, 'Flip Player'], VERSION], [
|
||||
], [[NAME, 'Flip Player'], VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i
|
||||
// FStream/NativeHost/QuerySeekSpider/IA Archiver/facebookexternalhit
|
||||
], [NAME], [
|
||||
], [NAME, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(gstreamer) souphttpsrc.+libsoup\/([\w\.-]+)/i
|
||||
// Gstreamer
|
||||
], [NAME, VERSION], [
|
||||
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(htc streaming player)\s[\w_]+\s\/\s([\d\.]+)/i, // HTC Streaming Player
|
||||
/(java|python-urllib|python-requests|wget|libcurl)\/([\w\.-_]+)/i,
|
||||
// Java/urllib/requests/wget/cURL
|
||||
/(lavf)([\d\.]+)/i // Lavf (FFMPEG)
|
||||
], [NAME, VERSION], [
|
||||
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(htc_one_s)\/([\d\.]+)/i, // HTC One S
|
||||
], [[NAME, /_/g, ' '], VERSION], [
|
||||
], [[NAME, /_/g, ' '], VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+))/i,
|
||||
// MPlayer SVN
|
||||
], [NAME, VERSION], [
|
||||
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(mplayer)(?:\s|\/)([\w\.-]+)/i, // MPlayer
|
||||
/(mplayer) unknown-([\w\.\-]+)/i // MPlayer UNKNOWN
|
||||
], [NAME, VERSION], [
|
||||
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(mplayer)/i, // MPlayer (no other info)
|
||||
/(yourmuze)/i, // YourMuze
|
||||
/(media player classic|nero showtime)/i // Media Player Classic/Nero ShowTime
|
||||
], [NAME], [
|
||||
], [NAME, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(nero (?:home|scout))\/([\w\.-]+)/i // Nero Home/Nero Scout
|
||||
], [NAME, VERSION], [
|
||||
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(nokia\d+)\/([\w\.-]+)/i // Nokia
|
||||
], [NAME, VERSION], [
|
||||
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/\s(songbird)\/([\w\.-]+)/i // Songbird/Philips-Songbird
|
||||
], [NAME, VERSION], [
|
||||
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(winamp)3 version ([\w\.-]+)/i, // Winamp
|
||||
/(winamp)\s([\w\.-]+)/i,
|
||||
/(winamp)mpeg\/([\w\.-]+)/i
|
||||
], [NAME, VERSION], [
|
||||
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i // OCMS-bot/tap in radio/tunein/unknown/winamp (no other info)
|
||||
// inlight radio
|
||||
], [NAME], [
|
||||
], [NAME, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/([\w\.-]+)/i
|
||||
// QuickTime/RealMedia/RadioApp/RadioClientApplication/
|
||||
// SoundTap/Totem/Stagefright/Streamium
|
||||
], [NAME, VERSION], [
|
||||
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(smp)([\d\.]+)/i // SMP
|
||||
], [NAME, VERSION], [
|
||||
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(vlc) media player - version ([\w\.]+)/i, // VLC Videolan
|
||||
/(vlc)\/([\w\.-]+)/i,
|
||||
/(xbmc|gvfs|xine|xmms|irapp)\/([\w\.-]+)/i, // XBMC/gvfs/Xine/XMMS/irapp
|
||||
/(foobar2000)\/([\d\.]+)/i, // Foobar2000
|
||||
/(itunes)\/([\d\.]+)/i // iTunes
|
||||
], [NAME, VERSION], [
|
||||
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(wmplayer)\/([\w\.-]+)/i, // Windows Media Player
|
||||
/(windows-media-player)\/([\w\.-]+)/i
|
||||
], [[NAME, /-/g, ' '], VERSION], [
|
||||
], [[NAME, /-/g, ' '], VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/windows\/([\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i,
|
||||
// Windows Media Server
|
||||
], [VERSION, [NAME, 'Windows']], [
|
||||
], [VERSION, [NAME, 'Windows'], [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(com\.riseupradioalarm)\/([\d\.]*)/i // RiseUP Radio Alarm
|
||||
], [NAME, VERSION], [
|
||||
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
|
||||
|
||||
/(rad.io)\s([\d\.]+)/i, // Rad.io
|
||||
/(radio.(?:de|at|fr))\s([\d\.]+)/i
|
||||
], [[NAME, 'rad.io'], VERSION]
|
||||
], [[NAME, 'rad.io'], VERSION, [TYPE, MEDIAPLAYER]]
|
||||
]
|
||||
});
|
||||
|
||||
|
2
src/main/ua-parser.d.ts
vendored
2
src/main/ua-parser.d.ts
vendored
@ -15,7 +15,7 @@ declare namespace UAParser {
|
||||
name?: string;
|
||||
version?: string;
|
||||
major?: string;
|
||||
type?: 'crawler' | 'cli' | 'email' | 'fetcher' | 'inapp' | 'module';
|
||||
type?: 'crawler' | 'cli' | 'email' | 'fetcher' | 'inapp' | 'mediaplayer' | 'module';
|
||||
}
|
||||
|
||||
interface ICPU extends IData<ICPU> {
|
||||
|
@ -28,7 +28,7 @@ expectType<IBrowser>(browser);
|
||||
expectType<string | undefined>(browser.name);
|
||||
expectType<string | undefined>(browser.version);
|
||||
expectType<string | undefined>(browser.major);
|
||||
expectType<'crawler' | 'cli' | 'email' | 'fetcher' | 'inapp' | 'module' | undefined>(browser.type);
|
||||
expectType<'crawler' | 'cli' | 'email' | 'fetcher' | 'inapp' | 'mediaplayer' | 'module' | undefined>(browser.type);
|
||||
expectType<boolean>(browser.is(''));
|
||||
expectType<string>(browser.toString());
|
||||
expectType<IBrowser | PromiseLike<IBrowser>>(browser.withClientHints());
|
||||
|
Loading…
x
Reference in New Issue
Block a user