diff --git a/README.md b/README.md index 1aa9aa62..6bd34430 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Add this package (`opentok/opentok`) to your `composer.json` file, or just run t command line: ``` -$ ./composer.phar require opentok/opentok 4.3.x +$ ./composer.phar require opentok/opentok 4.4.x ``` ### Manually: @@ -255,16 +255,18 @@ You can only start live streaming broadcasts for sessions that use the OpenTok M Start the live streaming broadcast of an OpenTok Session using the `startBroadcast($sessionId, $options)` method of the `OpenTok\OpenTok` class. This will return an `OpenTok\Broadcast` instance. The `$options` parameter is -an optional array used to assign a layout type for the broadcast. +an optional array used to assign broadcast options such as layout, maxDuration, resolution, and more. ```php // Start a live streaming broadcast of a session $broadcast = $opentok->startBroadcast($sessionId); -// Start a live streaming broadcast of a session, setting a layout type +// Start a live streaming broadcast of a session, using broadcast options $options = array( - 'layout' => Layout::getBestFit() + 'layout' => Layout::getBestFit(), + 'maxDuration' => 5400, + 'resolution' => '1280x720' ); $broadcast = $opentok->startBroadcast($sessionId, $options); diff --git a/src/OpenTok/Broadcast.php b/src/OpenTok/Broadcast.php index e97eb365..a9cb9848 100644 --- a/src/OpenTok/Broadcast.php +++ b/src/OpenTok/Broadcast.php @@ -87,6 +87,9 @@ public function __get($name) case 'partnerId': case 'sessionId': case 'broadcastUrls': + case 'status': + case 'maxDuration': + case 'resolution': return $this->data[$name]; break; case 'hlsUrl': diff --git a/src/OpenTok/OpenTok.php b/src/OpenTok/OpenTok.php index f838d718..9006a0cc 100755 --- a/src/OpenTok/OpenTok.php +++ b/src/OpenTok/OpenTok.php @@ -504,7 +504,7 @@ public function startBroadcast($sessionId, $options=array()) $defaults = array( 'layout' => Layout::getBestFit() ); - $options = array_merge($defaults, array_intersect_key($options, $defaults)); + $options = array_merge($defaults, $options); list($layout) = array_values($options); // validate arguments diff --git a/src/OpenTok/Util/Client.php b/src/OpenTok/Util/Client.php index 6740265a..365cb314 100755 --- a/src/OpenTok/Util/Client.php +++ b/src/OpenTok/Util/Client.php @@ -38,7 +38,7 @@ // TODO: build this dynamically /** @internal */ -define('OPENTOK_SDK_VERSION', '4.3.0'); +define('OPENTOK_SDK_VERSION', '4.4.0'); /** @internal */ define('OPENTOK_SDK_USER_AGENT', 'OpenTok-PHP-SDK/' . OPENTOK_SDK_VERSION); @@ -280,13 +280,17 @@ public function startBroadcast($sessionId, $options) '/v2/project/'.$this->apiKey.'/broadcast' ); + $optionsJson = [ + 'sessionId' => $sessionId, + 'layout' => $options['layout']->jsonSerialize() + ]; + unset($options['layout']); + $optionsJson = array_merge($optionsJson, $options); + try { $response = $this->client->send($request, [ 'debug' => $this->isDebug(), - 'json' => [ - 'sessionId' => $sessionId, - 'layout' => $options['layout']->jsonSerialize() - ] + 'json' => $optionsJson ]); $broadcastJson = json_decode($response->getBody(), true); } catch (\Exception $e) { diff --git a/tests/OpenTok/ArchiveTest.php b/tests/OpenTok/ArchiveTest.php index eec01758..3cafb4c2 100644 --- a/tests/OpenTok/ArchiveTest.php +++ b/tests/OpenTok/ArchiveTest.php @@ -156,7 +156,7 @@ public function testStopsArchive() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); // TODO: test the properties of the actual archive object $this->assertEquals('stopped', $this->archive->status); @@ -195,7 +195,7 @@ public function testDeletesArchive() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $this->assertTrue($success); // TODO: assert that all properties of the archive object were cleared diff --git a/tests/OpenTok/OpenTokTest.php b/tests/OpenTok/OpenTokTest.php index 8aa84e6b..59e80ce5 100644 --- a/tests/OpenTok/OpenTokTest.php +++ b/tests/OpenTok/OpenTokTest.php @@ -126,7 +126,7 @@ public function testCreatesDefaultSession() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $p2p_preference = $this->getPostField($request, 'p2p.preference'); $this->assertEquals('enabled', $p2p_preference); @@ -186,7 +186,7 @@ public function testCreatesMediaRoutedAndLocationSession() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $location = $this->getPostField($request, 'location'); $this->assertEquals('12.34.56.78', $location); @@ -234,7 +234,7 @@ public function testCreatesMediaRelayedSession() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $p2p_preference = $this->getPostField($request, 'p2p.preference'); $this->assertEquals('enabled', $p2p_preference); @@ -279,7 +279,7 @@ public function testCreatesAutoArchivedSession() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $archiveMode = $this->getPostField($request, 'archiveMode'); $this->assertEquals('always', $archiveMode); @@ -496,7 +496,7 @@ public function testStartsArchive() ]]); // This sessionId was generated using a different apiKey, but this method doesn't do any - // decoding to check, so its fine. + // decoding to check, so it's fine. $sessionId = '2_MX44NTQ1MTF-flR1ZSBOb3YgMTIgMDk6NDA6NTkgUFNUIDIwMTN-MC43NjU0Nzh-'; // Act @@ -521,7 +521,7 @@ public function testStartsArchive() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $this->assertInstanceOf('OpenTok\Archive', $archive); $this->assertEquals(0, $archive->duration); @@ -546,7 +546,7 @@ public function testStartsArchiveNamed() ]]); // This sessionId was generated using a different apiKey, but this method doesn't do any - // decoding to check, so its fine. + // decoding to check, so it's fine. $sessionId = '2_MX44NTQ1MTF-flR1ZSBOb3YgMTIgMDk6NDA6NTkgUFNUIDIwMTN-MC43NjU0Nzh-'; // Act @@ -571,7 +571,7 @@ public function testStartsArchiveNamed() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $body = json_decode($request->getBody()); $this->assertEquals($sessionId, $body->sessionId); @@ -594,7 +594,7 @@ public function testStartsArchiveNamedDeprecated() ]]); // This sessionId was generated using a different apiKey, but this method doesn't do any - // decoding to check, so its fine. + // decoding to check, so it's fine. $sessionId = '2_MX44NTQ1MTF-flR1ZSBOb3YgMTIgMDk6NDA6NTkgUFNUIDIwMTN-MC43NjU0Nzh-'; // Act @@ -619,7 +619,7 @@ public function testStartsArchiveNamedDeprecated() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $body = json_decode($request->getBody()); $this->assertEquals($sessionId, $body->sessionId); @@ -641,7 +641,7 @@ public function testStartsArchiveAudioOnly() ]]); // This sessionId was generated using a different apiKey, but this method doesn't do any - // decoding to check, so its fine. + // decoding to check, so it's fine. $sessionId = '2_MX44NTQ1MTF-flR1ZSBOb3YgMTIgMDk6NDA6NTkgUFNUIDIwMTN-MC43NjU0Nzh-'; // Act @@ -666,7 +666,7 @@ public function testStartsArchiveAudioOnly() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $body = json_decode($request->getBody()); $this->assertEquals($sessionId, $body->sessionId); @@ -689,7 +689,7 @@ public function testStartsArchiveIndividualOutput() ]]); // This sessionId was generated using a different apiKey, but this method doesn't do any - // decoding to check, so its fine. + // decoding to check, so it's fine. $sessionId = '2_MX44NTQ1MTF-flR1ZSBOb3YgMTIgMDk6NDA6NTkgUFNUIDIwMTN-MC43NjU0Nzh-'; // Act @@ -716,7 +716,7 @@ public function testStartsArchiveIndividualOutput() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $body = json_decode($request->getBody()); $this->assertEquals($sessionId, $body->sessionId); @@ -738,7 +738,7 @@ public function testStartsArchiveResolutionSD() ]]); // This sessionId was generated using a different apiKey, but this method doesn't do any - // decoding to check, so its fine. + // decoding to check, so it's fine. $sessionId = '2_MX44NTQ1MTF-flR1ZSBOb3YgMTIgMDk6NDA6NTkgUFNUIDIwMTN-MC43NjU0Nzh-'; // Act @@ -765,7 +765,7 @@ public function testStartsArchiveResolutionSD() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $body = json_decode($request->getBody()); $this->assertEquals($sessionId, $body->sessionId); @@ -786,7 +786,7 @@ public function testStartsArchiveResolutionHD() ]]); // This sessionId was generated using a different apiKey, but this method doesn't do any - // decoding to check, so its fine. + // decoding to check, so it's fine. $sessionId = '2_MX44NTQ1MTF-flR1ZSBOb3YgMTIgMDk6NDA6NTkgUFNUIDIwMTN-MC43NjU0Nzh-'; // Act @@ -813,7 +813,7 @@ public function testStartsArchiveResolutionHD() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $body = json_decode($request->getBody()); $this->assertEquals($sessionId, $body->sessionId); @@ -857,7 +857,7 @@ public function testStopsArchive() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $this->assertInstanceOf('OpenTok\Archive', $archive); // TODO: test the properties of the actual archive object @@ -896,7 +896,7 @@ public function testGetsArchive() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $this->assertInstanceOf('OpenTok\Archive', $archive); // TODO: test the properties of the actual archive object @@ -933,7 +933,7 @@ public function testDeletesArchive() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $this->assertTrue($success); // TODO: test the properties of the actual archive object @@ -968,7 +968,7 @@ public function testListsArchives() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $this->assertInstanceOf('OpenTok\ArchiveList', $archiveList); // TODO: test the properties of the actual archiveList object and its contained archive @@ -1004,7 +1004,7 @@ public function testListsArchivesWithOffsetAndCount() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $this->assertInstanceOf('OpenTok\ArchiveList', $archiveList); $this->assertEquals(1, $archiveList->totalCount()); @@ -1045,7 +1045,7 @@ public function testListsArchivesWithSessionId() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $this->assertInstanceOf('OpenTok\ArchiveList', $archiveList); $this->assertEquals(2, $archiveList->totalCount()); @@ -1131,7 +1131,7 @@ public function testForceDisconnect() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $this->assertTrue($success); } @@ -1167,7 +1167,7 @@ public function testStartsBroadcast() ]]); // This sessionId was generated using a different apiKey, but this method doesn't do any - // decoding to check, so its fine. + // decoding to check, so it's fine. $sessionId = '2_MX44NTQ1MTF-fjE0NzI0MzU2MDUyMjN-eVgwNFJhZmR6MjdockFHanpxNzBXaEFXfn4'; // Act @@ -1192,7 +1192,7 @@ public function testStartsBroadcast() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $this->assertInstanceOf('OpenTok\Broadcast', $broadcast); $this->assertInternalType('string', $broadcast->id); @@ -1204,6 +1204,64 @@ public function testStartsBroadcast() $this->assertFalse($broadcast->isStopped); } + public function testStartBroadcastWithOptions() + { + // Arrange + $this->setupOTWithMocks([[ + 'code' => 200, + 'headers' => [ + 'Content-Type' => 'application/json' + ], + 'path' => '/v2/project/APIKEY/broadcast/session_layout-bestfit' + ]]); + + // This sessionId was generated using a different apiKey, but this method doesn't do any + // decoding to check, so it's fine. + $sessionId = '2_MX44NTQ1MTF-fjE0NzI0MzU2MDUyMjN-eVgwNFJhZmR6MjdockFHanpxNzBXaEFXfn4'; + + $maxDuration = 5400; + $resolution = '1280x720'; + $broadcastOptions = [ + 'maxDuration' => $maxDuration, + 'resolution' => $resolution, + ]; + + // Act + $broadcast = $this->opentok->startBroadcast($sessionId, $broadcastOptions); + + // Assert + $this->assertCount(1, $this->historyContainer); + + $request = $this->historyContainer[0]['request']; + $this->assertEquals('POST', strtoupper($request->getMethod())); + $this->assertEquals('/v2/project/'.$this->API_KEY.'/broadcast', $request->getUri()->getPath()); + $this->assertEquals('api.opentok.com', $request->getUri()->getHost()); + $this->assertEquals('https', $request->getUri()->getScheme()); + + $contentType = $request->getHeaderLine('Content-Type'); + $this->assertNotEmpty($contentType); + $this->assertEquals('application/json', $contentType); + + $authString = $request->getHeaderLine('X-OPENTOK-AUTH'); + $this->assertEquals(true, TestHelpers::validateOpenTokAuthHeader($this->API_KEY, $this->API_SECRET, $authString)); + + // TODO: test the dynamically built User Agent string + $userAgent = $request->getHeaderLine('User-Agent'); + $this->assertNotEmpty($userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); + + $this->assertInstanceOf('OpenTok\Broadcast', $broadcast); + $this->assertInternalType('string', $broadcast->id); + $this->assertEquals($sessionId, $broadcast->sessionId); + $this->assertEquals($maxDuration, $broadcast->maxDuration); + $this->assertEquals($resolution, $broadcast->resolution); + $this->assertInternalType('array', $broadcast->broadcastUrls); + $this->assertArrayHasKey('hls', $broadcast->broadcastUrls); + $this->assertInternalType('string', $broadcast->broadcastUrls['hls']); + $this->assertInternalType('string', $broadcast->hlsUrl); + $this->assertFalse($broadcast->isStopped); + } + // TODO: test startBroadcast with layout public function testStopsBroadcast() @@ -1237,7 +1295,7 @@ public function testStopsBroadcast() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $this->assertInstanceOf('OpenTok\Broadcast', $broadcast); $this->assertTrue($broadcast->isStopped); @@ -1274,7 +1332,7 @@ public function testGetsBroadcast() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $this->assertInstanceOf('OpenTok\Broadcast', $broadcast); } @@ -1318,7 +1376,7 @@ public function testUpdatesBroadcastLayoutWithPredefined() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); } public function testUpdatesBroadcastLayoutWithCustom() @@ -1364,7 +1422,7 @@ public function testUpdatesBroadcastLayoutWithCustom() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); } public function testUpdatesStreamLayoutClassList() @@ -1409,7 +1467,7 @@ public function testUpdatesStreamLayoutClassList() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); } public function testGetStream() @@ -1448,7 +1506,7 @@ public function testGetStream() $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); } public function testSipCall() @@ -1616,7 +1674,7 @@ public function testSignalData() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $body = json_decode($request->getBody()); $this->assertEquals('apple', $body->data); @@ -1658,7 +1716,7 @@ public function testSignalWithConnectionId() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $body = json_decode($request->getBody()); $this->assertEquals('random message', $body->data); @@ -1769,7 +1827,7 @@ public function testListStreams() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); $this->assertInstanceOf('OpenTok\StreamList', $streamList); @@ -1813,7 +1871,7 @@ public function testsSetArchiveLayoutWithPredefined() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); } public function testsSetArchiveLayoutWithCustom() @@ -1859,7 +1917,7 @@ public function testsSetArchiveLayoutWithCustom() // TODO: test the dynamically built User Agent string $userAgent = $request->getHeaderLine('User-Agent'); $this->assertNotEmpty($userAgent); - $this->assertStringStartsWith('OpenTok-PHP-SDK/4.3.0', $userAgent); + $this->assertStringStartsWith('OpenTok-PHP-SDK/4.4.0', $userAgent); } } diff --git a/tests/mock/v2/project/APIKEY/broadcast/session_layout-bestfit b/tests/mock/v2/project/APIKEY/broadcast/session_layout-bestfit index dfab3eea..8401e135 100644 --- a/tests/mock/v2/project/APIKEY/broadcast/session_layout-bestfit +++ b/tests/mock/v2/project/APIKEY/broadcast/session_layout-bestfit @@ -8,5 +8,7 @@ }, "updatedAt":1472435660268, "status":"started", - "partnerId":854511 + "partnerId":854511, + "maxDuration":5400, + "resolution": "1280x720" }