forked from openfresh/wse-rest-library-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstreamfile_test.go
66 lines (55 loc) · 1.31 KB
/
streamfile_test.go
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
package wserest
import (
"testing"
"github.com/sebastien4/wse-rest-library-go/entity/application/helper"
)
func TestStreamfile(t *testing.T) {
// Create settings
settings := helper.NewDefaultSettings()
settings.SetHost(WowzaHost)
settings.SetUseDigest(true)
settings.SetUsername(WowzaUsername)
settings.SetPassword(WowzaPassword)
sf := NewStreamFile(settings, "live", "myStream")
if UseWowza == "" {
return
}
urlProps := map[string]interface{}{
"uri": "rtsp://localhost/vod/mp4:BigBuckBunny_115k.mov",
"streamTimeout": 1200,
"rtspSessionTimeout": 800,
}
response, err := sf.Create(urlProps, "rtp", "")
if err != nil {
t.Fatal(err)
}
t.Log(response)
// Complete an update on the stream file
urlProps = map[string]interface{}{
"uri": "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov",
"streamTimeout": 1100,
"rtspSessionTimeout": 600,
}
response, err = sf.Update(urlProps)
if err != nil {
t.Fatal(err)
}
t.Log(response)
// Connect to the stream identified in the file
response, err = sf.Connect("")
if err != nil {
t.Fatal(err)
}
t.Log(response)
response, err = sf.Disconnect()
if err != nil {
t.Fatal(err)
}
t.Log(response)
// Remove the stream file
response, err = sf.Remove()
if err != nil {
t.Fatal(err)
}
t.Log(response)
}