Comparing version 1.0.1 to 1.0.2
@@ -11,3 +11,3 @@ import { Metadata } from "../protocol/metadata"; | ||
/** | ||
* MediaChannel Class dedicated to OrangeCast Protocol | ||
* MediaChannel Class dedicated to OCast Protocol | ||
*/ | ||
@@ -92,3 +92,3 @@ export declare class MediaChannel extends Channel { | ||
*/ | ||
doVolume(level: number, options: any): EnumError; | ||
doVolume(volume: number, options: any): EnumError; | ||
/** | ||
@@ -95,0 +95,0 @@ * Send a mute command |
export { EnumError } from "./type/enum.error"; | ||
export { EnumMediaStatus } from "./type/enum.media.status"; | ||
export { EnumMedia } from "./type/enum.media"; | ||
export { EnumTransferMode } from "./type/enum.transfermode"; | ||
export { Channel } from "./channel/channel"; | ||
@@ -8,2 +9,3 @@ export { MediaChannel } from "./channel/media.channel"; | ||
export { Media } from "./media/media"; | ||
export { IMediaNotifier } from "./channel/media.notifier"; | ||
export { VideoMedia } from "./media/video.media"; | ||
@@ -14,2 +16,2 @@ export { ImageMedia } from "./media/image.media"; | ||
export { Logger } from "./util/logger"; | ||
export { OrangeCast } from "./orangecast"; | ||
export { OCast } from "./ocast"; |
@@ -28,3 +28,3 @@ /** | ||
/** In the namespace org.ocast.media, the command is not implemented by the application */ | ||
IMPLEMENTATION_ERROR = 2501, | ||
IMPLEMENTATION_ERROR = 2400, | ||
} |
@@ -9,3 +9,2 @@ export declare class Logger { | ||
private static instance; | ||
private static debugLevel; | ||
debug: any; | ||
@@ -12,0 +11,0 @@ info: any; |
144
package.json
{ | ||
"name": "ocast-sdk", | ||
"version": "1.0.1", | ||
"main": "dist/orangecast.js", | ||
"module": "dist/orangecast.mjs", | ||
"jsnext:main": "dist/orangecast.mjs", | ||
"scripts": { | ||
"dev": "rollup -c -w", | ||
"prepublish": "tslint 'src/**/*.ts'", | ||
"prepare": "rollup -c rollup.config.js --environment BUILD:production && rollup -c rollup.config.es5.js --environment BUILD:production", | ||
"build": "rollup -c rollup.config.js --environment BUILD:production && rollup -c rollup.config.es5.js --environment BUILD:production", | ||
"test": "nyc mocha --require ts-node/register", | ||
"doc": "typedoc --out public --exclude ./test --exclude ./node_modules ./src" | ||
}, | ||
"repository": "ocast-sdk", | ||
"reporters": [ | ||
{ | ||
"name": "jasmine-spec-reporter#SpecReporter", | ||
"options": { | ||
"displayStacktrace": "all" | ||
} | ||
} | ||
], | ||
"files": [ | ||
"examples", | ||
"src", | ||
"dist" | ||
], | ||
"dependencies": { | ||
"rxjs": "^5.4.2" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "^4.0.2", | ||
"@types/mocha": "^2.2.41", | ||
"@types/node": "^8.0.17", | ||
"@types/websocket": "0.0.34", | ||
"@types/ws": "^3.0.2", | ||
"babel-plugin-external-helpers": "^6.22.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"ocast-dongletv": "latest", | ||
"istanbul": "^0.4.5", | ||
"jsdoc": "^3.5.3", | ||
"mocha": "~3.4.2", | ||
"nyc": "~11.0.3", | ||
"rollup": "^0.45.1", | ||
"rollup-plugin-babel": "^2.7.1", | ||
"rollup-plugin-commonjs": "^8.0.2", | ||
"rollup-plugin-istanbul": "^1.1.0", | ||
"rollup-plugin-node-resolve": "^3.0.0", | ||
"rollup-plugin-typescript2": "^0.4.6", | ||
"rollup-plugin-uglify": "^2.0.1", | ||
"rollup-watch": "^4.0.0", | ||
"source-map-support": "^0.4.15", | ||
"ts-node": "^3.3.0", | ||
"tslint": "^4.5.1", | ||
"typedoc": "^0.8.0", | ||
"typescript": "^2.4.2" | ||
}, | ||
"nyc": { | ||
"include": [ | ||
"src/**/*.ts", | ||
"src/**/*.tsx" | ||
"name": "ocast-sdk", | ||
"version": "1.0.2", | ||
"engines": { | ||
"node": ">=8.6.0" | ||
}, | ||
"main": "dist/ocast.js", | ||
"module": "dist/ocast.mjs", | ||
"jsnext:main": "dist/ocast.mjs", | ||
"scripts": { | ||
"dev": "rollup -c -w", | ||
"prepare": "tslint 'src/**/*.ts' && rollup -c rollup.config.js --environment BUILD:production && rollup -c rollup.config.es5.js --environment BUILD:production", | ||
"build": "rollup -c rollup.config.js --environment BUILD:production && rollup -c rollup.config.es5.js --environment BUILD:production", | ||
"test": "nyc mocha --require ts-node/register", | ||
"doc": "typedoc --out public --exclude ./test --exclude ./node_modules ./src" | ||
}, | ||
"repository": "ocast-sdk", | ||
"reporters": [ | ||
{ | ||
"name": "jasmine-spec-reporter#SpecReporter", | ||
"options": { | ||
"displayStacktrace": "all" | ||
} | ||
} | ||
], | ||
"extension": [ | ||
".ts", | ||
".tsx" | ||
"files": [ | ||
"src", | ||
"dist" | ||
], | ||
"reporter": [ | ||
"text-summary", | ||
"html" | ||
], | ||
"sourceMap": true, | ||
"instrument": true | ||
} | ||
"devDependencies": { | ||
"@types/chai": "^4.0.2", | ||
"@types/mocha": "^2.2.41", | ||
"@types/node": "^8.0.17", | ||
"@types/websocket": "0.0.34", | ||
"@types/ws": "^3.0.2", | ||
"babel-plugin-external-helpers": "^6.22.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"commitizen": "^2.9.6", | ||
"cz-conventional-changelog": "^2.1.0", | ||
"istanbul": "^0.4.5", | ||
"jsdoc": "^3.5.3", | ||
"mocha": "~3.4.2", | ||
"nyc": "~11.0.3", | ||
"ocast-dongletv": "latest", | ||
"resolve": "^1.5.0", | ||
"rollup": "^0.45.1", | ||
"rollup-plugin-babel": "^2.7.1", | ||
"rollup-plugin-commonjs": "^8.0.2", | ||
"rollup-plugin-istanbul": "^1.1.0", | ||
"rollup-plugin-node-resolve": "^3.0.0", | ||
"rollup-plugin-typescript2": "^0.4.6", | ||
"rollup-plugin-uglify": "^2.0.1", | ||
"rollup-watch": "^4.0.0", | ||
"semantic-release": "^15.0.3", | ||
"source-map-support": "^0.4.15", | ||
"ts-node": "^3.3.0", | ||
"tslint": "^4.5.1", | ||
"typedoc": "^0.8.0", | ||
"typescript": "^2.4.2" | ||
}, | ||
"nyc": { | ||
"include": [ | ||
"src/**/*.ts", | ||
"src/**/*.tsx" | ||
], | ||
"extension": [ | ||
".ts", | ||
".tsx" | ||
], | ||
"reporter": [ | ||
"text-summary", | ||
"html" | ||
], | ||
"sourceMap": true, | ||
"instrument": true | ||
} | ||
} |
# OCast | ||
[![npm version](https://badge.fury.io/js/ocast-sdk.svg)](http://badge.fury.io/js/ocast-sdk) | ||
[![node](https://img.shields.io/node/v/ocast-sdk-iconify.svg)](https://www.npmjs.com/package/ocast-sdk-iconify) | ||
[![Build Status](https://travis-ci.org/Orange-OpenSource/OCast-JS.svg?branch=master)](https://travis-ci.org/Orange-OpenSource/OCast-JS) | ||
@@ -4,0 +5,0 @@ [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) |
@@ -17,3 +17,3 @@ /* | ||
import {OrangeCast} from "../orangecast"; | ||
import {OCast} from "../ocast"; | ||
import {Transport} from "../protocol/transport"; | ||
@@ -20,0 +20,0 @@ import {TransportMessage} from "../protocol/transport.message"; |
@@ -20,6 +20,4 @@ /* | ||
import {VideoMedia} from "../media/video.media"; | ||
import {OrangeCast} from "../orangecast"; | ||
import {Metadata} from "../protocol/metadata"; | ||
import {PlaybackStatus} from "../protocol/playback.status"; | ||
import {Track} from "../protocol/track"; | ||
import {Transport} from "../protocol/transport"; | ||
@@ -31,2 +29,3 @@ import {EnumError} from "../type/enum.error"; | ||
import {EnumTransferMode} from "../type/enum.transfermode"; | ||
import {EnumTransport} from "../type/enum.transport"; | ||
import {FunctionHelper} from "../util/function.helper"; | ||
@@ -41,3 +40,3 @@ import {Logger} from "../util/logger"; | ||
/** | ||
* MediaChannel Class dedicated to OrangeCast Protocol | ||
* MediaChannel Class dedicated to OCast Protocol | ||
*/ | ||
@@ -76,2 +75,3 @@ export class MediaChannel extends Channel { | ||
} | ||
public addImageMediaManager(types: EnumMedia[], mediaElement: any) { | ||
@@ -115,3 +115,3 @@ let media = new ImageMedia(mediaElement, this); | ||
try { | ||
Log.debug(TAG + "call " + method + "(" + JSON.stringify(methodParams) + ")"); | ||
Log.debug(TAG + "call " + method + "(" + JSON.stringify(methodParams) + ")"); | ||
const returnCode = this[method].apply(this, methodParams); | ||
@@ -121,24 +121,31 @@ if (typeof(returnCode) !== "undefined") { | ||
name: transport.message.data.name, | ||
params: { code: returnCode}, | ||
params: {code: returnCode}, | ||
}); | ||
} | ||
} catch (e) { | ||
Log.error(TAG + "Error while executing " + method + " with error " , e); | ||
Log.error(TAG + "Error while executing " + method + " with error ", e); | ||
if (transport.type === EnumTransport.COMMAND) { | ||
this.sendReply(transport.id, transport.src, { | ||
name: transport.message.data.name, | ||
params: {code: EnumError.UNKNOWN_ERROR}, | ||
}); | ||
} | ||
} | ||
} else { | ||
Log.error(TAG + "Error while executing " + method + " paramters missing)"); | ||
if (transport.type === EnumTransport.COMMAND) { | ||
this.sendReply(transport.id, transport.src, { | ||
name: transport.message.data.name, | ||
params: { code: EnumError.UNKNOWN_ERROR}, | ||
params: {code: EnumError.PARAMS_MISSING}, | ||
}); | ||
} | ||
} else { | ||
} | ||
} else { | ||
Log.error(TAG + "Function '" + method + "' not found"); | ||
if (transport.type === EnumTransport.COMMAND) { | ||
this.sendReply(transport.id, transport.src, { | ||
name: transport.message.data.name, | ||
params: { code: EnumError.PARAMS_MISSING}, | ||
params: {code: EnumError.NO_IMPLEMENTATION}, | ||
}); | ||
} | ||
} else { | ||
Log.error("Function \"" + method + "\" not found"); | ||
this.sendReply(transport.id, transport.src, { | ||
name: transport.message.data.name, | ||
params: {code: EnumError.NO_IMPLEMENTATION}, | ||
}); | ||
} | ||
@@ -164,3 +171,3 @@ } | ||
"," + transferMode + "," + autoplay + "," + frequency + "," + options); | ||
if (! this.medias.hasOwnProperty(mediaType)) { | ||
if (!this.medias.hasOwnProperty(mediaType)) { | ||
return EnumError.NO_IMPLEMENTATION; | ||
@@ -202,3 +209,3 @@ } | ||
let status = (this.media != null) ? this.media.getStatus() : null; | ||
if ( (status !== EnumMediaStatus.PAUSED)) { | ||
if ((status !== EnumMediaStatus.PAUSED)) { | ||
return EnumError.PLAYER_INVALID_STATE; | ||
@@ -220,3 +227,2 @@ } | ||
} | ||
let returnCode: EnumError = this.media.pause(); | ||
@@ -262,3 +268,5 @@ return (returnCode !== EnumError.OK) ? returnCode : this.callNotifier("onPause", arguments); | ||
*/ | ||
public doSeek(position: number, options: any ): EnumError { | ||
public doSeek(position: number, options: any): EnumError { | ||
Log.debug(TAG + "onSeek"); | ||
@@ -279,3 +287,3 @@ if (!this.media) { | ||
*/ | ||
public doVolume(level: number, options: any): EnumError { | ||
public doVolume(volume: number, options: any): EnumError { | ||
Log.debug(TAG + "onVolume"); | ||
@@ -286,3 +294,3 @@ if (!this.media) { | ||
let returnCode: EnumError = this.media.setVolume(level); | ||
let returnCode: EnumError = this.media.setVolume(volume); | ||
return (returnCode !== EnumError.OK) ? returnCode : this.callNotifier("onVolume", arguments); | ||
@@ -304,3 +312,3 @@ } | ||
return (returnCode !== EnumError.OK) ? returnCode : this.callNotifier("onMute", arguments); | ||
} | ||
} | ||
@@ -357,5 +365,7 @@ /** | ||
// To be called .... | ||
this.sendEvent({name: MediaChannel.EVENTS.METADATA_CHANGED, | ||
options: null, | ||
params: this.media.getMedatadata()}); | ||
this.sendEvent({ | ||
name: MediaChannel.EVENTS.METADATA_CHANGED, | ||
options: null, | ||
params: this.media.getMedatadata(), | ||
}); | ||
} | ||
@@ -378,3 +388,4 @@ | ||
} catch (e) { | ||
Log.error(TAG + "Implementation error on Notifier Method " + method + " : " , e); | ||
Log.error(TAG + "Implementation error on Notifier Method " + method + " : ", e); | ||
Log.error(TAG + "Implementation error on Notifier Method " + method + " : ", e); | ||
return EnumError.IMPLEMENTATION_ERROR; | ||
@@ -381,0 +392,0 @@ } |
@@ -19,3 +19,2 @@ /* | ||
import {PlaybackStatus} from "../protocol/playback.status"; | ||
import {Track} from "../protocol/track"; | ||
import {EnumError} from "../type/enum.error"; | ||
@@ -22,0 +21,0 @@ import {EnumMedia} from "../type/enum.media"; |
@@ -17,3 +17,3 @@ /* | ||
import {OrangeCast} from "../orangecast"; | ||
import {OCast} from "../ocast"; | ||
import {EnumProtocol} from "../type/enum.protocol"; | ||
@@ -20,0 +20,0 @@ import {Logger} from "../util/logger"; |
@@ -5,4 +5,4 @@ /* tslint:disable */ | ||
debug: any, | ||
WebSocket: any | ||
WebSocket: any | ||
} | ||
} |
@@ -20,2 +20,3 @@ /* | ||
export {EnumMedia} from "./type/enum.media"; | ||
export {EnumTransferMode} from "./type/enum.transfermode"; | ||
export {Channel} from "./channel/channel"; | ||
@@ -25,2 +26,3 @@ export {MediaChannel} from "./channel/media.channel"; | ||
export {Media} from "./media/media"; | ||
export {IMediaNotifier} from "./channel/media.notifier"; | ||
export {VideoMedia} from "./media/video.media"; | ||
@@ -31,2 +33,2 @@ export {ImageMedia} from "./media/image.media"; | ||
export {Logger} from "./util/logger"; | ||
export {OrangeCast} from "./orangecast"; | ||
export {OCast} from "./ocast"; |
@@ -44,3 +44,3 @@ /* | ||
/** In the namespace org.ocast.media, the command is not implemented by the application */ | ||
IMPLEMENTATION_ERROR = 2501, | ||
IMPLEMENTATION_ERROR = 2400, | ||
} |
@@ -34,3 +34,2 @@ /* | ||
private static instance: Logger; | ||
private static debugLevel: number = Logger.INFO; | ||
@@ -37,0 +36,0 @@ public debug = null; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 3 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 3 instances in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 2 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 4 instances in 1 package
0
3
40
1
2
555346
29
61
7431
- Removedrxjs@^5.4.2
- Removedrxjs@5.5.12(transitive)
- Removedsymbol-observable@1.0.1(transitive)