Enhancement: Include channelId in video playback parameters for better tracking

This commit is contained in:
SergeantPanda 2026-04-30 18:02:40 -05:00
parent a80af16e6a
commit 01e356c156
2 changed files with 12 additions and 5 deletions

View file

@ -575,12 +575,19 @@ const ChannelStreams = ({ channel }) => {
if (wasVisible && !isVideoVisible) {
const meta = lastPreviewMetaRef.current;
lastPreviewMetaRef.current = null;
const streamId = meta && meta.streamId;
const channelId = channelRef.current?.id;
const previewedStreamId = meta && meta.streamId;
const previewedChannelId = meta && meta.channelId;
if (
streamId != null &&
(dataRef.current || []).some((s) => s.id === streamId)
previewedStreamId != null &&
(dataRef.current || []).some((s) => s.id === previewedStreamId)
) {
refreshStats({ ids: [streamId] });
refreshStats({ ids: [previewedStreamId] });
} else if (
previewedChannelId != null &&
previewedChannelId === channelId
) {
refreshStats();
}
}
}, [isVideoVisible, refreshStats]);

View file

@ -689,7 +689,7 @@ const ChannelsTable = ({ onReady }) => {
const handleWatchStream = useCallback(
(channel) => {
const url = getChannelURL(channel);
showVideo(url, 'live', { name: channel.name });
showVideo(url, 'live', { name: channel.name, channelId: channel.id });
},
[getChannelURL, showVideo]
);