.content-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.favorite-item button, .recent-item button { padding: 5px 10px; background: #667eea; color: white; border: none; border-radius: 3px; cursor: pointer; }

const toggleFavorite = (stream) => { let updated; if (favorites.find(f => f.stream_id === stream.stream_id)) { updated = favorites.filter(f => f.stream_id !== stream.stream_id); } else { updated = [...favorites, stream]; } setFavorites(updated); localStorage.setItem('favorites', JSON.stringify(updated)); }; xtream code club

const playStream = async (stream, type) => { const response = await fetch(`/api/stream/url/${type}/${stream.stream_id}`); const data = await response.json(); if (videoRef.current) { videoRef.current.src = data.url; videoRef.current.play(); setSelectedStream({ ...stream, type, url: data.url }); // Add to recently watched const updated = [stream, ...recentlyWatched.filter(s => s.stream_id !== stream.stream_id)].slice(0, 20); setRecentlyWatched(updated); localStorage.setItem('recentlyWatched', JSON.stringify(updated)); } };

.favorites, .recently-watched { margin-bottom: 30px; } .content-area { flex: 1

async getStreams(categoryId = null, type = 'live') { try { let action = ''; switch(type) { case 'live': action = 'get_live_streams'; break; case 'vod': action = 'get_vod_streams'; break; case 'series': action = 'get_series'; break; } const params = { username: this.username, password: this.password, action: action }; if (categoryId) params.category_id = categoryId; const response = await axios.get(`${this.baseUrl}/player_api.php`, { params }); return response.data; } catch (error) { throw error; } }

app.get('/api/streams', async (req, res) => { if (!req.app.locals.client) { return res.status(401).json({ error: 'Not connected' }); } const { category_id, type } = req.query; const streams = await req.app.locals.client.getStreams(category_id, type); res.json(streams); }); } .favorite-item button

async getShortEPG(streamId) { try { const response = await axios.get(`${this.baseUrl}/player_api.php`, { params: { username: this.username, password: this.password, action: 'get_short_epg', stream_id: streamId, limit: 5 } }); return response.data; } catch (error) { return []; } } }

.channel-info p { color: #666; font-size: 12px; }