|
4 | 4 |
|
5 | 5 | <img src="https://assets.tokbox.com/img/vonage/Vonage_VideoAPI_black.svg" height="48px" alt="Tokbox is now known as Vonage" /> |
6 | 6 |
|
7 | | -The OpenTok PHP SDK lets you generate [sessions](http://tokbox.com/developer/guides/create-session/) and |
8 | | -[tokens](http://tokbox.com/developer/guides/create-token/) for [OpenTok](http://www.tokbox.com/) |
9 | | -applications, and [archive](http://tokbox.com/developer/guides/archiving/) sessions. |
10 | | -It also includes methods for working with OpenTok |
11 | | -[archives](http://tokbox.com/developer/guides/archiving), working with OpenTok |
12 | | -[SIP interconnect](http://tokbox.com/developer/guides/sip), and |
13 | | -[disconnecting clients from sessions](http://tokbox.com/developer/guides/moderation/rest/). |
| 7 | +The OpenTok PHP SDK provides methods for: |
| 8 | + |
| 9 | +* Generating |
| 10 | +[sessions](https://tokbox.com/developer/guides/create-session/) and |
| 11 | +[tokens](https://tokbox.com/developer/guides/create-token/) for |
| 12 | +[OpenTok](https://www.tokbox.com/) applications that run on the .NET platform |
| 13 | +* Working with [OpenTok archives](https://tokbox.com/opentok/tutorials/archiving) |
| 14 | +* Working with [OpenTok live streaming broadcasts](https://tokbox.com/developer/guides/broadcast/live-streaming/) |
| 15 | +* Working with [OpenTok SIP interconnect](https://tokbox.com/developer/guides/sip) |
| 16 | +* [Sending signals to clients connected to a session](https://www.tokbox.com/developer/guides/signaling/) |
| 17 | +* [Disconnecting clients from sessions](https://tokbox.com/developer/guides/moderation/rest/) |
| 18 | +* [Forcing clients in a session to disconnect or mute published audio](https://tokbox.com/developer/guides/moderation/) |
14 | 19 |
|
15 | 20 | ## Installation |
16 | 21 |
|
@@ -370,6 +375,17 @@ use OpenTok\OpenTok; |
370 | 375 | $opentok->forceDisconnect($sessionId, $connectionId); |
371 | 376 | ``` |
372 | 377 |
|
| 378 | +### Forcing clients in a session mute published audio |
| 379 | + |
| 380 | +You can force the publisher of a specific stream to stop publishing audio using the |
| 381 | +`Opentok.forceMuteStream($sessionId, $stream)` method. |
| 382 | + |
| 383 | +You can force the publisher of all streams in a session (except for an optional list of streams) |
| 384 | +to stop publishing audio using the `Opentok.forceMuteAll($sessionId, $excludedStreamIds)` method. |
| 385 | +You can then disable the mute state of the session by calling the |
| 386 | +`Opentok.DisableForceMute(sessionId)` or `Opentok.DisableForceMuteAsync(sessionId)` |
| 387 | +method. |
| 388 | + |
373 | 389 | ### Sending Signals |
374 | 390 |
|
375 | 391 | Once a Session is created, you can send signals to everyone in the session or to a specific connection. |
@@ -411,7 +427,7 @@ $opentok->signal($sessionId, $signalPayload); |
411 | 427 | For more information, see the [OpenTok signaling developer |
412 | 428 | guide](https://tokbox.com/developer/guides/signaling/). |
413 | 429 |
|
414 | | -## Working with SIP Interconnect |
| 430 | +### Working with SIP Interconnect |
415 | 431 |
|
416 | 432 | You can add an audio-only stream from an external third-party SIP gateway using the SIP |
417 | 433 | Interconnect feature. This requires a SIP URI, the session ID you wish to add the audio-only |
@@ -441,59 +457,6 @@ $opentok->dial($sessionId, $token, $sipUri, $options); |
441 | 457 | For more information, see the [OpenTok SIP Interconnect developer |
442 | 458 | guide](https://tokbox.com/developer/guides/sip/). |
443 | 459 |
|
444 | | -## Force Disconnect |
445 | | - |
446 | | -Your application server can disconnect a client from an OpenTok session by calling the `forceDisconnect($sessionId, $connectionId)` |
447 | | -method of the `OpenTok\OpenTok` class. |
448 | | - |
449 | | -```php |
450 | | -use OpenTok\OpenTok; |
451 | | - |
452 | | -// Force disconnect a client connection |
453 | | -$opentok->forceDisconnect($sessionId, $connectionId); |
454 | | -``` |
455 | | - |
456 | | -## Sending Signals |
457 | | - |
458 | | -Once a Session is created, you can send signals to everyone in the session or to a specific connection. |
459 | | -You can send a signal by calling the `signal($sessionId, $payload, $connectionId)` method of the |
460 | | -`OpenTok\OpenTok` class. |
461 | | - |
462 | | -The `$sessionId` parameter is the session ID of the session. |
463 | | - |
464 | | -The `$payload` parameter is an associative array used to set the |
465 | | -following: |
466 | | - |
467 | | -- `data` (string) -- The data string for the signal. You can send a maximum of 8kB. |
468 | | - |
469 | | -- `type` (string) -- — (Optional) The type string for the signal. You can send a maximum of 128 characters, and only the following characters are allowed: A-Z, a-z, numbers (0-9), '-', '\_', and '~'. |
470 | | - |
471 | | -The `$connectionId` parameter is an optional string used to specify the connection ID of |
472 | | -a client connected to the session. If you specify this value, the signal is sent to |
473 | | -the specified client. Otherwise, the signal is sent to all clients connected to the session. |
474 | | - |
475 | | -```php |
476 | | -use OpenTok\OpenTok; |
477 | | - |
478 | | -// Send a signal to a specific client |
479 | | -$signalPayload = array( |
480 | | - 'data' => 'some signal message', |
481 | | - 'type' => 'signal type' |
482 | | -); |
483 | | -$connectionId = 'da9cb410-e29b-4c2d-ab9e-fe65bf83fcaf'; |
484 | | -$opentok->signal($sessionId, $signalPayload, $connectionId); |
485 | | - |
486 | | -// Send a signal to everyone in the session |
487 | | -$signalPayload = array( |
488 | | - 'data' => 'some signal message', |
489 | | - 'type' => 'signal type' |
490 | | -); |
491 | | -$opentok->signal($sessionId, $signalPayload); |
492 | | -``` |
493 | | - |
494 | | -For more information, see the [OpenTok signaling developer |
495 | | -guide](https://tokbox.com/developer/guides/signaling/). |
496 | | - |
497 | 460 | ## Samples |
498 | 461 |
|
499 | 462 | There are three sample applications included in this repository. To get going as fast as possible, clone the whole |
|
0 commit comments