Skip to content

Commit ed982c7

Browse files
committed
Merge pull request #122 from aoberoi/issue-119
adds paused status to archive, fixes #119
2 parents 9ec2e41 + 88f0955 commit ed982c7

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

src/OpenTok/Archive.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@
4343
*
4444
* <ul>
4545
* <li> "available" -- The archive is available for download from the OpenTok cloud.</li>
46-
* <li>"expired" -- The archive is no longer available for download from the OpenTok
46+
* <li> "expired" -- The archive is no longer available for download from the OpenTok
4747
* cloud.</li>
4848
* <li> "failed" -- The archive recording failed.</li>
49+
* <li> "paused" -- The archive recording has paused.</li>
4950
* <li> "started" -- The archive started and is in the process of being recorded.</li>
5051
* <li> "stopped" -- The archive stopped recording.</li>
5152
* <li> "uploaded" -- The archive is available for download from the the upload target

src/OpenTok/Util/archive-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
},
5151
"status": {
5252
"type": "string",
53-
"enum": ["available", "started", "stopped", "failed", "deleted", "uploaded", "expired"]
53+
"enum": ["available", "started", "stopped", "failed", "deleted", "uploaded", "expired", "paused"]
5454
},
5555
"url": {
5656
"type": ["string", "null"]

tests/OpenTok/ArchiveTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,34 @@ public function testRejectsBadArchiveData() {
211211
));
212212
}
213213

214+
public function testAllowsPausedStatus() {
215+
// Set up fixtures
216+
$archiveData = array(
217+
'createdAt' => 1394394801000,
218+
'duration' => 0,
219+
'id' => '063e72a4-64b4-43c8-9da5-eca071daab89',
220+
'name' => 'showtime',
221+
'partnerId' => 854511,
222+
'reason' => '',
223+
'sessionId' => '2_MX44NTQ1MTF-flR1ZSBOb3YgMTIgMDk6NDA6NTkgUFNUIDIwMTN-MC43NjU0Nzh-',
224+
'size' => 0,
225+
'status' => 'paused',
226+
'url' => null,
227+
);
228+
$apiKey = defined('API_KEY') ? API_KEY : '12345678';
229+
$apiSecret = defined('API_SECRET') ? API_SECRET : '0123456789abcdef0123456789abcdef0123456789';
230+
231+
$client = new Client();
232+
$archive = new Archive($archiveData, array(
233+
'apiKey' => $this->API_KEY,
234+
'apiSecret' => $this->API_SECRET,
235+
'client' => $this->client
236+
));
237+
238+
$this->assertInstanceOf('OpenTok\Archive', $archive);
239+
$this->assertEquals($archiveData['status'], $archive->status);
240+
}
241+
214242
public function testSerializesToJson() {
215243

216244
// Arrange

0 commit comments

Comments
 (0)