Skip to content

Commit 0511dea

Browse files
committed
add example app
1 parent 56bce36 commit 0511dea

File tree

15 files changed

+4876
-8
lines changed

15 files changed

+4876
-8
lines changed

example/.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.rebar3
2+
_*
3+
.eunit
4+
*.o
5+
*.beam
6+
*.plt
7+
*.swp
8+
*.swo
9+
.erlang.cookie
10+
ebin
11+
log
12+
erl_crash.dump
13+
.rebar
14+
logs
15+
_build
16+
.idea
17+
*.iml
18+
rebar3.crashdump

example/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.PHONY: dev
2+
3+
dev:
4+
../rebar3 compile && ../rebar3 shell
5+
6+
release:
7+
../rebar3 as prod release

example/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
example
2+
=====
3+
4+
An OTP application
5+
6+
Build
7+
-----
8+
9+
$ rebar3 compile

example/conf/sys.config

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[{example, [
2+
{port, 8443},
3+
{certfile, <<"../priv/certs/certificate.pem">>},
4+
{keyfile, <<"../priv/certs/key.pem">>},
5+
{example_password, <<"password">>}
6+
]},
7+
{webrtc_server, [
8+
{hostname, <<"localhost">>},
9+
{certfile, <<"../priv/certs/certificate.pem">>},
10+
{keyfile, <<"../priv/certs/key.pem">>},
11+
{auth_fun, {callbacks, authenticate}},
12+
{create_callback, {callbacks, create}},
13+
{join_callback, {callbacks, join}},
14+
{leave_callback, {callbacks, leave}}
15+
]},
16+
{lager, [
17+
{handlers, [
18+
{lager_console_backend, [{level, debug}]},
19+
{lager_file_backend, [{file, "log/error.log"}, {level, error}]},
20+
{lager_file_backend, [{file, "log/console.log"}, {level, info}]}]}
21+
]}
22+
23+
].

example/priv/css/main.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
body {
2+
font-family: sans-serif;
3+
}
4+
5+
video {
6+
max-width: 100%;
7+
width: 320px;
8+
}

example/priv/index.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
6+
<title>Realtime communication with WebRTC</title>
7+
8+
<link rel="stylesheet" href="/css/main.css" />
9+
10+
</head>
11+
12+
<body>
13+
14+
<h1>Realtime communication with WebRTC</h1>
15+
16+
<div id="videos">
17+
<video id="localVideo" autoplay muted></video>
18+
<video id="remoteVideo" autoplay></video>
19+
</div>
20+
21+
<script src="js/main.js"></script>
22+
<script src="js/adapter-latest.js"></script>
23+
24+
</body>
25+
26+
</html>

0 commit comments

Comments
 (0)