Skip to content

Commit

Permalink
Merge pull request #115 from jellyfin/stable-fix
Browse files Browse the repository at this point in the history
Make chromecast stable work on 10.7
  • Loading branch information
ferferga authored Jan 16, 2021
2 parents 5194d2b + 30f16b9 commit de689c5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
6 changes: 3 additions & 3 deletions components/embyactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@
lastTranscoderPing = new Date().getTime();

return fetchhelper.ajax({

url: url,
// 10.7 needs it there instead of in POST
url: url + '?playSessionId=' + options.PlaySessionId,
headers: getSecurityHeaders($scope.accessToken, $scope.userId),
type: 'POST',
data: JSON.stringify(options),
Expand Down Expand Up @@ -646,4 +646,4 @@
factory.setApplicationClose = setApplicationClose;

return factory;
});
});
19 changes: 18 additions & 1 deletion components/maincontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@

window.VolumeInfo.Level = (event.data['level'] || 1) * 100;
window.VolumeInfo.IsMuted = event.data['muted'] || false;

if ($scope.userId != null) {
reportEvent('volumechange', true);
}
Expand Down Expand Up @@ -503,6 +503,12 @@

var data = event.data;

// Apparently chromium likes to pass it as json, not as object.
// chrome on android works fine
if (typeof data === 'string') {
data = JSON.parse(data);
}

data.options = data.options || {};
data.options.senderId = event.senderId;

Expand Down Expand Up @@ -693,6 +699,17 @@
Method: 'External'
});

// clean up deviceprofile since in this version it's in the submodule.
for(var pi in profile.CodecProfiles) {
var p = profile.CodecProfiles[pi];
for(var ci in p.Conditions) {
var c = p.Conditions[ci];
if (c.IsRequired === 'false') {
c.IsRequired = false;
}
}
}

return profile;
}

Expand Down
6 changes: 3 additions & 3 deletions helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ function getCurrentPositionTicks($scope) {
function getReportingParams($scope) {

return {
PositionTicks: getCurrentPositionTicks($scope),
PositionTicks: Math.round(getCurrentPositionTicks($scope)),
IsPaused: window.mediaElement.paused,
IsMuted: window.VolumeInfo.IsMuted,
AudioStreamIndex: $scope.audioStreamIndex,
SubtitleStreamIndex: $scope.subtitleStreamIndex,
VolumeLevel: window.VolumeInfo.Level,
VolumeLevel: Math.round(window.VolumeInfo.Level),
ItemId: $scope.itemId,
MediaSourceId: $scope.mediaSourceId,
QueueableMediaTypes: ['Audio', 'Video'],
Expand Down Expand Up @@ -1158,4 +1158,4 @@ function extend(target, source) {
target[i] = source[i];
}
return target;
}
}

0 comments on commit de689c5

Please sign in to comment.