Skip to content

Commit

Permalink
Fix potential undefined values in getReportingParams
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsvanvelzen committed Oct 3, 2023
1 parent eb5fdd2 commit cbf861f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function getReportingParams(state: PlaybackState): PlaybackProgressInfo {
return {
AudioStreamIndex: state.audioStreamIndex,
CanSeek: state.canSeek,
IsMuted: window.volume?.muted,
IsMuted: window.volume?.muted ?? false,
IsPaused:
window.playerManager.getPlayerState() ===
cast.framework.messages.PlayerState.PAUSED,
Expand All @@ -55,7 +55,7 @@ export function getReportingParams(state: PlaybackState): PlaybackProgressInfo {
PositionTicks: Math.round(getCurrentPositionTicks(state)),
RepeatMode: window.repeatMode,
SubtitleStreamIndex: state.subtitleStreamIndex,
VolumeLevel: Math.round(window.volume?.level * 100)
VolumeLevel: Math.round(window.volume?.level ?? 0 * 100)
};
}

Expand Down

0 comments on commit cbf861f

Please sign in to comment.