Skip to content

Commit

Permalink
Fix README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
FelonEkonom committed Feb 26, 2025
1 parent 88dd337 commit aad34f2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
29 changes: 17 additions & 12 deletions example_project/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# ExampleProject
# Example Project

To start your Phoenix server:
Example project showing how `Membrane.WebRTC.Live.Capture` and `Membrane.WebRTC.Live.Player` can be used.

* Run `mix setup` to install and setup dependencies
* Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server`
It contains a simple demo, where:
- the video stream is get from the browser and sent via WebRTC to Elixir server using `Membrane.WebRTC.Live.Capture`
- then, this same video stream is re-sent again to the browser and displayed using `Membrane.WebRTC.Live.Player`.

Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
This demo uses also [Boombox](https://hex.pm/packages/boombox).

The most important file in the project is `example_project/lib/example_project_web/live_views/echo.ex`, that
contains the usage of `Boombox` and LiveViews defined in `membrane_webrtc_live`.

You can also take a look at `example_project/assets/js/app.js` to see how you can use `membrane_webrtc_live` JS hooks.

Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html).
## Run server

## Learn more
To start Phoenix server:

* Official website: https://www.phoenixframework.org/
* Guides: https://hexdocs.pm/phoenix/overview.html
* Docs: https://hexdocs.pm/phoenix
* Forum: https://elixirforum.com/c/phoenix-forum
* Source: https://github.com/phoenixframework/phoenix
* Run `mix setup` to install and setup dependencies
* Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server`

Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
7 changes: 5 additions & 2 deletions example_project/lib/example_project_web/live_views/echo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ defmodule ExampleProjectWeb.LiveViews.Echo do

def render(assigns) do
~H"""
<Capture.live_render socket={@socket} capture={"mediaCapture"} />
<Player.live_render socket={@socket} player={"videoPlayer"} />
<h3>Captured stream preview</h3>
<Capture.live_render socket={@socket} capture="mediaCapture" />
<h3>Stream sent by the server</h3>
<Player.live_render socket={@socket} player="videoPlayer" />
"""
end
end

0 comments on commit aad34f2

Please sign in to comment.