Skip to content

Commit

Permalink
Add support for SqueezePlay based players to provide direct streaming…
Browse files Browse the repository at this point in the history
… of HTTPS sources

- players wanting to support this feature need to be based on SqueezePlay (eg. SqueezeLite)
- the player needs to add „CanHTTPS=1“ to the capabilities string to announce this capability
  • Loading branch information
mherger committed Nov 25, 2016
1 parent 7931fbd commit aa99239
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Slim/Player/Client.pm
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,8 @@ sub canDoReplayGain { return 0; }

sub canPowerOff { return 1; }

sub canHTTPS { return 0; }

=head2 mixerConstant( $client, $feature, $aspect )
Returns the requested aspect of a given mixer feature.
Expand Down
13 changes: 11 additions & 2 deletions Slim/Player/Protocols/HTTPS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,16 @@ sub new {
return $sock->request($args);
}

# we can't direct stream, as players don't support SSL
sub canDirectStream { 0 }
# Check whether the current player can stream HTTPS or not
sub canDirectStream {
my $self = shift;
my ($client) = @_;

if ( $client->canHTTPS ) {
return $self->SUPER::canDirectStream(@_);
}

return 0;
}

1;
7 changes: 7 additions & 0 deletions Slim/Player/SqueezePlay.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ BEGIN {
hasPolarityInversion
spDirectHandlers
proxyAddress
_canHTTPS
));
}

Expand All @@ -58,6 +59,7 @@ sub new {
firmware => 0,
canDecodeRhapsody => 0,
canDecodeRtmp => 0,
_canHTTPS => 0,
hasDigitalOut => 0,
hasPreAmp => 0,
hasDisableDac => 0,
Expand Down Expand Up @@ -86,6 +88,7 @@ my %CapabilitiesMap = (
SyncgroupID => undef,
Spdirect => 'spDirectHandlers',
Proxy => 'proxyAddress',
CanHTTPS => '_canHTTPS',

# deprecated
model => '_model',
Expand All @@ -96,6 +99,10 @@ sub model {
return shift->_model;
}

sub canHTTPS {
return shift->_canHTTPS;
}

# This will return the full version + revision, i.e. 7.5.0 r8265
sub revision {
return shift->firmware;
Expand Down

0 comments on commit aa99239

Please sign in to comment.