Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Tried example, didnt work #34

Open
Meai1 opened this issue May 30, 2017 · 10 comments
Open

Tried example, didnt work #34

Meai1 opened this issue May 30, 2017 · 10 comments

Comments

@Meai1
Copy link

Meai1 commented May 30, 2017

I started the demo-server.js, opened the client/index.html, click "start streaming", it asks for permission then nothing happens for a while and then these errors.
test

@kbbqiu
Copy link
Collaborator

kbbqiu commented May 30, 2017

@Meai1 Cannot, reproduce your issue. Can you give us a rundown on how to reproduce it?
It seems that the getUserMedia on ur end isnt even working. Are you getting any errors other than the POST error?

For now, I've merged a slightly cleaner version of the codebase, so try another pull request.

  1. npm start
  2. localhost://8000
  3. open up a broadcaster and open up a viewer.
  4. start Streaming from the broadcaster.
  5. Wait 10 secs or so for the stream to start on the viewer side

screen shot 2017-05-30 at 7 53 46 am

@RobAWilkinson
Copy link
Contributor

Not sure if related, but I keep getting TypeError: Argument 1 of RTCPeerConnection.getStats does not implement interface MediaStreamTrack.

@Meai1
Copy link
Author

Meai1 commented May 30, 2017

ok I guess I opened the viewer with a different webserver than the server. I did python -m http.server 8099 for the broadcaster and viewer, only the server was running on 8000.
Idk if that is still supposed to work, shouldnt it? obviously everyone will run from different PCs even.
Now that I opened it all with port 8000 at least a video is showing in the broadcaster, but not in the viewer
bla

@adaxi
Copy link

adaxi commented May 31, 2017

I am experiencing the same issue when using the provided example and instructions. The viewer does not see the video that is being transmitted by the broadcaster. The viewer seems to be receiving the magnets according to the log.

screenshot from 2017-05-31 21 32 06

Server log:

> nile.js@1.0.12 start /home/adaxi/Workspaces/XXXX/nile.js
> node demo-server.js

Listening on port 8000
New connection: jAV42cja660ZVwgdAAAA
Added sockets: [ 'jAV42cja660ZVwgdAAAA' ]
jAV42cja660ZVwgdAAAA disconnected
Updated sockets: []
New connection: CkCCMxnznIyVJEE1AAAB
Added sockets: [ 'CkCCMxnznIyVJEE1AAAB' ]
CkCCMxnznIyVJEE1AAAB disconnected
Updated sockets: []
New connection: LuBMDaNrWSnV6Br3AAAC
Added sockets: [ 'LuBMDaNrWSnV6Br3AAAC' ]
LuBMDaNrWSnV6Br3AAAC disconnected
Updated sockets: []
New connection: CJXMXH8hOEBxX8soAAAD
Added sockets: [ 'CJXMXH8hOEBxX8soAAAD' ]

@StarpTech
Copy link

I also run into the same issue like @adaxi everythings looks fine but the viewer cant see the video.

@kbbqiu
Copy link
Collaborator

kbbqiu commented Jun 1, 2017

Can't really identify the error from the information provided. :/

@StarpTech
Copy link

@kbbqiu I also tried to access my torrent with a web torrent client but the clients hangs at fetching the torrent informations. What information do you need? Could you provide a picture of the source code of the viewer? Is it correct that the video tag has no attributes except Id?

@adaxi
Copy link

adaxi commented Jun 1, 2017

@kbbqiu I have attempted to debug a bit more, and it seems that the torrent is never received once the magnet is given to the client.

https://github.com/gitsummore/nile.js/blob/master/client/module/viewer.js#L316

@Qix-
Copy link

Qix- commented Jun 1, 2017

@Meai1 I did the same thing - it appears the broadcast server and static server have to be on the same port (i.e. served by the same server instance) - which really dampens the "scalable" aspect.

Would be nice to be able to specify a custom port.


I'm also having problems running examples.

$ node --version
v8.0.0
$ npm --version
v5.0.0

index.js (the magnet server code):

const path = require('path');

const express = require('express');
const nile = require('nile.js/server/nileServer');

const app = express();
const server = app.listen(8000);
const nileServer = nile(server);

app.use('/', nileServer);
app.use('/broadcast', express.static(path.join(__dirname, 'broadcast')));

broadcast/index.html (for serving the broadcaster static assets):

<!doctype html>
<html>
	<head>
		<title>Nile.js Test</title>
		<script src="https://unpkg.com/nile.js/client/dist/nile.Broadcaster.min.js"></script>
	</head>
	<body>
		<video id="viewfinder"></video>
		<button id="start">Start</button>
		<button id="stop">Stop</button>
		<script>
			const broadcaster = new Broadcaster(8000, 'viewfinder', 'start', 'stop');
		</script>
	</body>
</html>

When I serve and visit localhost:8000/broadcast, I see my interface and click Start - chrome prompts for webcam access, but nothing ever shows up in the video port (even after waiting quite a while - it's been running for a few minutes and nothing is showing up).

screen shot 2017-06-01 at 2 49 09 pm


EDIT: Nevermind; the documentation is vague. You can't use a <video> tag as Nile.js inserts a <video> tag in the element specified in the second argument.

The documentation should be updated to reflect that.

Now I'm seeing myself, but it's just a still. No video.


EDIT 2: Just tested with a viewer client. It's showing that it successfully connected but I'm not seeing any video on the client side. Broadcaster side is still frozen after first or second frame.

Here's the current repro case:

// index.js
const path = require('path');

const express = require('express');
const nile = require('nile.js/server/nileServer');

const app = express();
const server = app.listen(8000);
const nileServer = nile(server);

app.use('/', nileServer);
app.use('/broadcast', express.static(path.join(__dirname, 'broadcast')));
app.use('/view', express.static(path.join(__dirname, 'viewer')));
<!-- broadcast/index.html -->
<!doctype html>
<html>
	<head>
		<title>Nile.js Test Broadcaster</title>
		<script src="https://unpkg.com/nile.js/client/dist/nile.Broadcaster.min.js"></script>
	</head>
	<body>
		<div id="viewfinder"></div>
		<button id="start">Start</button>
		<button id="stop">Stop</button>
		<script>
			const broadcaster = new Broadcaster(1000, 'viewfinder', 'start', 'stop');
		</script>
	</body>
</html>
<!-- viewer/index.html -->
<!doctype html>
<html>
	<head>
		<title>Nile.js Test Viewer</title>
		<script src="https://unpkg.com/nile.js/client/dist/nile.Viewer.min.js"></script>
	</head>
	<body>
		<div id="viewfinder"></div>
		<script>
			const viewer = new Viewer('viewfinder');
		</script>
	</body>
</html>

@karuppiah7890
Copy link

@Qix- Thanks for the update that the docs weren't proper. I think I should have understood that when I saw video tags within video tags. I was so sleepy that I didn't even think about it.

And about the broadcasting side video element, for me it doesn't freeze. It shows real movement. But nothing on Viewer side, but when I got the magnet link's contents (before it got removed) using WebTorrent, it downloaded and showed me my video.

I think there are some bugs to be fixed. Other than that, I think this is super cool. I had this idea, but without the torrent and other concepts and obviously I didn't see it fit to implement because I saw lot of problems. But Nile Js uses Torrents to tackle some of them !

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

No branches or pull requests

7 participants