Skip to content
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

Connecting to remote streams #85

Closed
mariawitek opened this issue Apr 12, 2020 · 15 comments
Closed

Connecting to remote streams #85

mariawitek opened this issue Apr 12, 2020 · 15 comments

Comments

@mariawitek
Copy link

Hi,

First, thanks for developing such an awesome tool!

I'm having problems connecting to remote streams in Hydra. Changing the tab name in the first window seems to work fine, but when I then try to connect using s0.initStream() in the second window, I don't see the remote stream and get the following error in the console (see attached screenshot). Any ideas what's going on here?
hydra_error

@ojack
Copy link
Member

ojack commented Apr 15, 2020

Hi @mariawitek that part is currently broken in most browsers unfortunately. Working on fixing it!

@mariawitek
Copy link
Author

Ok, thanks for the update @ojack !

@sanotronics
Copy link

I have the same issue.

Not JS expert at all, but maybe this helps?
https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/srcObject

@sanotronics
Copy link

sanotronics commented Apr 21, 2020

I just tried on a local server replacing line 61 on https://github.com/ojack/hydra/blob/1985574d65dacea079bad1824b06090b7187de90/hydra-server/app/src/pb-live.js#L61

for the following (as suggested in the previous link I sent)

if ('srcObject' in video) {
  video.srcObject = stream
} else {
  // Avoid using this in new browsers, as it is going away.
  video.src = window.URL.createObjectURL(stream)
}

And it worked, streaming to a browser instance... Once haha

Rolled back to confirm that had done the trick, but then I couldn't get it to work once again:/

@sanotronics
Copy link

sanotronics commented Apr 21, 2020

it worked!

I just added that very code in the bundle.js file and commented line 1123 (same as line 61 in the pb file) and I got a stream from one local instance to another :)

Tried (and it worked) in:

  • Brave browser Version 1.7.92 Chromium: 80.0.3987.163 (Official Build) (64-bit)
  • Chrome Version 81.0.4044.113 (Official Build) (64-bit)
  • Firefox 70.0.1 (64-bit)

Seems to be a really easy fix luckily :)

@ojack
Copy link
Member

ojack commented Apr 27, 2020

Hey I just updated this! I thought it was something much more complicated, thanks @sanotronics . @mariawitek try and report back if it works!

Closing this for now, but feel free to keep commenting.

@mariawitek
Copy link
Author

Hey thanks @ojack! I just tried in firefox and chrome, and it worked in both! (PS: I deleted a comment I just posted where I said it didn't work. I just needed to wait a bit!)

@ojack
Copy link
Member

ojack commented Apr 27, 2020

Oh thats great to hear! I would love to hear more about how you end up using this feature. It was something that was initially a part of hydra (and was one of the reasons I made it). But since then I haven't used it very much.

Going to close this issue but feel free to continue to add comments here.

@ojack ojack closed this as completed Apr 27, 2020
@mariawitek
Copy link
Author

So actually I'm using it for maybe a slightly unusual (and less interesting) reason.. I've been doing some live-streams with a DJ and don't have a webcam. We wanted to use one laptop as the webcam (placed so that both the DJ and I were visible), and then connect to another laptop to make patterns with the output in hydra and send that out via obs (hope that makes sense!)

@sanotronics
Copy link

Oh I'm so glad I could help out!

I think it's a great feature to use remote cam like a smart phone :) this gives you a lot more flexibility and resolution than the laptop webcam

I was able to use initCam() to use the front camera and initCam(1) for the back camera.

Will test later if the stream works but I have a feeling it will

@ojack
Copy link
Member

ojack commented Apr 27, 2020 via email

@sanotronics
Copy link

sanotronics commented Apr 27, 2020

I also have a friend who uses the output that this project generates, which is a controlled PWM RGB LED using the rolling shutter of the smartphones cams, and inputs this to hydra.

The result is quite awesome :)

hydra-RSD
hydra-RSD-2

Great work olivia :) Cheers from Argentina

@sanotronics
Copy link

sanotronics commented Apr 27, 2020

@ojack do you still have that website to load the camera?

Looks like hydra doesn't load properly on iPhones :( in an iPad it does load 🙃

hydra-iOS-fail

@ojack
Copy link
Member

ojack commented Apr 27, 2020

@sanotronics no I don't. And oh no, did this update that was supposed to make it run on IOS, https://github.com/ojack/hydra/blob/5e289dc539ba51797f79e0d3840ba5441fb0e3a8/hydra-server/app/index.js#L23
but it seems it still isn't working. I don't have an ios device so can't test.

@sanotronics
Copy link

sanotronics commented Apr 27, 2020

me neither, but I can work remotely with my father or this friend of mine to debug, if need be

It seems to work in iPad, so iOS shouldn't be the problem, but something related to iPhones :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants