Skip to content

Commit 6ec7ab2

Browse files
committed
change the service to search and make sure it is active
1 parent 16022a8 commit 6ec7ab2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

classes/local/lti_helper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public static function get_filter_lti_launch_url(int $ocinstanceid, int $coursei
209209
*/
210210
public static function get_engage_url(int $ocinstanceid) {
211211
$api = api::get_instance($ocinstanceid);
212-
$response = $api->opencastapi->services->getServiceJSON('org.opencastproject.engage.ui.player.redirect');
212+
$response = $api->opencastapi->services->getServiceJSON('org.opencastproject.search');
213213
$code = $response['code'];
214214

215215
// Make sure everything goes fine.
@@ -225,9 +225,9 @@ public static function get_engage_url(int $ocinstanceid) {
225225
if (property_exists($servicesobj, 'services') && property_exists($servicesobj->services, 'service')
226226
&& !empty($servicesobj->services->service)) {
227227
// Parse the service object to array, which is easier to use!
228-
$engageservice = (array) $servicesobj->services->service;
229-
if (!empty($engageservice['host'])) {
230-
$engageurl = preg_replace(["/\/docs/"], [''], $engageservice['host']);
228+
$searchservice = (array) $servicesobj->services->service;
229+
if (!empty($searchservice['host']) && $searchservice['active'] && $searchservice['online']) {
230+
$engageurl = preg_replace(["/\/docs/"], [''], $searchservice['host']);
231231
}
232232
}
233233

0 commit comments

Comments
 (0)