@@ -13,12 +13,12 @@ Currently it allows for:
13
13
14
14
## Installation
15
15
16
- The package can be installed by adding ` jellyfish_server_sdk ` to your list of dependencies in ` mix.exs ` :
16
+ The package can be installed by adding ` fishjam_server_sdk ` to your list of dependencies in ` mix.exs ` :
17
17
18
18
``` elixir
19
19
def deps do
20
20
[
21
- {:jellyfish_server_sdk , " ~> 0.5 .0" }
21
+ {:fishjam_server_sdk , " ~> 0.6 .0" }
22
22
]
23
23
end
24
24
```
@@ -29,22 +29,22 @@ Define the connection configuration in the mix config,
29
29
specifying server address and authentication token
30
30
(for more information see [ Fishjam docs] ( https://fishjam-dev.github.io/fishjam-docs/getting_started/authentication ) )
31
31
``` config.exs
32
- config :jellyfish_server_sdk ,
32
+ config :fishjam_server_sdk ,
33
33
server_address: " localhost:5002" ,
34
- server_api_token: " your-jellyfish -token" ,
34
+ server_api_token: " your-fishjam -token" ,
35
35
secure?: true
36
36
```
37
37
38
- Alternatively, the connection options can be provided when creating a ` Jellyfish .Client` or starting ` Jellyfish .WSNotifier` :
38
+ Alternatively, the connection options can be provided when creating a ` Fishjam .Client` or starting ` Fishjam .WSNotifier` :
39
39
40
40
``` elixir
41
41
client =
42
- Jellyfish .Client .new (server_address: " localhost:5002" , server_api_token: " your-jellyfish -token" )
42
+ Fishjam .Client .new (server_address: " localhost:5002" , server_api_token: " your-fishjam -token" )
43
43
44
44
{:ok , notifier} =
45
- Jellyfish .WSNotifier .start (
45
+ Fishjam .WSNotifier .start (
46
46
server_address: " localhost:5002" ,
47
- server_api_token: " your-jellyfish -token"
47
+ server_api_token: " your-fishjam -token"
48
48
)
49
49
```
50
50
@@ -54,29 +54,29 @@ Make API calls to Fishjam and receive server events:
54
54
55
55
``` elixir
56
56
# start process responsible for receiving events
57
- {:ok , notifier} = Jellyfish .WSNotifier .start ()
58
- :ok = Jellyfish .WSNotifier .subscribe_server_notifications (notifier)
57
+ {:ok , notifier} = Fishjam .WSNotifier .start ()
58
+ :ok = Fishjam .WSNotifier .subscribe_server_notifications (notifier)
59
59
60
60
# create HTTP client instance
61
- client = Jellyfish .Client .new ()
61
+ client = Fishjam .Client .new ()
62
62
63
63
# Create room
64
- {:ok , %Jellyfish .Room {id: room_id}, jellyfish_address } = Jellyfish .Room .create (client, max_peers: 10 )
64
+ {:ok , %Fishjam .Room {id: room_id}, fishjam_address } = Fishjam .Room .create (client, max_peers: 10 )
65
65
66
66
room_id
67
67
# => "8878cd13-99a6-40d6-8d7e-8da23d803dab"
68
68
69
69
# Add peer
70
- {:ok , %Jellyfish .Peer {id: peer_id}, peer_token} =
71
- Jellyfish .Room .add_peer (client, room_id, Jellyfish .Peer .WebRTC )
70
+ {:ok , %Fishjam .Peer {id: peer_id}, peer_token} =
71
+ Fishjam .Room .add_peer (client, room_id, Fishjam .Peer .WebRTC )
72
72
73
73
receive do
74
- {:jellyfish , %Jellyfish .Notification .PeerConnected {room_id: ^room_id , peer_id: ^peer_id }} ->
74
+ {:fishjam , %Fishjam .Notification .PeerConnected {room_id: ^room_id , peer_id: ^peer_id }} ->
75
75
# handle the notification
76
76
end
77
77
78
78
# Delete peer
79
- :ok = Jellyfish .Room .delete_peer (client, room_id, peer_id)
79
+ :ok = Fishjam .Room .delete_peer (client, room_id, peer_id)
80
80
```
81
81
82
82
List of structs representing events can be found in the [ docs] ( https://hexdocs.pm/fishjam_server_sdk ) .
0 commit comments