Skip to content

Added Live feature#61

Open
Haseebx162006 wants to merge 4 commits intogbowne1:masterfrom
Haseebx162006:feature/go-live-streaming
Open

Added Live feature#61
Haseebx162006 wants to merge 4 commits intogbowne1:masterfrom
Haseebx162006:feature/go-live-streaming

Conversation

@Haseebx162006
Copy link
Contributor

Changes

**Backend **

  • Added Socket.IO signaling server for WebRTC peer connection establishment
  • New endpoint GET /api/live-streams to list active streams
  • Room-based stream management with automatic cleanup on disconnect

Frontend - Broadcaster (go-live.html, src/js/go-live.js)

  • New "Go Live Dashboard" page accessible from navigation
  • "Share Screen" and "Use Camera" buttons for media capture
  • Real-time viewer count display
  • Comprehensive error handling for permission denials

Frontend - Viewer (src/js/main.js)

  • Updated stream detail modal to use WebRTC playback
  • Connects to signaling server and receives live video via peer connection
  • Shows stream status (connecting, live, ended, offline)
    Dependencies Added
  • socket.io - Server-side real-time communication
  • socket.io-client - Client-side Socket.IO
  • Security
  • CORS restricted to localhost origins
  • Room-based isolation prevents cross-stream access
  • STUN-only ICE configuration (no TURN relay)
  • All connections go through signaling server (no direct IP exposure) @gbowne1 you are requested to review this !. Thanks

@gbowne1 gbowne1 linked an issue Jan 27, 2026 that may be closed by this pull request
@gbowne1
Copy link
Owner

gbowne1 commented Jan 27, 2026

@Haseebx162006

This is great but doesn't handle what might happen if either of the streamer or the viewer happens to disconnect, close the tab, etc

@Haseebx162006
Copy link
Contributor Author

I will fix this 👍

@Haseebx162006
Copy link
Contributor Author

@gbowne1 you can check now i have fixed the issues and made the following changes:

I created a dedicated Watch page (watch.html+ watch.js) where viewers can join any live stream by entering the stream room ID.
The page has an input field where viewers type the room ID shared by the broadcaster, then click "Join Stream" to connect. It also supports direct links like /watch.html?room=my-stream so broadcasters can share a URL with their audience.
The viewer logic handles WebRTC connection setup, ICE candidate exchange, and displays real-time status updates ("Connecting", "LIVE", "Stream Ended"). I also added proper cleanup for when viewers leave or lose connection, and a "Leave Stream" button for manual disconnect.
Finally, I added "Watch" navigation links to all three pages (index.html, go-live.html, watch.html) so users can easily navigate between them. All files pass ESLint with zero errors and build successfully with Vite.

@gbowne1 gbowne1 added the enhancement New feature or request label Jan 28, 2026
@gbowne1
Copy link
Owner

gbowne1 commented Jan 28, 2026

@Haseebx162006

Do you have screenshots of the application you can contribute to Discussion tab? Make a new Discussion there. Especially to show your work

I'll review your PR momentarily

Could you also help us also review PRs in this Pull Request tab? I'll merge them as soon as there are a minimum of 1 or 2 accepted reviews ✅

https://github.com/gbowne1/codestream/pull

Thanks

@Haseebx162006
Copy link
Contributor Author

i have added the screenshots in the discussion tab you can view it and am ready to review PRs!. Thanks

Copy link
Owner

@gbowne1 gbowne1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Haseebx162006

I checked out this change locally for testing and review for merge

This is a excellent initial implementation live broadcast for this stream application.

I also always appreciate screenshots, short video clips, etc of working changes. Logs, passing tests, other stuff useful so that developers have some idea what to expect when working on issues.

It appears to work properly allowing users to go live

Thanks for the opportunity to review your PR and for your contribution to this project

@gbowne1 gbowne1 requested review from Ved178 and shishir-21 January 31, 2026 08:12
Copy link
Collaborator

@shishir-21 shishir-21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gbowne1

Reviewed the PR — the implementation looks good.
There are merge conflicts that need to be resolved before merging.
Happy to re-review once that’s done 👍

@gbowne1
Copy link
Owner

gbowne1 commented Jan 31, 2026

@shishir-21

Well, we can do that via the GitHub merge conflict resolve thing or rebase and apply or?

@shishir-21
Copy link
Collaborator

@gbowne1

Either approach works 👍

Since the conflicts are limited to package.json, package-lock.json, and server.js,
I’d recommend resolving them directly using GitHub’s conflict resolver for simplicity.

If you prefer a cleaner history, rebasing onto main and resolving locally is also fine.
Happy to re-review once it’s updated.

@gbowne1
Copy link
Owner

gbowne1 commented Jan 31, 2026

@shishir-21

That sounds okay. I'm not terribly worried about history.

I'll let any of the collaborators help resolve conflicts if they wish. Theres a few of PRs that have conflicts now. I tried to pick initial ones to merge that would have the least issues being merged.

Github allows maintainers to commit fixes to open PRs so I'll allow that too

Workflow runs are 👎 right now. I'll merge anything that's got the proper ✅ reviews and still a green merge button.. probably the best way for now during this round.

@Ved178
Copy link
Collaborator

Ved178 commented Jan 31, 2026

This PR looks good. Resolving the merge conflicts right now, will approve once the commit has been made.

@Ved178
Copy link
Collaborator

Ved178 commented Jan 31, 2026

I have resolved the merge conflicts, let me know if they're okay.

@Ved178
Copy link
Collaborator

Ved178 commented Jan 31, 2026

Are the CI checks failing because of the changes or are there issues with the CI code itself?

@gbowne1
Copy link
Owner

gbowne1 commented Jan 31, 2026

Workflow still fails... separate issue. It's an issue with the CI code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add a go live feature

4 participants