-
Notifications
You must be signed in to change notification settings - Fork 2
FCE-2808: Fix module resolution #477
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
Changes from all commits
ceb3019
bd36ce8
bdf7752
b380086
787e8af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,11 +1,10 @@ | ||||||||||||||||
| type LivestreamKind = "whip" | "whep"; | ||||||||||||||||
|
|
||||||||||||||||
| export function resolveFishjamUrl(fishjamId: string): string { | ||||||||||||||||
| try { | ||||||||||||||||
| if (/^https?:\/\//.test(fishjamId)) { | ||||||||||||||||
| return new URL(fishjamId).href; | ||||||||||||||||
|
||||||||||||||||
| return new URL(fishjamId).href; | |
| try { | |
| return new URL(fishjamId).href; | |
| } catch { | |
| // Fall back to default connect URL if the provided string is not a valid absolute URL. | |
| return `https://fishjam.io/api/v1/connect/${fishjamId}`; | |
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| import { WHEPClient } from '@binbat/whip-whep/whep'; | ||
| import { WHIPClient } from '@binbat/whip-whep/whip'; | ||
|
|
||
| export type ReceiveLivestreamResult = { | ||
| stream: MediaStream; | ||
| stop: () => Promise<void>; | ||
|
|
@@ -21,13 +18,14 @@ export type LivestreamCallbacks = { | |
| onConnectionStateChange?: (pc: RTCPeerConnection) => void; | ||
| }; | ||
|
|
||
| export function receiveLivestream(url: string, token?: string, callbacks?: LivestreamCallbacks) { | ||
| export async function receiveLivestream(url: string, token?: string, callbacks?: LivestreamCallbacks) { | ||
| const pc = new RTCPeerConnection({ bundlePolicy: 'max-bundle' }); | ||
|
|
||
| pc.addTransceiver('video', { direction: 'recvonly' }); | ||
| pc.addTransceiver('audio', { direction: 'recvonly' }); | ||
| pc.onconnectionstatechange = (_ev) => callbacks?.onConnectionStateChange?.(pc); | ||
|
|
||
| const { WHEPClient } = await import('@binbat/whip-whep/whep'); | ||
| const whep = new WHEPClient(); | ||
|
Comment on lines
+28
to
29
|
||
|
|
||
| return new Promise<ReceiveLivestreamResult>((resolve, reject) => { | ||
|
||
|
|
@@ -77,6 +75,7 @@ export async function publishLivestream( | |
| if (video) pc.addTransceiver(video, { direction: 'sendonly' }); | ||
| if (audio) pc.addTransceiver(audio, { direction: 'sendonly' }); | ||
|
|
||
| const { WHIPClient } = await import('@binbat/whip-whep/whip'); | ||
| const whip = new WHIPClient(); | ||
| try { | ||
| await whip.publish(pc, url, token); | ||
|
|
||
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.
@fishjam-cloud/react-native-webrtcandreact-native-get-random-valuesare listed in bothdependenciesandpeerDependencies. A dependency does not satisfy a peer dependency, so consumers may still see unmet-peer warnings and can end up with duplicate installs. Consider choosing one model (peer-only for host-provided native deps, or dependency-only for auto-install), and if keeping them as peers, remove them fromdependenciesand/or mark them optional viapeerDependenciesMeta.