2727use BigBlueButton \Parameters \EndMeetingParameters ;
2828use BigBlueButton \Parameters \GetMeetingInfoParameters ;
2929use BigBlueButton \Parameters \GetRecordingsParameters ;
30+ use BigBlueButton \Parameters \GetRecordingTextTracksParameters ;
3031use BigBlueButton \Parameters \HooksCreateParameters ;
3132use BigBlueButton \Parameters \HooksDestroyParameters ;
3233use BigBlueButton \Parameters \InsertDocumentParameters ;
3334use BigBlueButton \Parameters \IsMeetingRunningParameters ;
3435use BigBlueButton \Parameters \JoinMeetingParameters ;
3536use BigBlueButton \Parameters \PublishRecordingsParameters ;
37+ use BigBlueButton \Parameters \PutRecordingTextTrackParameters ;
3638use BigBlueButton \Parameters \UpdateRecordingsParameters ;
3739use BigBlueButton \Responses \ApiVersionResponse ;
3840use BigBlueButton \Responses \CreateMeetingResponse ;
4143use BigBlueButton \Responses \GetMeetingInfoResponse ;
4244use BigBlueButton \Responses \GetMeetingsResponse ;
4345use BigBlueButton \Responses \GetRecordingsResponse ;
46+ use BigBlueButton \Responses \GetRecordingTextTracksResponseResponse ;
4447use BigBlueButton \Responses \HooksCreateResponse ;
4548use BigBlueButton \Responses \HooksDestroyResponse ;
4649use BigBlueButton \Responses \HooksListResponse ;
50+ use BigBlueButton \Responses \InsertDocumentResponse ;
4751use BigBlueButton \Responses \IsMeetingRunningResponse ;
4852use BigBlueButton \Responses \JoinMeetingResponse ;
4953use BigBlueButton \Responses \PublishRecordingsResponse ;
54+ use BigBlueButton \Responses \PutRecordingTextTrackResponse ;
5055use BigBlueButton \Responses \UpdateRecordingsResponse ;
5156use BigBlueButton \Util \UrlBuilder ;
5257
@@ -183,7 +188,7 @@ public function getInsertDocumentUrl($createMeetingParams)
183188 }
184189
185190 /**
186- * @param InsertDocumentParameters $insertDocumentParams
191+ * @param $insertDocumentParams InsertDocumentParameters
187192 *
188193 * @return InsertDocumentResponse
189194 *
@@ -260,8 +265,6 @@ public function getMeetingInfoUrl($meetingParams)
260265 /**
261266 * @param $meetingParams GetMeetingInfoParameters
262267 *
263- * @return GetMeetingInfoResponse
264- *
265268 * @throws \RuntimeException
266269 */
267270 public function getMeetingInfo ($ meetingParams )
@@ -291,8 +294,6 @@ public function getRecordingsUrl($recordingsParams)
291294 /**
292295 * @param mixed $recordingParams
293296 *
294- * @return GetRecordingsResponse
295- *
296297 * @throws \RuntimeException
297298 */
298299 public function getRecordings ($ recordingParams )
@@ -315,8 +316,6 @@ public function getPublishRecordingsUrl($recordingParams)
315316 /**
316317 * @param $recordingParams PublishRecordingsParameters
317318 *
318- * @return PublishRecordingsResponse
319- *
320319 * @throws \RuntimeException
321320 */
322321 public function publishRecordings ($ recordingParams )
@@ -363,8 +362,6 @@ public function getUpdateRecordingsUrl($recordingParams)
363362 /**
364363 * @param $recordingParams UpdateRecordingsParameters
365364 *
366- * @return UpdateRecordingsResponse
367- *
368365 * @throws \RuntimeException
369366 */
370367 public function updateRecordings ($ recordingParams )
@@ -374,6 +371,50 @@ public function updateRecordings($recordingParams)
374371 return new UpdateRecordingsResponse ($ xml );
375372 }
376373
374+ /**
375+ * @param $getRecordingTextTracksParameters GetRecordingTextTracksParameters
376+ *
377+ * @return string
378+ */
379+ public function getRecordingTextTracksUrl ($ getRecordingTextTracksParameters )
380+ {
381+ return $ this ->urlBuilder ->buildUrl (ApiMethod::GET_RECORDING_TEXT_TRACKS , $ getRecordingTextTracksParameters ->getHTTPQuery ());
382+ }
383+
384+ /**
385+ * @param $getRecordingTextTracksParams GetRecordingTextTracksParameters
386+ *
387+ * @return GetRecordingTextTracksResponseResponse
388+ */
389+ public function getRecordingTextTracks ($ getRecordingTextTracksParams )
390+ {
391+ $ json = $ this ->processJsonResponse ($ this ->getRecordingTextTracksUrl ($ getRecordingTextTracksParams ));
392+
393+ return new GetRecordingTextTracksResponseResponse ($ json );
394+ }
395+
396+ /**
397+ * @param $putRecordingTextTrackParams PutRecordingTextTrackParameters
398+ *
399+ * @return string
400+ */
401+ public function getPutRecordingTextTrackUrl (PutRecordingTextTrackParameters $ putRecordingTextTrackParams )
402+ {
403+ return $ this ->urlBuilder ->buildUrl (ApiMethod::PUT_RECORDING_TEXT_TRACK , $ putRecordingTextTrackParams ->getHTTPQuery ());
404+ }
405+
406+ /**
407+ * @param $putRecordingTextTrackParams PutRecordingTextTrackParameters
408+ *
409+ * @return PutRecordingTextTrackResponse
410+ */
411+ public function putRecordingTextTrack ($ putRecordingTextTrackParams )
412+ {
413+ $ json = $ this ->processJsonResponse ($ this ->getPutRecordingTextTrackUrl ($ putRecordingTextTrackParams ));
414+
415+ return new PutRecordingTextTrackResponse ($ json );
416+ }
417+
377418 // ____________________ WEB HOOKS METHODS ___________________
378419
379420 /**
@@ -494,17 +535,17 @@ public function buildUrl($method = '', $params = '', $append = true)
494535 // ____________________ INTERNAL CLASS METHODS ___________________
495536
496537 /**
497- * A private utility method used by other public methods to process XML responses.
538+ * A private utility method used by other public methods to request HTTP responses.
498539 *
499540 * @param string $url
500541 * @param string $payload
501542 * @param string $contentType
502543 *
503- * @return \SimpleXMLElement
544+ * @return string
504545 *
505546 * @throws \RuntimeException
506547 */
507- private function processXmlResponse ($ url , $ payload = '' , $ contentType = 'application/xml ' )
548+ private function sendRequest ($ url , $ payload = '' , $ contentType = 'application/xml ' )
508549 {
509550 if (extension_loaded ('curl ' )) {
510551 $ ch = curl_init ();
@@ -554,9 +595,31 @@ private function processXmlResponse($url, $payload = '', $contentType = 'applica
554595 $ this ->setJSessionId ($ output_array ['JSESSIONID ' ]);
555596 }
556597
557- return new \ SimpleXMLElement ( $ data) ;
598+ return $ data ;
558599 }
559600
560601 throw new \RuntimeException ('Post XML data set but curl PHP module is not installed or not enabled. ' );
561602 }
603+
604+ /**
605+ * A private utility method used by other public methods to process XML responses.
606+ *
607+ * @param string $url
608+ * @param string $payload
609+ * @param string $contentType
610+ *
611+ * @return \SimpleXMLElement
612+ */
613+ private function processXmlResponse ($ url , $ payload = '' , $ contentType = 'application/xml ' )
614+ {
615+ return new \SimpleXMLElement ($ this ->sendRequest ($ url , $ payload , $ contentType ));
616+ }
617+
618+ /**
619+ * A private utility method used by other public methods to process json responses.
620+ */
621+ private function processJsonResponse (string $ url , string $ payload = '' , string $ contentType = 'application/json ' )
622+ {
623+ return $ this ->sendRequest ($ url , $ payload , $ contentType );
624+ }
562625}
0 commit comments