-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopentok.elm
107 lines (92 loc) · 2.25 KB
/
opentok.elm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
port module OpenTok exposing (..)
type alias Credentials =
{ apiKey : String
, sessionId : String
, token : String
}
type alias ConnectCallbackResult =
{ sessionId : String
, success : Bool
, message : String
}
type alias PublishCallbackResult =
{ sessionId : String
, streamId : String
, success : Bool
, message : String
}
type alias SubscribeCallbackResult =
{ sessionId : String
, streamId : String
, success : Bool
, message : String
}
type alias StreamEvent =
{ sessionId : String
, streamId : String
}
type alias DisconnectOptions =
{ sessionId : String
}
type alias PublishOptions =
{ sessionId : String
, containerId : String
}
type alias SubscribeOptions =
{ sessionId : String
, streamId : String
, containerId : String
}
type alias UnsubscribeOptions =
{ sessionId : String
, streamId : String
}
port connect : Credentials -> Cmd msg
port disconnect : DisconnectOptions -> Cmd msg
port publish : PublishOptions -> Cmd msg
port subscribe : SubscribeOptions -> Cmd msg
port unsubscribe : UnsubscribeOptions -> Cmd msg
port connectCallback : (ConnectCallbackResult -> msg) -> Sub msg
port publishCallback : (PublishCallbackResult -> msg) -> Sub msg
port subscribeCallback : (SubscribeCallbackResult -> msg) -> Sub msg
port onStreamCreated : (StreamEvent -> msg) -> Sub msg
port onStreamDestroyed : (StreamEvent -> msg) -> Sub msg
{--
-- Unused Types:
type alias ResolutionObject =
{ width : Int
, height : Int
}
type alias PublisherProperties =
{ audioFallbackEnabled : Bool
, audioSource : String
, fitMode : String
, frameRate : Int
, height : Int
, insertDefaultUI : Bool
, insertMode : String
, maxResolution : ResolutionObject
, mirror : Bool
, name : String
, publishAudio : Bool
, publishVideo : Bool
, resolution : String
, showControls : Bool
, usePreviousDeviceSelection : Bool
, videoSource : String
, width : Int
}
type alias SubscriberProperties =
{ audioVolume : Int
, fitMode : String
, height : Int
, insertDefaultUI : Bool
, insertMode : String
, preferredFrameRate : Int
, preferredResolution : ResolutionObject
, showControls : Bool
, subscribeToAudio : Bool , subscribeToVideo : Bool
, testNetwork : Bool
, width : Int
}
--}