feat(remote-control): add channel selection by number and volume control features

- Implemented `getChannelItemByNumber` utility function to retrieve channels by their number.
- Enhanced `StalkerLiveStreamLayoutComponent` and `LiveStreamLayoutComponent` to handle remote control commands for channel selection and volume adjustments.
- Updated typings to include new remote control commands and status updates.
- Refactored `RemoteControlComponent` to manage numeric input for channel selection and volume control actions.
- Improved UI for remote control with new volume and channel navigation features.
- Added service methods for volume up, down, and mute toggle in `RemoteControlService`.
This commit is contained in:
4gray committed 2026-02-14 00:03:42 +01:00
1 parent 620ecb7518
commit 7c9db4bc7d
14 files changed
+1100 -400

No files matched your search

@@ -32,3 +32,26 @@ export function getAdjacentChannelItem<T>(
return items[nextIndex] ?? null;
}
/**
* Returns the Nth item in a list (1-based index), or null if out of range.
*/
export function getChannelItemByNumber<T>(
items: T[],
channelNumber: number
): T | null {
if (
!Array.isArray(items) ||
items.length === 0 ||
!Number.isFinite(channelNumber)
) {
return null;
}
const index = Math.floor(channelNumber) - 1;
if (index < 0 || index >= items.length) {
return null;
}
return items[index] ?? null;
}