-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add WHIP support #49
Merged
Add WHIP support #49
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7fbe1f9
add WHIP support
mat-hek 0951985
refactor WHIP API, make CLI work
mat-hek 604bf47
fix whip IP
mat-hek ab5072b
update examples
mat-hek 370835d
make WHIP <-> WebRTC connection work, refactor browser tests
mat-hek 9d722ba
CR
mat-hek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#/bin/sh | ||
mix run -e 'Logger.configure(level: :info);Boombox.run_cli()' -- $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>Membrane WebRTC WHIP/WHEP Example</title> | ||
</head> | ||
|
||
<body | ||
style="background-color: black; color: white; font-family: Arial, Helvetica, sans-serif; min-height: 100vh; margin: 0px; padding: 5px 0px 5px 0px"> | ||
<h1>Boombox WHIP Example</h1> | ||
<div> | ||
Boombox URL: <input type="text" value="http://localhost:8829" id="url" /> | ||
Token: <input type="text" value="whip_it!" id="token" /> | ||
<button id="button">Connect</button> | ||
</div> | ||
<div id="status"></div> | ||
<br> | ||
<video id="preview" autoplay muted></video> | ||
<script type="module"> | ||
import { WHIPClient } from 'https://cdn.jsdelivr.net/npm/[email protected]/whip.js' | ||
|
||
const button = document.getElementById("button"); | ||
const connStatus = document.getElementById("status"); | ||
const preview = document.getElementById("preview"); | ||
const url = document.getElementById("url"); | ||
const status = document.getElementById("status"); | ||
const token = document.getElementById("token"); | ||
const pcConfig = { iceServers: [{ urls: "stun:stun.l.google.com:19302" }] }; | ||
const mediaConstraints = { video: true, audio: true }; | ||
|
||
const connect = async () => { | ||
connStatus.innerHTML = "Connecting..." | ||
const localStream = await navigator.mediaDevices.getUserMedia(mediaConstraints); | ||
preview.srcObject = localStream; | ||
const pc = new RTCPeerConnection(pcConfig); | ||
window.pc = pc; // for debugging purposes | ||
for (const track of localStream.getTracks()) { pc.addTransceiver(track, { 'direction': 'sendonly' }) } | ||
const whip = new WHIPClient(); | ||
await whip.publish(pc, url.value, token.value); | ||
connStatus.innerHTML = "Connected"; | ||
button.innerHTML = "Disconnect"; | ||
button.onclick = async () => { | ||
await whip.stop(); | ||
status.innerHTML = "Disconnected"; | ||
button.onclick = connect; | ||
} | ||
} | ||
|
||
button.onclick = connect; | ||
</script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise, if
opts
is not a keyword listThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do that in line 222