Relay.Calling.RecordResult
This object returned from record
method that represents the final result of a recording.
Methods
getDuration
Returns the duration of the recording in seconds.
Available In:
Parameters
None
Returns
number
- Duration of the recording in seconds.
Examples
Start recording and use the duration.
<?php
$params = [
'stereo' => true
];
$call->record($params)->done(function($result) {
if ($result->isSuccessful()) {
$duration = $result->getDuration();
}
});
getEvent
Returns the last Relay Event arrived for this operation.
Available In:
Parameters
None
Returns
Relay.Event
- Last Relay Event.
Examples
Start recording in stereo mode and grab the result when it's completed.
<?php
$params = [
'stereo' => true
];
$call->record($params)->done(function($result) {
$event = $result->getEvent();
// Inspect $event->payload ..
});
getSize
Returns the size of the recording file.
Available In:
Parameters
None
Returns
number
- Size of the recording file.
Examples
Start recording and use the size of the file.
<?php
$params = [
'stereo' => true
];
$call->record($params)->done(function($result) {
if ($result->isSuccessful()) {
$size = $result->getSize();
}
});
getUrl
Returns the HTTPS URL to the recording file.
Available In:
Parameters
None
Returns
string
- HTTPS URL to the file.
Examples
Start recording and use the URL.
<?php
$params = [
'stereo' => true
];
$call->record($params)->done(function($result) {
if ($result->isSuccessful()) {
$httpsUrl = $result->getUrl();
}
});
isSuccessful
Return true
if the recording succeeded, false
otherwise.
Available In:
Parameters
None
Returns
boolean
- True/False accordingly to the state.
Examples
Start the recording and then check if it has ended successfully.
<?php
$params = [
'stereo' => true
];
$call->record($params)->done(function($result) {
if ($result->isSuccessful()) {
// Recording completed with success
}
});