From c03250ba7d33a7583b0ecd179938a3fe376d5ffc Mon Sep 17 00:00:00 2001 From: Froghut Date: Mon, 1 Apr 2019 14:23:41 +0200 Subject: [PATCH 1/3] get cast device volume/mute on init and send to client on connect --- components/maincontroller.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/maincontroller.js b/components/maincontroller.js index 9764d7d7..6addb4f1 100644 --- a/components/maincontroller.js +++ b/components/maincontroller.js @@ -10,6 +10,8 @@ resetPlaybackScope($scope); clearMediaElement(); + window.VolumeInfo.Level = cast.receiver.media.Volume.level * 100; + window.VolumeInfo.IsMuted = cast.receiver.media.Volume.muted; }; init(); @@ -273,6 +275,7 @@ if (!isPlaying()) { embyActions.displayUserInfo($scope, data.serverAddress, data.accessToken, data.userId); } + embyActions.reportPlaybackProgress($scope, getReportingParams($scope), true, "playbackstop"); } else if (data.command == 'SetVolume') { From 56d239b29c115297dab344843efefe87efa76b47 Mon Sep 17 00:00:00 2001 From: Froghut Date: Mon, 1 Apr 2019 15:07:48 +0200 Subject: [PATCH 2/3] fix tabs/spaces --- components/maincontroller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/maincontroller.js b/components/maincontroller.js index 6addb4f1..68023405 100644 --- a/components/maincontroller.js +++ b/components/maincontroller.js @@ -10,8 +10,8 @@ resetPlaybackScope($scope); clearMediaElement(); - window.VolumeInfo.Level = cast.receiver.media.Volume.level * 100; - window.VolumeInfo.IsMuted = cast.receiver.media.Volume.muted; + window.VolumeInfo.Level = cast.receiver.media.Volume.level * 100; + window.VolumeInfo.IsMuted = cast.receiver.media.Volume.muted; }; init(); @@ -275,7 +275,7 @@ if (!isPlaying()) { embyActions.displayUserInfo($scope, data.serverAddress, data.accessToken, data.userId); } - embyActions.reportPlaybackProgress($scope, getReportingParams($scope), true, "playbackstop"); + embyActions.reportPlaybackProgress($scope, getReportingParams($scope), true, "playbackstop"); } else if (data.command == 'SetVolume') { From a24f80310f229b2b1821f10a9ffe1ab162f86dad Mon Sep 17 00:00:00 2001 From: Froghut Date: Tue, 2 Apr 2019 09:23:42 +0200 Subject: [PATCH 3/3] add comments --- components/maincontroller.js | 1 + 1 file changed, 1 insertion(+) diff --git a/components/maincontroller.js b/components/maincontroller.js index 68023405..aef58ce8 100644 --- a/components/maincontroller.js +++ b/components/maincontroller.js @@ -275,6 +275,7 @@ if (!isPlaying()) { embyActions.displayUserInfo($scope, data.serverAddress, data.accessToken, data.userId); } + // when a client connects send back the initial device state (volume etc) via a playbackstop message embyActions.reportPlaybackProgress($scope, getReportingParams($scope), true, "playbackstop"); } else if (data.command == 'SetVolume') {