dao-xyz / peerbit-examples

Example library for learning and fun
Apache License 2.0
7 stars 3 forks source link

How to Live Stream with Live Streaming example? #3

Closed Erudition closed 1 year ago

Erudition commented 1 year ago

When I enter the live application for the streaming example, I see a video of simulated static. There doesn't seem to be any way to stream anything.

In Chromium, I see this in the log:

Generating new keypair for client
index-97d41044.js:235 aquire id at 0
index-97d41044.js:238 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl.qjz9zk/7K7WLu
init @ index-97d41044.js:238
index-97d41044.js:238 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl.qjz9zk/7K7WLu
init @ index-97d41044.js:238
index-97d41044.js:192 Object 'Failed to connect directly to: /dns4/fa061453733e2adf9a8f893832f3190e5f3ec35c.peerchecker.com/tcp/8002/ws/p2p/12D3KooWPyPuMT7BR9LkpYwhvRDXQyTsVAhbaQ2ViyQXg9FRK6vm/p2p-circuit/webrtc/p2p/12D3KooWPazjY1uAcRrc8vhVuBwozdujLCJ6sg9JqwSoy2tebt67. The dial request has no valid addresses'
(anonymous) @ index-97d41044.js:192
index-97d41044.js:192 Object 'Failed to connect directly to: /dns4/fa061453733e2adf9a8f893832f3190e5f3ec35c.peerchecker.com/tcp/8001/p2p/12D3KooWPyPuMT7BR9LkpYwhvRDXQyTsVAhbaQ2ViyQXg9FRK6vm/p2p-circuit/webrtc/p2p/12D3KooWPazjY1uAcRrc8vhVuBwozdujLCJ6sg9JqwSoy2tebt67. The dial request has no valid addresses'
(anonymous) @ index-97d41044.js:192
index-97d41044.js:192 Object 'Failed to connect directly to: /ip4/127.0.0.1/tcp/8002/ws/p2p/12D3KooWBKx9dtKCSy2j1NpdFMSDQcQmRqTee8wSetuMZhSifAPs/p2p-circuit/webrtc/p2p/12D3KooWPazjY1uAcRrc8vhVuBwozdujLCJ6sg9JqwSoy2tebt67. The dial request has no valid addresses'
(anonymous) @ index-97d41044.js:192
index-97d41044.js:192 Object 'Failed to connect directly to: /ip4/127.0.0.1/tcp/8001/p2p/12D3KooWBKx9dtKCSy2j1NpdFMSDQcQmRqTee8wSetuMZhSifAPs/p2p-circuit/webrtc/p2p/12D3KooWPazjY1uAcRrc8vhVuBwozdujLCJ6sg9JqwSoy2tebt67. The dial request has no valid addresses'
(anonymous) @ index-97d41044.js:192
index-97d41044.js:192 Object 'Failed to connect directly to: /dns4/fa061453733e2adf9a8f893832f3190e5f3ec35c.peerchecker.com/tcp/8002/ws/p2p/12D3KooWPyPuMT7BR9LkpYwhvRDXQyTsVAhbaQ2ViyQXg9FRK6vm/p2p-circuit/webrtc/p2p/12D3KooWPazjY1uAcRrc8vhVuBwozdujLCJ6sg9JqwSoy2tebt67. The dial request has no valid addresses'
(anonymous) @ index-97d41044.js:192
index-97d41044.js:192 Object 'Failed to connect directly to: /dns4/fa061453733e2adf9a8f893832f3190e5f3ec35c.peerchecker.com/tcp/8001/p2p/12D3KooWPyPuMT7BR9LkpYwhvRDXQyTsVAhbaQ2ViyQXg9FRK6vm/p2p-circuit/webrtc/p2p/12D3KooWPazjY1uAcRrc8vhVuBwozdujLCJ6sg9JqwSoy2tebt67. The dial request has no valid addresses'
(anonymous) @ index-97d41044.js:192
index-97d41044.js:192 Object 'Failed to connect directly to: /dns4/fa061453733e2adf9a8f893832f3190e5f3ec35c.peerchecker.com/tcp/8002/ws/p2p/12D3KooWPyPuMT7BR9LkpYwhvRDXQyTsVAhbaQ2ViyQXg9FRK6vm/p2p-circuit/webrtc/p2p/12D3KooWPazjY1uAcRrc8vhVuBwozdujLCJ6sg9JqwSoy2tebt67. The dial request has no valid addresses'
(anonymous) @ index-97d41044.js:192
index-97d41044.js:192 Object 'Failed to connect directly to: /dns4/fa061453733e2adf9a8f893832f3190e5f3ec35c.peerchecker.com/tcp/8001/p2p/12D3KooWPyPuMT7BR9LkpYwhvRDXQyTsVAhbaQ2ViyQXg9FRK6vm/p2p-circuit/webrtc/p2p/12D3KooWPazjY1uAcRrc8vhVuBwozdujLCJ6sg9JqwSoy2tebt67. The dial request has no valid addresses'
(anonymous) @ index-97d41044.js:192
index-97d41044.js:192 Object 'Failed to connect directly to: /dns4/fa061453733e2adf9a8f893832f3190e5f3ec35c.peerchecker.com/tcp/8002/ws/p2p/12D3KooWPyPuMT7BR9LkpYwhvRDXQyTsVAhbaQ2ViyQXg9FRK6vm/p2p-circuit/webrtc/p2p/12D3KooWPazjY1uAcRrc8vhVuBwozdujLCJ6sg9JqwSoy2tebt67. The dial request has no valid addresses'
(anonymous) @ index-97d41044.js:192
index-97d41044.js:192 Object 'Failed to connect directly to: /dns4/fa061453733e2adf9a8f893832f3190e5f3ec35c.peerchecker.com/tcp/8001/p2p/12D3KooWPyPuMT7BR9LkpYwhvRDXQyTsVAhbaQ2ViyQXg9FRK6vm/p2p-circuit/webrtc/p2p/12D3KooWPazjY1uAcRrc8vhVuBwozdujLCJ6sg9JqwSoy2tebt67. The dial request has no valid addresses'
(anonymous) @ index-97d41044.js:192
index-97d41044.js:192 {module: 'direct-stream'} 'Failed to connect directly to: /ip4/127.0.0.1/tcp/8002/ws/p2p/12D3KooWBKx9dtKCSy2j1NpdFMSDQcQmRqTee8wSetuMZhSifAPs/p2p-circuit/webrtc/p2p/12D3KooWPazjY1uAcRrc8vhVuBwozdujLCJ6sg9JqwSoy2tebt67. The dial request has no valid addresses'
(anonymous) @ index-97d41044.js:192
(anonymous) @ index-97d41044.js:192
maybeConnectDirectly @ index-97d41044.js:200
await in maybeConnectDirectly (async)
publishMessage @ index-97d41044.js:200
publish @ index-97d41044.js:200
await in publish (async)
publish @ index-97d41044.js:200
send @ index-97d41044.js:238
await in send (async)
append @ index-97d41044.js:238
await in append (async)
put @ index-97d41044.js:238
output @ index-97d41044.js:238
index-97d41044.js:192 {module: 'direct-stream'} 'Failed to connect directly to: /ip4/127.0.0.1/tcp/8001/p2p/12D3KooWBKx9dtKCSy2j1NpdFMSDQcQ

When I open the same URL from another instance, I see a black screen, after a brief flash of "streamer is offline". In firefox, I see this in the log:

13:01:03.875 Generating new keypair for client index-97d41044.js:237:18385
13:01:03.876 aquire id at 0 index-97d41044.js:235:80270
13:01:05.839
Object { module: "direct-stream" }
 Failed to connect directly to: /dns4/fa061453733e2adf9a8f893832f3190e5f3ec35c.peerchecker.com/tcp/8001/p2p/12D3KooWPyPuMT7BR9LkpYwhvRDXQyTsVAhbaQ2ViyQXg9FRK6vm/p2p-circuit/webrtc/p2p/12D3KooWL6G2WfHpkHaMemEh1r7GGaWPChjvmycGuAYZPdQPwWig. The dial request has no valid addresses index-97d41044.js:192:252229
    $ https://stream.dao.xyz/assets/index-97d41044.js:192
    1 https://stream.dao.xyz/assets/index-97d41044.js:192
    maybeConnectDirectly https://stream.dao.xyz/assets/index-97d41044.js:200
13:01:05.841
Object { module: "direct-stream" }
 Failed to connect directly to: /dns4/fa061453733e2adf9a8f893832f3190e5f3ec35c.peerchecker.com/tcp/8002/ws/p2p/12D3KooWPyPuMT7BR9LkpYwhvRDXQyTsVAhbaQ2ViyQXg9FRK6vm/p2p-circuit/webrtc/p2p/12D3KooWL6G2WfHpkHaMemEh1r7GGaWPChjvmycGuAYZPdQPwWig. The dial request has no valid addresses index-97d41044.js:192:252229
    $ https://stream.dao.xyz/assets/index-97d41044.js:192
    1 https://stream.dao.xyz/assets/index-97d41044.js:192
    maybeConnectDirectly https://stream.dao.xyz/assets/index-97d41044.js:200
13:01:06.511 An AudioContext was prevented from starting automatically. It must be created or resumed after a user gesture on the page. index-97d41044.js:257:4129
13:01:07.057 Uncaught (in promise) ReferenceError: VideoDecoder is not defined
    pt https://stream.dao.xyz/assets/index-97d41044.js:257
    addVideoStreamListener https://stream.dao.xyz/assets/index-97d41044.js:257
    current https://stream.dao.xyz/assets/index-97d41044.js:257
index-97d41044.js:257:3079
marcus-pousette commented 1 year ago

Thanks for creating this issue.

Firefox does not support WebCodecs yet so it will not work in there sadly, but hopefully soon. Maybe in a month or so with Nightly :)

I updated the readme for clarification https://github.com/dao-xyz/peerbit-examples/commit/5bdd66e07d5d03d35e1a91a688bb40869d0a1630

Can you try with two browser tabs/windows in chrome?

Erudition commented 1 year ago

Sorry, I should clarify that I tried two instances with both browsers. Firefox <-> Firefox Chromium <-> Chromium streaming

Erudition commented 1 year ago

My bad! I just realized the Static is intentional, after discovering the "source" menu. Works on Chromium, nevermind!