-
Notifications
You must be signed in to change notification settings - Fork 1
/
recording_test.go
65 lines (56 loc) · 1.7 KB
/
recording_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
package wserest
import (
"testing"
"github.com/openfresh/wse-rest-library-go/entity/application/helper"
)
func TestRecording(t *testing.T) {
// Create settings
settings := helper.NewDefaultSettings()
settings.SetHost(WowzaHost)
settings.SetUseDigest(true)
settings.SetUsername(WowzaUsername)
settings.SetPassword(WowzaPassword)
sf := NewRecording(settings, "", "")
if UseWowza == "" {
return
}
response, err := sf.Split("myStream")
if err != nil {
t.Fatal(err)
}
t.Log(response)
recordName := "myStream"
instanceName := "_definst_"
recorderState := "Waiting for stream"
defaultRecorder := true
segmentationType := "None"
outputPath := "/usr/local/WowzaStreamingEngine/content"
baseFile := "testme.mp4"
fileFormat := "MP4" // or FLV
fileVersionDelegateName := "com.wowza.wms.livestreamrecord.manager.StreamRecorderFileVersionDelegate"
fileTemplate := "${BaseFileName}_${RecordingStartTime}_${SegmentNumber}"
segmentDuration := 900000
segmentSize := 10485760
segmentSchedule := ""
recordData := true
startOnKeyFrame := true
splitOnTcDiscontinuity := false
option := "Version existing file"
moveFirstVideoFrameToZero := true
currentSize := 0
currentDuration := 0
recordingStartTime := ""
response, err = sf.Create(recordName, instanceName, recorderState, defaultRecorder,
segmentationType, outputPath, baseFile, fileFormat, fileVersionDelegateName, fileTemplate,
segmentDuration, segmentSize, segmentSchedule, recordData, startOnKeyFrame, splitOnTcDiscontinuity,
option, moveFirstVideoFrameToZero, currentSize, currentDuration, recordingStartTime)
if err != nil {
t.Fatal(err)
}
t.Log(response)
response, err = sf.GetAll()
if err != nil {
t.Fatal(err)
}
t.Log(response)
}