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

mediaplex

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mediaplex - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

src/decoder/mod.rs

11

index.d.ts

@@ -9,6 +9,13 @@ import type { ProbeResult } from './js-binding'

export * from './lib/binding';
export interface Metadata {
title: string | null;
author: string | null;
genre: string | null;
}
export * from './js-binding';
export function probeStream(
stream: Readable,
probeSize?: number
): Promise<StreamProbeResult>;
): Promise<StreamProbeResult>;
export function readMetadata(result: ProbeResult): Metadata;

@@ -92,2 +92,30 @@ const binding = require('./js-binding');

/**
* Reads metadata tags
* @param {import('./js-binding').ProbeResult} result The probe result to read metadata from
*/
function readMetadata(result) {
const res = {
title: null,
author: null,
genre: null
};
if (!result.metadata?.length) return res;
result.metadata.forEach(m => {
if (!m.value) return;
if ((m.name === 'TPE1' || m.name === 'TPUB') && !res['author']) {
res['author'] = m.value;
} else if (m.name === 'TIT2') {
res['title'] = m.value;
} else if ((m.name === 'TALB' || m.name === 'TCON') && !res['genre']) {
res['genre'] = m.value;
}
});
return res;
}
const { CodecType, probe } = binding;

@@ -99,2 +127,3 @@

probeStream,
readMetadata
};

@@ -19,2 +19,4 @@ /* tslint:disable */

duration: number
/** The metadata object */
metadata: Array<MetadataField>
}

@@ -89,2 +91,6 @@ export const enum CodecType {

}
export interface MetadataField {
name: string
value: string
}
export function probe(data: Buffer): ProbeResult

30

package.json
{
"name": "mediaplex",
"version": "0.0.0",
"version": "0.0.1",
"main": "index.js",

@@ -64,17 +64,17 @@ "types": "index.d.ts",

"optionalDependencies": {
"mediaplex-win32-x64-msvc": "0.0.0",
"mediaplex-darwin-x64": "0.0.0",
"mediaplex-linux-x64-gnu": "0.0.0",
"mediaplex-darwin-arm64": "0.0.0",
"mediaplex-android-arm64": "0.0.0",
"mediaplex-linux-arm64-gnu": "0.0.0",
"mediaplex-linux-arm64-musl": "0.0.0",
"mediaplex-win32-arm64-msvc": "0.0.0",
"mediaplex-linux-arm-gnueabihf": "0.0.0",
"mediaplex-linux-x64-musl": "0.0.0",
"mediaplex-freebsd-x64": "0.0.0",
"mediaplex-win32-ia32-msvc": "0.0.0",
"mediaplex-android-arm-eabi": "0.0.0",
"mediaplex-darwin-universal": "0.0.0"
"mediaplex-win32-x64-msvc": "0.0.1",
"mediaplex-darwin-x64": "0.0.1",
"mediaplex-linux-x64-gnu": "0.0.1",
"mediaplex-darwin-arm64": "0.0.1",
"mediaplex-android-arm64": "0.0.1",
"mediaplex-linux-arm64-gnu": "0.0.1",
"mediaplex-linux-arm64-musl": "0.0.1",
"mediaplex-win32-arm64-msvc": "0.0.1",
"mediaplex-linux-arm-gnueabihf": "0.0.1",
"mediaplex-linux-x64-musl": "0.0.1",
"mediaplex-freebsd-x64": "0.0.1",
"mediaplex-win32-ia32-msvc": "0.0.1",
"mediaplex-android-arm-eabi": "0.0.1",
"mediaplex-darwin-universal": "0.0.1"
}
}

Sorry, the diff of this file is not supported yet

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