castv2-player
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -5,13 +5,13 @@ "use strict" | ||
class DummyLogClass { | ||
constructor (componentName){ | ||
this.componentName = componentName; | ||
}; | ||
_addPrefix (orgArguments) { | ||
var orgArguments = Array.prototype.slice.call(orgArguments); | ||
orgArguments[0] = this.componentName + " - "+orgArguments[0] | ||
return orgArguments; | ||
let args = Array.prototype.slice.call(orgArguments); | ||
args[0] = this.componentName + " - " + args[0] | ||
return args; | ||
} | ||
error () { | ||
@@ -29,6 +29,6 @@ console.error.apply(console, this._addPrefix(arguments)); | ||
} | ||
} // end of class | ||
return new DummyLogClass(componentName); | ||
} |
@@ -151,11 +151,11 @@ "use strict" | ||
let parser; | ||
if (that._contentType == "audio/x-mpegurl") { | ||
if (that._contentType === "audio/x-mpegurl" || that._contentType === "application/x-mpegURL") { | ||
//This is a M3U playlist | ||
parser = playlist_parsers.M3U; | ||
} else if (that._contentType == "audio/x-scpls") { | ||
} else if (that._contentType === "audio/x-scpls") { | ||
//This is a PLS playlist | ||
parser = playlist_parsers.PLS; | ||
} else if ( | ||
(that._contentType == "video/x-ms-asf") || | ||
(that._contentType == "video/x-ms-asx")) | ||
(that._contentType === "video/x-ms-asf") || | ||
(that._contentType === "video/x-ms-asx")) | ||
{ | ||
@@ -162,0 +162,0 @@ //This is a ASX playlist |
@@ -124,2 +124,7 @@ "use strict" | ||
//subtitlesOffPromise | ||
subtitlesOffPromise() { | ||
return this._player.subtitlesOffPromise(); | ||
} | ||
//pausePromise | ||
@@ -146,3 +151,3 @@ pausePromise() { | ||
getStatusPromise() { | ||
return this._player.getStatusPromise | ||
return this._player.getStatusPromise(); | ||
} | ||
@@ -149,0 +154,0 @@ |
@@ -98,5 +98,9 @@ "use strict" | ||
if (volume == that.getVolume()) { | ||
log.info("%s - setting volume to same value %s - ignored", that._name, volume); | ||
return Promise.resolve(volume); | ||
try{ | ||
if (volume === that.getVolume()) { | ||
log.info("%s - setting volume to same value %s - ignored", that._name, volume); | ||
return Promise.resolve(volume); | ||
} | ||
} catch (e) { | ||
log.info(`Failed getVolume in castv2-player persistentClient ${e}`) | ||
} | ||
@@ -103,0 +107,0 @@ |
@@ -94,2 +94,9 @@ "use strict" | ||
//subtitlesOff | ||
subtitlesOffPromise () { | ||
let that = this; | ||
return that._getConnectedPlayerPromise() | ||
.then (function (player) {return that._playerActionPromise ("subtitlesOff", player.subtitlesOff.bind(player));}); | ||
} | ||
//seek | ||
@@ -542,3 +549,3 @@ seekPromise (currentTime) { | ||
// It works fine with the TuneIn and Plex applications | ||
if ("applications" in status) { | ||
if ("applications" in status && status.applications[0] !== undefined) { | ||
@@ -737,8 +744,12 @@ let currentApplicationId = status.applications[0].appId; | ||
//Set timeout to 10 seconds | ||
let timeout = setTimeout(reject.bind (Error("Could not connect after 10 seconds")), 10000); | ||
that.once(that.EVENT_CONNECTED, function() { | ||
const listenerCallback = function() { | ||
//Received connected event | ||
clearTimeout(timeout); | ||
resolve(that._player); | ||
}); | ||
}; | ||
that.once(that.EVENT_CONNECTED, listenerCallback); | ||
let timeout = setTimeout(function(){ | ||
that.removeListener(that.EVENT_CONNECTED, listenerCallback); | ||
reject(Error("Could not connect after 10 seconds")); | ||
}, 10000); | ||
}); | ||
@@ -753,3 +764,3 @@ } | ||
if (err) { | ||
log.error ("%s - Rejected %s - %s", that._name, actionName, err); | ||
log.warn ("%s - Rejected %s - %s", that._name, actionName, err); | ||
reject(err); | ||
@@ -756,0 +767,0 @@ } else { |
{ | ||
"name": "castv2-player", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "A Chromecast client based on the new (CASTV2) protocol", | ||
@@ -5,0 +5,0 @@ "author": "angelnu", |
@@ -14,2 +14,7 @@ cast2-player | ||
## [Sponsors](./SPONSORS.md) | ||
If you like my work, please feel free to provide a personal donation | ||
(this is an personal Donate link for Jey Cee, no relation to the ioBroker Project !) | ||
[![Donate](https://raw.githubusercontent.com/iobroker-community-adapters/ioBroker.wled/master/admin/button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=95YZN2LR59Q64&source=url) | ||
##Features | ||
@@ -16,0 +21,0 @@ * Scanner |
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
88103
24
2333
46
1