Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fe-utils

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fe-utils - npm Package Compare versions

Comparing version 1.0.11 to 1.1.0

libs/mediaError.js

40

fe-utils.js

@@ -167,2 +167,41 @@ (function (global, factory) {

var mediaError = function mediaError(media, callback) {
var err = media.error;
var message = err.message;
var nodeName = media.nodeName.toLowerCase();
var errMsg = '';
try {
switch (err.code) {
case MediaError.MEDIA_ERR_ABORTED:
errMsg += 'The user canceled the ' + nodeName + '. ';
break;
case MediaError.MEDIA_ERR_NETWORK:
errMsg += 'A network error occurred while fetching the ' + nodeName + '. ';
break;
case MediaError.MEDIA_ERR_DECODE:
errMsg += 'An error occurred while decoding the ' + nodeName + '. ';
break;
case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:
errMsg += 'The ' + nodeName + ' is missing or is in a format not supported by your browser. ';
break;
default:
errMsg += 'An unknown error occurred. ';
break;
}
} catch (err) {
console && console.log(err);
}
if (message && message.length) {
errMsg += message;
}
callback && callback({
code: err.code,
msg: errMsg
});
};
var mobileCheck = function mobileCheck() {

@@ -319,2 +358,3 @@ var check = false;

urlQuery: urlQuery,
mediaError: mediaError,
detectedInfos: detectedInfos,

@@ -321,0 +361,0 @@ getVersionOfIOS: getVersionOfIOS,

2

libs/main.js

@@ -5,2 +5,3 @@ import date from './date'

import urlQuery from './urlQuery'
import mediaError from './mediaError'
import detectedInfos from './detectedInfos'

@@ -16,2 +17,3 @@ import getVersionOfIOS from './getVersionOfIOS'

urlQuery,
mediaError,
detectedInfos,

@@ -18,0 +20,0 @@ getVersionOfIOS,

2

package.json
{
"name": "fe-utils",
"version": "1.0.11",
"version": "1.1.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "fe-utils.js",

@@ -49,2 +49,4 @@ # fe-utils

9. **logger**
* <img src="http://o4a7cbihz.qnssl.com/cover/4ec91a4e-e638-4753-9f6a-9cee4e715420" width = "250" align="center" />
* <img src="http://o4a7cbihz.qnssl.com/cover/4ec91a4e-e638-4753-9f6a-9cee4e715420" width = "250" align="center" />
10. **mediaError**
* ```mediaError(video / audio, (code, msg) => { ... }) // for error-listener-callback of audio and video ```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc